Repository: briannesbitt/Carbon Branch: master Commit: 4e0ab6a8b454 Files: 2034 Total size: 13.6 MB Directory structure: gitextract_wjayfrdi/ ├── .editorconfig ├── .gitattributes ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ └── bug_report.md │ ├── ISSUE_TEMPLATE.md │ ├── dependabot.yml │ └── workflows/ │ ├── deploy-documentation.yml │ ├── documentation.yml │ ├── laravel.yml │ ├── phpcs.yml │ ├── phpmd.yml │ ├── phpstan.yml │ ├── sponsors.yml │ └── tests.yml ├── .gitignore ├── .php-cs-fixer.dist.php ├── .phpstorm.meta.php ├── .styleci.yml ├── LICENSE ├── bin/ │ ├── carbon │ └── carbon.bat ├── build.php ├── codecov.yml ├── composer.json ├── contributing.md ├── extension.neon ├── lazy/ │ └── Carbon/ │ ├── MessageFormatter/ │ │ ├── MessageFormatterMapperStrongType.php │ │ └── MessageFormatterMapperWeakType.php │ ├── ProtectedDatePeriod.php │ ├── TranslatorStrongType.php │ ├── TranslatorWeakType.php │ └── UnprotectedDatePeriod.php ├── phpdoc.php ├── phpmd.xml ├── phpstan.neon ├── phpunit.xml.dist ├── psalm.xml ├── readme.md ├── sponsors.php ├── src/ │ └── Carbon/ │ ├── AbstractTranslator.php │ ├── Callback.php │ ├── Carbon.php │ ├── CarbonConverterInterface.php │ ├── CarbonImmutable.php │ ├── CarbonInterface.php │ ├── CarbonInterval.php │ ├── CarbonPeriod.php │ ├── CarbonPeriodImmutable.php │ ├── CarbonTimeZone.php │ ├── Cli/ │ │ └── Invoker.php │ ├── Constants/ │ │ ├── DiffOptions.php │ │ ├── Format.php │ │ ├── TranslationOptions.php │ │ └── UnitValue.php │ ├── Exceptions/ │ │ ├── BadComparisonUnitException.php │ │ ├── BadFluentConstructorException.php │ │ ├── BadFluentSetterException.php │ │ ├── BadMethodCallException.php │ │ ├── EndLessPeriodException.php │ │ ├── Exception.php │ │ ├── ImmutableException.php │ │ ├── InvalidArgumentException.php │ │ ├── InvalidCastException.php │ │ ├── InvalidDateException.php │ │ ├── InvalidFormatException.php │ │ ├── InvalidIntervalException.php │ │ ├── InvalidPeriodDateException.php │ │ ├── InvalidPeriodParameterException.php │ │ ├── InvalidTimeZoneException.php │ │ ├── InvalidTypeException.php │ │ ├── NotACarbonClassException.php │ │ ├── NotAPeriodException.php │ │ ├── NotLocaleAwareException.php │ │ ├── OutOfRangeException.php │ │ ├── ParseErrorException.php │ │ ├── RuntimeException.php │ │ ├── UnitException.php │ │ ├── UnitNotConfiguredException.php │ │ ├── UnknownGetterException.php │ │ ├── UnknownMethodException.php │ │ ├── UnknownSetterException.php │ │ ├── UnknownUnitException.php │ │ ├── UnreachableException.php │ │ └── UnsupportedUnitException.php │ ├── Factory.php │ ├── FactoryImmutable.php │ ├── Lang/ │ │ ├── aa.php │ │ ├── aa_DJ.php │ │ ├── aa_ER.php │ │ ├── aa_ER@saaho.php │ │ ├── aa_ET.php │ │ ├── af.php │ │ ├── af_NA.php │ │ ├── af_ZA.php │ │ ├── agq.php │ │ ├── agr.php │ │ ├── agr_PE.php │ │ ├── ak.php │ │ ├── ak_GH.php │ │ ├── am.php │ │ ├── am_ET.php │ │ ├── an.php │ │ ├── an_ES.php │ │ ├── anp.php │ │ ├── anp_IN.php │ │ ├── ar.php │ │ ├── ar_AE.php │ │ ├── ar_BH.php │ │ ├── ar_DJ.php │ │ ├── ar_DZ.php │ │ ├── ar_EG.php │ │ ├── ar_EH.php │ │ ├── ar_ER.php │ │ ├── ar_IL.php │ │ ├── ar_IN.php │ │ ├── ar_IQ.php │ │ ├── ar_JO.php │ │ ├── ar_KM.php │ │ ├── ar_KW.php │ │ ├── ar_LB.php │ │ ├── ar_LY.php │ │ ├── ar_MA.php │ │ ├── ar_MR.php │ │ ├── ar_OM.php │ │ ├── ar_PS.php │ │ ├── ar_QA.php │ │ ├── ar_SA.php │ │ ├── ar_SD.php │ │ ├── ar_SO.php │ │ ├── ar_SS.php │ │ ├── ar_SY.php │ │ ├── ar_Shakl.php │ │ ├── ar_TD.php │ │ ├── ar_TN.php │ │ ├── ar_YE.php │ │ ├── as.php │ │ ├── as_IN.php │ │ ├── asa.php │ │ ├── ast.php │ │ ├── ast_ES.php │ │ ├── ayc.php │ │ ├── ayc_PE.php │ │ ├── az.php │ │ ├── az_AZ.php │ │ ├── az_Arab.php │ │ ├── az_Cyrl.php │ │ ├── az_IR.php │ │ ├── az_Latn.php │ │ ├── bas.php │ │ ├── be.php │ │ ├── be_BY.php │ │ ├── be_BY@latin.php │ │ ├── bem.php │ │ ├── bem_ZM.php │ │ ├── ber.php │ │ ├── ber_DZ.php │ │ ├── ber_MA.php │ │ ├── bez.php │ │ ├── bg.php │ │ ├── bg_BG.php │ │ ├── bhb.php │ │ ├── bhb_IN.php │ │ ├── bho.php │ │ ├── bho_IN.php │ │ ├── bi.php │ │ ├── bi_VU.php │ │ ├── bm.php │ │ ├── bn.php │ │ ├── bn_BD.php │ │ ├── bn_IN.php │ │ ├── bo.php │ │ ├── bo_CN.php │ │ ├── bo_IN.php │ │ ├── br.php │ │ ├── br_FR.php │ │ ├── brx.php │ │ ├── brx_IN.php │ │ ├── bs.php │ │ ├── bs_BA.php │ │ ├── bs_Cyrl.php │ │ ├── bs_Latn.php │ │ ├── byn.php │ │ ├── byn_ER.php │ │ ├── ca.php │ │ ├── ca_AD.php │ │ ├── ca_ES.php │ │ ├── ca_ES_Valencia.php │ │ ├── ca_FR.php │ │ ├── ca_IT.php │ │ ├── ccp.php │ │ ├── ccp_IN.php │ │ ├── ce.php │ │ ├── ce_RU.php │ │ ├── cgg.php │ │ ├── chr.php │ │ ├── chr_US.php │ │ ├── ckb.php │ │ ├── cmn.php │ │ ├── cmn_TW.php │ │ ├── crh.php │ │ ├── crh_UA.php │ │ ├── cs.php │ │ ├── cs_CZ.php │ │ ├── csb.php │ │ ├── csb_PL.php │ │ ├── cu.php │ │ ├── cv.php │ │ ├── cv_RU.php │ │ ├── cy.php │ │ ├── cy_GB.php │ │ ├── da.php │ │ ├── da_DK.php │ │ ├── da_GL.php │ │ ├── dav.php │ │ ├── de.php │ │ ├── de_AT.php │ │ ├── de_BE.php │ │ ├── de_CH.php │ │ ├── de_DE.php │ │ ├── de_IT.php │ │ ├── de_LI.php │ │ ├── de_LU.php │ │ ├── dje.php │ │ ├── doi.php │ │ ├── doi_IN.php │ │ ├── dsb.php │ │ ├── dsb_DE.php │ │ ├── dua.php │ │ ├── dv.php │ │ ├── dv_MV.php │ │ ├── dyo.php │ │ ├── dz.php │ │ ├── dz_BT.php │ │ ├── ebu.php │ │ ├── ee.php │ │ ├── ee_TG.php │ │ ├── el.php │ │ ├── el_CY.php │ │ ├── el_GR.php │ │ ├── en.php │ │ ├── en_001.php │ │ ├── en_150.php │ │ ├── en_AG.php │ │ ├── en_AI.php │ │ ├── en_AS.php │ │ ├── en_AT.php │ │ ├── en_AU.php │ │ ├── en_BB.php │ │ ├── en_BE.php │ │ ├── en_BI.php │ │ ├── en_BM.php │ │ ├── en_BS.php │ │ ├── en_BW.php │ │ ├── en_BZ.php │ │ ├── en_CA.php │ │ ├── en_CC.php │ │ ├── en_CH.php │ │ ├── en_CK.php │ │ ├── en_CM.php │ │ ├── en_CX.php │ │ ├── en_CY.php │ │ ├── en_DE.php │ │ ├── en_DG.php │ │ ├── en_DK.php │ │ ├── en_DM.php │ │ ├── en_ER.php │ │ ├── en_FI.php │ │ ├── en_FJ.php │ │ ├── en_FK.php │ │ ├── en_FM.php │ │ ├── en_GB.php │ │ ├── en_GD.php │ │ ├── en_GG.php │ │ ├── en_GH.php │ │ ├── en_GI.php │ │ ├── en_GM.php │ │ ├── en_GU.php │ │ ├── en_GY.php │ │ ├── en_HK.php │ │ ├── en_IE.php │ │ ├── en_IL.php │ │ ├── en_IM.php │ │ ├── en_IN.php │ │ ├── en_IO.php │ │ ├── en_ISO.php │ │ ├── en_JE.php │ │ ├── en_JM.php │ │ ├── en_KE.php │ │ ├── en_KI.php │ │ ├── en_KN.php │ │ ├── en_KY.php │ │ ├── en_LC.php │ │ ├── en_LR.php │ │ ├── en_LS.php │ │ ├── en_MG.php │ │ ├── en_MH.php │ │ ├── en_MO.php │ │ ├── en_MP.php │ │ ├── en_MS.php │ │ ├── en_MT.php │ │ ├── en_MU.php │ │ ├── en_MW.php │ │ ├── en_MY.php │ │ ├── en_NA.php │ │ ├── en_NF.php │ │ ├── en_NG.php │ │ ├── en_NL.php │ │ ├── en_NR.php │ │ ├── en_NU.php │ │ ├── en_NZ.php │ │ ├── en_PG.php │ │ ├── en_PH.php │ │ ├── en_PK.php │ │ ├── en_PN.php │ │ ├── en_PR.php │ │ ├── en_PW.php │ │ ├── en_RW.php │ │ ├── en_SB.php │ │ ├── en_SC.php │ │ ├── en_SD.php │ │ ├── en_SE.php │ │ ├── en_SG.php │ │ ├── en_SH.php │ │ ├── en_SI.php │ │ ├── en_SL.php │ │ ├── en_SS.php │ │ ├── en_SX.php │ │ ├── en_SZ.php │ │ ├── en_TC.php │ │ ├── en_TK.php │ │ ├── en_TO.php │ │ ├── en_TT.php │ │ ├── en_TV.php │ │ ├── en_TZ.php │ │ ├── en_UG.php │ │ ├── en_UM.php │ │ ├── en_US.php │ │ ├── en_US_Posix.php │ │ ├── en_VC.php │ │ ├── en_VG.php │ │ ├── en_VI.php │ │ ├── en_VU.php │ │ ├── en_WS.php │ │ ├── en_ZA.php │ │ ├── en_ZM.php │ │ ├── en_ZW.php │ │ ├── eo.php │ │ ├── es.php │ │ ├── es_419.php │ │ ├── es_AR.php │ │ ├── es_BO.php │ │ ├── es_BR.php │ │ ├── es_BZ.php │ │ ├── es_CL.php │ │ ├── es_CO.php │ │ ├── es_CR.php │ │ ├── es_CU.php │ │ ├── es_DO.php │ │ ├── es_EA.php │ │ ├── es_EC.php │ │ ├── es_ES.php │ │ ├── es_GQ.php │ │ ├── es_GT.php │ │ ├── es_HN.php │ │ ├── es_IC.php │ │ ├── es_MX.php │ │ ├── es_NI.php │ │ ├── es_PA.php │ │ ├── es_PE.php │ │ ├── es_PH.php │ │ ├── es_PR.php │ │ ├── es_PY.php │ │ ├── es_SV.php │ │ ├── es_US.php │ │ ├── es_UY.php │ │ ├── es_VE.php │ │ ├── et.php │ │ ├── et_EE.php │ │ ├── eu.php │ │ ├── eu_ES.php │ │ ├── ewo.php │ │ ├── fa.php │ │ ├── fa_AF.php │ │ ├── fa_IR.php │ │ ├── ff.php │ │ ├── ff_CM.php │ │ ├── ff_GN.php │ │ ├── ff_MR.php │ │ ├── ff_SN.php │ │ ├── fi.php │ │ ├── fi_FI.php │ │ ├── fil.php │ │ ├── fil_PH.php │ │ ├── fo.php │ │ ├── fo_DK.php │ │ ├── fo_FO.php │ │ ├── fr.php │ │ ├── fr_BE.php │ │ ├── fr_BF.php │ │ ├── fr_BI.php │ │ ├── fr_BJ.php │ │ ├── fr_BL.php │ │ ├── fr_CA.php │ │ ├── fr_CD.php │ │ ├── fr_CF.php │ │ ├── fr_CG.php │ │ ├── fr_CH.php │ │ ├── fr_CI.php │ │ ├── fr_CM.php │ │ ├── fr_DJ.php │ │ ├── fr_DZ.php │ │ ├── fr_FR.php │ │ ├── fr_GA.php │ │ ├── fr_GF.php │ │ ├── fr_GN.php │ │ ├── fr_GP.php │ │ ├── fr_GQ.php │ │ ├── fr_HT.php │ │ ├── fr_KM.php │ │ ├── fr_LU.php │ │ ├── fr_MA.php │ │ ├── fr_MC.php │ │ ├── fr_MF.php │ │ ├── fr_MG.php │ │ ├── fr_ML.php │ │ ├── fr_MQ.php │ │ ├── fr_MR.php │ │ ├── fr_MU.php │ │ ├── fr_NC.php │ │ ├── fr_NE.php │ │ ├── fr_PF.php │ │ ├── fr_PM.php │ │ ├── fr_RE.php │ │ ├── fr_RW.php │ │ ├── fr_SC.php │ │ ├── fr_SN.php │ │ ├── fr_SY.php │ │ ├── fr_TD.php │ │ ├── fr_TG.php │ │ ├── fr_TN.php │ │ ├── fr_VU.php │ │ ├── fr_WF.php │ │ ├── fr_YT.php │ │ ├── fur.php │ │ ├── fur_IT.php │ │ ├── fy.php │ │ ├── fy_DE.php │ │ ├── fy_NL.php │ │ ├── ga.php │ │ ├── ga_IE.php │ │ ├── gd.php │ │ ├── gd_GB.php │ │ ├── gez.php │ │ ├── gez_ER.php │ │ ├── gez_ET.php │ │ ├── gl.php │ │ ├── gl_ES.php │ │ ├── gom.php │ │ ├── gom_Latn.php │ │ ├── gsw.php │ │ ├── gsw_CH.php │ │ ├── gsw_FR.php │ │ ├── gsw_LI.php │ │ ├── gu.php │ │ ├── gu_IN.php │ │ ├── guz.php │ │ ├── gv.php │ │ ├── gv_GB.php │ │ ├── ha.php │ │ ├── ha_GH.php │ │ ├── ha_NE.php │ │ ├── ha_NG.php │ │ ├── hak.php │ │ ├── hak_TW.php │ │ ├── haw.php │ │ ├── he.php │ │ ├── he_IL.php │ │ ├── hi.php │ │ ├── hi_IN.php │ │ ├── hif.php │ │ ├── hif_FJ.php │ │ ├── hne.php │ │ ├── hne_IN.php │ │ ├── hr.php │ │ ├── hr_BA.php │ │ ├── hr_HR.php │ │ ├── hsb.php │ │ ├── hsb_DE.php │ │ ├── ht.php │ │ ├── ht_HT.php │ │ ├── hu.php │ │ ├── hu_HU.php │ │ ├── hy.php │ │ ├── hy_AM.php │ │ ├── i18n.php │ │ ├── ia.php │ │ ├── ia_FR.php │ │ ├── id.php │ │ ├── id_ID.php │ │ ├── ig.php │ │ ├── ig_NG.php │ │ ├── ii.php │ │ ├── ik.php │ │ ├── ik_CA.php │ │ ├── in.php │ │ ├── is.php │ │ ├── is_IS.php │ │ ├── it.php │ │ ├── it_CH.php │ │ ├── it_IT.php │ │ ├── it_SM.php │ │ ├── it_VA.php │ │ ├── iu.php │ │ ├── iu_CA.php │ │ ├── iw.php │ │ ├── ja.php │ │ ├── ja_JP.php │ │ ├── jgo.php │ │ ├── jmc.php │ │ ├── jv.php │ │ ├── ka.php │ │ ├── ka_GE.php │ │ ├── kab.php │ │ ├── kab_DZ.php │ │ ├── kam.php │ │ ├── kde.php │ │ ├── kea.php │ │ ├── khq.php │ │ ├── ki.php │ │ ├── kk.php │ │ ├── kk_KZ.php │ │ ├── kkj.php │ │ ├── kl.php │ │ ├── kl_GL.php │ │ ├── kln.php │ │ ├── km.php │ │ ├── km_KH.php │ │ ├── kn.php │ │ ├── kn_IN.php │ │ ├── ko.php │ │ ├── ko_KP.php │ │ ├── ko_KR.php │ │ ├── kok.php │ │ ├── kok_IN.php │ │ ├── ks.php │ │ ├── ks_IN.php │ │ ├── ks_IN@devanagari.php │ │ ├── ksb.php │ │ ├── ksf.php │ │ ├── ksh.php │ │ ├── ku.php │ │ ├── ku_TR.php │ │ ├── kw.php │ │ ├── kw_GB.php │ │ ├── ky.php │ │ ├── ky_KG.php │ │ ├── lag.php │ │ ├── lb.php │ │ ├── lb_LU.php │ │ ├── lg.php │ │ ├── lg_UG.php │ │ ├── li.php │ │ ├── li_NL.php │ │ ├── lij.php │ │ ├── lij_IT.php │ │ ├── lkt.php │ │ ├── ln.php │ │ ├── ln_AO.php │ │ ├── ln_CD.php │ │ ├── ln_CF.php │ │ ├── ln_CG.php │ │ ├── lo.php │ │ ├── lo_LA.php │ │ ├── lrc.php │ │ ├── lrc_IQ.php │ │ ├── lt.php │ │ ├── lt_LT.php │ │ ├── lu.php │ │ ├── luo.php │ │ ├── luy.php │ │ ├── lv.php │ │ ├── lv_LV.php │ │ ├── lzh.php │ │ ├── lzh_TW.php │ │ ├── mag.php │ │ ├── mag_IN.php │ │ ├── mai.php │ │ ├── mai_IN.php │ │ ├── mas.php │ │ ├── mas_TZ.php │ │ ├── mer.php │ │ ├── mfe.php │ │ ├── mfe_MU.php │ │ ├── mg.php │ │ ├── mg_MG.php │ │ ├── mgh.php │ │ ├── mgo.php │ │ ├── mhr.php │ │ ├── mhr_RU.php │ │ ├── mi.php │ │ ├── mi_NZ.php │ │ ├── miq.php │ │ ├── miq_NI.php │ │ ├── mjw.php │ │ ├── mjw_IN.php │ │ ├── mk.php │ │ ├── mk_MK.php │ │ ├── ml.php │ │ ├── ml_IN.php │ │ ├── mn.php │ │ ├── mn_MN.php │ │ ├── mni.php │ │ ├── mni_IN.php │ │ ├── mo.php │ │ ├── mr.php │ │ ├── mr_IN.php │ │ ├── ms.php │ │ ├── ms_BN.php │ │ ├── ms_MY.php │ │ ├── ms_SG.php │ │ ├── mt.php │ │ ├── mt_MT.php │ │ ├── mua.php │ │ ├── my.php │ │ ├── my_MM.php │ │ ├── mzn.php │ │ ├── nan.php │ │ ├── nan_TW.php │ │ ├── nan_TW@latin.php │ │ ├── naq.php │ │ ├── nb.php │ │ ├── nb_NO.php │ │ ├── nb_SJ.php │ │ ├── nd.php │ │ ├── nds.php │ │ ├── nds_DE.php │ │ ├── nds_NL.php │ │ ├── ne.php │ │ ├── ne_IN.php │ │ ├── ne_NP.php │ │ ├── nhn.php │ │ ├── nhn_MX.php │ │ ├── niu.php │ │ ├── niu_NU.php │ │ ├── nl.php │ │ ├── nl_AW.php │ │ ├── nl_BE.php │ │ ├── nl_BQ.php │ │ ├── nl_CW.php │ │ ├── nl_NL.php │ │ ├── nl_SR.php │ │ ├── nl_SX.php │ │ ├── nmg.php │ │ ├── nn.php │ │ ├── nn_NO.php │ │ ├── nnh.php │ │ ├── no.php │ │ ├── nr.php │ │ ├── nr_ZA.php │ │ ├── nso.php │ │ ├── nso_ZA.php │ │ ├── nus.php │ │ ├── nyn.php │ │ ├── oc.php │ │ ├── oc_FR.php │ │ ├── om.php │ │ ├── om_ET.php │ │ ├── om_KE.php │ │ ├── or.php │ │ ├── or_IN.php │ │ ├── os.php │ │ ├── os_RU.php │ │ ├── pa.php │ │ ├── pa_Arab.php │ │ ├── pa_Guru.php │ │ ├── pa_IN.php │ │ ├── pa_PK.php │ │ ├── pap.php │ │ ├── pap_AW.php │ │ ├── pap_CW.php │ │ ├── pl.php │ │ ├── pl_PL.php │ │ ├── prg.php │ │ ├── ps.php │ │ ├── ps_AF.php │ │ ├── pt.php │ │ ├── pt_AO.php │ │ ├── pt_BR.php │ │ ├── pt_CH.php │ │ ├── pt_CV.php │ │ ├── pt_GQ.php │ │ ├── pt_GW.php │ │ ├── pt_LU.php │ │ ├── pt_MO.php │ │ ├── pt_MZ.php │ │ ├── pt_PT.php │ │ ├── pt_ST.php │ │ ├── pt_TL.php │ │ ├── qu.php │ │ ├── qu_BO.php │ │ ├── qu_EC.php │ │ ├── quz.php │ │ ├── quz_PE.php │ │ ├── raj.php │ │ ├── raj_IN.php │ │ ├── rm.php │ │ ├── rn.php │ │ ├── ro.php │ │ ├── ro_MD.php │ │ ├── ro_RO.php │ │ ├── rof.php │ │ ├── ru.php │ │ ├── ru_BY.php │ │ ├── ru_KG.php │ │ ├── ru_KZ.php │ │ ├── ru_MD.php │ │ ├── ru_RU.php │ │ ├── ru_UA.php │ │ ├── rw.php │ │ ├── rw_RW.php │ │ ├── rwk.php │ │ ├── sa.php │ │ ├── sa_IN.php │ │ ├── sah.php │ │ ├── sah_RU.php │ │ ├── saq.php │ │ ├── sat.php │ │ ├── sat_IN.php │ │ ├── sbp.php │ │ ├── sc.php │ │ ├── sc_IT.php │ │ ├── sd.php │ │ ├── sd_IN.php │ │ ├── sd_IN@devanagari.php │ │ ├── se.php │ │ ├── se_FI.php │ │ ├── se_NO.php │ │ ├── se_SE.php │ │ ├── seh.php │ │ ├── ses.php │ │ ├── sg.php │ │ ├── sgs.php │ │ ├── sgs_LT.php │ │ ├── sh.php │ │ ├── shi.php │ │ ├── shi_Latn.php │ │ ├── shi_Tfng.php │ │ ├── shn.php │ │ ├── shn_MM.php │ │ ├── shs.php │ │ ├── shs_CA.php │ │ ├── si.php │ │ ├── si_LK.php │ │ ├── sid.php │ │ ├── sid_ET.php │ │ ├── sk.php │ │ ├── sk_SK.php │ │ ├── sl.php │ │ ├── sl_SI.php │ │ ├── sm.php │ │ ├── sm_WS.php │ │ ├── smn.php │ │ ├── sn.php │ │ ├── so.php │ │ ├── so_DJ.php │ │ ├── so_ET.php │ │ ├── so_KE.php │ │ ├── so_SO.php │ │ ├── sq.php │ │ ├── sq_AL.php │ │ ├── sq_MK.php │ │ ├── sq_XK.php │ │ ├── sr.php │ │ ├── sr_Cyrl.php │ │ ├── sr_Cyrl_BA.php │ │ ├── sr_Cyrl_ME.php │ │ ├── sr_Cyrl_XK.php │ │ ├── sr_Latn.php │ │ ├── sr_Latn_BA.php │ │ ├── sr_Latn_ME.php │ │ ├── sr_Latn_XK.php │ │ ├── sr_ME.php │ │ ├── sr_RS.php │ │ ├── sr_RS@latin.php │ │ ├── ss.php │ │ ├── ss_ZA.php │ │ ├── st.php │ │ ├── st_ZA.php │ │ ├── sv.php │ │ ├── sv_AX.php │ │ ├── sv_FI.php │ │ ├── sv_SE.php │ │ ├── sw.php │ │ ├── sw_CD.php │ │ ├── sw_KE.php │ │ ├── sw_TZ.php │ │ ├── sw_UG.php │ │ ├── szl.php │ │ ├── szl_PL.php │ │ ├── ta.php │ │ ├── ta_IN.php │ │ ├── ta_LK.php │ │ ├── ta_MY.php │ │ ├── ta_SG.php │ │ ├── tcy.php │ │ ├── tcy_IN.php │ │ ├── te.php │ │ ├── te_IN.php │ │ ├── teo.php │ │ ├── teo_KE.php │ │ ├── tet.php │ │ ├── tg.php │ │ ├── tg_TJ.php │ │ ├── th.php │ │ ├── th_TH.php │ │ ├── the.php │ │ ├── the_NP.php │ │ ├── ti.php │ │ ├── ti_ER.php │ │ ├── ti_ET.php │ │ ├── tig.php │ │ ├── tig_ER.php │ │ ├── tk.php │ │ ├── tk_TM.php │ │ ├── tl.php │ │ ├── tl_PH.php │ │ ├── tlh.php │ │ ├── tn.php │ │ ├── tn_ZA.php │ │ ├── to.php │ │ ├── to_TO.php │ │ ├── tpi.php │ │ ├── tpi_PG.php │ │ ├── tr.php │ │ ├── tr_CY.php │ │ ├── tr_TR.php │ │ ├── ts.php │ │ ├── ts_ZA.php │ │ ├── tt.php │ │ ├── tt_RU.php │ │ ├── tt_RU@iqtelif.php │ │ ├── twq.php │ │ ├── tzl.php │ │ ├── tzm.php │ │ ├── tzm_Latn.php │ │ ├── ug.php │ │ ├── ug_CN.php │ │ ├── uk.php │ │ ├── uk_UA.php │ │ ├── unm.php │ │ ├── unm_US.php │ │ ├── ur.php │ │ ├── ur_IN.php │ │ ├── ur_PK.php │ │ ├── uz.php │ │ ├── uz_Arab.php │ │ ├── uz_Cyrl.php │ │ ├── uz_Latn.php │ │ ├── uz_UZ.php │ │ ├── uz_UZ@cyrillic.php │ │ ├── vai.php │ │ ├── vai_Latn.php │ │ ├── vai_Vaii.php │ │ ├── ve.php │ │ ├── ve_ZA.php │ │ ├── vi.php │ │ ├── vi_VN.php │ │ ├── vo.php │ │ ├── vun.php │ │ ├── wa.php │ │ ├── wa_BE.php │ │ ├── wae.php │ │ ├── wae_CH.php │ │ ├── wal.php │ │ ├── wal_ET.php │ │ ├── wo.php │ │ ├── wo_SN.php │ │ ├── xh.php │ │ ├── xh_ZA.php │ │ ├── xog.php │ │ ├── yav.php │ │ ├── yi.php │ │ ├── yi_US.php │ │ ├── yo.php │ │ ├── yo_BJ.php │ │ ├── yo_NG.php │ │ ├── yue.php │ │ ├── yue_HK.php │ │ ├── yue_Hans.php │ │ ├── yue_Hant.php │ │ ├── yuw.php │ │ ├── yuw_PG.php │ │ ├── zgh.php │ │ ├── zh.php │ │ ├── zh_CN.php │ │ ├── zh_HK.php │ │ ├── zh_Hans.php │ │ ├── zh_Hans_HK.php │ │ ├── zh_Hans_MO.php │ │ ├── zh_Hans_SG.php │ │ ├── zh_Hant.php │ │ ├── zh_Hant_HK.php │ │ ├── zh_Hant_MO.php │ │ ├── zh_Hant_TW.php │ │ ├── zh_MO.php │ │ ├── zh_SG.php │ │ ├── zh_TW.php │ │ ├── zh_YUE.php │ │ ├── zu.php │ │ └── zu_ZA.php │ ├── Language.php │ ├── Laravel/ │ │ └── ServiceProvider.php │ ├── List/ │ │ ├── languages.php │ │ └── regions.php │ ├── MessageFormatter/ │ │ └── MessageFormatterMapper.php │ ├── Month.php │ ├── PHPStan/ │ │ ├── MacroExtension.php │ │ └── MacroMethodReflection.php │ ├── Traits/ │ │ ├── Boundaries.php │ │ ├── Cast.php │ │ ├── Comparison.php │ │ ├── Converter.php │ │ ├── Creator.php │ │ ├── Date.php │ │ ├── DeprecatedPeriodProperties.php │ │ ├── Difference.php │ │ ├── IntervalRounding.php │ │ ├── IntervalStep.php │ │ ├── LocalFactory.php │ │ ├── Localization.php │ │ ├── Macro.php │ │ ├── MagicParameter.php │ │ ├── Mixin.php │ │ ├── Modifiers.php │ │ ├── Mutability.php │ │ ├── ObjectInitialisation.php │ │ ├── Options.php │ │ ├── Rounding.php │ │ ├── Serialization.php │ │ ├── StaticLocalization.php │ │ ├── StaticOptions.php │ │ ├── Test.php │ │ ├── Timestamp.php │ │ ├── ToStringFormat.php │ │ ├── Units.php │ │ └── Week.php │ ├── Translator.php │ ├── TranslatorImmutable.php │ ├── TranslatorStrongTypeInterface.php │ ├── Unit.php │ ├── WeekDay.php │ └── WrapperClock.php └── tests/ ├── AbstractTestCase.php ├── AbstractTestCaseWithOldNow.php ├── Carbon/ │ ├── AddMonthsTest.php │ ├── AddTest.php │ ├── ArraysTest.php │ ├── ComparisonTest.php │ ├── ConstructTest.php │ ├── CopyTest.php │ ├── CreateFromDateTest.php │ ├── CreateFromFormatTest.php │ ├── CreateFromTimeStringTest.php │ ├── CreateFromTimeTest.php │ ├── CreateFromTimestampTest.php │ ├── CreateSafeTest.php │ ├── CreateStrictTest.php │ ├── CreateTest.php │ ├── DayOfWeekModifiersTest.php │ ├── DiffTest.php │ ├── Exceptions/ │ │ ├── BadComparisonUnitExceptionTest.php │ │ ├── BadFluentConstructorExceptionTest.php │ │ ├── BadFluentSetterExceptionTest.php │ │ ├── ImmutableExceptionTest.php │ │ ├── InvalidCastExceptionTest.php │ │ ├── InvalidDateExceptionTest.php │ │ ├── InvalidFormatExceptionTest.php │ │ ├── InvalidIntervalExceptionTest.php │ │ ├── InvalidPeriodDateExceptionTest.php │ │ ├── InvalidPeriodParameterExceptionTest.php │ │ ├── InvalidTimeZoneExceptionTest.php │ │ ├── InvalidTypeExceptionTest.php │ │ ├── NotACarbonClassExceptionTest.php │ │ ├── NotAPeriodExceptionTest.php │ │ ├── NotLocaleAwareExceptionTest.php │ │ ├── OutOfRangeExceptionTest.php │ │ ├── ParseErrorExceptionTest.php │ │ ├── UnitExceptionTest.php │ │ ├── UnitNotConfiguredExceptionTest.php │ │ ├── UnknownGetterExceptionTest.php │ │ ├── UnknownMethodExceptionTest.php │ │ ├── UnknownSetterExceptionTest.php │ │ ├── UnknownUnitExceptionTest.php │ │ └── UnreachableExceptionTest.php │ ├── ExpressiveComparisonTest.php │ ├── Fixtures/ │ │ ├── BadIsoCarbon.php │ │ ├── DumpCarbon.php │ │ ├── FooBar.php │ │ ├── Mixin.php │ │ ├── MyCarbon.php │ │ └── NoLocaleTranslator.php │ ├── FluidSettersTest.php │ ├── GenericMacroTest.php │ ├── GettersTest.php │ ├── InstanceTest.php │ ├── IsTest.php │ ├── IssetTest.php │ ├── JsonSerializationTest.php │ ├── LastErrorTest.php │ ├── LocalizationTest.php │ ├── MacroTest.php │ ├── ModifyNearDSTChangeTest.php │ ├── ModifyTest.php │ ├── NowAndOtherStaticHelpersTest.php │ ├── NowDerivativesTest.php │ ├── ObjectsTest.php │ ├── PhpBug72338Test.php │ ├── RelativeDateStringTest.php │ ├── RelativeTest.php │ ├── RoundTest.php │ ├── SerializationTest.php │ ├── SetDateAndTimeFromTest.php │ ├── SettersTest.php │ ├── SettingsTest.php │ ├── StartEndOfTest.php │ ├── StrictModeTest.php │ ├── StringsTest.php │ ├── SubTest.php │ ├── TestingAidsTest.php │ └── WeekTest.php ├── CarbonImmutable/ │ ├── AddMonthsTest.php │ ├── AddTest.php │ ├── ArraysTest.php │ ├── ComparisonTest.php │ ├── ConstructTest.php │ ├── CopyTest.php │ ├── CreateFromDateTest.php │ ├── CreateFromFormatTest.php │ ├── CreateFromTimeStringTest.php │ ├── CreateFromTimeTest.php │ ├── CreateFromTimestampTest.php │ ├── CreateSafeTest.php │ ├── CreateTest.php │ ├── DayOfWeekModifiersTest.php │ ├── DiffTest.php │ ├── ExpressiveComparisonTest.php │ ├── Fixtures/ │ │ ├── BadIsoCarbon.php │ │ ├── Mixin.php │ │ └── MyCarbon.php │ ├── FluidSettersTest.php │ ├── GenericMacroTest.php │ ├── GettersTest.php │ ├── InstanceTest.php │ ├── IsTest.php │ ├── IssetTest.php │ ├── JsonSerializationTest.php │ ├── LastErrorTest.php │ ├── LocalizationTest.php │ ├── MacroTest.php │ ├── ModifyNearDSTChangeTest.php │ ├── ModifyTest.php │ ├── NowAndOtherStaticHelpersTest.php │ ├── NowDerivativesTest.php │ ├── ObjectsTest.php │ ├── PhpBug72338Test.php │ ├── RelativeDateStringTest.php │ ├── RelativeTest.php │ ├── RoundTest.php │ ├── SerializationTest.php │ ├── SetDateAndTimeFromTest.php │ ├── SetStateTest.php │ ├── SettersTest.php │ ├── SettingsTest.php │ ├── StartEndOfTest.php │ ├── StringsTest.php │ ├── SubTest.php │ ├── TestingAidsTest.php │ └── WeekTest.php ├── CarbonInterval/ │ ├── AddTest.php │ ├── AlternativeNumbersTest.php │ ├── CascadeTest.php │ ├── CloneTest.php │ ├── CompareTest.php │ ├── ComparisonTest.php │ ├── ConstructTest.php │ ├── CreateFromFormatTest.php │ ├── DivideTest.php │ ├── Fixtures/ │ │ ├── Mixin.php │ │ ├── MixinTrait.php │ │ └── MyCarbonInterval.php │ ├── FloatSettersEnabledTest.php │ ├── ForHumansTest.php │ ├── FromStringTest.php │ ├── GettersTest.php │ ├── MacroTest.php │ ├── MultiplyTest.php │ ├── ParseFromLocaleTest.php │ ├── RoundingTest.php │ ├── SetStateTest.php │ ├── SettersTest.php │ ├── SharesTest.php │ ├── SpecTest.php │ ├── StrictModeTest.php │ ├── TimesTest.php │ ├── ToDateIntervalTest.php │ ├── ToPeriodTest.php │ ├── ToStringTest.php │ └── TotalTest.php ├── CarbonPeriod/ │ ├── AliasTest.php │ ├── CloneTest.php │ ├── ComparisonTest.php │ ├── CreateTest.php │ ├── DynamicIntervalTest.php │ ├── FilterTest.php │ ├── Fixtures/ │ │ ├── AbstractCarbon.php │ │ ├── CarbonPeriodFactory.php │ │ ├── FooFilters.php │ │ ├── MacroableClass.php │ │ ├── Mixin.php │ │ ├── MixinTrait.php │ │ └── filters.php │ ├── GettersTest.php │ ├── IterationMethodsTest.php │ ├── IteratorTest.php │ ├── MacroTest.php │ ├── RoundingTest.php │ ├── SerializationTest.php │ ├── SettersTest.php │ ├── StrictModeTest.php │ ├── ToArrayTest.php │ ├── ToDatePeriodTest.php │ └── ToStringTest.php ├── CarbonPeriodImmutable/ │ ├── AliasTest.php │ ├── CloneTest.php │ ├── ComparisonTest.php │ ├── CreateTest.php │ ├── DynamicIntervalTest.php │ ├── FilterTest.php │ ├── GettersTest.php │ ├── IterationMethodsTest.php │ ├── IteratorTest.php │ ├── MacroTest.php │ ├── RoundingTest.php │ ├── SettersTest.php │ ├── StrictModeTest.php │ ├── ToArrayTest.php │ ├── ToDatePeriodTest.php │ └── ToStringTest.php ├── CarbonTimeZone/ │ ├── ConversionsTest.php │ ├── CreateTest.php │ ├── Fixtures/ │ │ └── UnknownZone.php │ └── GettersTest.php ├── Cli/ │ ├── Cli.php │ └── InvokerTest.php ├── CommonTraits/ │ └── MacroContextNestingTest.php ├── Doctrine/ │ └── CarbonTypesTest.php ├── Factory/ │ ├── CallbackTest.php │ ├── FactoryTest.php │ └── WrapperClockTest.php ├── Fixtures/ │ ├── CarbonTimezoneTrait.php │ ├── CarbonTypeCase.php │ ├── DateMalformedIntervalStringException.php │ ├── DateMalformedStringException.php │ ├── SubCarbon.php │ ├── SubCarbonImmutable.php │ ├── dynamicInterval.php │ └── serialized-interval-from-v2.txt ├── Jenssegers/ │ ├── DateTest.php │ ├── JenssegersDate.php │ ├── TestCaseBase.php │ ├── TranslationElTest.php │ ├── TranslationHuTest.php │ ├── TranslationJaTest.php │ ├── TranslationKaTest.php │ ├── TranslationTaTest.php │ ├── TranslationTest.php │ ├── TranslationThTest.php │ └── TranslationUkTest.php ├── Language/ │ ├── LanguageTest.php │ └── TranslatorTest.php ├── Laravel/ │ ├── App.php │ ├── Dispatcher.php │ ├── EventDispatcher.php │ ├── EventDispatcherBase.php │ ├── ServiceProvider.php │ ├── ServiceProviderTest.php │ ├── Translator.php │ ├── laravel.12.x.multi-tester.yml │ └── laravel.master.multi-tester.yml ├── Localization/ │ ├── AaDjTest.php │ ├── AaErSaahoTest.php │ ├── AaErTest.php │ ├── AaEtTest.php │ ├── AaTest.php │ ├── AfNaTest.php │ ├── AfTest.php │ ├── AfZaTest.php │ ├── AgqTest.php │ ├── AgrPeTest.php │ ├── AgrTest.php │ ├── AkGhTest.php │ ├── AkTest.php │ ├── AmEtTest.php │ ├── AmTest.php │ ├── AnEsTest.php │ ├── AnTest.php │ ├── AnpInTest.php │ ├── AnpTest.php │ ├── ArAeTest.php │ ├── ArBhTest.php │ ├── ArDjTest.php │ ├── ArDzTest.php │ ├── ArEgTest.php │ ├── ArEhTest.php │ ├── ArErTest.php │ ├── ArIlTest.php │ ├── ArInTest.php │ ├── ArIqTest.php │ ├── ArJoTest.php │ ├── ArKmTest.php │ ├── ArKwTest.php │ ├── ArLbTest.php │ ├── ArLyTest.php │ ├── ArMaTest.php │ ├── ArMrTest.php │ ├── ArOmTest.php │ ├── ArPsTest.php │ ├── ArQaTest.php │ ├── ArSaTest.php │ ├── ArSdTest.php │ ├── ArShaklTest.php │ ├── ArSoTest.php │ ├── ArSsTest.php │ ├── ArSyTest.php │ ├── ArTdTest.php │ ├── ArTest.php │ ├── ArTnTest.php │ ├── ArYeTest.php │ ├── AsInTest.php │ ├── AsTest.php │ ├── AsaTest.php │ ├── AstEsTest.php │ ├── AstTest.php │ ├── AycPeTest.php │ ├── AycTest.php │ ├── AzArabTest.php │ ├── AzAzTest.php │ ├── AzCyrlTest.php │ ├── AzIrTest.php │ ├── AzLatnTest.php │ ├── AzTest.php │ ├── BasTest.php │ ├── BeByLatinTest.php │ ├── BeByTest.php │ ├── BeTest.php │ ├── BemTest.php │ ├── BemZmTest.php │ ├── BerDzTest.php │ ├── BerMaTest.php │ ├── BerTest.php │ ├── BezTest.php │ ├── BgBgTest.php │ ├── BgTest.php │ ├── BhbInTest.php │ ├── BhbTest.php │ ├── BhoInTest.php │ ├── BhoTest.php │ ├── BiTest.php │ ├── BiVuTest.php │ ├── BmTest.php │ ├── BnBdTest.php │ ├── BnInTest.php │ ├── BnTest.php │ ├── BoCnTest.php │ ├── BoInTest.php │ ├── BoTest.php │ ├── BrFrTest.php │ ├── BrTest.php │ ├── BrxInTest.php │ ├── BrxTest.php │ ├── BsBaTest.php │ ├── BsCyrlTest.php │ ├── BsLatnTest.php │ ├── BsTest.php │ ├── BynErTest.php │ ├── BynTest.php │ ├── CaAdTest.php │ ├── CaEsTest.php │ ├── CaEsValenciaTest.php │ ├── CaFrTest.php │ ├── CaItTest.php │ ├── CaTest.php │ ├── CcpInTest.php │ ├── CcpTest.php │ ├── CeRuTest.php │ ├── CeTest.php │ ├── CggTest.php │ ├── ChrTest.php │ ├── ChrUsTest.php │ ├── CkbTest.php │ ├── CmnTest.php │ ├── CmnTwTest.php │ ├── CrhTest.php │ ├── CrhUaTest.php │ ├── CsCzTest.php │ ├── CsTest.php │ ├── CsbPlTest.php │ ├── CsbTest.php │ ├── CuTest.php │ ├── CvRuTest.php │ ├── CvTest.php │ ├── CyGbTest.php │ ├── CyTest.php │ ├── DaDkTest.php │ ├── DaGlTest.php │ ├── DaTest.php │ ├── DavTest.php │ ├── DeAtTest.php │ ├── DeBeTest.php │ ├── DeChTest.php │ ├── DeDeTest.php │ ├── DeItTest.php │ ├── DeLiTest.php │ ├── DeLuTest.php │ ├── DeTest.php │ ├── DjeTest.php │ ├── DoiInTest.php │ ├── DoiTest.php │ ├── DsbDeTest.php │ ├── DsbTest.php │ ├── DuaTest.php │ ├── DvMvTest.php │ ├── DvTest.php │ ├── DyoTest.php │ ├── DzBtTest.php │ ├── DzTest.php │ ├── EbuTest.php │ ├── EeTest.php │ ├── EeTgTest.php │ ├── ElCyTest.php │ ├── ElGrTest.php │ ├── ElTest.php │ ├── En001Test.php │ ├── En150Test.php │ ├── EnAgTest.php │ ├── EnAiTest.php │ ├── EnAsTest.php │ ├── EnAtTest.php │ ├── EnAuTest.php │ ├── EnBbTest.php │ ├── EnBeTest.php │ ├── EnBiTest.php │ ├── EnBmTest.php │ ├── EnBsTest.php │ ├── EnBwTest.php │ ├── EnBzTest.php │ ├── EnCaTest.php │ ├── EnCcTest.php │ ├── EnChTest.php │ ├── EnCkTest.php │ ├── EnCmTest.php │ ├── EnCxTest.php │ ├── EnCyTest.php │ ├── EnDeTest.php │ ├── EnDgTest.php │ ├── EnDkTest.php │ ├── EnDmTest.php │ ├── EnErTest.php │ ├── EnFiTest.php │ ├── EnFjTest.php │ ├── EnFkTest.php │ ├── EnFmTest.php │ ├── EnGbTest.php │ ├── EnGdTest.php │ ├── EnGgTest.php │ ├── EnGhTest.php │ ├── EnGiTest.php │ ├── EnGmTest.php │ ├── EnGuTest.php │ ├── EnGyTest.php │ ├── EnHkTest.php │ ├── EnIeTest.php │ ├── EnIlTest.php │ ├── EnImTest.php │ ├── EnInTest.php │ ├── EnIoTest.php │ ├── EnIsoTest.php │ ├── EnJeTest.php │ ├── EnJmTest.php │ ├── EnKeTest.php │ ├── EnKiTest.php │ ├── EnKnTest.php │ ├── EnKyTest.php │ ├── EnLcTest.php │ ├── EnLrTest.php │ ├── EnLsTest.php │ ├── EnMgTest.php │ ├── EnMhTest.php │ ├── EnMoTest.php │ ├── EnMpTest.php │ ├── EnMsTest.php │ ├── EnMtTest.php │ ├── EnMuTest.php │ ├── EnMwTest.php │ ├── EnMyTest.php │ ├── EnNaTest.php │ ├── EnNfTest.php │ ├── EnNgTest.php │ ├── EnNlTest.php │ ├── EnNrTest.php │ ├── EnNuTest.php │ ├── EnNzTest.php │ ├── EnPgTest.php │ ├── EnPhTest.php │ ├── EnPkTest.php │ ├── EnPnTest.php │ ├── EnPrTest.php │ ├── EnPwTest.php │ ├── EnRwTest.php │ ├── EnSbTest.php │ ├── EnScTest.php │ ├── EnSdTest.php │ ├── EnSeTest.php │ ├── EnSgTest.php │ ├── EnShTest.php │ ├── EnSiTest.php │ ├── EnSlTest.php │ ├── EnSsTest.php │ ├── EnSxTest.php │ ├── EnSzTest.php │ ├── EnTcTest.php │ ├── EnTest.php │ ├── EnTkTest.php │ ├── EnToTest.php │ ├── EnTtTest.php │ ├── EnTvTest.php │ ├── EnTzTest.php │ ├── EnUgTest.php │ ├── EnUmTest.php │ ├── EnUsPosixTest.php │ ├── EnUsTest.php │ ├── EnVcTest.php │ ├── EnVgTest.php │ ├── EnViTest.php │ ├── EnVuTest.php │ ├── EnWsTest.php │ ├── EnZaTest.php │ ├── EnZmTest.php │ ├── EnZwTest.php │ ├── EoTest.php │ ├── Es419Test.php │ ├── EsArTest.php │ ├── EsBoTest.php │ ├── EsBrTest.php │ ├── EsBzTest.php │ ├── EsClTest.php │ ├── EsCoTest.php │ ├── EsCrTest.php │ ├── EsCuTest.php │ ├── EsDoTest.php │ ├── EsEaTest.php │ ├── EsEcTest.php │ ├── EsEsTest.php │ ├── EsGqTest.php │ ├── EsGtTest.php │ ├── EsHnTest.php │ ├── EsIcTest.php │ ├── EsMxTest.php │ ├── EsNiTest.php │ ├── EsPaTest.php │ ├── EsPeTest.php │ ├── EsPhTest.php │ ├── EsPrTest.php │ ├── EsPyTest.php │ ├── EsSvTest.php │ ├── EsTest.php │ ├── EsUsTest.php │ ├── EsUyTest.php │ ├── EsVeTest.php │ ├── EtEeTest.php │ ├── EtTest.php │ ├── EuEsTest.php │ ├── EuTest.php │ ├── EwoTest.php │ ├── FaAfTest.php │ ├── FaIrTest.php │ ├── FaTest.php │ ├── FfCmTest.php │ ├── FfGnTest.php │ ├── FfMrTest.php │ ├── FfSnTest.php │ ├── FfTest.php │ ├── FiFiTest.php │ ├── FiTest.php │ ├── FilPhTest.php │ ├── FilTest.php │ ├── FoDkTest.php │ ├── FoFoTest.php │ ├── FoTest.php │ ├── FrBeTest.php │ ├── FrBfTest.php │ ├── FrBiTest.php │ ├── FrBjTest.php │ ├── FrBlTest.php │ ├── FrCaTest.php │ ├── FrCdTest.php │ ├── FrCfTest.php │ ├── FrCgTest.php │ ├── FrChTest.php │ ├── FrCiTest.php │ ├── FrCmTest.php │ ├── FrDjTest.php │ ├── FrDzTest.php │ ├── FrFrTest.php │ ├── FrGaTest.php │ ├── FrGfTest.php │ ├── FrGnTest.php │ ├── FrGpTest.php │ ├── FrGqTest.php │ ├── FrHtTest.php │ ├── FrKmTest.php │ ├── FrLuTest.php │ ├── FrMaTest.php │ ├── FrMcTest.php │ ├── FrMfTest.php │ ├── FrMgTest.php │ ├── FrMlTest.php │ ├── FrMqTest.php │ ├── FrMrTest.php │ ├── FrMuTest.php │ ├── FrNcTest.php │ ├── FrNeTest.php │ ├── FrPfTest.php │ ├── FrPmTest.php │ ├── FrReTest.php │ ├── FrRwTest.php │ ├── FrScTest.php │ ├── FrSnTest.php │ ├── FrSyTest.php │ ├── FrTdTest.php │ ├── FrTest.php │ ├── FrTgTest.php │ ├── FrTnTest.php │ ├── FrVuTest.php │ ├── FrWfTest.php │ ├── FrYtTest.php │ ├── FurItTest.php │ ├── FurTest.php │ ├── FyDeTest.php │ ├── FyNlTest.php │ ├── FyTest.php │ ├── GaIeTest.php │ ├── GaTest.php │ ├── GdGbTest.php │ ├── GdTest.php │ ├── GezErTest.php │ ├── GezEtTest.php │ ├── GezTest.php │ ├── GlEsTest.php │ ├── GlTest.php │ ├── GomLatnTest.php │ ├── GomTest.php │ ├── GswChTest.php │ ├── GswFrTest.php │ ├── GswLiTest.php │ ├── GswTest.php │ ├── GuInTest.php │ ├── GuTest.php │ ├── GuzTest.php │ ├── GvGbTest.php │ ├── GvTest.php │ ├── HaGhTest.php │ ├── HaNeTest.php │ ├── HaNgTest.php │ ├── HaTest.php │ ├── HakTest.php │ ├── HakTwTest.php │ ├── HawTest.php │ ├── HeIlTest.php │ ├── HeTest.php │ ├── HiInTest.php │ ├── HiTest.php │ ├── HifFjTest.php │ ├── HifTest.php │ ├── HneInTest.php │ ├── HneTest.php │ ├── HrBaTest.php │ ├── HrHrTest.php │ ├── HrTest.php │ ├── HsbDeTest.php │ ├── HsbTest.php │ ├── HtHtTest.php │ ├── HtTest.php │ ├── HuHuTest.php │ ├── HuTest.php │ ├── HyAmTest.php │ ├── HyTest.php │ ├── I18nTest.php │ ├── IaFrTest.php │ ├── IaTest.php │ ├── IdIdTest.php │ ├── IdTest.php │ ├── IgNgTest.php │ ├── IgTest.php │ ├── IiTest.php │ ├── IkCaTest.php │ ├── IkTest.php │ ├── InTest.php │ ├── IsIsTest.php │ ├── IsTest.php │ ├── ItChTest.php │ ├── ItItTest.php │ ├── ItSmTest.php │ ├── ItTest.php │ ├── ItVaTest.php │ ├── IuCaTest.php │ ├── IuTest.php │ ├── IwTest.php │ ├── JaJpTest.php │ ├── JaTest.php │ ├── JgoTest.php │ ├── JmcTest.php │ ├── JvTest.php │ ├── KaGeTest.php │ ├── KaTest.php │ ├── KabDzTest.php │ ├── KabTest.php │ ├── KamTest.php │ ├── KdeTest.php │ ├── KeaTest.php │ ├── KhqTest.php │ ├── KiTest.php │ ├── KkKzTest.php │ ├── KkTest.php │ ├── KkjTest.php │ ├── KlGlTest.php │ ├── KlTest.php │ ├── KlnTest.php │ ├── KmKhTest.php │ ├── KmTest.php │ ├── KnInTest.php │ ├── KnTest.php │ ├── KoKpTest.php │ ├── KoKrTest.php │ ├── KoTest.php │ ├── KokInTest.php │ ├── KokTest.php │ ├── KsInDevanagariTest.php │ ├── KsInTest.php │ ├── KsTest.php │ ├── KsbTest.php │ ├── KsfTest.php │ ├── KshTest.php │ ├── KuTest.php │ ├── KuTrTest.php │ ├── KwGbTest.php │ ├── KwTest.php │ ├── KyKgTest.php │ ├── KyTest.php │ ├── LagTest.php │ ├── LanguagesCoverageTest.php │ ├── LbLuTest.php │ ├── LbTest.php │ ├── LgTest.php │ ├── LgUgTest.php │ ├── LiNlTest.php │ ├── LiTest.php │ ├── LijItTest.php │ ├── LijTest.php │ ├── LktTest.php │ ├── LnAoTest.php │ ├── LnCdTest.php │ ├── LnCfTest.php │ ├── LnCgTest.php │ ├── LnTest.php │ ├── LoLaTest.php │ ├── LoTest.php │ ├── LocalizationTestCase.php │ ├── LrcIqTest.php │ ├── LrcTest.php │ ├── LtLtTest.php │ ├── LtTest.php │ ├── LuTest.php │ ├── LuoTest.php │ ├── LuyTest.php │ ├── LvLvTest.php │ ├── LvTest.php │ ├── LzhTest.php │ ├── LzhTwTest.php │ ├── MagInTest.php │ ├── MagTest.php │ ├── MaiInTest.php │ ├── MaiTest.php │ ├── MasTest.php │ ├── MasTzTest.php │ ├── MeTest.php │ ├── MerTest.php │ ├── MfeMuTest.php │ ├── MfeTest.php │ ├── MgMgTest.php │ ├── MgTest.php │ ├── MghTest.php │ ├── MgoTest.php │ ├── MhrRuTest.php │ ├── MhrTest.php │ ├── MiNzTest.php │ ├── MiTest.php │ ├── MiqNiTest.php │ ├── MiqTest.php │ ├── MjwInTest.php │ ├── MjwTest.php │ ├── MkMkTest.php │ ├── MkTest.php │ ├── MlInTest.php │ ├── MlTest.php │ ├── MnMnTest.php │ ├── MnTest.php │ ├── MniInTest.php │ ├── MniTest.php │ ├── MoTest.php │ ├── MrInTest.php │ ├── MrTest.php │ ├── MsBnTest.php │ ├── MsMyTest.php │ ├── MsSgTest.php │ ├── MsTest.php │ ├── MtMtTest.php │ ├── MtTest.php │ ├── MuaTest.php │ ├── MyMmTest.php │ ├── MyTest.php │ ├── MznTest.php │ ├── NanTest.php │ ├── NanTwLatinTest.php │ ├── NanTwTest.php │ ├── NaqTest.php │ ├── NbNoTest.php │ ├── NbSjTest.php │ ├── NbTest.php │ ├── NdTest.php │ ├── NdsDeTest.php │ ├── NdsNlTest.php │ ├── NdsTest.php │ ├── NeInTest.php │ ├── NeNpTest.php │ ├── NeTest.php │ ├── NhnMxTest.php │ ├── NhnTest.php │ ├── NiuNuTest.php │ ├── NiuTest.php │ ├── NlAwTest.php │ ├── NlBeTest.php │ ├── NlBqTest.php │ ├── NlCwTest.php │ ├── NlNlTest.php │ ├── NlSrTest.php │ ├── NlSxTest.php │ ├── NlTest.php │ ├── NmgTest.php │ ├── NnNoTest.php │ ├── NnTest.php │ ├── NnhTest.php │ ├── NoTest.php │ ├── NrTest.php │ ├── NrZaTest.php │ ├── NsoTest.php │ ├── NsoZaTest.php │ ├── NusTest.php │ ├── NynTest.php │ ├── OcFrTest.php │ ├── OcTest.php │ ├── OmEtTest.php │ ├── OmKeTest.php │ ├── OmTest.php │ ├── OrInTest.php │ ├── OrTest.php │ ├── OsRuTest.php │ ├── OsTest.php │ ├── PaArabTest.php │ ├── PaGuruTest.php │ ├── PaInTest.php │ ├── PaPkTest.php │ ├── PaTest.php │ ├── PapAwTest.php │ ├── PapCwTest.php │ ├── PapTest.php │ ├── PlPlTest.php │ ├── PlTest.php │ ├── PrgTest.php │ ├── PsAfTest.php │ ├── PsTest.php │ ├── PtAoTest.php │ ├── PtBrTest.php │ ├── PtChTest.php │ ├── PtCvTest.php │ ├── PtGqTest.php │ ├── PtGwTest.php │ ├── PtLuTest.php │ ├── PtMoTest.php │ ├── PtMzTest.php │ ├── PtPtTest.php │ ├── PtStTest.php │ ├── PtTest.php │ ├── PtTlTest.php │ ├── QuBoTest.php │ ├── QuEcTest.php │ ├── QuTest.php │ ├── QuzPeTest.php │ ├── QuzTest.php │ ├── RajInTest.php │ ├── RajTest.php │ ├── RmTest.php │ ├── RnTest.php │ ├── RoMdTest.php │ ├── RoRoTest.php │ ├── RoTest.php │ ├── RofTest.php │ ├── RuByTest.php │ ├── RuKgTest.php │ ├── RuKzTest.php │ ├── RuMdTest.php │ ├── RuRuTest.php │ ├── RuTest.php │ ├── RuUaTest.php │ ├── RwRwTest.php │ ├── RwTest.php │ ├── RwkTest.php │ ├── SaInTest.php │ ├── SaTest.php │ ├── SahRuTest.php │ ├── SahTest.php │ ├── SaqTest.php │ ├── SatInTest.php │ ├── SatTest.php │ ├── SbpTest.php │ ├── ScItTest.php │ ├── ScTest.php │ ├── ScrTest.php │ ├── SdInDevanagariTest.php │ ├── SdInTest.php │ ├── SdTest.php │ ├── SeFiTest.php │ ├── SeNoTest.php │ ├── SeSeTest.php │ ├── SeTest.php │ ├── SehTest.php │ ├── SesTest.php │ ├── SgTest.php │ ├── SgsLtTest.php │ ├── SgsTest.php │ ├── ShTest.php │ ├── ShiLatnTest.php │ ├── ShiTest.php │ ├── ShiTfngTest.php │ ├── ShnMmTest.php │ ├── ShnTest.php │ ├── ShsCaTest.php │ ├── ShsTest.php │ ├── SiLkTest.php │ ├── SiTest.php │ ├── SidEtTest.php │ ├── SidTest.php │ ├── SkSkTest.php │ ├── SkTest.php │ ├── SlSiTest.php │ ├── SlTest.php │ ├── SmTest.php │ ├── SmWsTest.php │ ├── SmnTest.php │ ├── SnTest.php │ ├── SoDjTest.php │ ├── SoEtTest.php │ ├── SoKeTest.php │ ├── SoSoTest.php │ ├── SoTest.php │ ├── SqAlTest.php │ ├── SqMkTest.php │ ├── SqTest.php │ ├── SqXkTest.php │ ├── SrCyrlBaTest.php │ ├── SrCyrlMeTest.php │ ├── SrCyrlTest.php │ ├── SrCyrlXkTest.php │ ├── SrLatnBaTest.php │ ├── SrLatnMeTest.php │ ├── SrLatnTest.php │ ├── SrLatnXkTest.php │ ├── SrMeTest.php │ ├── SrRsLatinTest.php │ ├── SrRsTest.php │ ├── SrTest.php │ ├── SsTest.php │ ├── SsZaTest.php │ ├── StTest.php │ ├── StZaTest.php │ ├── SvAxTest.php │ ├── SvFiTest.php │ ├── SvSeTest.php │ ├── SvTest.php │ ├── SwCdTest.php │ ├── SwKeTest.php │ ├── SwTest.php │ ├── SwTzTest.php │ ├── SwUgTest.php │ ├── SzlPlTest.php │ ├── SzlTest.php │ ├── TaInTest.php │ ├── TaLkTest.php │ ├── TaMyTest.php │ ├── TaSgTest.php │ ├── TaTest.php │ ├── TcyInTest.php │ ├── TcyTest.php │ ├── TeInTest.php │ ├── TeTest.php │ ├── TeoKeTest.php │ ├── TeoTest.php │ ├── TetTest.php │ ├── TgTest.php │ ├── TgTjTest.php │ ├── ThTest.php │ ├── ThThTest.php │ ├── TheNpTest.php │ ├── TheTest.php │ ├── TiErTest.php │ ├── TiEtTest.php │ ├── TiTest.php │ ├── TigErTest.php │ ├── TigTest.php │ ├── TkTest.php │ ├── TkTmTest.php │ ├── TlPhTest.php │ ├── TlTest.php │ ├── TlhTest.php │ ├── TnTest.php │ ├── TnZaTest.php │ ├── ToTest.php │ ├── ToToTest.php │ ├── TpiPgTest.php │ ├── TpiTest.php │ ├── TrCyTest.php │ ├── TrTest.php │ ├── TrTrTest.php │ ├── TsTest.php │ ├── TsZaTest.php │ ├── TtRuIqtelifTest.php │ ├── TtRuTest.php │ ├── TtTest.php │ ├── TwqTest.php │ ├── TzlTest.php │ ├── TzmLatnTest.php │ ├── TzmTest.php │ ├── UgCnTest.php │ ├── UgTest.php │ ├── UkTest.php │ ├── UkUaTest.php │ ├── UnmTest.php │ ├── UnmUsTest.php │ ├── UrInTest.php │ ├── UrPkTest.php │ ├── UrTest.php │ ├── UzArabTest.php │ ├── UzCyrlTest.php │ ├── UzLatnTest.php │ ├── UzTest.php │ ├── UzUzCyrillicTest.php │ ├── UzUzTest.php │ ├── VaiLatnTest.php │ ├── VaiTest.php │ ├── VaiVaiiTest.php │ ├── VeTest.php │ ├── VeZaTest.php │ ├── ViTest.php │ ├── ViVnTest.php │ ├── VoTest.php │ ├── VunTest.php │ ├── WaBeTest.php │ ├── WaTest.php │ ├── WaeChTest.php │ ├── WaeTest.php │ ├── WalEtTest.php │ ├── WalTest.php │ ├── WoSnTest.php │ ├── WoTest.php │ ├── XhTest.php │ ├── XhZaTest.php │ ├── XogTest.php │ ├── YavTest.php │ ├── YiTest.php │ ├── YiUsTest.php │ ├── YoBjTest.php │ ├── YoNgTest.php │ ├── YoTest.php │ ├── YueHansTest.php │ ├── YueHantTest.php │ ├── YueHkTest.php │ ├── YueTest.php │ ├── YuwPgTest.php │ ├── YuwTest.php │ ├── ZghTest.php │ ├── ZhCnTest.php │ ├── ZhHansHkTest.php │ ├── ZhHansMoTest.php │ ├── ZhHansSgTest.php │ ├── ZhHansTest.php │ ├── ZhHantHkTest.php │ ├── ZhHantMoTest.php │ ├── ZhHantTest.php │ ├── ZhHantTwTest.php │ ├── ZhHkTest.php │ ├── ZhMoTest.php │ ├── ZhSgTest.php │ ├── ZhTest.php │ ├── ZhTwTest.php │ ├── ZhYueTest.php │ ├── ZuTest.php │ └── ZuZaTest.php ├── PHPStan/ │ ├── FeaturesTest.php │ ├── Fixture.php │ ├── MacroExtensionTest.php │ ├── MixinClass.php │ ├── bad-project.neon │ ├── bootstrap-non-static.php │ ├── bootstrap.php │ └── project.neon ├── PHPUnit/ │ ├── AssertObjectHasPropertyNoopTrait.php │ ├── AssertObjectHasPropertyPolyfillTrait.php │ └── AssertObjectHasPropertyTrait.php ├── Unit/ │ ├── MonthTest.php │ ├── UnitTest.php │ └── WeekDayTest.php ├── bootstrap.php ├── phpmd-test.xml └── remove-comments-in-switch.php ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] charset = utf-8 end_of_line = lf insert_final_newline = true indent_style = space indent_size = 4 trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false [*.yml] indent_style = space indent_size = 2 ================================================ FILE: .gitattributes ================================================ /.editorconfig export-ignore /.gitattributes export-ignore /.github export-ignore /.gitignore export-ignore /.multi-tester.yml export-ignore /.php-cs-fixer.dist.php export-ignore /.styleci.yml export-ignore /.travis.yml export-ignore /build.php export-ignore /contributing.md export-ignore /codecov.yml export-ignore /phpdoc.php export-ignore /phpmd.xml export-ignore /phpstan.neon export-ignore /phpunit.xml.dist export-ignore /psalm.xml export-ignore /sponsors.php export-ignore /tests export-ignore * text=auto eol=lf ================================================ FILE: .github/FUNDING.yml ================================================ github: kylekatarnls open_collective: Carbon tidelift: packagist/nesbot/carbon ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: bug assignees: kylekatarnls --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** A stand-alone chunk of code (with no dependences to other packages, user-land function nor variables with unknow values), for example: ```php echo Carbon::parse('2018-06-01')->subDay()->month; ``` **Expected behavior** A clear and concise description of what you expected to happen. **Actual behavior** Show the value(s) you get. If you get an error or exception, provide the whole stack trace of it. **Versions** - PHP: [e.g. 8.4.11] (use `echo phpversion();` to get it) - Carbon: [e.g. 3.10.2] (run `composer show nesbot/carbon` to find it) **Additional context** Add any other context about the problem here. If some default timezone or other php.ini settings are in use for instance. ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ Hello, I encountered an issue with the following code: ```php echo Carbon::parse('2018-06-01')->subDay()->month; ``` Carbon version: **PUT HERE YOUR CARBON VERSION (exact version, not the range)** PHP version: **PUT HERE YOUR PHP VERSION** I expected to get: ``` 6 ``` But I actually get: ``` 5 ``` Thanks! ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: composer directory: / schedule: interval: weekly - package-ecosystem: github-actions directory: / schedule: interval: weekly ================================================ FILE: .github/workflows/deploy-documentation.yml ================================================ name: Deploy Documentation on: schedule: - cron: '0 0 * * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 with: ref: gh-pages - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: 8.4 extensions: json tools: composer:v2 coverage: none - name: Install dependencies run: composer update --prefer-dist --no-interaction --no-suggest - name: Run PHP generators run: composer run build - name: Setup pnpm uses: pnpm/action-setup@v4 - name: Setup Node uses: actions/setup-node@v6 with: node-version: 24 cache: pnpm - name: Setup Pages uses: actions/configure-pages@v5 - name: Install dependencies run: pnpm install - name: Build with VitePress run: pnpm docs:build env: REPOSITORY: ${{ github.repository }} - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: path: docs/.vitepress/dist deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} needs: build runs-on: ubuntu-latest name: Deploy steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 ================================================ FILE: .github/workflows/documentation.yml ================================================ name: Documentation on: schedule: - cron: '0 0 15 * *' - cron: '0 0 2 * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: sponsors: name: Update documentation runs-on: ubuntu-latest steps: - name: Checkout the code uses: actions/checkout@v6 with: ref: gh-pages - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: 8.4 tools: composer:v2 - name: Get composer cache directory id: composer-cache shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: "documentation-${{ hashFiles('**/composer.json') }}" restore-keys: "documentation-${{ hashFiles('**/composer.json') }}" - name: Install dependencies uses: nick-fields/retry@v3 if: steps.composer-cache.outputs.cache-hit != 'true' with: timeout_minutes: 10 max_attempts: 3 command: composer update --prefer-dist --no-progress --prefer-stable - name: Update documentation run: composer build - name: Create Pull Request if: github.repository_owner == 'briannesbitt' uses: peter-evans/create-pull-request@v8 with: branch: job/update-documentation commit-message: Update documentation title: Update documentation body: Monthly automated documentation update assignees: kylekatarnls reviewers: kylekatarnls add-paths: :!history.json ================================================ FILE: .github/workflows/laravel.yml ================================================ name: Laravel on: [ pull_request, push ] jobs: ubuntu: runs-on: ubuntu-latest services: memcached: image: memcached:1.6-alpine ports: - 11211:11211 mysql: image: mysql:5.7 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: forge ports: - 33306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 redis: image: redis:7.0 ports: - 6379:6379 options: --entrypoint redis-server dynamodb: image: amazon/dynamodb-local:2.0.0 ports: - 8888:8000 strategy: fail-fast: false matrix: php: [8.3, 8.5] reference: [12.x] name: ${{ matrix.reference }} - PHP ${{ matrix.php }} steps: - name: Checkout the code uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, memcached, gmp, :php-psr ini-values: error_reporting=E_ALL tools: composer:v2 coverage: none env: REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev - name: Install locales run: | sudo apt-get update || apt --fix-broken install || echo 'Apt failure ignored' sudo apt-get install tzdata locales -y && sudo locale-gen fr_FR.UTF-8 sr_ME.UTF-8 ar_AE.UTF-8 zh_TW.UTF-8 zh_CN.UTF-8 yo_NG.UTF-8 en_US.UTF-8 || echo 'Apt failure ignored' - name: Get composer cache directory id: composer-cache-ubuntu run: echo "dir=$(composer config cache-files-dir)" > $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v5 with: path: ${{ steps.composer-cache-ubuntu.outputs.dir }} key: "l${{ matrix.reference }}-php-${{ matrix.php }}-ubuntu-${{ hashFiles('**/composer.json') }}" restore-keys: "l${{ matrix.reference }}-php-${{ matrix.php }}-ubuntu-${{ hashFiles('**/composer.json') }}" - name: Install dependencies uses: nick-fields/retry@v3 if: steps.composer-cache.outputs.cache-hit != 'true' with: timeout_minutes: 10 max_attempts: 3 command: | composer remove --no-update phpmd/phpmd friendsofphp/php-cs-fixer --no-interaction --dev; composer update --prefer-dist --no-progress --prefer-stable; - name: Execute tests run: vendor/bin/multi-tester tests/Laravel/laravel.${{ matrix.reference }}.multi-tester.yml env: DB_PORT: ${{ job.services.mysql.ports[3306] }} DB_USERNAME: root DYNAMODB_CACHE_TABLE: laravel_dynamodb_test DYNAMODB_ENDPOINT: "http://localhost:8888" AWS_ACCESS_KEY_ID: randomKey AWS_SECRET_ACCESS_KEY: randomSecret GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/phpcs.yml ================================================ name: PHP-CS-Fixer on: [ pull_request, push ] jobs: lint: name: PHP-CS-Fixer runs-on: ubuntu-latest steps: - name: Checkout the code uses: actions/checkout@v6 - name: Ignore comments in switch run: php tests/remove-comments-in-switch.php - name: Check for code style violation with PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga with: args: --diff --dry-run ================================================ FILE: .github/workflows/phpmd.yml ================================================ name: PHPMD on: [ pull_request, push ] jobs: ubuntu: name: PHPMD runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - php: 8.3 steps: - name: Checkout the code uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: json, msgpack tools: composer:v2 coverage: none - name: Install dependencies uses: nick-fields/retry@v3 with: timeout_minutes: 10 max_attempts: 3 command: | composer remove --no-update phpstan/extension-installer phpstan/phpstan ondrejmirtes/better-reflection friendsofphp/php-cs-fixer kylekatarnls/multi-tester --no-interaction --dev; composer update --prefer-dist --no-progress --prefer-${{ matrix.setup || 'stable' }}; - name: Check source code run: composer phpmd - name: Check tests code run: composer phpmd-test ================================================ FILE: .github/workflows/phpstan.yml ================================================ name: PHPStan on: [ pull_request, push ] jobs: ubuntu: name: PHPStan runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - php: 8.3 steps: - name: Checkout the code uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: json, msgpack tools: composer:v2 coverage: none - name: Get composer cache directory id: composer-cache shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: "phpstan-${{ matrix.php }}-${{ matrix.setup }}-${{ matrix.os }}-${{ matrix.phpunit }}-${{ hashFiles('**/composer.json') }}" restore-keys: "phpstan-${{ matrix.php }}-${{ matrix.setup }}-${{ matrix.os }}-${{ matrix.phpunit }}-${{ hashFiles('**/composer.json') }}" - name: Install dependencies uses: nick-fields/retry@v3 with: timeout_minutes: 10 max_attempts: 3 command: | composer remove --no-update phpmd/phpmd friendsofphp/php-cs-fixer kylekatarnls/multi-tester --no-interaction --dev; composer require --no-update doctrine/orm symfony/config --no-interaction; composer update --prefer-dist --no-progress --prefer-${{ matrix.setup || 'stable' }}; - name: Run phpstan run: composer phpstan ================================================ FILE: .github/workflows/sponsors.yml ================================================ name: Sponsors on: schedule: - cron: '0 0 15 * *' - cron: '0 0 2 * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: sponsors: name: Update readme runs-on: ubuntu-latest steps: - name: Checkout the code uses: actions/checkout@v6 with: ref: master - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: 8.4 tools: composer:v2 - name: Get composer cache directory id: composer-cache shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: "sponsors-${{ hashFiles('**/composer.json') }}" restore-keys: "sponsors-${{ hashFiles('**/composer.json') }}" - name: Install dependencies uses: nick-fields/retry@v3 if: steps.composer-cache.outputs.cache-hit != 'true' with: timeout_minutes: 10 max_attempts: 3 command: composer update --prefer-dist --no-progress --prefer-stable - name: Update sponsors on readme.md run: composer sponsors - name: Create Pull Request if: github.repository_owner == 'briannesbitt' uses: peter-evans/create-pull-request@v8 with: branch: job/update-sponsors commit-message: Update sponsors title: Update sponsors body: Monthly automated sponsors update assignees: kylekatarnls reviewers: kylekatarnls add-paths: | readme.md ================================================ FILE: .github/workflows/tests.yml ================================================ name: Tests on: [ pull_request, push ] jobs: tests: strategy: fail-fast: false matrix: os: [ubuntu] php: [8.1, 8.2, 8.3, 8.4, 8.5] setup: [lowest, stable] include: - php: 8.1 os: windows setup: lowest - php: 8.1 os: windows setup: stable - php: 8.5 os: windows setup: stable - php: 8.1 os: ubuntu setup: stable classmap-authoritative: true - php: 8.3 os: ubuntu setup: stable phpunit: 11 coverage: true - php: 8.4 os: ubuntu setup: stable phpunit: 11 - php: 8.4 os: ubuntu setup: stable phpunit: 12 name: ${{ matrix.phpunit && format('PHPUnit {0} - ', matrix.phpunit) || '' }}${{ matrix.classmap-authoritative && 'classmap-authoritative - ' || '' }}${{ matrix.coverage && 'Coverage - ' || '' }}PHP ${{ matrix.php }} - ${{ matrix.setup || 'stable' }} - ${{ matrix.os }} runs-on: ${{ matrix.os }}-latest steps: - name: Checkout the code uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: json, msgpack ini-values: error_reporting=${{ (matrix.setup != 'lowest') && '32767' || '8191' }} tools: composer:v2 coverage: ${{ matrix.coverage && 'pcov' || 'none' }} - name: Install locales if: matrix.os == 'ubuntu' run: | sudo apt-get update || apt --fix-broken install || echo 'Apt failure ignored' sudo apt-get install tzdata locales -y && sudo locale-gen fr_FR.UTF-8 sr_ME.UTF-8 ar_AE.UTF-8 zh_TW.UTF-8 zh_CN.UTF-8 yo_NG.UTF-8 en_US.UTF-8 || echo 'Apt failure ignored' - name: Get composer cache directory id: composer-cache shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: "php-${{ matrix.php }}-${{ matrix.setup }}-${{ matrix.os }}-${{ matrix.phpunit }}-${{ hashFiles('**/composer.json') }}" restore-keys: "php-${{ matrix.php }}-${{ matrix.setup }}-${{ matrix.os }}-${{ matrix.phpunit }}-${{ hashFiles('**/composer.json') }}" - name: Select PHPUnit version if: matrix.phpunit shell: bash run: composer require --no-update --no-interaction --dev "phpunit/phpunit:^${{ matrix.phpunit }}" - name: Remove conflicting optional dependencies if: matrix.phpunit >= 11 run: composer remove --no-update --no-interaction --dev ondrejmirtes/better-reflection - name: Downgrade nikic/php-parser if: matrix.phpunit < 11 && matrix.php < 8.5 shell: bash run: composer require --no-update --no-interaction --dev "nikic/php-parser:^4" - name: Updgrade symfony/translation if: matrix.php >= 8.4 shell: bash run: composer require --no-update --no-interaction "symfony/translation:^5.4.35||^6.3.12||^7.0.3||^8.0.0" "symfony/contracts:^2.5.3||>=3.4.2" "sebastian/exporter:>5.1.2" # https://github.com/symfony/symfony/commit/f4118e110a46de3ffb799e7d79bf15128d1646ea - name: Install dependencies uses: nick-fields/retry@v3 if: steps.composer-cache.outputs.cache-hit != 'true' with: timeout_minutes: 10 max_attempts: 3 command: | composer remove --no-update --no-interaction --dev phpmd/phpmd friendsofphp/php-cs-fixer kylekatarnls/multi-tester; composer update --prefer-dist --no-progress --prefer-${{ matrix.setup || 'stable' }} ${{ matrix.classmap-authoritative && '--classmap-authoritative' || '' }}${{ matrix.php >= 8.2 && ' --ignore-platform-reqs' || '' }}; - name: Run test suite if: matrix.coverage != true run: php -d memory_limit=-1 -d zend.enable_gc=0 -d error_reporting=-1 vendor/phpunit/phpunit/phpunit --exclude-testsuite=localization --default-time-limit=${{ matrix.php >= 8.2 && '2' || '4' }} ${{ matrix.os == 'ubuntu' && '--enforce-time-limit' || '' }} --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings env: PHP_VERSION: ${{ matrix.php }} - name: Run test suite with coverage if: matrix.coverage run: php -d memory_limit=-1 -d zend.enable_gc=0 -d error_reporting=-1 vendor/phpunit/phpunit/phpunit --default-time-limit=3 ${{ matrix.os == 'ubuntu' && '--enforce-time-limit' || '' }} --coverage-clover=clover.xml --coverage-text env: PHP_VERSION: ${{ matrix.php }} - name: Code Climate Test Reporter uses: qltysh/qlty-action/coverage@v2 if: matrix.coverage with: token: ${{ secrets.QLTY_COVERAGE_TOKEN }} files: clover.xml - name: Coverage if: matrix.coverage uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} ================================================ FILE: .gitignore ================================================ .idea .vscode *.iml .php-cs-fixer.php .php-cs-fixer.cache vendor composer.phar composer.lock coverage.xml coverage phpunit.xml Carbon-*.zip *.phpunit.result.cache /nbproject/ *.cache ================================================ FILE: .php-cs-fixer.dist.php ================================================ For the full copyright and license information, please view the LICENSE file that was distributed with this source code. EOF; $rules = [ '@PSR2' => true, '@PSR12' => true, '@PHP71Migration' => true, 'array_syntax' => [ 'syntax' => 'short', ], 'blank_line_after_namespace' => true, 'blank_line_before_statement' => true, 'cast_spaces' => true, 'class_definition' => false, 'concat_space' => [ 'spacing' => 'none', ], 'ereg_to_preg' => true, 'general_phpdoc_tag_rename' => true, 'header_comment' => [ 'comment_type' => 'PHPDoc', 'header' => $header, 'location' => 'after_declare_strict', 'separate' => 'both', ], 'is_null' => true, 'line_ending' => true, 'modernize_types_casting' => true, 'native_function_invocation' => [ 'include' => ['@compiler_optimized', 'app'], ], 'no_blank_lines_after_phpdoc' => true, 'no_empty_phpdoc' => true, 'no_extra_blank_lines' => true, 'no_short_bool_cast' => true, 'no_unneeded_control_parentheses' => true, 'no_unused_imports' => true, 'no_whitespace_in_blank_line' => true, 'ordered_imports' => true, 'php_unit_method_casing' => [ 'case' => 'camel_case', ], 'php_unit_test_annotation' => [ 'style' => 'prefix', ], 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'this', ], 'phpdoc_align' => [ 'align' => 'vertical', 'tags' => [ 'param', 'return', 'throws', 'type', 'var', ], ], 'phpdoc_indent' => true, 'phpdoc_inline_tag_normalizer' => true, 'phpdoc_no_access' => true, 'phpdoc_no_package' => true, 'phpdoc_order' => true, 'phpdoc_scalar' => true, 'phpdoc_separation' => true, 'phpdoc_tag_type' => [ 'tags' => [ 'inheritdoc' => 'inline', ], ], 'phpdoc_to_comment' => true, 'phpdoc_trim' => true, 'phpdoc_types' => true, 'phpdoc_var_without_name' => true, 'self_accessor' => true, 'single_quote' => true, 'space_after_semicolon' => true, 'standardize_not_equals' => true, 'ternary_operator_spaces' => true, 'trailing_comma_in_multiline' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, 'yoda_style' => [ 'always_move_variable' => false, 'equal' => false, 'identical' => false, 'less_and_greater' => false, ], ]; return (new Config())->setRules($rules) ->setFinder( Finder::create() ->in(__DIR__) ->notPath([ 'src/Carbon/Doctrine/DateTimeImmutableType.php', 'src/Carbon/Doctrine/DateTimeType.php', ]), ) ->setUsingCache(true) ->setRiskyAllowed(true); ================================================ FILE: .phpstorm.meta.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ chdir(__DIR__); $currentBranch = 'master'; if (preg_match('/On branch ([^\n]+)\n/', shell_exec('git status'), $match)) { $currentBranch = $match[1]; } shell_exec('git fetch --all --tags --prune'); $remotes = explode("\n", trim(shell_exec('git remote'))); $tagsCommand = \count($remotes) ? 'git ls-remote --tags '.(\in_array('upstream', $remotes, true) ? 'upstream' : (\in_array('origin', $remotes, true) ? 'origin' : $remotes[0])) : 'git tag'; $tags = array_map(function ($ref) { $ref = explode('refs/tags/', $ref); return $ref[1] ?? $ref[0]; }, array_filter(explode("\n", trim(shell_exec($tagsCommand))), function ($ref) { return substr($ref, -3) !== '^{}'; })); usort($tags, 'version_compare'); $tag = isset($argv[1]) && !\in_array($argv[1], ['last', 'latest']) ? $argv[1] : end($tags); if (strtolower($tag) !== 'all') { if (!\in_array($tag, $tags, true)) { echo "Tag must be one of remote tags available:\n"; foreach ($tags as $_tag) { echo " - $_tag\n"; } echo "\"$tag\" does not match.\n"; exit(1); } $tags = [$tag]; } function getPhpLevel($tag) { if (version_compare($tag, '2.0.0-dev', '<')) { return '5.3.9'; } if (version_compare($tag, '3.0.0-dev', '<')) { return '7.1.8'; } return '8.1.0'; } foreach ($tags as $tag) { $archive = "Carbon-$tag.zip"; if (isset($argv[2]) && $argv[2] === 'missing' && file_exists($archive)) { continue; } $branch = "build-$tag"; shell_exec('git stash'); shell_exec("git branch -d $branch"); shell_exec("git checkout tags/$tag -b $branch"); $phpVersion = getPhpLevel($tag); shell_exec("composer config platform.php $phpVersion"); shell_exec('composer remove friendsofphp/php-cs-fixer --dev'); shell_exec('composer remove kylekatarnls/multi-tester --dev'); shell_exec('composer remove phpmd/phpmd --dev'); shell_exec('composer remove phpstan/phpstan --dev'); shell_exec('composer remove phpunit/phpunit --dev'); shell_exec('composer remove squizlabs/php_codesniffer --dev'); shell_exec('composer update --no-interaction --no-dev --optimize-autoloader'); $zip = new ZipArchive(); $zip->open($archive, ZipArchive::CREATE | ZipArchive::OVERWRITE); foreach (['src', 'vendor', 'Carbon', 'lazy'] as $directory) { if (is_dir($directory)) { $directory = realpath($directory); $base = \dirname($directory); $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::LEAVES_ONLY, ); foreach ($files as $name => $file) { if (!$file->isDir()) { $filePath = $file->getRealPath(); $zip->addFile($filePath, substr($filePath, \strlen($base) + 1)); } } } } $autoload = 'autoload.php'; file_put_contents($autoload, "addFile($autoload, $autoload); $zip->close(); unlink($autoload); shell_exec('git checkout .'); shell_exec("git checkout $currentBranch"); shell_exec("git branch -d $branch"); shell_exec('git stash pop'); shell_exec('composer config platform.php 8.1.0'); shell_exec('composer update --no-interaction'); } exit(0); ================================================ FILE: codecov.yml ================================================ comment: false ================================================ FILE: composer.json ================================================ { "name": "nesbot/carbon", "description": "An API extension for DateTime that supports 281 different languages.", "license": "MIT", "type": "library", "keywords": [ "date", "time", "DateTime" ], "authors": [ { "name": "Brian Nesbitt", "email": "brian@nesbot.com", "homepage": "https://markido.com" }, { "name": "kylekatarnls", "homepage": "https://github.com/kylekatarnls" } ], "homepage": "https://carbonphp.github.io/carbon/", "support": { "issues": "https://github.com/CarbonPHP/carbon/issues", "source": "https://github.com/CarbonPHP/carbon", "docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html" }, "funding": [ { "url": "https://github.com/sponsors/kylekatarnls", "type": "github" }, { "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", "type": "tidelift" }, { "url": "https://opencollective.com/Carbon#sponsor", "type": "opencollective" } ], "require": { "php": "^8.1", "ext-json": "*", "carbonphp/carbon-doctrine-types": "<100.0", "psr/clock": "^1.0", "symfony/clock": "^6.3.12 || ^7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.0", "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { "doctrine/dbal": "^3.6.3 || ^4.0", "doctrine/orm": "^2.15.2 || ^3.0", "friendsofphp/php-cs-fixer": "^v3.87.1", "kylekatarnls/multi-tester": "^2.5.3", "phpmd/phpmd": "^2.15.0", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan": "^2.1.22", "phpunit/phpunit": "^10.5.53", "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" }, "provide": { "psr/clock-implementation": "1.0" }, "minimum-stability": "dev", "prefer-stable": true, "autoload": { "psr-4": { "Carbon\\": "src/Carbon/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" }, "files": [ "tests/Laravel/ServiceProvider.php" ] }, "bin": [ "bin/carbon" ], "config": { "allow-plugins": { "phpstan/extension-installer": true, "composer/package-versions-deprecated": true }, "process-timeout": 0, "sort-packages": true }, "extra": { "branch-alias": { "dev-master": "3.x-dev", "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" ] }, "phpstan": { "includes": [ "extension.neon" ] } }, "scripts": { "phpcs": "php-cs-fixer fix -v --diff --dry-run", "phpdoc": "php phpdoc.php", "phpmd": "phpmd src text /phpmd.xml", "phpmd-test": "phpmd tests text /tests/phpmd-test.xml", "phpstan": "phpstan analyse --configuration phpstan.neon", "phpunit": "phpunit --verbose", "style-check": [ "@phpcs", "@phpstan", "@phpmd" ], "test": [ "@phpunit", "@style-check" ], "sponsors": "php sponsors.php" } } ================================================ FILE: contributing.md ================================================ # Contributing to Carbon ## Issue Contributions Please report any security issue using [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. Please don't disclose security bugs publicly until they have been handled by us. For any other bug or issue, please click this link and follow the template: [Create new issue](https://github.com/CarbonPHP/carbon/issues/new) You may think this template does not apply to your case but please think again. A long description will never be as clear as a code chunk with the output you expect from it (for either bug report or new features). ## Code Contributions ### Where to begin We use the label **good first issue** to tag issues that could be a good fit for new contributors, see if there are such issues now following this link: https://github.com/CarbonPHP/carbon/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 Else, check the roadmap to see what we plan to do in next releases: https://github.com/briannesbitt/Carbon/issues/1681 ### Develop locally, then submit changes Fork the [GitHub project](https://github.com/CarbonPHP/carbon) and download it locally: ```shell git clone https://github.com//carbon.git cd Carbon git remote add upstream https://github.com/CarbonPHP/carbon.git ``` Replace `` with your GitHub username. Then, you can work on the master or create a specific branch for your development: ```shell git checkout -b my-feature-branch -t origin/master ``` You can now edit the "Carbon" directory contents. Before committing, please set your name and your e-mail (use the same e-mail address as in your GitHub account): ```shell git config --global user.name "Your Name" git config --global user.email "your.email.address@example.com" ``` The ```--global``` argument will apply this setting for all your git repositories, remove it to set only your Carbon fork with those settings. Now you can commit your modifications as you usually do with git: ```shell git add --all git commit -m "The commit message log" ``` If your patch fixes an open issue, please insert ```#``` immediately followed by the issue number: ```shell git commit -m "#21 Fix this or that" ``` Use git rebase (not git merge) to sync your work from time to time: ```shell git fetch origin git rebase origin/master ``` Please add some tests for bug fixes and features (so it will ensure next developments will not break your code), then check all is right with phpunit: Install PHP if you haven't yet, then install composer: https://getcomposer.org/download/ Update dependencies: ``` ./composer.phar update ``` Or if you installed composer globally: ``` composer update ``` Then call phpunit: ``` ./vendor/bin/phpunit ``` Make sure all tests succeed before submitting your pull-request, else we will not be able to merge it. Push your work on your remote GitHub fork with: ``` git push origin my-feature-branch ``` Go to https://github.com/yourusername/Carbon and select your feature branch. Click the 'Pull Request' button and fill out the form. We will review it within a few days. And we thank you in advance for your help. ## Versioning ### Note about Semantic Versioning and breaking changes As a developer, you must understand every change is a breaking change. What is a bug for someone is expected in someone else's workflow. The consequence of a change strongly depends on the usage. [Semantic Versioning](https://semver.org/) relies to public API. In PHP, the public API of a class is its public methods. However, if you extend a class, you can access protected methods, then if you use reflexion, you can access private methods. So anything can become a public API if you force it to be. That doesn't mean we should handle any possible usage, else we would have to publish a major release for each change and it would no longer make sense. So before any complain about a breaking change, be warned, we do not guarantee a strict Semantic Versioning as you may expect, we're following a pragmatic interpretation of Semantic Versioning that allows the software to evolve in a reliable way with reasonable maintenance effort. Concretely, we consider a change as breaking if it makes fail one of our unit test. We will do our best to avoid incompatibilities with libraries that extends Carbon classes (such as Laravel that is continuously tested thanks to Travis CI, [see the compatibility matrix](https://github.com/kylekatarnls/carbon-laravel/tree/master#carbon-1-dev-version-1next)). If you're the owner of a library that strongly depends on Carbon, we recommend you to run unit tests daily requiring `"nesbot/carbon": "dev-master"` (for `^2`) or `"nesbot/carbon": "dev-version-1.next"` (for `^1`), this way you can detect incompatibilities earlier and report it to us before we tag a release. We'll pay attention and try to fix it to make update to next minor releases as soft as possible. We reserve the right to publish emergency patches within 24 hours after a release if a tag that does not respect this pattern would have been released despite our vigilance. In this very rare and particular case, we would mark the tag as broken on GitHub and backward compatibility would be based on previous stable tag. Last, you must understand that Carbon extends PHP natives classes, that means Carbon can be impacted by any change that occurs in the date/time API of PHP. We watch new PHP versions and handle those changes as quickly as possible when detected, but as PHP does not follow the semantic versioning pattern, it basically means any releases (including patches) can have unexpected consequences on Carbon methods results. ### Long term support To benefit the better support, require Carbon using major version range (`^1` or `^2`). By requiring `1.26.*`, `~1.26.0` or limited range such as `>=1.20 <1.33`, you fall to low priority support (only security and critical issues will be fixed), our prior support goes to next minor releases of each major version. It applies to bug fixes and low-cost features. Other new features will only be added in the last stable release. At the opposite, we recommend you to restrain to a major number, as there is no compatibility guarantee from a major version to the next. It means requiring `>=2`, as it allows any newer version, will probably leads to errors on releasing our next major version. Open milestones can be patched if a minor bug is detected while if you're on a closed milestone, we'll more likely ask you to update first to an open one. See currently open milestones: https://github.com/CarbonPHP/carbon/milestones ================================================ FILE: extension.neon ================================================ services: - class: Carbon\PHPStan\MacroExtension tags: - phpstan.broker.methodsClassReflectionExtension ================================================ FILE: lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\MessageFormatter; use Symfony\Component\Translation\Formatter\MessageFormatterInterface; if (!class_exists(LazyMessageFormatter::class, false)) { abstract class LazyMessageFormatter implements MessageFormatterInterface { public function format(string $message, string $locale, array $parameters = []): string { return $this->formatter->format( $message, $this->transformLocale($locale), $parameters ); } } } ================================================ FILE: lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\MessageFormatter; use Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface; use Symfony\Component\Translation\Formatter\MessageFormatterInterface; if (!class_exists(LazyMessageFormatter::class, false)) { abstract class LazyMessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface { abstract protected function transformLocale(?string $locale): ?string; public function format($message, $locale, array $parameters = []) { return $this->formatter->format( $message, $this->transformLocale($locale), $parameters ); } public function choiceFormat($message, $number, $locale, array $parameters = []) { return $this->formatter->choiceFormat($message, $number, $locale, $parameters); } } } ================================================ FILE: lazy/Carbon/ProtectedDatePeriod.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use DatePeriod; if (!class_exists(DatePeriodBase::class, false)) { class DatePeriodBase extends DatePeriod { /** * Period start in PHP < 8.2. * * @var CarbonInterface * * @deprecated PHP 8.2 this property is no longer in sync with the actual period start. */ protected $start; /** * Period end in PHP < 8.2. * * @var CarbonInterface|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period end. */ protected $end; /** * Period current iterated date in PHP < 8.2. * * @var CarbonInterface|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period current iterated date. */ protected $current; /** * Period interval in PHP < 8.2. * * @var CarbonInterval|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period interval. */ protected $interval; /** * Period recurrences in PHP < 8.2. * * @var int|float|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period recurrences. */ protected $recurrences; /** * Period start included option in PHP < 8.2. * * @var bool * * @deprecated PHP 8.2 this property is no longer in sync with the actual period start included option. */ protected $include_start_date; } } ================================================ FILE: lazy/Carbon/TranslatorStrongType.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Symfony\Component\Translation\MessageCatalogueInterface; if (!class_exists(LazyTranslator::class, false)) { class LazyTranslator extends AbstractTranslator implements TranslatorStrongTypeInterface { public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { return $this->translate($id, $parameters, $domain, $locale); } public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages') { $messages = $this->getPrivateProperty($catalogue, 'messages'); if (isset($messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id])) { return $messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id]; } if (isset($messages[$domain][$id])) { return $messages[$domain][$id]; } $fallbackCatalogue = $this->getPrivateProperty($catalogue, 'fallbackCatalogue'); if ($fallbackCatalogue !== null) { return $this->getFromCatalogue($fallbackCatalogue, $id, $domain); } return $id; } private function getPrivateProperty($instance, string $field) { return (function (string $field) { return $this->$field; })->call($instance, $field); } } } ================================================ FILE: lazy/Carbon/TranslatorWeakType.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; if (!class_exists(LazyTranslator::class, false)) { class LazyTranslator extends AbstractTranslator { /** * Returns the translation. * * @param string|null $id * @param array $parameters * @param string|null $domain * @param string|null $locale * * @return string */ public function trans($id, array $parameters = [], $domain = null, $locale = null) { return $this->translate($id, $parameters, $domain, $locale); } } } ================================================ FILE: lazy/Carbon/UnprotectedDatePeriod.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use DatePeriod; if (!class_exists(DatePeriodBase::class, false)) { class DatePeriodBase extends DatePeriod { } } ================================================ FILE: phpdoc.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\Factory; use Carbon\FactoryImmutable; $tags = [ 'property', 'property-read', 'property-write', PHP_EOL, 'mode', ['call', 'is'], ['call', 'isDayOfWeek'], ['call', 'isSameUnit'], ['call', 'setUnit'], ['call', 'addUnit'], ['call', 'addUTCUnit'], ['call', 'roundUnit'], ['call', 'diffForHumans'], ]; $nativeMethods = [ 'getOffset' => 'int', 'getTimestamp' => 'int', ]; $noInterface = [ 'setMicrosecond', ]; $modes = []; $autoDocLines = []; $carbon = __DIR__.'/src/Carbon/Carbon.php'; $immutable = __DIR__.'/src/Carbon/CarbonImmutable.php'; $interface = __DIR__.'/src/Carbon/CarbonInterface.php'; $phpLevel = 7.1; file_put_contents($interface, preg_replace('/(\/\/ )([\s\S]+)(<\/methods>)/mU', "$1\n\n // $3", file_get_contents($interface), 1)); require_once __DIR__.'/vendor/autoload.php'; $trait = __DIR__.'/src/Carbon/Traits/Date.php'; $code = ''; $overrideTyping = [ $carbon => [ // 'createFromImmutable' => ['static Carbon', 'DateTimeImmutable $dateTime', 'Create a new Carbon object from an immutable date.'], // 'createFromFormat' => ['static static', 'string $format, string $time, DateTimeZone|string|false|null $timezone = null', 'Parse a string into a new Carbon object according to the specified format.'], // '__set_state' => ['static static', 'array $array', 'https://php.net/manual/en/datetime.set-state.php'], ], $immutable => [ // 'createFromMutable' => ['static CarbonImmutable', 'DateTime $dateTime', 'Create a new CarbonImmutable object from an immutable date.'], // 'createFromFormat' => ['static static', 'string $format, string $time, DateTimeZone|string|false|null $timezone = null', 'Parse a string into a new CarbonImmutable object according to the specified format.'], // '__set_state' => ['static static', 'array $array', 'https://php.net/manual/en/datetime.set-state.php'], ], ]; foreach (glob(__DIR__.'/src/Carbon/Traits/*.php') as $file) { $code .= file_get_contents($file); } function unitName($unit) { return match ($unit) { 'milli' => 'millisecond', 'micro' => 'microsecond', default => $unit, }; } function pluralize($word) { if (preg_match('/(millenni)um$/i', $word)) { return preg_replace('/(millenni)um$/i', '$1a', $word); } return preg_replace('/(centur)y$/i', '$1ie', $word).'s'; } function dumpValue($value) { if ($value === null) { return 'null'; } if ($value === CarbonInterface::TRANSLATE_ALL) { return 'CarbonInterface::TRANSLATE_ALL'; } $value = preg_replace('/^array\s*\(\s*\)$/', '[]', var_export($value, true)); $value = preg_replace('/^array\s*\(([\s\S]+)\)$/', '[$1]', $value); return $value; } function cleanClassName($name) { if ($name === 'CarbonInterval') { throw new \Exception('stop'); } if (preg_match('/^[A-Z]/', $name)) { $name = "\\$name"; } if ($name === '\\Symfony\\Contracts\\Translation\\TranslatorInterface') { return 'TranslatorInterface'; } return preg_replace('/^\\\\(Date(?:Time(?:Immutable|Interface|Zone)?|Interval)|[a-z]*Exception|Closure)$/i', '$1', preg_replace('/^\\\\Carbon\\\\/', '', $name)); } function dumpType(ReflectionType $type, bool $deep = true, bool $allowsNull = false): string { if ($type instanceof ReflectionUnionType) { return ($deep ? '(' : '').implode('|', array_map( dumpType(...), $type->getTypes(), )).($deep ? ')' : ''); } if ($type instanceof ReflectionIntersectionType) { return ($deep ? '(' : '').implode('&', array_map( dumpType(...), $type->getTypes(), )).($deep ? ')' : ''); } $name = cleanClassName($type instanceof ReflectionNamedType ? $type->getName() : (string) $type); $nullable = $allowsNull && $name !== 'mixed'; return (!$deep && $nullable ? '?' : ''). $name. ($deep && $nullable ? '|null' : ''); } function dumpParameter(string $method, ReflectionParameter $parameter): string { global $defaultValues; $name = $parameter->getName(); $output = '$'.$name; if ($parameter->isVariadic()) { $output = "...$output"; } if ($parameter->hasType()) { $output = dumpType($parameter->getType(), false, $parameter->allowsNull())." $output"; } if (isset($defaultValues[$method])) { if (isset($defaultValues[$method][$name])) { $output .= ' = '.dumpValue($defaultValues[$method][$name]); } return $output; } if ($parameter->isDefaultValueAvailable()) { $output .= ' = '.dumpValue($parameter->getDefaultValue()); } return $output; } $deprecated = []; foreach ($tags as $tag) { if (\is_array($tag)) { [$tag, $pattern] = $tag; } $pattern ??= '\S+'; if ($tag === PHP_EOL) { $autoDocLines[] = ''; continue; } $unitOfUnit = []; preg_match_all('/\/\/ @'.$tag.'\s+(?'.$pattern.')(?:\s+\$(?\S+)(?:[^\S\n](?.*))?\n|(?:[^\S\n](?.*))?\n(?(?:[ \t]+\/\/[^\n]*\n)*)[^\']*\'(?[^\']+)\')/', $code, $oneLine, PREG_SET_ORDER); preg_match_all('/\/\* *@'.$tag.'\s+(?'.$pattern.') *\*\/[^\']*\'(?[^\']+)\'/', $code, $multiLine, PREG_SET_ORDER); foreach ([...$oneLine, ...$multiLine] as $match) { $vars = (object) $match; $deprecation = null; if (isset($vars->comments) && preg_match( '`^[ \t]+(//|/*|#)[ \t]*@deprecated(?:\s(?[\s\S]*))?$`', $vars->comments, $comments )) { ['deprecation' => $deprecation] = $comments; $deprecation = preg_replace('/^\s*(\/\/|#|\*) {0,3}/m', '', trim($deprecation)); if (preg_match('/^(?:[a-z]+:[^\n]+\n)+$/', "$deprecation\n")) { $data = []; foreach (explode("\n", $deprecation) as $line) { [$name, $value] = array_map('trim', explode(':', $line, 2)); $data[$name] = $value; } $deprecation = $data; } else { $deprecation = ['reason' => $deprecation]; } } $vars->name = ($vars->name ?? null) ?: ($vars->name2 ?? ''); $vars->description = ($vars->description ?? null) ?: ($vars->description2 ?? ''); if ($tag === 'mode') { $modes[$vars->type] ??= []; $modes[$vars->type][] = $vars->name; continue; } if ($tag === 'call') { switch ($vars->type) { case 'diffForHumans': foreach ($modes[$vars->type] as $mode) { $autoDocLines[] = [ '@method', 'string', "$mode{$vars->name}DiffForHumans(DateTimeInterface \$other = null, int \$parts = 1)", "Get the difference ($mode format, '{$vars->name}' mode) in a human readable format in the current locale. (\$other and \$parts parameters can be swapped.)", ]; } break; case 'isDayOfWeek': $autoDocLines[] = [ '@method', 'bool', 'is'.ucFirst($vars->name).'()', 'Checks if the instance day is '.unitName(strtolower($vars->name)).'.', ]; break; case 'is': $autoDocLines[] = [ '@method', 'bool', 'is'.ucFirst($vars->name).'()', $vars->description, ]; break; case 'isSameUnit': $unit = $vars->name; $unitName = unitName($unit); $method = 'isSame'.ucFirst($unit); if (!method_exists(Carbon::class, $method)) { $autoDocLines[] = [ '@method', 'bool', $method.'(DateTimeInterface|string $date)', "Checks if the given date is in the same $unitName as the instance. If null passed, compare to now (with the same timezone).", ]; } $autoDocLines[] = [ '@method', 'bool', 'isCurrent'.ucFirst($unit).'()', "Checks if the instance is in the same $unitName as the current moment.", ]; $autoDocLines[] = [ '@method', 'bool', 'isNext'.ucFirst($unit).'()', "Checks if the instance is in the same $unitName as the current moment next $unitName.", ]; $autoDocLines[] = [ '@method', 'bool', 'isLast'.ucFirst($unit).'()', "Checks if the instance is in the same $unitName as the current moment last $unitName.", ]; break; case 'setUnit': $unit = $vars->name; $unitName = unitName($unit); $plUnit = pluralize($unit); $enums = $unitName === 'month' ? 'Month|' : ''; $autoDocLines[] = [ '@method', 'self', "$plUnit({$enums}int \$value)", "Set current instance $unitName to the given value.", ]; $autoDocLines[] = [ '@method', 'self', "$unit({$enums}int \$value)", "Set current instance $unitName to the given value.", ]; $autoDocLines[] = [ '@method', 'self', 'set'.ucfirst($plUnit)."({$enums}int \$value)", "Set current instance $unitName to the given value.", ]; $autoDocLines[] = [ '@method', 'self', 'set'.ucfirst($unit)."({$enums}int \$value)", "Set current instance $unitName to the given value.", ]; break; case 'addUnit': $unit = $vars->name; $unitName = unitName($unit); $plUnit = pluralize($unit); $plUnitName = pluralize($unitName); $autoDocLines[] = [ '@method', 'self', 'add'.ucFirst($plUnit).'(int|float $value = 1)', "Add $plUnitName (the \$value count passed in) to the instance (using date interval).", ]; $autoDocLines[] = [ '@method', 'self', 'add'.ucFirst($unit).'()', "Add one $unitName to the instance (using date interval).", ]; $autoDocLines[] = [ '@method', 'self', 'sub'.ucFirst($plUnit).'(int|float $value = 1)', "Sub $plUnitName (the \$value count passed in) to the instance (using date interval).", ]; $autoDocLines[] = [ '@method', 'self', 'sub'.ucFirst($unit).'()', "Sub one $unitName to the instance (using date interval).", ]; if (\in_array($unit, [ 'month', 'quarter', 'year', 'decade', 'century', 'millennium', ])) { $autoDocLines[] = [ '@method', 'self', 'add'.ucFirst($plUnit).'WithOverflow(int|float $value = 1)', "Add $plUnitName (the \$value count passed in) to the instance (using date interval) with overflow explicitly allowed.", ]; $autoDocLines[] = [ '@method', 'self', 'add'.ucFirst($unit).'WithOverflow()', "Add one $unitName to the instance (using date interval) with overflow explicitly allowed.", ]; $autoDocLines[] = [ '@method', 'self', 'sub'.ucFirst($plUnit).'WithOverflow(int|float $value = 1)', "Sub $plUnitName (the \$value count passed in) to the instance (using date interval) with overflow explicitly allowed.", ]; $autoDocLines[] = [ '@method', 'self', 'sub'.ucFirst($unit).'WithOverflow()', "Sub one $unitName to the instance (using date interval) with overflow explicitly allowed.", ]; foreach (['WithoutOverflow', 'WithNoOverflow', 'NoOverflow'] as $alias) { $autoDocLines[] = [ '@method', 'self', 'add'.ucFirst($plUnit)."$alias(int|float \$value = 1)", "Add $plUnitName (the \$value count passed in) to the instance (using date interval) with overflow explicitly forbidden.", ]; $autoDocLines[] = [ '@method', 'self', 'add'.ucFirst($unit)."$alias()", "Add one $unitName to the instance (using date interval) with overflow explicitly forbidden.", ]; $autoDocLines[] = [ '@method', 'self', 'sub'.ucFirst($plUnit)."$alias(int|float \$value = 1)", "Sub $plUnitName (the \$value count passed in) to the instance (using date interval) with overflow explicitly forbidden.", ]; $autoDocLines[] = [ '@method', 'self', 'sub'.ucFirst($unit)."$alias()", "Sub one $unitName to the instance (using date interval) with overflow explicitly forbidden.", ]; } break; } break; case 'addUTCUnit': $unit = $vars->name; $unitName = unitName($unit); $plUnit = pluralize($unit); $plUnitName = pluralize($unitName); $autoDocLines[] = [ '@method', 'self', 'addUTC'.ucFirst($plUnit).'(int|float $value = 1)', "Add $plUnitName (the \$value count passed in) to the instance (using timestamp).", ]; $autoDocLines[] = [ '@method', 'self', 'addUTC'.ucFirst($unit).'()', "Add one $unitName to the instance (using timestamp).", ]; $autoDocLines[] = [ '@method', 'self', 'subUTC'.ucFirst($plUnit).'(int|float $value = 1)', "Sub $plUnitName (the \$value count passed in) to the instance (using timestamp).", ]; $autoDocLines[] = [ '@method', 'self', 'subUTC'.ucFirst($unit).'()', "Sub one $unitName to the instance (using timestamp).", ]; $autoDocLines[] = [ '@method', 'CarbonPeriod', $plUnit.'Until($endDate = null, int|float $factor = 1)', "Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each $unitName or every X $plUnitName if a factor is given.", ]; $autoDocLines[] = [ '@method', 'float', 'diffInUTC'.ucFirst($plUnit).'(DateTimeInterface|string|null $date, bool $absolute = false)', "Convert current and given date in UTC timezone and return a floating number of $plUnitName.", ]; break; case 'roundUnit': $unit = $vars->name; $unitName = unitName($unit); $plUnit = pluralize($unit); $autoDocLines[] = [ '@method', 'self', 'round'.ucFirst($unit).'(float $precision = 1, string $function = "round")', "Round the current instance $unitName with given precision using the given function.", ]; $autoDocLines[] = [ '@method', 'self', 'round'.ucFirst($plUnit).'(float $precision = 1, string $function = "round")', "Round the current instance $unitName with given precision using the given function.", ]; $autoDocLines[] = [ '@method', 'self', 'floor'.ucFirst($unit).'(float $precision = 1)', "Truncate the current instance $unitName with given precision.", ]; $autoDocLines[] = [ '@method', 'self', 'floor'.ucFirst($plUnit).'(float $precision = 1)', "Truncate the current instance $unitName with given precision.", ]; $autoDocLines[] = [ '@method', 'self', 'ceil'.ucFirst($unit).'(float $precision = 1)', "Ceil the current instance $unitName with given precision.", ]; $autoDocLines[] = [ '@method', 'self', 'ceil'.ucFirst($plUnit).'(float $precision = 1)', "Ceil the current instance $unitName with given precision.", ]; break; } continue; } $description = trim($vars->description); $variable = $vars->name; if (str_starts_with($description, '$')) { [$variable, $description] = explode(' ', $description, 2); $variable = ltrim($variable, '$'); $description = ltrim($description); } if ($deprecation !== null) { $deprecated[$tag] = $deprecated[$tag] ?? []; $deprecated[$tag][] = [ 'deprecation' => $deprecation, 'type' => $vars->type, 'variable' => $variable, 'description' => $description ?: '', ]; continue; } if ( \in_array($tag, ['property', 'property-read'], true) && preg_match('/^[a-z]{2,}(?In|Of)[A-Z][a-z]+$/', $vars->name, $match) ) { $unitOfUnit[$vars->name] = [ '@'.($match['operator'] === 'Of' ? 'property' : 'property-read'), $vars->type, '$'.$variable, $description ?: '', ]; continue; } $autoDocLines[] = [ '@'.$tag, $vars->type, '$'.$variable, $description ?: '', ]; } if ($tag === 'property') { $units = ['microseconds', 'milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'quarters', 'years', 'decades', 'centuries', 'millennia']; foreach ($units as $small) { array_shift($units); foreach ($units as $big) { $singularSmall = Carbon::singularUnit($small); $singularBig = Carbon::singularUnit($big); $name = $singularSmall.'Of'.ucfirst($singularBig); $unitOfUnit[$name] ??= [ '@property', 'int', '$'.$name, 'The value of the '.$singularSmall.' starting from the beginning of the current '.$singularBig, ]; } } ksort($unitOfUnit); array_push($autoDocLines, ...array_values($unitOfUnit)); } if ($tag === 'property-read') { $units = ['microseconds', 'milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'quarters', 'years', 'decades', 'centuries', 'millennia']; foreach ($units as $small) { array_shift($units); foreach ($units as $big) { $singularSmall = Carbon::singularUnit($small); $singularBig = Carbon::singularUnit($big); $name = $small.'In'.ucfirst($singularBig); $unitOfUnit[$name] ??= [ '@property-read', 'int', '$'.$name, 'The number of '.$small.' contained in the current '.$singularBig, ]; } } ksort($unitOfUnit); array_push($autoDocLines, ...array_values($unitOfUnit)); } } $units = ['microseconds', 'milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'quarters', 'years', 'decades', 'centuries', 'millennia']; $unitOfUnit = [ 'dayOfYear' => false, 'weeksInYear' => false, ]; foreach ($units as $small) { array_shift($units); foreach ($units as $big) { $singularSmall = Carbon::singularUnit($small); $singularBig = Carbon::singularUnit($big); $name = $singularSmall.'Of'.ucfirst($singularBig); $unitOfUnit[$name] ??= [ '@method', 'int|static', $name.'(?int $'.$singularSmall.' = null)', 'Return the value of the '.$singularSmall.' starting from the beginning of the current '.$singularBig.' when called with no parameters, change the current '.$singularSmall.' when called with an integer value', ]; $name = $small.'In'.ucfirst($singularBig); $unitOfUnit[$name] ??= [ '@method', 'int', $name.'()', 'Return the number of '.$small.' contained in the current '.$singularBig, ]; } } ksort($unitOfUnit); array_push($autoDocLines, ...array_values(array_filter($unitOfUnit))); $propertyTemplate = ' /** * %description% * * @var %type% * * @deprecated %line1% * %line2% */ public $%variable%; '; $lineGlue = preg_replace('/^[\s\S]*%line1%([\s\S]*)%line2%[\s\S]*$/', '$1', $propertyTemplate); $propertyTemplate = preg_replace('/(%line1%[\s\S]*%line2%)/', '%deprecation%', $propertyTemplate); function compileDoc($autoDocLines, $file) { global $noInterface; $class = 'CarbonInterface'; if (preg_match('`[\\\\/](Carbon\w*)\.php$`', $file, $match)) { $class = $match[1]; } $autoDoc = ''; $columnsMaxLengths = []; foreach ($autoDocLines as &$editableLine) { if (\is_array($editableLine)) { [$method] = explode('(', $editableLine[2] ?? ''); if (\in_array($method, $noInterface)) { continue; } if (($editableLine[1] ?? '') === 'self') { $editableLine[1] = $class === 'Carbon' ? '$this' : $class; } foreach ($editableLine as $column => $text) { $length = \strlen($text); $max = $columnsMaxLengths[$column] ?? 0; if ($length > $max) { $columnsMaxLengths[$column] = $length; } } } } foreach ($autoDocLines as $line) { $autoDoc .= "\n *"; if (\is_string($line)) { if (!empty($line)) { $autoDoc .= " $line"; } continue; } $computedLine = ' '; foreach ($line as $column => $text) { $computedLine .= str_pad($text, $columnsMaxLengths[$column] + 1, ' ', STR_PAD_RIGHT); } $autoDoc .= rtrim($computedLine); } return $autoDoc; } $files = new stdClass(); foreach ([$trait, $carbon, $immutable, $interface] as $file) { $content = file_get_contents($file); $files->$file = preg_replace_callback('/()([\s\S]+)(<\/autodoc>)/mU', function ($matches) use ($file, $autoDocLines, $overrideTyping) { foreach (($overrideTyping[$file] ?? []) as $method => $line) { $line[1] = $method.'('.$line[1].')'; array_unshift($line, '@method'); $autoDocLines[] = $line; } $autoDoc = compileDoc($autoDocLines, $file); return $matches[1]."\n *$autoDoc\n *\n * ".$matches[3]; }, $content, 1); } $staticMethods = []; $staticImmutableMethods = []; $methods = ''; $carbonMethods = get_class_methods(Carbon::class); sort($carbonMethods); function getMethodReturnType(ReflectionMethod $method): string { $type = $method->getReturnType(); $type = $type ? dumpType($type, false, $type->allowsNull()) : null; return $type ? ': '.$type : ''; } foreach ($carbonMethods as $method) { if (!method_exists(CarbonImmutable::class, $method) || method_exists(DateTimeInterface::class, $method) || \in_array($method, ['diff', 'createFromInterface'], true) ) { continue; } $function = new ReflectionMethod(Carbon::class, $method); $static = $function->isStatic() ? ' static' : ''; $parameters = implode(', ', array_map(function (ReflectionParameter $parameter) use ($method) { return dumpParameter($method, $parameter); }, $function->getParameters())); $methodDocBlock = $function->getDocComment() ?: ''; if (!str_starts_with($method, '__') && $function->isStatic()) { $doc = preg_replace('/^\/\*+\n([\s\S]+)\s*\*\//', '$1', $methodDocBlock); $doc = preg_replace('/^\s*\*\s?/m', '', $doc); $doc = explode("\n@", $doc, 2); $doc = preg_split('/(\r\n|\r|\n)/', trim($doc[0])); $returnType = $function->getReturnType(); if ($returnType instanceof ReflectionType) { $returnType = dumpType($returnType, false, $returnType->allowsNull()); } if (!$returnType && preg_match('/\*\s*@returns?\s+(\S+)/', $methodDocBlock, $match)) { $returnType = $match[1]; } $returnType = str_replace('static|CarbonInterface', 'static', $returnType ?: 'static'); if (!method_exists(Factory::class, $method)) { $staticMethods[] = [ '@method', str_replace(['self', 'static'], 'Carbon', $returnType), "$method($parameters)", $doc[0], ]; for ($i = 1; $i < \count($doc); $i++) { $staticMethods[] = ['', '', '', $doc[$i]]; } } if (!method_exists(FactoryImmutable::class, $method)) { $staticImmutableMethods[] = [ '@method', str_replace(['self', 'static'], 'CarbonImmutable', $returnType), "$method($parameters)", $doc[0], ]; for ($i = 1; $i < \count($doc); $i++) { $staticImmutableMethods[] = ['', '', '', $doc[$i]]; } } } $return = getMethodReturnType($function); if (!empty($methodDocBlock)) { $methodDocBlock = "\n $methodDocBlock"; } elseif (isset($nativeMethods[$method])) { $link = strtolower($method); $methodDocBlock = "\n /**\n". " * Calls DateTime::$method if mutable or DateTimeImmutable::$method else.\n". " *\n". " * @see https://php.net/manual/en/datetime.$link.php\n". ' */'; } if (str_contains($return, 'self') && $phpLevel < 7.4) { $return = ''; } if ($method === '__toString' && $phpLevel < 8) { $return = ''; } if (method_exists($function, 'getAttributes') && ($attributes = $function->getAttributes())) { foreach ($attributes as $attribute) { $methodDocBlock .= "\n #[".$attribute->getName().']'; } } if (!\in_array($method, $noInterface)) { $methods .= "\n$methodDocBlock\n public$static function $method($parameters)$return;"; } } $files->$interface = strtr(preg_replace_callback( '/(\/\/ )([\s\S]+)(<\/methods>)/mU', static fn ($matches) => "{$matches[1]}$methods\n\n // {$matches[3]}", $files->$interface, 1, ), [ '|CarbonInterface' => '|self', 'CarbonInterface::TRANSLATE_ALL' => 'self::TRANSLATE_ALL', ]); $factories = [ __DIR__.'/src/Carbon/Factory.php' => $staticMethods, __DIR__.'/src/Carbon/FactoryImmutable.php' => $staticImmutableMethods, ]; foreach ($factories as $file => $methods) { $autoDoc = compileDoc($methods, $file); $content = file_get_contents($file); $files->$file = preg_replace_callback( '/()([\s\S]+)(<\/autodoc>)/mU', static fn ($matches) => "{$matches[1]}\n *$autoDoc\n *\n * {$matches[3]}", $content, 1, ); } foreach ($files as $file => $contents) { file_put_contents($file, $contents); } ================================================ FILE: phpmd.xml ================================================ Mess detection rules for Carbon ================================================ FILE: phpstan.neon ================================================ parameters: scanFiles: - lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php - lazy/Carbon/TranslatorStrongType.php - lazy/Carbon/UnprotectedDatePeriod.php - tests/Fixtures/DateMalformedIntervalStringException.php - tests/Fixtures/DateMalformedStringException.php - vendor/autoload.php level: 3 paths: - src - tests parallel: processTimeout: 300.0 ignoreErrors: - identifier: varTag.nativeType - identifier: return.type paths: - tests/Carbon/TestingAidsTest.php - '#^Call to static method get\(\) on an unknown class Symfony\\Component\\Translation\\PluralizationRules\.$#' - '#^Call to an undefined static method#' - '#^Call to an undefined method Carbon\\Carbon(Immutable)?::floatDiffIn([A-Za-z]+)\(\)\.$#' - '#^Call to an undefined method Carbon\\Carbon(Immutable)?::(diffInBusinessDays|diffInReal([A-Za-z]+))\(\)\.$#' - '#^Call to an undefined method Carbon\\Carbon(Immutable)?::(add|sub)Real([A-Za-z]+)\(\)\.$#' - '#^Unsafe usage of new static\(\)\.$#' - '#^Method Carbon\\Carbon(Interface|Immutable)?::(add|sub)[A-Z][A-Za-z]+\(\) invoked with 1 parameter, 0 required\.$#' - '#^Call to an undefined method Carbon\\Carbon(Interface|Immutable)?::(super|noThis|toAppTz|copyWithAppTz)\(\)\.$#' - '#^Call to an undefined method Carbon\\CarbonInterval::(multiply|andAgain|copyAndAgain)\(\)\.$#' - '#^Call to an undefined method Carbon\\CarbonPeriod::(oneMoreDay|copyOneMoreDay|endNextDay)\(\)\.$#' - '#should return (\S*)(static|\$this)\(Carbon\\Carbon\)(\|null)? but returns Carbon\\Carbon(Interface)?(\|null)?\.$#' - '#should return (\S*)(static|\$this)\(Carbon\\CarbonImmutable\)(\|null)? but returns Carbon\\Carbon(Immutable|Interface)(\|null)?\.$#' - '#should return (\S*)\$this\(Carbon\\CarbonInterval\)(\|null)? but returns static\(Carbon\\CarbonInterval\)(\|null)?\.$#' - '#should return (\S*)static\(Carbon\\CarbonInterval\)(\|null)? but returns Carbon\\CarbonInterval(\|null)?\.$#' - '#^Call to an undefined method DateInterval::(spec|optimize)\(\)\.$#' - '#^Property Carbon\\Carbon::\$timezone \(Carbon\\CarbonTimeZone\) does not accept string\.$#' - message: '#^Variable \$this in isset\(\) always exists and is not nullable\.$#' paths: - src/Carbon/Traits/Mixin.php - message: '#^Call to an undefined method Carbon\\Carbon::[a-zA-Z]+Of[a-zA-Z]+\(\)\.$#' paths: - tests/Carbon/SettersTest.php - message: "#^Property Carbon\\\\Carbon\\:\\:\\$month \\(int\\) does not accept Carbon\\\\Month\\:\\:February\\.$#" paths: - tests/Carbon/SettersTest.php - message: '#^Access to an undefined property Carbon\\CarbonImmutable::\$[a-zA-Z]+\.$#' paths: - tests/CarbonImmutable/GettersTest.php - message: '#^Call to an undefined method Carbon\\CarbonImmutable::[a-zA-Z]+Of[a-zA-Z]+\(\)\.$#' paths: - tests/CarbonImmutable/GettersTest.php - message: '#^Access to an undefined property Carbon\\CarbonInterval::\$tz_?[Nn]ame\.$#' paths: - tests/CarbonInterval/GettersTest.php - tests/CarbonInterval/SettersTest.php - message: '#^Access to an undefined property Carbon\\CarbonPeriod::\$(include)?(Start|End)Date\.$#' paths: - tests/CarbonPeriod/GettersTest.php - message: '#^Access to protected property Carbon\\CarbonPeriod::\$endDate\.$#' paths: - tests/CarbonPeriod/GettersTest.php - message: '#^Cannot access property \$locale on Carbon\\CarbonPeriod\|string\.$#' paths: - tests/CarbonPeriod/GettersTest.php - message: '#^Access to protected property Carbon\\CarbonPeriod::\$startDate\.$#' paths: - tests/CarbonPeriod/GettersTest.php - message: '#^Access to an undefined property Carbon\\CarbonPeriod::\$locale\.$#' paths: - tests/CarbonPeriod/GettersTest.php - message: '#^Parameter \$foo of anonymous function has invalid type Tests\\Factory\\FooBar\.#' paths: - tests/Factory/CallbackTest.php - message: '#^Call to an undefined method SubCarbon(Immutable)?::diffInDecades\(\)\.#' paths: - tests/Carbon/MacroTest.php - tests/CarbonImmutable/MacroTest.php - message: '#^Call to an undefined method Doctrine\\DBAL\\Types\\Type::requiresSQLCommentHint\(\)\.#' paths: - tests/Doctrine/CarbonTypesTest.php - message: '#^Instantiated class Doctrine\\DBAL\\Platforms\\MySQL57Platform not found\.#' paths: - tests/Doctrine/CarbonTypesTest.php - message: '#^Call to an undefined method Symfony\\Contracts\\Translation\\TranslatorInterface::getMessages\(\)\.#' paths: - tests/CarbonInterval/ConstructTest.php - message: '#^Access to protected property Carbon\\CarbonPeriod::\$dateInterval\.#' paths: - tests/CarbonPeriod/CreateTest.php excludePaths: - '*/src/Carbon/CarbonPeriod.php' - '*/src/Carbon/Laravel/ServiceProvider.php' - '*/src/Carbon/TranslatorWeakType.php' - '*/src/Carbon/PHPStan/*' - '*/tests/Carbon/Fixtures/DumpCarbon.php' - '*/tests/Carbon/LocalizationTest.php' - '*/tests/Carbon/SerializationTest.php' - '*/tests/Carbon/LastErrorTest.php' - '*/tests/CarbonImmutable/LocalizationTest.php' - '*/tests/CarbonImmutable/SetStateTest.php' - '*/tests/CarbonImmutable/SerializationTest.php' - '*/tests/CarbonImmutable/LastErrorTest.php' - '*/tests/Laravel/*.php' - '*/tests/Cli/*.php' - '*/tests/Carbon/Fixtures/NoLocaleTranslator.php' - '*/tests/CarbonPeriod/Fixtures/filters.php' - '*/tests/Fixtures/dynamicInterval.php' - '*/tests/PHPStan/*.php' - '*/tests/PHPUnit/AssertObjectHasPropertyPolyfillTrait.php' ================================================ FILE: phpunit.xml.dist ================================================ tests/Carbon tests/CommonTraits tests/CarbonImmutable tests/CarbonInterval tests/CarbonPeriod tests/CarbonPeriodImmutable tests/CarbonTimeZone tests/Localization tests/Laravel tests/Doctrine tests/Factory tests/Language tests/Jenssegers tests/Cli tests/PHPStan tests/Unit src/Carbon src/Carbon/PHPStan/Macro.php src/Carbon/Translator.php src/Carbon/TranslatorStrongType.php src/Carbon/TranslatorWeakType.php ================================================ FILE: psalm.xml ================================================ ================================================ FILE: readme.md ================================================ # Carbon [![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FCarbonPHP%2Fcarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://github.com/CarbonPHP/carbon/actions) [![codecov.io](https://img.shields.io/codecov/c/github/CarbonPHP/carbon.svg?style=flat-square)](https://codecov.io/github/CarbonPHP/carbon/actions?branch=master) An international PHP extension for DateTime. [Documentation](https://carbonphp.github.io/carbon/) > [!NOTE] > We're migrating the repository from [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon) to [CarbonPHP/carbon](https://github.com/CarbonPHP/carbon), > which means if you're looking specific issues/pull-requests, you may have to search both. No other impact as code on both will be kept up to date. ```php toDateTimeString()); printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver')); //implicit __toString() $tomorrow = Carbon::now()->addDay(); $lastWeek = Carbon::now()->subWeek(); $officialDate = Carbon::now()->toRfc2822String(); $howOldAmI = Carbon::createFromDate(1975, 5, 21)->age; $noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London'); $internetWillBlowUpOn = Carbon::create(2038, 01, 19, 3, 14, 7, 'GMT'); // Don't really want this to happen so mock now Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1)); // comparisons are always done in UTC if (Carbon::now()->gte($internetWillBlowUpOn)) { die(); } // Phew! Return to normal behaviour Carbon::setTestNow(); if (Carbon::now()->isWeekend()) { echo 'Party!'; } // Over 200 languages (and over 500 regional variants) supported: echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago' echo Carbon::now()->subMinutes(2)->locale('zh_CN')->diffForHumans(); // '2分钟前' echo Carbon::parse('2019-07-23 14:51')->isoFormat('LLLL'); // 'Tuesday, July 23, 2019 2:51 PM' echo Carbon::parse('2019-07-23 14:51')->locale('fr_FR')->isoFormat('LLLL'); // 'mardi 23 juillet 2019 14:51' // ... but also does 'from now', 'after' and 'before' // rolling up to seconds, minutes, hours, days, months, years $daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays(); // something such as: // 19817.6771 $daysUntilInternetBlowUp = $internetWillBlowUpOn->diffInDays(); // Negative value since it's in the future: // -5037.4560 // Without parameter, difference is calculated from now, but doing $a->diff($b) // it will count time from $a to $b. Carbon::createFromTimestamp(0)->diffInDays($internetWillBlowUpOn); // 24855.1348 ``` ## Installation ### With Composer ``` $ composer require nesbot/carbon ``` ```json { "require": { "nesbot/carbon": "^3" } } ``` ```php ### Translators [Thanks to people helping us to translate Carbon in so many languages](https://carbonphp.github.io/carbon/develop/translations/translators.html) ### Sponsors Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Ставки на спорт Онлайн казино 777 Non GamStop Bookies UK Best non Gamstop sites in the UK Route4Me Route Planner Releaf – Medizinischer Cannabis Shop Buitenlandse Online Casino Online Casino Zonder Registratie Transparencia en Casinos Online Wildflower gaia-wines.gr CasinoHex Canada PayID Pokies iDealeCasinos Top Rating casino Online Kasyno Polis Interac-casino.com - Canada
See more OnlineCasinosSpelen Guidebook.BetWinner Top 10 Casino Australia PayID Pokies Sites Best Online Pokies in Australia Plinko Game Онлайн казино casino.ua Real Money Pokies parhaatuudetkasinot.com New Casino Bonuses Fun88 East Villa FC Instant withdrawal casino Fun88 Thailand Fun88 Vietnam Casino ohne oasis Najlepsi Bukmacherzy Sportsbook Reviews Online Ставки на спорт Favbet Tidelift Casino-portugal.pt https://play-fortune.pl/kasyno/z-minimalnym-depozytem/ Playfortune.net.br best non Gamstop casinos Probukmacher Fastest Payout Online Casino betking онлайн казино inkedin Best Betting AusGambler Онлайн казино України freispace bestecasinozondercruks Slots City Run Weekly New Casino Sites UK (2025) Help Direct UnAIMyText Online Casino utan Svensk licens TopKasynoOnline PL ssddanbrown
[[See all](https://carbonphp.github.io/carbon/#sponsors)] [[Become a sponsor via OpenCollective*](https://opencollective.com/Carbon#sponsor)] [[Become a sponsor via GitHub*](https://github.com/sponsors/kylekatarnls)] * This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected. ### Backers Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Carbon#backer)] ## Carbon for enterprise Available as part of the Tidelift Subscription. The maintainers of ``Carbon`` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) ================================================ FILE: sponsors.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonImmutable; require_once __DIR__.'/vendor/autoload.php'; function getMaxHistoryMonthsByAmount($amount): int { if ($amount >= 50) { return 6; } if ($amount >= 20) { return 4; } return 2; } function getHtmlAttribute($rawValue): string { return str_replace( ['​', "\r"], '', trim(htmlspecialchars((string) $rawValue), "  \n\r\t\v\0"), ); } function getOpenCollectiveSponsors(): string { $customSponsorOverride = [ // For consistency and equity among sponsors, as of now, we kindly ask our sponsors // to provide an image having a width/height ratio between 1/1 and 2/1. // By default, we'll show the member picture from OpenCollective, and will resize it if bigger 662698 => [ // alt attribute 'name' => 'Non Gamstop Casinos', // title attribute 'description' => 'Casinos not on Gamstop', // src attribute 'image' => 'https://lgcnews.com/wp-content/uploads/2018/01/LGC-logo-v8-temp.png', // href attribute 'website' => 'https://lgcnews.com/', ], 663069 => [ // alt attribute 'name' => 'Ставки на спорт Favbet', // href attribute 'website' => 'https://www.favbet.ua/uk/', ], 676798 => [ // alt attribute 'name' => 'Top Casinos Canada', // title attribute 'description' => 'Top Casinos Canada', // src attribute 'image' => 'https://topcasino.net/img/topcasino-logo-cover.png', // href attribute 'website' => 'https://topcasino.net/', ], ]; $members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true); foreach ($members as &$member) { $member = array_merge($member, $customSponsorOverride[$member['MemberId']] ?? []); } // Adding sponsors paying via other payment methods $members[] = [ 'MemberId' => 1, 'createdAt' => '2019-01-01 02:00', 'type' => 'ORGANIZATION', 'role' => 'BACKER', 'tier' => 'backer+', 'isActive' => true, 'totalAmountDonated' => 1000, 'currency' => 'USD', 'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d').' 02:00', 'lastTransactionAmount' => 25, 'profile' => 'https://tidelift.com/', 'name' => 'Tidelift', 'description' => 'Get professional support for Carbon', 'image' => 'https://carbonphp.github.io/carbon/sponsors/tidelift-brand.png', 'website' => 'https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs', ]; $members[] = [ 'MemberId' => 2, 'createdAt' => '2024-11-14 02:00', 'type' => 'ORGANIZATION', 'role' => 'BACKER', 'tier' => 'backer+ yearly', 'isActive' => true, 'totalAmountDonated' => 170, 'currency' => 'USD', 'lastTransactionAt' => '2024-11-14 02:00', 'lastTransactionAmount' => 170, 'profile' => 'https://www.slotozilla.com/nz/free-spins', 'name' => 'Slotozilla', 'description' => 'Slotozilla website', 'image' => 'https://carbonphp.github.io/carbon/sponsors/slotozilla.png', 'website' => 'https://www.slotozilla.com/nz/free-spins', ]; $list = array_filter($members, static fn (array $member): bool => $member['totalAmountDonated'] > 3 && $member['role'] !== 'HOST' && ( $member['totalAmountDonated'] > 100 || $member['lastTransactionAt'] > CarbonImmutable::now() ->subMonthsNoOverflow(getMaxHistoryMonthsByAmount($member['lastTransactionAmount'])) ->format('Y-m-d h:i') || $member['isActive'] && $member['lastTransactionAmount'] >= 30 )); $list = array_map(static function (array $member): array { $createdAt = CarbonImmutable::parse($member['createdAt']); $lastTransactionAt = CarbonImmutable::parse($member['lastTransactionAt']); if ($createdAt->format('d H:i:s.u') > $lastTransactionAt->format('d H:i:s.u')) { $createdAt = $createdAt ->setDay($lastTransactionAt->day) ->modify($lastTransactionAt->format('H:i:s.u')); } $isYearly = str_contains(strtolower($member['tier'] ?? ''), 'yearly'); $monthlyContribution = (float) ( ($isYearly && $lastTransactionAt > CarbonImmutable::parse('-1 year')) ? ($member['lastTransactionAmount'] / 11.2) // 11.2 instead of 12 to include the discount for yearly subscription : ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths())) ); if (!$isYearly) { if ( $lastTransactionAt->isAfter('last month') && $member['lastTransactionAmount'] > $monthlyContribution ) { $monthlyContribution = (float) $member['lastTransactionAmount']; } if ($lastTransactionAt->isBefore('-75 days')) { $days = min(120, $lastTransactionAt->diffInDays('now') - 70); $monthlyContribution *= 1 - $days / 240; } } $yearlyContribution = (float) ( $isYearly ? (12 * $monthlyContribution) : ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears())) ); $status = null; $rank = 0; if ($monthlyContribution > 50 || $yearlyContribution > 900) { $status = 'sponsor'; $rank = 5; } elseif ($monthlyContribution > 29 || $yearlyContribution > 700) { $status = 'sponsor'; $rank = 4; } elseif ($monthlyContribution > 14.5 || $yearlyContribution > 500) { $status = 'backerPlus'; $rank = 3; } elseif ($monthlyContribution > 4.5 || $yearlyContribution > 80) { $status = 'backer'; $rank = 2; } elseif ($member['totalAmountDonated'] > 0) { $status = 'helper'; $rank = 1; } return array_merge($member, [ 'star' => ($monthlyContribution > 98 || $yearlyContribution > 800), 'status' => $status, 'rank' => $rank, 'monthlyContribution' => $monthlyContribution, 'yearlyContribution' => $yearlyContribution, ]); }, $list); usort($list, static function (array $a, array $b): int { return ($b['star'] <=> $a['star']) ?: ($b['rank'] <=> $a['rank']) ?: ($b['monthlyContribution'] <=> $a['monthlyContribution']) ?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']); }); $membersByUrl = []; $output = ''; $extra = ''; foreach ($list as $member) { $url = $member['website'] ?? $member['profile']; if (isset($membersByUrl[$url]) || !\in_array($member['status'], ['sponsor', 'backerPlus'], true)) { continue; } $membersByUrl[$url] = $member; $href = htmlspecialchars($url); $src = $customSponsorImages[$member['MemberId'] ?? ''] ?? $member['image'] ?? (strtr($member['profile'], ['https://opencollective.com/' => 'https://images.opencollective.com/']).'/avatar/256.png'); [$x, $y] = @getimagesize($src) ?: [0, 0]; $validImage = ($x && $y); $src = $validImage ? htmlspecialchars($src) : 'https://opencollective.com/static/images/default-guest-logo.svg'; $height = match ($member['status']) { 'sponsor' => 64, 'backerPlus' => 42, 'backer' => 32, default => 24, }; $rel = match ($member['status']) { 'sponsor', 'backerPlus' => '', default => ' rel="sponsored"', }; $width = min($height * 2, $validImage ? round($x * $height / $y) : $height); if (!str_contains($href, 'utm_source') && !preg_match('/^https?:\/\/(?:www\.)?(?:onlinekasyno-polis\.pl|zonaminecraft\.net|slotozilla\.com)(\/.*)?/', $href)) { $href .= (!str_contains($href, '?') ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon'; } $title = getHtmlAttribute(($member['description'] ?? null) ?: $member['name']); $alt = getHtmlAttribute($member['name']); if ($member['star']) { $width *= 1.5; $height *= 1.5; } $link = "\n".''. ''.$alt.''. ''; if ($member['rank'] >= 5) { $output .= $link; continue; } $extra .= $link; } $github = [ 8343178 => 'ssddanbrown', ]; foreach ($github as $avatar => $user) { $extra .= "\n".''. ''.$user.''. ''; } return $output.'
See more'.$extra.'
'; } file_put_contents('readme.md', preg_replace_callback( '/()[\s\S]+()/', static function (array $match): string { return $match[1].getOpenCollectiveSponsors().$match[2]; }, file_get_contents('readme.md'), )); ================================================ FILE: src/Carbon/AbstractTranslator.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\MessageFormatter\MessageFormatterMapper; use Closure; use ReflectionException; use ReflectionFunction; use ReflectionProperty; use Symfony\Component\Translation\Formatter\MessageFormatterInterface; use Symfony\Component\Translation\Loader\ArrayLoader; use Symfony\Component\Translation\Translator as SymfonyTranslator; use Throwable; abstract class AbstractTranslator extends SymfonyTranslator { public const REGION_CODE_LENGTH = 2; /** * Translator singletons for each language. * * @var array */ protected static array $singletons = []; /** * List of custom localized messages. * * @var array */ protected array $messages = []; /** * List of custom directories that contain translation files. * * @var string[] */ protected array $directories = []; /** * Set to true while constructing. */ protected bool $initializing = false; /** * List of locales aliases. * * @var array */ protected array $aliases = [ 'me' => 'sr_Latn_ME', 'scr' => 'sh', ]; /** * Return a singleton instance of Translator. * * @param string|null $locale optional initial locale ("en" - english by default) * * @return static */ public static function get(?string $locale = null): static { $locale = $locale ?: 'en'; $key = static::class === Translator::class ? $locale : static::class.'|'.$locale; $count = \count(static::$singletons); // Remember only the last 10 translators created if ($count > 10) { foreach (\array_slice(array_keys(static::$singletons), 0, $count - 10) as $index) { unset(static::$singletons[$index]); } } static::$singletons[$key] ??= new static($locale); return static::$singletons[$key]; } public function __construct($locale, ?MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) { $this->initialize($locale, $formatter, $cacheDir, $debug); } /** * Returns the list of directories translation files are searched in. */ public function getDirectories(): array { return $this->directories; } /** * Set list of directories translation files are searched in. * * @param array $directories new directories list * * @return $this */ public function setDirectories(array $directories): static { $this->directories = $directories; return $this; } /** * Add a directory to the list translation files are searched in. * * @param string $directory new directory * * @return $this */ public function addDirectory(string $directory): static { $this->directories[] = $directory; return $this; } /** * Remove a directory from the list translation files are searched in. * * @param string $directory directory path * * @return $this */ public function removeDirectory(string $directory): static { $search = rtrim(strtr($directory, '\\', '/'), '/'); return $this->setDirectories(array_filter( $this->getDirectories(), static fn ($item) => rtrim(strtr($item, '\\', '/'), '/') !== $search, )); } /** * Reset messages of a locale (all locale if no locale passed). * Remove custom messages and reload initial messages from matching * file in Lang directory. */ public function resetMessages(?string $locale = null): bool { if ($locale === null) { $this->messages = []; $this->catalogues = []; $this->modifyResources(static function (array $resources): array { foreach ($resources as &$list) { array_splice($list, 1); } return $resources; }); return true; } $this->assertValidLocale($locale); foreach ($this->getDirectories() as $directory) { $file = \sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); $data = @include $file; if ($data !== false) { $this->messages[$locale] = $data; unset($this->catalogues[$locale]); $this->modifyResources(static function (array $resources) use ($locale): array { unset($resources[$locale]); return $resources; }); $this->addResource('array', $this->messages[$locale], $locale); return true; } } return false; } /** * Returns the list of files matching a given locale prefix (or all if empty). * * @param string $prefix prefix required to filter result * * @return array */ public function getLocalesFiles(string $prefix = ''): array { $files = []; foreach ($this->getDirectories() as $directory) { foreach (self::getPhpFilesInDirectory(rtrim($directory, '\\/'), $prefix) as $file) { $files[] = $file; } } return array_unique($files); } /** * Returns the list of internally available locales and already loaded custom locales. * (It will ignore custom translator dynamic loading.) * * @param string $prefix prefix required to filter result * * @return array */ public function getAvailableLocales(string $prefix = ''): array { return array_unique(array_merge( array_map( static fn (string $file) => substr($file, strrpos($file, '/') + 1, -4), $this->getLocalesFiles($prefix), ), array_keys($this->messages), )); } protected function translate(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $domain ??= 'messages'; $catalogue = $this->getCatalogue($locale); $format = $this instanceof TranslatorStrongTypeInterface ? $this->getFromCatalogue($catalogue, (string) $id, $domain) : $this->getCatalogue($locale)->get((string) $id, $domain); // @codeCoverageIgnore if ($format instanceof Closure) { // @codeCoverageIgnoreStart try { $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); } catch (ReflectionException) { $count = 0; } // @codeCoverageIgnoreEnd return $format( ...array_values($parameters), ...array_fill(0, max(0, $count - \count($parameters)), null) ); } return parent::trans($id, $parameters, $domain, $locale); } /** * Init messages language from matching file in Lang directory. * * @param string $locale * * @return bool */ protected function loadMessagesFromFile(string $locale): bool { return isset($this->messages[$locale]) || $this->resetMessages($locale); } /** * Set messages of a locale and take file first if present. * * @param string $locale * @param array $messages * * @return $this */ public function setMessages(string $locale, array $messages): static { $this->loadMessagesFromFile($locale); $this->addResource('array', $messages, $locale); $this->messages[$locale] = array_merge( $this->messages[$locale] ?? [], $messages ); return $this; } /** * Set messages of the current locale and take file first if present. * * @param array $messages * * @return $this */ public function setTranslations(array $messages): static { return $this->setMessages($this->getLocale(), $messages); } /** * Get messages of a locale, if none given, return all the * languages. */ public function getMessages(?string $locale = null): array { return $locale === null ? $this->messages : $this->messages[$locale]; } /** * Set the current translator locale and indicate if the source locale file exists * * @param string $locale locale ex. en */ public function setLocale($locale): void { $locale = preg_replace_callback('/[-_]([a-z]{2,}|\d{2,})/', function ($matches) { // _2-letters or YUE is a region, _3+-letters is a variant $upper = strtoupper($matches[1]); if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) <= static::REGION_CODE_LENGTH) { return "_$upper"; } return '_'.ucfirst($matches[1]); }, strtolower($locale)); $previousLocale = $this->getLocale(); if ($previousLocale === $locale && isset($this->messages[$locale])) { return; } unset(static::$singletons[$previousLocale]); if ($locale === 'auto') { $completeLocale = setlocale(LC_TIME, '0'); $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); $locales = $this->getAvailableLocales($locale); $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); $getScore = static fn ($language) => self::compareChunkLists( $completeLocaleChunks, preg_split('/[_.-]+/', $language), ); usort($locales, static fn ($first, $second) => $getScore($second) <=> $getScore($first)); $locale = $locales[0] ?? 'en'; } if (isset($this->aliases[$locale])) { $locale = $this->aliases[$locale]; } // If the language is not provided by a Carbon file // and the tag contains a region (ex: en_CA), then // first load the macro (ex: en) to have a fallback if ( str_contains($locale, '_') && !\in_array($locale, self::getInternallySupportedLocales(), true) && $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) ) { parent::setLocale($macroLocale); } if (!$this->loadMessagesFromFile($locale) && !$this->initializing) { return; } parent::setLocale($locale); } /** * Show locale on var_dump(). * * @return array */ public function __debugInfo() { return [ 'locale' => $this->getLocale(), ]; } public function __serialize(): array { return [ 'locale' => $this->getLocale(), ]; } public function __unserialize(array $data): void { $this->initialize($data['locale'] ?? 'en'); } private function initialize($locale, ?MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false): void { parent::setLocale($locale); $this->initializing = true; $this->directories = [self::getDefaultLangDirectory()]; $this->addLoader('array', new ArrayLoader()); parent::__construct($locale, new MessageFormatterMapper($formatter), $cacheDir, $debug); $this->initializing = false; } private static function compareChunkLists($referenceChunks, $chunks) { $score = 0; foreach ($referenceChunks as $index => $chunk) { if (!isset($chunks[$index])) { $score++; continue; } if (strtolower($chunks[$index]) === strtolower($chunk)) { $score += 10; } } return $score; } /** @codeCoverageIgnore */ private function modifyResources(callable $callback): void { try { $resourcesProperty = new ReflectionProperty(SymfonyTranslator::class, 'resources'); $resources = $resourcesProperty->getValue($this); $resourcesProperty->setValue($this, $callback($resources)); } catch (Throwable) { // Clear resources if available, if not, then nothing to clean } } private static function getPhpFilesInDirectory(string $directory, string $prefix): array { if ($directory !== self::getDefaultLangDirectory()) { return glob("$directory/$prefix*.php") ?: []; } // If it's the internal Carbon directory we use a static list // which is faster than scanning the folder with glob() $locales = self::getInternallySupportedLocales(); if ($prefix !== '') { $locales = array_values(array_filter( self::getInternallySupportedLocales(), static fn (string $locale) => str_starts_with($locale, $prefix), )); } return array_map( static fn (string $locale) => "$directory/$locale.php", $locales, ); } private static function getDefaultLangDirectory(): string { return __DIR__.'/Lang'; } /** @return list */ private static function getInternallySupportedLocales(): array { return [ 'aa', 'aa_DJ', 'aa_ER', 'aa_ER@saaho', 'aa_ET', 'af', 'af_NA', 'af_ZA', 'agq', 'agr', 'agr_PE', 'ak', 'ak_GH', 'am', 'am_ET', 'an', 'an_ES', 'anp', 'anp_IN', 'ar', 'ar_AE', 'ar_BH', 'ar_DJ', 'ar_DZ', 'ar_EG', 'ar_EH', 'ar_ER', 'ar_IL', 'ar_IN', 'ar_IQ', 'ar_JO', 'ar_KM', 'ar_KW', 'ar_LB', 'ar_LY', 'ar_MA', 'ar_MR', 'ar_OM', 'ar_PS', 'ar_QA', 'ar_SA', 'ar_SD', 'ar_SO', 'ar_SS', 'ar_SY', 'ar_Shakl', 'ar_TD', 'ar_TN', 'ar_YE', 'as', 'as_IN', 'asa', 'ast', 'ast_ES', 'ayc', 'ayc_PE', 'az', 'az_AZ', 'az_Arab', 'az_Cyrl', 'az_IR', 'az_Latn', 'bas', 'be', 'be_BY', 'be_BY@latin', 'bem', 'bem_ZM', 'ber', 'ber_DZ', 'ber_MA', 'bez', 'bg', 'bg_BG', 'bhb', 'bhb_IN', 'bho', 'bho_IN', 'bi', 'bi_VU', 'bm', 'bn', 'bn_BD', 'bn_IN', 'bo', 'bo_CN', 'bo_IN', 'br', 'br_FR', 'brx', 'brx_IN', 'bs', 'bs_BA', 'bs_Cyrl', 'bs_Latn', 'byn', 'byn_ER', 'ca', 'ca_AD', 'ca_ES', 'ca_ES_Valencia', 'ca_FR', 'ca_IT', 'ccp', 'ccp_IN', 'ce', 'ce_RU', 'cgg', 'chr', 'chr_US', 'ckb', 'cmn', 'cmn_TW', 'crh', 'crh_UA', 'cs', 'cs_CZ', 'csb', 'csb_PL', 'cu', 'cv', 'cv_RU', 'cy', 'cy_GB', 'da', 'da_DK', 'da_GL', 'dav', 'de', 'de_AT', 'de_BE', 'de_CH', 'de_DE', 'de_IT', 'de_LI', 'de_LU', 'dje', 'doi', 'doi_IN', 'dsb', 'dsb_DE', 'dua', 'dv', 'dv_MV', 'dyo', 'dz', 'dz_BT', 'ebu', 'ee', 'ee_TG', 'el', 'el_CY', 'el_GR', 'en', 'en_001', 'en_150', 'en_AG', 'en_AI', 'en_AS', 'en_AT', 'en_AU', 'en_BB', 'en_BE', 'en_BI', 'en_BM', 'en_BS', 'en_BW', 'en_BZ', 'en_CA', 'en_CC', 'en_CH', 'en_CK', 'en_CM', 'en_CX', 'en_CY', 'en_DE', 'en_DG', 'en_DK', 'en_DM', 'en_ER', 'en_FI', 'en_FJ', 'en_FK', 'en_FM', 'en_GB', 'en_GD', 'en_GG', 'en_GH', 'en_GI', 'en_GM', 'en_GU', 'en_GY', 'en_HK', 'en_IE', 'en_IL', 'en_IM', 'en_IN', 'en_IO', 'en_ISO', 'en_JE', 'en_JM', 'en_KE', 'en_KI', 'en_KN', 'en_KY', 'en_LC', 'en_LR', 'en_LS', 'en_MG', 'en_MH', 'en_MO', 'en_MP', 'en_MS', 'en_MT', 'en_MU', 'en_MW', 'en_MY', 'en_NA', 'en_NF', 'en_NG', 'en_NL', 'en_NR', 'en_NU', 'en_NZ', 'en_PG', 'en_PH', 'en_PK', 'en_PN', 'en_PR', 'en_PW', 'en_RW', 'en_SB', 'en_SC', 'en_SD', 'en_SE', 'en_SG', 'en_SH', 'en_SI', 'en_SL', 'en_SS', 'en_SX', 'en_SZ', 'en_TC', 'en_TK', 'en_TO', 'en_TT', 'en_TV', 'en_TZ', 'en_UG', 'en_UM', 'en_US', 'en_US_Posix', 'en_VC', 'en_VG', 'en_VI', 'en_VU', 'en_WS', 'en_ZA', 'en_ZM', 'en_ZW', 'eo', 'es', 'es_419', 'es_AR', 'es_BO', 'es_BR', 'es_BZ', 'es_CL', 'es_CO', 'es_CR', 'es_CU', 'es_DO', 'es_EA', 'es_EC', 'es_ES', 'es_GQ', 'es_GT', 'es_HN', 'es_IC', 'es_MX', 'es_NI', 'es_PA', 'es_PE', 'es_PH', 'es_PR', 'es_PY', 'es_SV', 'es_US', 'es_UY', 'es_VE', 'et', 'et_EE', 'eu', 'eu_ES', 'ewo', 'fa', 'fa_AF', 'fa_IR', 'ff', 'ff_CM', 'ff_GN', 'ff_MR', 'ff_SN', 'fi', 'fi_FI', 'fil', 'fil_PH', 'fo', 'fo_DK', 'fo_FO', 'fr', 'fr_BE', 'fr_BF', 'fr_BI', 'fr_BJ', 'fr_BL', 'fr_CA', 'fr_CD', 'fr_CF', 'fr_CG', 'fr_CH', 'fr_CI', 'fr_CM', 'fr_DJ', 'fr_DZ', 'fr_FR', 'fr_GA', 'fr_GF', 'fr_GN', 'fr_GP', 'fr_GQ', 'fr_HT', 'fr_KM', 'fr_LU', 'fr_MA', 'fr_MC', 'fr_MF', 'fr_MG', 'fr_ML', 'fr_MQ', 'fr_MR', 'fr_MU', 'fr_NC', 'fr_NE', 'fr_PF', 'fr_PM', 'fr_RE', 'fr_RW', 'fr_SC', 'fr_SN', 'fr_SY', 'fr_TD', 'fr_TG', 'fr_TN', 'fr_VU', 'fr_WF', 'fr_YT', 'fur', 'fur_IT', 'fy', 'fy_DE', 'fy_NL', 'ga', 'ga_IE', 'gd', 'gd_GB', 'gez', 'gez_ER', 'gez_ET', 'gl', 'gl_ES', 'gom', 'gom_Latn', 'gsw', 'gsw_CH', 'gsw_FR', 'gsw_LI', 'gu', 'gu_IN', 'guz', 'gv', 'gv_GB', 'ha', 'ha_GH', 'ha_NE', 'ha_NG', 'hak', 'hak_TW', 'haw', 'he', 'he_IL', 'hi', 'hi_IN', 'hif', 'hif_FJ', 'hne', 'hne_IN', 'hr', 'hr_BA', 'hr_HR', 'hsb', 'hsb_DE', 'ht', 'ht_HT', 'hu', 'hu_HU', 'hy', 'hy_AM', 'i18n', 'ia', 'ia_FR', 'id', 'id_ID', 'ig', 'ig_NG', 'ii', 'ik', 'ik_CA', 'in', 'is', 'is_IS', 'it', 'it_CH', 'it_IT', 'it_SM', 'it_VA', 'iu', 'iu_CA', 'iw', 'ja', 'ja_JP', 'jgo', 'jmc', 'jv', 'ka', 'ka_GE', 'kab', 'kab_DZ', 'kam', 'kde', 'kea', 'khq', 'ki', 'kk', 'kk_KZ', 'kkj', 'kl', 'kl_GL', 'kln', 'km', 'km_KH', 'kn', 'kn_IN', 'ko', 'ko_KP', 'ko_KR', 'kok', 'kok_IN', 'ks', 'ks_IN', 'ks_IN@devanagari', 'ksb', 'ksf', 'ksh', 'ku', 'ku_TR', 'kw', 'kw_GB', 'ky', 'ky_KG', 'lag', 'lb', 'lb_LU', 'lg', 'lg_UG', 'li', 'li_NL', 'lij', 'lij_IT', 'lkt', 'ln', 'ln_AO', 'ln_CD', 'ln_CF', 'ln_CG', 'lo', 'lo_LA', 'lrc', 'lrc_IQ', 'lt', 'lt_LT', 'lu', 'luo', 'luy', 'lv', 'lv_LV', 'lzh', 'lzh_TW', 'mag', 'mag_IN', 'mai', 'mai_IN', 'mas', 'mas_TZ', 'mer', 'mfe', 'mfe_MU', 'mg', 'mg_MG', 'mgh', 'mgo', 'mhr', 'mhr_RU', 'mi', 'mi_NZ', 'miq', 'miq_NI', 'mjw', 'mjw_IN', 'mk', 'mk_MK', 'ml', 'ml_IN', 'mn', 'mn_MN', 'mni', 'mni_IN', 'mo', 'mr', 'mr_IN', 'ms', 'ms_BN', 'ms_MY', 'ms_SG', 'mt', 'mt_MT', 'mua', 'my', 'my_MM', 'mzn', 'nan', 'nan_TW', 'nan_TW@latin', 'naq', 'nb', 'nb_NO', 'nb_SJ', 'nd', 'nds', 'nds_DE', 'nds_NL', 'ne', 'ne_IN', 'ne_NP', 'nhn', 'nhn_MX', 'niu', 'niu_NU', 'nl', 'nl_AW', 'nl_BE', 'nl_BQ', 'nl_CW', 'nl_NL', 'nl_SR', 'nl_SX', 'nmg', 'nn', 'nn_NO', 'nnh', 'no', 'nr', 'nr_ZA', 'nso', 'nso_ZA', 'nus', 'nyn', 'oc', 'oc_FR', 'om', 'om_ET', 'om_KE', 'or', 'or_IN', 'os', 'os_RU', 'pa', 'pa_Arab', 'pa_Guru', 'pa_IN', 'pa_PK', 'pap', 'pap_AW', 'pap_CW', 'pl', 'pl_PL', 'prg', 'ps', 'ps_AF', 'pt', 'pt_AO', 'pt_BR', 'pt_CH', 'pt_CV', 'pt_GQ', 'pt_GW', 'pt_LU', 'pt_MO', 'pt_MZ', 'pt_PT', 'pt_ST', 'pt_TL', 'qu', 'qu_BO', 'qu_EC', 'quz', 'quz_PE', 'raj', 'raj_IN', 'rm', 'rn', 'ro', 'ro_MD', 'ro_RO', 'rof', 'ru', 'ru_BY', 'ru_KG', 'ru_KZ', 'ru_MD', 'ru_RU', 'ru_UA', 'rw', 'rw_RW', 'rwk', 'sa', 'sa_IN', 'sah', 'sah_RU', 'saq', 'sat', 'sat_IN', 'sbp', 'sc', 'sc_IT', 'sd', 'sd_IN', 'sd_IN@devanagari', 'se', 'se_FI', 'se_NO', 'se_SE', 'seh', 'ses', 'sg', 'sgs', 'sgs_LT', 'sh', 'shi', 'shi_Latn', 'shi_Tfng', 'shn', 'shn_MM', 'shs', 'shs_CA', 'si', 'si_LK', 'sid', 'sid_ET', 'sk', 'sk_SK', 'sl', 'sl_SI', 'sm', 'sm_WS', 'smn', 'sn', 'so', 'so_DJ', 'so_ET', 'so_KE', 'so_SO', 'sq', 'sq_AL', 'sq_MK', 'sq_XK', 'sr', 'sr_Cyrl', 'sr_Cyrl_BA', 'sr_Cyrl_ME', 'sr_Cyrl_XK', 'sr_Latn', 'sr_Latn_BA', 'sr_Latn_ME', 'sr_Latn_XK', 'sr_ME', 'sr_RS', 'sr_RS@latin', 'ss', 'ss_ZA', 'st', 'st_ZA', 'sv', 'sv_AX', 'sv_FI', 'sv_SE', 'sw', 'sw_CD', 'sw_KE', 'sw_TZ', 'sw_UG', 'szl', 'szl_PL', 'ta', 'ta_IN', 'ta_LK', 'ta_MY', 'ta_SG', 'tcy', 'tcy_IN', 'te', 'te_IN', 'teo', 'teo_KE', 'tet', 'tg', 'tg_TJ', 'th', 'th_TH', 'the', 'the_NP', 'ti', 'ti_ER', 'ti_ET', 'tig', 'tig_ER', 'tk', 'tk_TM', 'tl', 'tl_PH', 'tlh', 'tn', 'tn_ZA', 'to', 'to_TO', 'tpi', 'tpi_PG', 'tr', 'tr_CY', 'tr_TR', 'ts', 'ts_ZA', 'tt', 'tt_RU', 'tt_RU@iqtelif', 'twq', 'tzl', 'tzm', 'tzm_Latn', 'ug', 'ug_CN', 'uk', 'uk_UA', 'unm', 'unm_US', 'ur', 'ur_IN', 'ur_PK', 'uz', 'uz_Arab', 'uz_Cyrl', 'uz_Latn', 'uz_UZ', 'uz_UZ@cyrillic', 'vai', 'vai_Latn', 'vai_Vaii', 've', 've_ZA', 'vi', 'vi_VN', 'vo', 'vun', 'wa', 'wa_BE', 'wae', 'wae_CH', 'wal', 'wal_ET', 'wo', 'wo_SN', 'xh', 'xh_ZA', 'xog', 'yav', 'yi', 'yi_US', 'yo', 'yo_BJ', 'yo_NG', 'yue', 'yue_HK', 'yue_Hans', 'yue_Hant', 'yuw', 'yuw_PG', 'zgh', 'zh', 'zh_CN', 'zh_HK', 'zh_Hans', 'zh_Hans_HK', 'zh_Hans_MO', 'zh_Hans_SG', 'zh_Hant', 'zh_Hant_HK', 'zh_Hant_MO', 'zh_Hant_TW', 'zh_MO', 'zh_SG', 'zh_TW', 'zh_YUE', 'zu', 'zu_ZA', ]; } } ================================================ FILE: src/Carbon/Callback.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Closure; use DateInterval; use DatePeriod; use DateTime; use DateTimeInterface; use DateTimeZone; use ReflectionFunction; use ReflectionNamedType; use ReflectionType; final class Callback { private ?ReflectionFunction $function; private function __construct(private readonly Closure $closure) { } public static function fromClosure(Closure $closure): self { return new self($closure); } public static function parameter(mixed $closure, mixed $value, string|int $index = 0): mixed { if ($closure instanceof Closure) { return self::fromClosure($closure)->prepareParameter($value, $index); } return $value; } public function getReflectionFunction(): ReflectionFunction { return $this->function ??= new ReflectionFunction($this->closure); } public function prepareParameter(mixed $value, string|int $index = 0): mixed { $type = $this->getParameterType($index); if (!($type instanceof ReflectionNamedType)) { return $value; } $name = $type->getName(); if ($name === CarbonInterface::class) { $name = $value instanceof DateTime ? Carbon::class : CarbonImmutable::class; } if (!class_exists($name) || is_a($value, $name)) { return $value; } $class = $this->getPromotedClass($value); if ($class && is_a($name, $class, true)) { return $name::instance($value); } return $value; } public function call(mixed ...$arguments): mixed { foreach ($arguments as $index => &$value) { if ($this->getPromotedClass($value)) { $value = $this->prepareParameter($value, $index); } } return ($this->closure)(...$arguments); } private function getParameterType(string|int $index): ?ReflectionType { $parameters = $this->getReflectionFunction()->getParameters(); if (\is_int($index)) { return ($parameters[$index] ?? null)?->getType(); } foreach ($parameters as $parameter) { if ($parameter->getName() === $index) { return $parameter->getType(); } } return null; } /** @return class-string|null */ private function getPromotedClass(mixed $value): ?string { if ($value instanceof DateTimeInterface) { return CarbonInterface::class; } if ($value instanceof DateInterval) { return CarbonInterval::class; } if ($value instanceof DatePeriod) { return CarbonPeriod::class; } if ($value instanceof DateTimeZone) { return CarbonTimeZone::class; } return null; } } ================================================ FILE: src/Carbon/Carbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Traits\Date; use DateTime; use DateTimeInterface; /** * A simple API extension for DateTime. * * * * @property string $localeDayOfWeek the day of week in current locale * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale * @property string $localeMonth the month in current locale * @property string $shortLocaleMonth the abbreviated month in current locale * @property int $year * @property int $yearIso * @property int $month * @property int $day * @property int $hour * @property int $minute * @property int $second * @property int $micro * @property int $microsecond * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) * @property int|float|string $timestamp seconds since the Unix Epoch * @property string $englishDayOfWeek the day of week in English * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English * @property int $milliseconds * @property int $millisecond * @property int $milli * @property int $week 1 through 53 * @property int $isoWeek 1 through 53 * @property int $weekYear year according to week format * @property int $isoWeekYear year according to ISO week format * @property int $age does a diffInYears() with default parameters * @property int $offset the timezone offset in seconds from UTC * @property int $offsetMinutes the timezone offset in minutes from UTC * @property int $offsetHours the timezone offset in hours from UTC * @property CarbonTimeZone $timezone the current timezone * @property CarbonTimeZone $tz alias of $timezone * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium * @property int $dayOfCentury The value of the day starting from the beginning of the current century * @property int $dayOfDecade The value of the day starting from the beginning of the current decade * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium * @property int $dayOfMonth The value of the day starting from the beginning of the current month * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property int $dayOfYear 1 through 366 * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium * @property int $hourOfCentury The value of the hour starting from the beginning of the current century * @property int $hourOfDay The value of the hour starting from the beginning of the current day * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium * @property int $hourOfMonth The value of the hour starting from the beginning of the current month * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter * @property int $hourOfWeek The value of the hour starting from the beginning of the current week * @property int $hourOfYear The value of the hour starting from the beginning of the current year * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century * @property int $minuteOfDay The value of the minute starting from the beginning of the current day * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week * @property int $minuteOfYear The value of the minute starting from the beginning of the current year * @property int $monthOfCentury The value of the month starting from the beginning of the current century * @property int $monthOfDecade The value of the month starting from the beginning of the current decade * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter * @property int $monthOfYear The value of the month starting from the beginning of the current year * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year * @property int $secondOfCentury The value of the second starting from the beginning of the current century * @property int $secondOfDay The value of the second starting from the beginning of the current day * @property int $secondOfDecade The value of the second starting from the beginning of the current decade * @property int $secondOfHour The value of the second starting from the beginning of the current hour * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium * @property int $secondOfMinute The value of the second starting from the beginning of the current minute * @property int $secondOfMonth The value of the second starting from the beginning of the current month * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter * @property int $secondOfWeek The value of the second starting from the beginning of the current week * @property int $secondOfYear The value of the second starting from the beginning of the current year * @property int $weekOfCentury The value of the week starting from the beginning of the current century * @property int $weekOfDecade The value of the week starting from the beginning of the current decade * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium * @property int $weekOfMonth 1 through 5 * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property int $yearOfCentury The value of the year starting from the beginning of the current century * @property int $yearOfDecade The value of the year starting from the beginning of the current decade * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read int $noZeroHour current hour from 1 to 24 * @property-read int $isoWeeksInYear 51 through 53 * @property-read int $weekNumberInMonth 1 through 5 * @property-read int $firstWeekDay 0 through 6 * @property-read int $lastWeekDay 0 through 6 * @property-read int $quarter the quarter of this instance, 1 - 4 * @property-read int $decade the decade of this instance * @property-read int $century the century of this instance * @property-read int $millennium the millennium of this instance * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise * @property-read bool $local checks if the timezone is local, true if local, false otherwise * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName the current timezone name * @property-read string $tzName alias of $timezoneName * @property-read string $locale locale of the current instance * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium * @property-read int $daysInCentury The number of days contained in the current century * @property-read int $daysInDecade The number of days contained in the current decade * @property-read int $daysInMillennium The number of days contained in the current millennium * @property-read int $daysInMonth number of days in the given month * @property-read int $daysInQuarter The number of days contained in the current quarter * @property-read int $daysInWeek The number of days contained in the current week * @property-read int $daysInYear 365 or 366 * @property-read int $decadesInCentury The number of decades contained in the current century * @property-read int $decadesInMillennium The number of decades contained in the current millennium * @property-read int $hoursInCentury The number of hours contained in the current century * @property-read int $hoursInDay The number of hours contained in the current day * @property-read int $hoursInDecade The number of hours contained in the current decade * @property-read int $hoursInMillennium The number of hours contained in the current millennium * @property-read int $hoursInMonth The number of hours contained in the current month * @property-read int $hoursInQuarter The number of hours contained in the current quarter * @property-read int $hoursInWeek The number of hours contained in the current week * @property-read int $hoursInYear The number of hours contained in the current year * @property-read int $microsecondsInCentury The number of microseconds contained in the current century * @property-read int $microsecondsInDay The number of microseconds contained in the current day * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade * @property-read int $microsecondsInHour The number of microseconds contained in the current hour * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute * @property-read int $microsecondsInMonth The number of microseconds contained in the current month * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter * @property-read int $microsecondsInSecond The number of microseconds contained in the current second * @property-read int $microsecondsInWeek The number of microseconds contained in the current week * @property-read int $microsecondsInYear The number of microseconds contained in the current year * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century * @property-read int $millisecondsInDay The number of milliseconds contained in the current day * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week * @property-read int $millisecondsInYear The number of milliseconds contained in the current year * @property-read int $minutesInCentury The number of minutes contained in the current century * @property-read int $minutesInDay The number of minutes contained in the current day * @property-read int $minutesInDecade The number of minutes contained in the current decade * @property-read int $minutesInHour The number of minutes contained in the current hour * @property-read int $minutesInMillennium The number of minutes contained in the current millennium * @property-read int $minutesInMonth The number of minutes contained in the current month * @property-read int $minutesInQuarter The number of minutes contained in the current quarter * @property-read int $minutesInWeek The number of minutes contained in the current week * @property-read int $minutesInYear The number of minutes contained in the current year * @property-read int $monthsInCentury The number of months contained in the current century * @property-read int $monthsInDecade The number of months contained in the current decade * @property-read int $monthsInMillennium The number of months contained in the current millennium * @property-read int $monthsInQuarter The number of months contained in the current quarter * @property-read int $monthsInYear The number of months contained in the current year * @property-read int $quartersInCentury The number of quarters contained in the current century * @property-read int $quartersInDecade The number of quarters contained in the current decade * @property-read int $quartersInMillennium The number of quarters contained in the current millennium * @property-read int $quartersInYear The number of quarters contained in the current year * @property-read int $secondsInCentury The number of seconds contained in the current century * @property-read int $secondsInDay The number of seconds contained in the current day * @property-read int $secondsInDecade The number of seconds contained in the current decade * @property-read int $secondsInHour The number of seconds contained in the current hour * @property-read int $secondsInMillennium The number of seconds contained in the current millennium * @property-read int $secondsInMinute The number of seconds contained in the current minute * @property-read int $secondsInMonth The number of seconds contained in the current month * @property-read int $secondsInQuarter The number of seconds contained in the current quarter * @property-read int $secondsInWeek The number of seconds contained in the current week * @property-read int $secondsInYear The number of seconds contained in the current year * @property-read int $weeksInCentury The number of weeks contained in the current century * @property-read int $weeksInDecade The number of weeks contained in the current decade * @property-read int $weeksInMillennium The number of weeks contained in the current millennium * @property-read int $weeksInMonth The number of weeks contained in the current month * @property-read int $weeksInQuarter The number of weeks contained in the current quarter * @property-read int $weeksInYear 51 through 53 * @property-read int $yearsInCentury The number of years contained in the current century * @property-read int $yearsInDecade The number of years contained in the current decade * @property-read int $yearsInMillennium The number of years contained in the current millennium * * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) * @method bool isLocal() Check if the current instance has non-UTC timezone. * @method bool isValid() Check if the current instance is a valid date. * @method bool isDST() Check if the current instance is in a daylight saving time. * @method bool isSunday() Checks if the instance day is sunday. * @method bool isMonday() Checks if the instance day is monday. * @method bool isTuesday() Checks if the instance day is tuesday. * @method bool isWednesday() Checks if the instance day is wednesday. * @method bool isThursday() Checks if the instance day is thursday. * @method bool isFriday() Checks if the instance day is friday. * @method bool isSaturday() Checks if the instance day is saturday. * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. * @method $this years(int $value) Set current instance year to the given value. * @method $this year(int $value) Set current instance year to the given value. * @method $this setYears(int $value) Set current instance year to the given value. * @method $this setYear(int $value) Set current instance year to the given value. * @method $this months(Month|int $value) Set current instance month to the given value. * @method $this month(Month|int $value) Set current instance month to the given value. * @method $this setMonths(Month|int $value) Set current instance month to the given value. * @method $this setMonth(Month|int $value) Set current instance month to the given value. * @method $this days(int $value) Set current instance day to the given value. * @method $this day(int $value) Set current instance day to the given value. * @method $this setDays(int $value) Set current instance day to the given value. * @method $this setDay(int $value) Set current instance day to the given value. * @method $this hours(int $value) Set current instance hour to the given value. * @method $this hour(int $value) Set current instance hour to the given value. * @method $this setHours(int $value) Set current instance hour to the given value. * @method $this setHour(int $value) Set current instance hour to the given value. * @method $this minutes(int $value) Set current instance minute to the given value. * @method $this minute(int $value) Set current instance minute to the given value. * @method $this setMinutes(int $value) Set current instance minute to the given value. * @method $this setMinute(int $value) Set current instance minute to the given value. * @method $this seconds(int $value) Set current instance second to the given value. * @method $this second(int $value) Set current instance second to the given value. * @method $this setSeconds(int $value) Set current instance second to the given value. * @method $this setSecond(int $value) Set current instance second to the given value. * @method $this millis(int $value) Set current instance millisecond to the given value. * @method $this milli(int $value) Set current instance millisecond to the given value. * @method $this setMillis(int $value) Set current instance millisecond to the given value. * @method $this setMilli(int $value) Set current instance millisecond to the given value. * @method $this milliseconds(int $value) Set current instance millisecond to the given value. * @method $this millisecond(int $value) Set current instance millisecond to the given value. * @method $this setMilliseconds(int $value) Set current instance millisecond to the given value. * @method $this setMillisecond(int $value) Set current instance millisecond to the given value. * @method $this micros(int $value) Set current instance microsecond to the given value. * @method $this micro(int $value) Set current instance microsecond to the given value. * @method $this setMicros(int $value) Set current instance microsecond to the given value. * @method $this setMicro(int $value) Set current instance microsecond to the given value. * @method $this microseconds(int $value) Set current instance microsecond to the given value. * @method $this microsecond(int $value) Set current instance microsecond to the given value. * @method $this setMicroseconds(int $value) Set current instance microsecond to the given value. * @method self setMicrosecond(int $value) Set current instance microsecond to the given value. * @method $this addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). * @method $this addYear() Add one year to the instance (using date interval). * @method $this subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). * @method $this subYear() Sub one year to the instance (using date interval). * @method $this addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. * @method $this subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. * @method $this addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method $this subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method $this addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method $this subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method $this addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method $this subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). * @method $this addMonth() Add one month to the instance (using date interval). * @method $this subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). * @method $this subMonth() Sub one month to the instance (using date interval). * @method $this addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. * @method $this subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. * @method $this addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). * @method $this addDay() Add one day to the instance (using date interval). * @method $this subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). * @method $this subDay() Sub one day to the instance (using date interval). * @method $this addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). * @method $this addHour() Add one hour to the instance (using date interval). * @method $this subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). * @method $this subHour() Sub one hour to the instance (using date interval). * @method $this addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). * @method $this addMinute() Add one minute to the instance (using date interval). * @method $this subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). * @method $this subMinute() Sub one minute to the instance (using date interval). * @method $this addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). * @method $this addSecond() Add one second to the instance (using date interval). * @method $this subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). * @method $this subSecond() Sub one second to the instance (using date interval). * @method $this addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method $this addMilli() Add one millisecond to the instance (using date interval). * @method $this subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method $this subMilli() Sub one millisecond to the instance (using date interval). * @method $this addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method $this addMillisecond() Add one millisecond to the instance (using date interval). * @method $this subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method $this subMillisecond() Sub one millisecond to the instance (using date interval). * @method $this addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method $this addMicro() Add one microsecond to the instance (using date interval). * @method $this subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method $this subMicro() Sub one microsecond to the instance (using date interval). * @method $this addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method $this addMicrosecond() Add one microsecond to the instance (using date interval). * @method $this subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method $this subMicrosecond() Sub one microsecond to the instance (using date interval). * @method $this addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). * @method $this addMillennium() Add one millennium to the instance (using date interval). * @method $this subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). * @method $this subMillennium() Sub one millennium to the instance (using date interval). * @method $this addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. * @method $this subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. * @method $this addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method $this addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). * @method $this addCentury() Add one century to the instance (using date interval). * @method $this subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). * @method $this subCentury() Sub one century to the instance (using date interval). * @method $this addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. * @method $this subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. * @method $this addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method $this subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method $this addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method $this subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method $this addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method $this subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). * @method $this addDecade() Add one decade to the instance (using date interval). * @method $this subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). * @method $this subDecade() Sub one decade to the instance (using date interval). * @method $this addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. * @method $this subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. * @method $this addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method $this subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method $this subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method $this subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method $this addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). * @method $this addQuarter() Add one quarter to the instance (using date interval). * @method $this subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). * @method $this subQuarter() Sub one quarter to the instance (using date interval). * @method $this addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. * @method $this subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. * @method $this addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method $this subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method $this addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method $this subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method $this addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method $this subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method $this addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). * @method $this addWeek() Add one week to the instance (using date interval). * @method $this subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). * @method $this subWeek() Sub one week to the instance (using date interval). * @method $this addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). * @method $this addWeekday() Add one weekday to the instance (using date interval). * @method $this subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). * @method $this subWeekday() Sub one weekday to the instance (using date interval). * @method $this addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMicro() Add one microsecond to the instance (using timestamp). * @method $this subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMicro() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method $this addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMicrosecond() Add one microsecond to the instance (using timestamp). * @method $this subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method $this addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMilli() Add one millisecond to the instance (using timestamp). * @method $this subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMilli() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method $this addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMillisecond() Add one millisecond to the instance (using timestamp). * @method $this subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMillisecond() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method $this addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). * @method $this addUTCSecond() Add one second to the instance (using timestamp). * @method $this subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). * @method $this subUTCSecond() Sub one second to the instance (using timestamp). * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. * @method $this addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMinute() Add one minute to the instance (using timestamp). * @method $this subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMinute() Sub one minute to the instance (using timestamp). * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. * @method $this addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). * @method $this addUTCHour() Add one hour to the instance (using timestamp). * @method $this subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). * @method $this subUTCHour() Sub one hour to the instance (using timestamp). * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. * @method $this addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). * @method $this addUTCDay() Add one day to the instance (using timestamp). * @method $this subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). * @method $this subUTCDay() Sub one day to the instance (using timestamp). * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. * @method $this addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). * @method $this addUTCWeek() Add one week to the instance (using timestamp). * @method $this subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). * @method $this subUTCWeek() Sub one week to the instance (using timestamp). * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. * @method $this addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMonth() Add one month to the instance (using timestamp). * @method $this subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMonth() Sub one month to the instance (using timestamp). * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. * @method $this addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). * @method $this addUTCQuarter() Add one quarter to the instance (using timestamp). * @method $this subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). * @method $this subUTCQuarter() Sub one quarter to the instance (using timestamp). * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. * @method $this addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). * @method $this addUTCYear() Add one year to the instance (using timestamp). * @method $this subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). * @method $this subUTCYear() Sub one year to the instance (using timestamp). * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. * @method $this addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). * @method $this addUTCDecade() Add one decade to the instance (using timestamp). * @method $this subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). * @method $this subUTCDecade() Sub one decade to the instance (using timestamp). * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. * @method $this addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). * @method $this addUTCCentury() Add one century to the instance (using timestamp). * @method $this subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). * @method $this subUTCCentury() Sub one century to the instance (using timestamp). * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. * @method $this addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). * @method $this addUTCMillennium() Add one millennium to the instance (using timestamp). * @method $this subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). * @method $this subUTCMillennium() Sub one millennium to the instance (using timestamp). * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value * @method int daysInCentury() Return the number of days contained in the current century * @method int daysInDecade() Return the number of days contained in the current decade * @method int daysInMillennium() Return the number of days contained in the current millennium * @method int daysInMonth() Return the number of days contained in the current month * @method int daysInQuarter() Return the number of days contained in the current quarter * @method int daysInWeek() Return the number of days contained in the current week * @method int daysInYear() Return the number of days contained in the current year * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value * @method int decadesInCentury() Return the number of decades contained in the current century * @method int decadesInMillennium() Return the number of decades contained in the current millennium * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value * @method int hoursInCentury() Return the number of hours contained in the current century * @method int hoursInDay() Return the number of hours contained in the current day * @method int hoursInDecade() Return the number of hours contained in the current decade * @method int hoursInMillennium() Return the number of hours contained in the current millennium * @method int hoursInMonth() Return the number of hours contained in the current month * @method int hoursInQuarter() Return the number of hours contained in the current quarter * @method int hoursInWeek() Return the number of hours contained in the current week * @method int hoursInYear() Return the number of hours contained in the current year * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value * @method int microsecondsInCentury() Return the number of microseconds contained in the current century * @method int microsecondsInDay() Return the number of microseconds contained in the current day * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade * @method int microsecondsInHour() Return the number of microseconds contained in the current hour * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute * @method int microsecondsInMonth() Return the number of microseconds contained in the current month * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter * @method int microsecondsInSecond() Return the number of microseconds contained in the current second * @method int microsecondsInWeek() Return the number of microseconds contained in the current week * @method int microsecondsInYear() Return the number of microseconds contained in the current year * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century * @method int millisecondsInDay() Return the number of milliseconds contained in the current day * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week * @method int millisecondsInYear() Return the number of milliseconds contained in the current year * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value * @method int minutesInCentury() Return the number of minutes contained in the current century * @method int minutesInDay() Return the number of minutes contained in the current day * @method int minutesInDecade() Return the number of minutes contained in the current decade * @method int minutesInHour() Return the number of minutes contained in the current hour * @method int minutesInMillennium() Return the number of minutes contained in the current millennium * @method int minutesInMonth() Return the number of minutes contained in the current month * @method int minutesInQuarter() Return the number of minutes contained in the current quarter * @method int minutesInWeek() Return the number of minutes contained in the current week * @method int minutesInYear() Return the number of minutes contained in the current year * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value * @method int monthsInCentury() Return the number of months contained in the current century * @method int monthsInDecade() Return the number of months contained in the current decade * @method int monthsInMillennium() Return the number of months contained in the current millennium * @method int monthsInQuarter() Return the number of months contained in the current quarter * @method int monthsInYear() Return the number of months contained in the current year * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value * @method int quartersInCentury() Return the number of quarters contained in the current century * @method int quartersInDecade() Return the number of quarters contained in the current decade * @method int quartersInMillennium() Return the number of quarters contained in the current millennium * @method int quartersInYear() Return the number of quarters contained in the current year * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value * @method int secondsInCentury() Return the number of seconds contained in the current century * @method int secondsInDay() Return the number of seconds contained in the current day * @method int secondsInDecade() Return the number of seconds contained in the current decade * @method int secondsInHour() Return the number of seconds contained in the current hour * @method int secondsInMillennium() Return the number of seconds contained in the current millennium * @method int secondsInMinute() Return the number of seconds contained in the current minute * @method int secondsInMonth() Return the number of seconds contained in the current month * @method int secondsInQuarter() Return the number of seconds contained in the current quarter * @method int secondsInWeek() Return the number of seconds contained in the current week * @method int secondsInYear() Return the number of seconds contained in the current year * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value * @method int weeksInCentury() Return the number of weeks contained in the current century * @method int weeksInDecade() Return the number of weeks contained in the current decade * @method int weeksInMillennium() Return the number of weeks contained in the current millennium * @method int weeksInMonth() Return the number of weeks contained in the current month * @method int weeksInQuarter() Return the number of weeks contained in the current quarter * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value * @method int yearsInCentury() Return the number of years contained in the current century * @method int yearsInDecade() Return the number of years contained in the current decade * @method int yearsInMillennium() Return the number of years contained in the current millennium * * */ class Carbon extends DateTime implements CarbonInterface { use Date; /** * Returns true if the current class/instance is mutable. */ public static function isMutable(): bool { return true; } } ================================================ FILE: src/Carbon/CarbonConverterInterface.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use DateTimeInterface; interface CarbonConverterInterface { public function convertDate(DateTimeInterface $dateTime, bool $negated = false): CarbonInterface; } ================================================ FILE: src/Carbon/CarbonImmutable.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Traits\Date; use DateTimeImmutable; use DateTimeInterface; /** * A simple API extension for DateTimeImmutable. * * * * @property string $localeDayOfWeek the day of week in current locale * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale * @property string $localeMonth the month in current locale * @property string $shortLocaleMonth the abbreviated month in current locale * @property int $year * @property int $yearIso * @property int $month * @property int $day * @property int $hour * @property int $minute * @property int $second * @property int $micro * @property int $microsecond * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) * @property int|float|string $timestamp seconds since the Unix Epoch * @property string $englishDayOfWeek the day of week in English * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English * @property int $milliseconds * @property int $millisecond * @property int $milli * @property int $week 1 through 53 * @property int $isoWeek 1 through 53 * @property int $weekYear year according to week format * @property int $isoWeekYear year according to ISO week format * @property int $age does a diffInYears() with default parameters * @property int $offset the timezone offset in seconds from UTC * @property int $offsetMinutes the timezone offset in minutes from UTC * @property int $offsetHours the timezone offset in hours from UTC * @property CarbonTimeZone $timezone the current timezone * @property CarbonTimeZone $tz alias of $timezone * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium * @property int $dayOfCentury The value of the day starting from the beginning of the current century * @property int $dayOfDecade The value of the day starting from the beginning of the current decade * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium * @property int $dayOfMonth The value of the day starting from the beginning of the current month * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property int $dayOfYear 1 through 366 * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium * @property int $hourOfCentury The value of the hour starting from the beginning of the current century * @property int $hourOfDay The value of the hour starting from the beginning of the current day * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium * @property int $hourOfMonth The value of the hour starting from the beginning of the current month * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter * @property int $hourOfWeek The value of the hour starting from the beginning of the current week * @property int $hourOfYear The value of the hour starting from the beginning of the current year * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century * @property int $minuteOfDay The value of the minute starting from the beginning of the current day * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week * @property int $minuteOfYear The value of the minute starting from the beginning of the current year * @property int $monthOfCentury The value of the month starting from the beginning of the current century * @property int $monthOfDecade The value of the month starting from the beginning of the current decade * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter * @property int $monthOfYear The value of the month starting from the beginning of the current year * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year * @property int $secondOfCentury The value of the second starting from the beginning of the current century * @property int $secondOfDay The value of the second starting from the beginning of the current day * @property int $secondOfDecade The value of the second starting from the beginning of the current decade * @property int $secondOfHour The value of the second starting from the beginning of the current hour * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium * @property int $secondOfMinute The value of the second starting from the beginning of the current minute * @property int $secondOfMonth The value of the second starting from the beginning of the current month * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter * @property int $secondOfWeek The value of the second starting from the beginning of the current week * @property int $secondOfYear The value of the second starting from the beginning of the current year * @property int $weekOfCentury The value of the week starting from the beginning of the current century * @property int $weekOfDecade The value of the week starting from the beginning of the current decade * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium * @property int $weekOfMonth 1 through 5 * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property int $yearOfCentury The value of the year starting from the beginning of the current century * @property int $yearOfDecade The value of the year starting from the beginning of the current decade * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read int $noZeroHour current hour from 1 to 24 * @property-read int $isoWeeksInYear 51 through 53 * @property-read int $weekNumberInMonth 1 through 5 * @property-read int $firstWeekDay 0 through 6 * @property-read int $lastWeekDay 0 through 6 * @property-read int $quarter the quarter of this instance, 1 - 4 * @property-read int $decade the decade of this instance * @property-read int $century the century of this instance * @property-read int $millennium the millennium of this instance * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise * @property-read bool $local checks if the timezone is local, true if local, false otherwise * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName the current timezone name * @property-read string $tzName alias of $timezoneName * @property-read string $locale locale of the current instance * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium * @property-read int $daysInCentury The number of days contained in the current century * @property-read int $daysInDecade The number of days contained in the current decade * @property-read int $daysInMillennium The number of days contained in the current millennium * @property-read int $daysInMonth number of days in the given month * @property-read int $daysInQuarter The number of days contained in the current quarter * @property-read int $daysInWeek The number of days contained in the current week * @property-read int $daysInYear 365 or 366 * @property-read int $decadesInCentury The number of decades contained in the current century * @property-read int $decadesInMillennium The number of decades contained in the current millennium * @property-read int $hoursInCentury The number of hours contained in the current century * @property-read int $hoursInDay The number of hours contained in the current day * @property-read int $hoursInDecade The number of hours contained in the current decade * @property-read int $hoursInMillennium The number of hours contained in the current millennium * @property-read int $hoursInMonth The number of hours contained in the current month * @property-read int $hoursInQuarter The number of hours contained in the current quarter * @property-read int $hoursInWeek The number of hours contained in the current week * @property-read int $hoursInYear The number of hours contained in the current year * @property-read int $microsecondsInCentury The number of microseconds contained in the current century * @property-read int $microsecondsInDay The number of microseconds contained in the current day * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade * @property-read int $microsecondsInHour The number of microseconds contained in the current hour * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute * @property-read int $microsecondsInMonth The number of microseconds contained in the current month * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter * @property-read int $microsecondsInSecond The number of microseconds contained in the current second * @property-read int $microsecondsInWeek The number of microseconds contained in the current week * @property-read int $microsecondsInYear The number of microseconds contained in the current year * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century * @property-read int $millisecondsInDay The number of milliseconds contained in the current day * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week * @property-read int $millisecondsInYear The number of milliseconds contained in the current year * @property-read int $minutesInCentury The number of minutes contained in the current century * @property-read int $minutesInDay The number of minutes contained in the current day * @property-read int $minutesInDecade The number of minutes contained in the current decade * @property-read int $minutesInHour The number of minutes contained in the current hour * @property-read int $minutesInMillennium The number of minutes contained in the current millennium * @property-read int $minutesInMonth The number of minutes contained in the current month * @property-read int $minutesInQuarter The number of minutes contained in the current quarter * @property-read int $minutesInWeek The number of minutes contained in the current week * @property-read int $minutesInYear The number of minutes contained in the current year * @property-read int $monthsInCentury The number of months contained in the current century * @property-read int $monthsInDecade The number of months contained in the current decade * @property-read int $monthsInMillennium The number of months contained in the current millennium * @property-read int $monthsInQuarter The number of months contained in the current quarter * @property-read int $monthsInYear The number of months contained in the current year * @property-read int $quartersInCentury The number of quarters contained in the current century * @property-read int $quartersInDecade The number of quarters contained in the current decade * @property-read int $quartersInMillennium The number of quarters contained in the current millennium * @property-read int $quartersInYear The number of quarters contained in the current year * @property-read int $secondsInCentury The number of seconds contained in the current century * @property-read int $secondsInDay The number of seconds contained in the current day * @property-read int $secondsInDecade The number of seconds contained in the current decade * @property-read int $secondsInHour The number of seconds contained in the current hour * @property-read int $secondsInMillennium The number of seconds contained in the current millennium * @property-read int $secondsInMinute The number of seconds contained in the current minute * @property-read int $secondsInMonth The number of seconds contained in the current month * @property-read int $secondsInQuarter The number of seconds contained in the current quarter * @property-read int $secondsInWeek The number of seconds contained in the current week * @property-read int $secondsInYear The number of seconds contained in the current year * @property-read int $weeksInCentury The number of weeks contained in the current century * @property-read int $weeksInDecade The number of weeks contained in the current decade * @property-read int $weeksInMillennium The number of weeks contained in the current millennium * @property-read int $weeksInMonth The number of weeks contained in the current month * @property-read int $weeksInQuarter The number of weeks contained in the current quarter * @property-read int $weeksInYear 51 through 53 * @property-read int $yearsInCentury The number of years contained in the current century * @property-read int $yearsInDecade The number of years contained in the current decade * @property-read int $yearsInMillennium The number of years contained in the current millennium * * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) * @method bool isLocal() Check if the current instance has non-UTC timezone. * @method bool isValid() Check if the current instance is a valid date. * @method bool isDST() Check if the current instance is in a daylight saving time. * @method bool isSunday() Checks if the instance day is sunday. * @method bool isMonday() Checks if the instance day is monday. * @method bool isTuesday() Checks if the instance day is tuesday. * @method bool isWednesday() Checks if the instance day is wednesday. * @method bool isThursday() Checks if the instance day is thursday. * @method bool isFriday() Checks if the instance day is friday. * @method bool isSaturday() Checks if the instance day is saturday. * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. * @method CarbonImmutable years(int $value) Set current instance year to the given value. * @method CarbonImmutable year(int $value) Set current instance year to the given value. * @method CarbonImmutable setYears(int $value) Set current instance year to the given value. * @method CarbonImmutable setYear(int $value) Set current instance year to the given value. * @method CarbonImmutable months(Month|int $value) Set current instance month to the given value. * @method CarbonImmutable month(Month|int $value) Set current instance month to the given value. * @method CarbonImmutable setMonths(Month|int $value) Set current instance month to the given value. * @method CarbonImmutable setMonth(Month|int $value) Set current instance month to the given value. * @method CarbonImmutable days(int $value) Set current instance day to the given value. * @method CarbonImmutable day(int $value) Set current instance day to the given value. * @method CarbonImmutable setDays(int $value) Set current instance day to the given value. * @method CarbonImmutable setDay(int $value) Set current instance day to the given value. * @method CarbonImmutable hours(int $value) Set current instance hour to the given value. * @method CarbonImmutable hour(int $value) Set current instance hour to the given value. * @method CarbonImmutable setHours(int $value) Set current instance hour to the given value. * @method CarbonImmutable setHour(int $value) Set current instance hour to the given value. * @method CarbonImmutable minutes(int $value) Set current instance minute to the given value. * @method CarbonImmutable minute(int $value) Set current instance minute to the given value. * @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value. * @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value. * @method CarbonImmutable seconds(int $value) Set current instance second to the given value. * @method CarbonImmutable second(int $value) Set current instance second to the given value. * @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value. * @method CarbonImmutable setSecond(int $value) Set current instance second to the given value. * @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value. * @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value. * @method self setMicrosecond(int $value) Set current instance microsecond to the given value. * @method CarbonImmutable addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addYear() Add one year to the instance (using date interval). * @method CarbonImmutable subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subYear() Sub one year to the instance (using date interval). * @method CarbonImmutable addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMonth() Add one month to the instance (using date interval). * @method CarbonImmutable subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMonth() Sub one month to the instance (using date interval). * @method CarbonImmutable addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addDay() Add one day to the instance (using date interval). * @method CarbonImmutable subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subDay() Sub one day to the instance (using date interval). * @method CarbonImmutable addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addHour() Add one hour to the instance (using date interval). * @method CarbonImmutable subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subHour() Sub one hour to the instance (using date interval). * @method CarbonImmutable addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMinute() Add one minute to the instance (using date interval). * @method CarbonImmutable subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval). * @method CarbonImmutable addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addSecond() Add one second to the instance (using date interval). * @method CarbonImmutable subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subSecond() Sub one second to the instance (using date interval). * @method CarbonImmutable addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval). * @method CarbonImmutable subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval). * @method CarbonImmutable addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval). * @method CarbonImmutable subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval). * @method CarbonImmutable addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval). * @method CarbonImmutable subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval). * @method CarbonImmutable addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval). * @method CarbonImmutable subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval). * @method CarbonImmutable addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval). * @method CarbonImmutable subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval). * @method CarbonImmutable addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addCentury() Add one century to the instance (using date interval). * @method CarbonImmutable subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subCentury() Sub one century to the instance (using date interval). * @method CarbonImmutable addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addDecade() Add one decade to the instance (using date interval). * @method CarbonImmutable subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval). * @method CarbonImmutable addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval). * @method CarbonImmutable subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval). * @method CarbonImmutable addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. * @method CarbonImmutable addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonImmutable addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addWeek() Add one week to the instance (using date interval). * @method CarbonImmutable subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subWeek() Sub one week to the instance (using date interval). * @method CarbonImmutable addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval). * @method CarbonImmutable subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). * @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval). * @method CarbonImmutable addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMicro() Add one microsecond to the instance (using timestamp). * @method CarbonImmutable subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMicro() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method CarbonImmutable addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMicrosecond() Add one microsecond to the instance (using timestamp). * @method CarbonImmutable subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method CarbonImmutable addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMilli() Add one millisecond to the instance (using timestamp). * @method CarbonImmutable subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMilli() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method CarbonImmutable addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMillisecond() Add one millisecond to the instance (using timestamp). * @method CarbonImmutable subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMillisecond() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method CarbonImmutable addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCSecond() Add one second to the instance (using timestamp). * @method CarbonImmutable subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCSecond() Sub one second to the instance (using timestamp). * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. * @method CarbonImmutable addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMinute() Add one minute to the instance (using timestamp). * @method CarbonImmutable subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMinute() Sub one minute to the instance (using timestamp). * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. * @method CarbonImmutable addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCHour() Add one hour to the instance (using timestamp). * @method CarbonImmutable subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCHour() Sub one hour to the instance (using timestamp). * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. * @method CarbonImmutable addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCDay() Add one day to the instance (using timestamp). * @method CarbonImmutable subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCDay() Sub one day to the instance (using timestamp). * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. * @method CarbonImmutable addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCWeek() Add one week to the instance (using timestamp). * @method CarbonImmutable subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCWeek() Sub one week to the instance (using timestamp). * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. * @method CarbonImmutable addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMonth() Add one month to the instance (using timestamp). * @method CarbonImmutable subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMonth() Sub one month to the instance (using timestamp). * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. * @method CarbonImmutable addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCQuarter() Add one quarter to the instance (using timestamp). * @method CarbonImmutable subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCQuarter() Sub one quarter to the instance (using timestamp). * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. * @method CarbonImmutable addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCYear() Add one year to the instance (using timestamp). * @method CarbonImmutable subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCYear() Sub one year to the instance (using timestamp). * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. * @method CarbonImmutable addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCDecade() Add one decade to the instance (using timestamp). * @method CarbonImmutable subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCDecade() Sub one decade to the instance (using timestamp). * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. * @method CarbonImmutable addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCCentury() Add one century to the instance (using timestamp). * @method CarbonImmutable subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCCentury() Sub one century to the instance (using timestamp). * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. * @method CarbonImmutable addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable addUTCMillennium() Add one millennium to the instance (using timestamp). * @method CarbonImmutable subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). * @method CarbonImmutable subUTCMillennium() Sub one millennium to the instance (using timestamp). * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. * @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision. * @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision. * @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision. * @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision. * @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision. * @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision. * @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision. * @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision. * @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision. * @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision. * @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision. * @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision. * @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision. * @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision. * @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision. * @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision. * @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision. * @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. * @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. * @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. * @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision. * @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision. * @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value * @method int daysInCentury() Return the number of days contained in the current century * @method int daysInDecade() Return the number of days contained in the current decade * @method int daysInMillennium() Return the number of days contained in the current millennium * @method int daysInMonth() Return the number of days contained in the current month * @method int daysInQuarter() Return the number of days contained in the current quarter * @method int daysInWeek() Return the number of days contained in the current week * @method int daysInYear() Return the number of days contained in the current year * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value * @method int decadesInCentury() Return the number of decades contained in the current century * @method int decadesInMillennium() Return the number of decades contained in the current millennium * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value * @method int hoursInCentury() Return the number of hours contained in the current century * @method int hoursInDay() Return the number of hours contained in the current day * @method int hoursInDecade() Return the number of hours contained in the current decade * @method int hoursInMillennium() Return the number of hours contained in the current millennium * @method int hoursInMonth() Return the number of hours contained in the current month * @method int hoursInQuarter() Return the number of hours contained in the current quarter * @method int hoursInWeek() Return the number of hours contained in the current week * @method int hoursInYear() Return the number of hours contained in the current year * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value * @method int microsecondsInCentury() Return the number of microseconds contained in the current century * @method int microsecondsInDay() Return the number of microseconds contained in the current day * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade * @method int microsecondsInHour() Return the number of microseconds contained in the current hour * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute * @method int microsecondsInMonth() Return the number of microseconds contained in the current month * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter * @method int microsecondsInSecond() Return the number of microseconds contained in the current second * @method int microsecondsInWeek() Return the number of microseconds contained in the current week * @method int microsecondsInYear() Return the number of microseconds contained in the current year * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century * @method int millisecondsInDay() Return the number of milliseconds contained in the current day * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week * @method int millisecondsInYear() Return the number of milliseconds contained in the current year * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value * @method int minutesInCentury() Return the number of minutes contained in the current century * @method int minutesInDay() Return the number of minutes contained in the current day * @method int minutesInDecade() Return the number of minutes contained in the current decade * @method int minutesInHour() Return the number of minutes contained in the current hour * @method int minutesInMillennium() Return the number of minutes contained in the current millennium * @method int minutesInMonth() Return the number of minutes contained in the current month * @method int minutesInQuarter() Return the number of minutes contained in the current quarter * @method int minutesInWeek() Return the number of minutes contained in the current week * @method int minutesInYear() Return the number of minutes contained in the current year * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value * @method int monthsInCentury() Return the number of months contained in the current century * @method int monthsInDecade() Return the number of months contained in the current decade * @method int monthsInMillennium() Return the number of months contained in the current millennium * @method int monthsInQuarter() Return the number of months contained in the current quarter * @method int monthsInYear() Return the number of months contained in the current year * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value * @method int quartersInCentury() Return the number of quarters contained in the current century * @method int quartersInDecade() Return the number of quarters contained in the current decade * @method int quartersInMillennium() Return the number of quarters contained in the current millennium * @method int quartersInYear() Return the number of quarters contained in the current year * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value * @method int secondsInCentury() Return the number of seconds contained in the current century * @method int secondsInDay() Return the number of seconds contained in the current day * @method int secondsInDecade() Return the number of seconds contained in the current decade * @method int secondsInHour() Return the number of seconds contained in the current hour * @method int secondsInMillennium() Return the number of seconds contained in the current millennium * @method int secondsInMinute() Return the number of seconds contained in the current minute * @method int secondsInMonth() Return the number of seconds contained in the current month * @method int secondsInQuarter() Return the number of seconds contained in the current quarter * @method int secondsInWeek() Return the number of seconds contained in the current week * @method int secondsInYear() Return the number of seconds contained in the current year * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value * @method int weeksInCentury() Return the number of weeks contained in the current century * @method int weeksInDecade() Return the number of weeks contained in the current decade * @method int weeksInMillennium() Return the number of weeks contained in the current millennium * @method int weeksInMonth() Return the number of weeks contained in the current month * @method int weeksInQuarter() Return the number of weeks contained in the current quarter * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value * @method int yearsInCentury() Return the number of years contained in the current century * @method int yearsInDecade() Return the number of years contained in the current decade * @method int yearsInMillennium() Return the number of years contained in the current millennium * * */ class CarbonImmutable extends DateTimeImmutable implements CarbonInterface { use Date { __clone as dateTraitClone; } public function __clone(): void { $this->dateTraitClone(); $this->endOfTime = false; $this->startOfTime = false; } /** * Create a very old date representing start of time. * * @return static */ public static function startOfTime(): static { $date = static::parse('0001-01-01')->years(self::getStartOfTimeYear()); $date->startOfTime = true; return $date; } /** * Create a very far date representing end of time. * * @return static */ public static function endOfTime(): static { $date = static::parse('9999-12-31 23:59:59.999999')->years(self::getEndOfTimeYear()); $date->endOfTime = true; return $date; } /** * @codeCoverageIgnore */ private static function getEndOfTimeYear(): int { return 1118290769066902787; // PHP_INT_MAX no longer work since PHP 8.1 } /** * @codeCoverageIgnore */ private static function getStartOfTimeYear(): int { return -1118290769066898816; // PHP_INT_MIN no longer work since PHP 8.1 } } ================================================ FILE: src/Carbon/CarbonInterface.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use BadMethodCallException; use Carbon\Constants\DiffOptions; use Carbon\Constants\Format; use Carbon\Constants\TranslationOptions; use Carbon\Constants\UnitValue; use Carbon\Exceptions\BadComparisonUnitException; use Carbon\Exceptions\ImmutableException; use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\UnknownGetterException; use Carbon\Exceptions\UnknownMethodException; use Carbon\Exceptions\UnknownSetterException; use Closure; use DateInterval; use DateTime; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use JsonSerializable; use ReflectionException; use ReturnTypeWillChange; use Symfony\Contracts\Translation\TranslatorInterface; use Throwable; /** * Common interface for Carbon and CarbonImmutable. * * * * @property string $localeDayOfWeek the day of week in current locale * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale * @property string $localeMonth the month in current locale * @property string $shortLocaleMonth the abbreviated month in current locale * @property int $year * @property int $yearIso * @property int $month * @property int $day * @property int $hour * @property int $minute * @property int $second * @property int $micro * @property int $microsecond * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) * @property int|float|string $timestamp seconds since the Unix Epoch * @property string $englishDayOfWeek the day of week in English * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English * @property int $milliseconds * @property int $millisecond * @property int $milli * @property int $week 1 through 53 * @property int $isoWeek 1 through 53 * @property int $weekYear year according to week format * @property int $isoWeekYear year according to ISO week format * @property int $age does a diffInYears() with default parameters * @property int $offset the timezone offset in seconds from UTC * @property int $offsetMinutes the timezone offset in minutes from UTC * @property int $offsetHours the timezone offset in hours from UTC * @property CarbonTimeZone $timezone the current timezone * @property CarbonTimeZone $tz alias of $timezone * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium * @property int $dayOfCentury The value of the day starting from the beginning of the current century * @property int $dayOfDecade The value of the day starting from the beginning of the current decade * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium * @property int $dayOfMonth The value of the day starting from the beginning of the current month * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property int $dayOfYear 1 through 366 * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium * @property int $hourOfCentury The value of the hour starting from the beginning of the current century * @property int $hourOfDay The value of the hour starting from the beginning of the current day * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium * @property int $hourOfMonth The value of the hour starting from the beginning of the current month * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter * @property int $hourOfWeek The value of the hour starting from the beginning of the current week * @property int $hourOfYear The value of the hour starting from the beginning of the current year * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century * @property int $minuteOfDay The value of the minute starting from the beginning of the current day * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week * @property int $minuteOfYear The value of the minute starting from the beginning of the current year * @property int $monthOfCentury The value of the month starting from the beginning of the current century * @property int $monthOfDecade The value of the month starting from the beginning of the current decade * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter * @property int $monthOfYear The value of the month starting from the beginning of the current year * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year * @property int $secondOfCentury The value of the second starting from the beginning of the current century * @property int $secondOfDay The value of the second starting from the beginning of the current day * @property int $secondOfDecade The value of the second starting from the beginning of the current decade * @property int $secondOfHour The value of the second starting from the beginning of the current hour * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium * @property int $secondOfMinute The value of the second starting from the beginning of the current minute * @property int $secondOfMonth The value of the second starting from the beginning of the current month * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter * @property int $secondOfWeek The value of the second starting from the beginning of the current week * @property int $secondOfYear The value of the second starting from the beginning of the current year * @property int $weekOfCentury The value of the week starting from the beginning of the current century * @property int $weekOfDecade The value of the week starting from the beginning of the current decade * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium * @property int $weekOfMonth 1 through 5 * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property int $yearOfCentury The value of the year starting from the beginning of the current century * @property int $yearOfDecade The value of the year starting from the beginning of the current decade * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read int $noZeroHour current hour from 1 to 24 * @property-read int $isoWeeksInYear 51 through 53 * @property-read int $weekNumberInMonth 1 through 5 * @property-read int $firstWeekDay 0 through 6 * @property-read int $lastWeekDay 0 through 6 * @property-read int $quarter the quarter of this instance, 1 - 4 * @property-read int $decade the decade of this instance * @property-read int $century the century of this instance * @property-read int $millennium the millennium of this instance * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise * @property-read bool $local checks if the timezone is local, true if local, false otherwise * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName the current timezone name * @property-read string $tzName alias of $timezoneName * @property-read string $locale locale of the current instance * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium * @property-read int $daysInCentury The number of days contained in the current century * @property-read int $daysInDecade The number of days contained in the current decade * @property-read int $daysInMillennium The number of days contained in the current millennium * @property-read int $daysInMonth number of days in the given month * @property-read int $daysInQuarter The number of days contained in the current quarter * @property-read int $daysInWeek The number of days contained in the current week * @property-read int $daysInYear 365 or 366 * @property-read int $decadesInCentury The number of decades contained in the current century * @property-read int $decadesInMillennium The number of decades contained in the current millennium * @property-read int $hoursInCentury The number of hours contained in the current century * @property-read int $hoursInDay The number of hours contained in the current day * @property-read int $hoursInDecade The number of hours contained in the current decade * @property-read int $hoursInMillennium The number of hours contained in the current millennium * @property-read int $hoursInMonth The number of hours contained in the current month * @property-read int $hoursInQuarter The number of hours contained in the current quarter * @property-read int $hoursInWeek The number of hours contained in the current week * @property-read int $hoursInYear The number of hours contained in the current year * @property-read int $microsecondsInCentury The number of microseconds contained in the current century * @property-read int $microsecondsInDay The number of microseconds contained in the current day * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade * @property-read int $microsecondsInHour The number of microseconds contained in the current hour * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute * @property-read int $microsecondsInMonth The number of microseconds contained in the current month * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter * @property-read int $microsecondsInSecond The number of microseconds contained in the current second * @property-read int $microsecondsInWeek The number of microseconds contained in the current week * @property-read int $microsecondsInYear The number of microseconds contained in the current year * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century * @property-read int $millisecondsInDay The number of milliseconds contained in the current day * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week * @property-read int $millisecondsInYear The number of milliseconds contained in the current year * @property-read int $minutesInCentury The number of minutes contained in the current century * @property-read int $minutesInDay The number of minutes contained in the current day * @property-read int $minutesInDecade The number of minutes contained in the current decade * @property-read int $minutesInHour The number of minutes contained in the current hour * @property-read int $minutesInMillennium The number of minutes contained in the current millennium * @property-read int $minutesInMonth The number of minutes contained in the current month * @property-read int $minutesInQuarter The number of minutes contained in the current quarter * @property-read int $minutesInWeek The number of minutes contained in the current week * @property-read int $minutesInYear The number of minutes contained in the current year * @property-read int $monthsInCentury The number of months contained in the current century * @property-read int $monthsInDecade The number of months contained in the current decade * @property-read int $monthsInMillennium The number of months contained in the current millennium * @property-read int $monthsInQuarter The number of months contained in the current quarter * @property-read int $monthsInYear The number of months contained in the current year * @property-read int $quartersInCentury The number of quarters contained in the current century * @property-read int $quartersInDecade The number of quarters contained in the current decade * @property-read int $quartersInMillennium The number of quarters contained in the current millennium * @property-read int $quartersInYear The number of quarters contained in the current year * @property-read int $secondsInCentury The number of seconds contained in the current century * @property-read int $secondsInDay The number of seconds contained in the current day * @property-read int $secondsInDecade The number of seconds contained in the current decade * @property-read int $secondsInHour The number of seconds contained in the current hour * @property-read int $secondsInMillennium The number of seconds contained in the current millennium * @property-read int $secondsInMinute The number of seconds contained in the current minute * @property-read int $secondsInMonth The number of seconds contained in the current month * @property-read int $secondsInQuarter The number of seconds contained in the current quarter * @property-read int $secondsInWeek The number of seconds contained in the current week * @property-read int $secondsInYear The number of seconds contained in the current year * @property-read int $weeksInCentury The number of weeks contained in the current century * @property-read int $weeksInDecade The number of weeks contained in the current decade * @property-read int $weeksInMillennium The number of weeks contained in the current millennium * @property-read int $weeksInMonth The number of weeks contained in the current month * @property-read int $weeksInQuarter The number of weeks contained in the current quarter * @property-read int $weeksInYear 51 through 53 * @property-read int $yearsInCentury The number of years contained in the current century * @property-read int $yearsInDecade The number of years contained in the current decade * @property-read int $yearsInMillennium The number of years contained in the current millennium * * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) * @method bool isLocal() Check if the current instance has non-UTC timezone. * @method bool isValid() Check if the current instance is a valid date. * @method bool isDST() Check if the current instance is in a daylight saving time. * @method bool isSunday() Checks if the instance day is sunday. * @method bool isMonday() Checks if the instance day is monday. * @method bool isTuesday() Checks if the instance day is tuesday. * @method bool isWednesday() Checks if the instance day is wednesday. * @method bool isThursday() Checks if the instance day is thursday. * @method bool isFriday() Checks if the instance day is friday. * @method bool isSaturday() Checks if the instance day is saturday. * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. * @method CarbonInterface years(int $value) Set current instance year to the given value. * @method CarbonInterface year(int $value) Set current instance year to the given value. * @method CarbonInterface setYears(int $value) Set current instance year to the given value. * @method CarbonInterface setYear(int $value) Set current instance year to the given value. * @method CarbonInterface months(Month|int $value) Set current instance month to the given value. * @method CarbonInterface month(Month|int $value) Set current instance month to the given value. * @method CarbonInterface setMonths(Month|int $value) Set current instance month to the given value. * @method CarbonInterface setMonth(Month|int $value) Set current instance month to the given value. * @method CarbonInterface days(int $value) Set current instance day to the given value. * @method CarbonInterface day(int $value) Set current instance day to the given value. * @method CarbonInterface setDays(int $value) Set current instance day to the given value. * @method CarbonInterface setDay(int $value) Set current instance day to the given value. * @method CarbonInterface hours(int $value) Set current instance hour to the given value. * @method CarbonInterface hour(int $value) Set current instance hour to the given value. * @method CarbonInterface setHours(int $value) Set current instance hour to the given value. * @method CarbonInterface setHour(int $value) Set current instance hour to the given value. * @method CarbonInterface minutes(int $value) Set current instance minute to the given value. * @method CarbonInterface minute(int $value) Set current instance minute to the given value. * @method CarbonInterface setMinutes(int $value) Set current instance minute to the given value. * @method CarbonInterface setMinute(int $value) Set current instance minute to the given value. * @method CarbonInterface seconds(int $value) Set current instance second to the given value. * @method CarbonInterface second(int $value) Set current instance second to the given value. * @method CarbonInterface setSeconds(int $value) Set current instance second to the given value. * @method CarbonInterface setSecond(int $value) Set current instance second to the given value. * @method CarbonInterface millis(int $value) Set current instance millisecond to the given value. * @method CarbonInterface milli(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMillis(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMilli(int $value) Set current instance millisecond to the given value. * @method CarbonInterface milliseconds(int $value) Set current instance millisecond to the given value. * @method CarbonInterface millisecond(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMilliseconds(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMillisecond(int $value) Set current instance millisecond to the given value. * @method CarbonInterface micros(int $value) Set current instance microsecond to the given value. * @method CarbonInterface micro(int $value) Set current instance microsecond to the given value. * @method CarbonInterface setMicros(int $value) Set current instance microsecond to the given value. * @method CarbonInterface setMicro(int $value) Set current instance microsecond to the given value. * @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value. * @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value. * @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value. * @method self setMicrosecond(int $value) Set current instance microsecond to the given value. * @method CarbonInterface addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addYear() Add one year to the instance (using date interval). * @method CarbonInterface subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subYear() Sub one year to the instance (using date interval). * @method CarbonInterface addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMonth() Add one month to the instance (using date interval). * @method CarbonInterface subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMonth() Sub one month to the instance (using date interval). * @method CarbonInterface addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addDay() Add one day to the instance (using date interval). * @method CarbonInterface subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subDay() Sub one day to the instance (using date interval). * @method CarbonInterface addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addHour() Add one hour to the instance (using date interval). * @method CarbonInterface subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subHour() Sub one hour to the instance (using date interval). * @method CarbonInterface addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMinute() Add one minute to the instance (using date interval). * @method CarbonInterface subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMinute() Sub one minute to the instance (using date interval). * @method CarbonInterface addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addSecond() Add one second to the instance (using date interval). * @method CarbonInterface subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subSecond() Sub one second to the instance (using date interval). * @method CarbonInterface addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMilli() Add one millisecond to the instance (using date interval). * @method CarbonInterface subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMilli() Sub one millisecond to the instance (using date interval). * @method CarbonInterface addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMillisecond() Add one millisecond to the instance (using date interval). * @method CarbonInterface subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMillisecond() Sub one millisecond to the instance (using date interval). * @method CarbonInterface addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMicro() Add one microsecond to the instance (using date interval). * @method CarbonInterface subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMicro() Sub one microsecond to the instance (using date interval). * @method CarbonInterface addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMicrosecond() Add one microsecond to the instance (using date interval). * @method CarbonInterface subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMicrosecond() Sub one microsecond to the instance (using date interval). * @method CarbonInterface addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMillennium() Add one millennium to the instance (using date interval). * @method CarbonInterface subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMillennium() Sub one millennium to the instance (using date interval). * @method CarbonInterface addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addCentury() Add one century to the instance (using date interval). * @method CarbonInterface subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subCentury() Sub one century to the instance (using date interval). * @method CarbonInterface addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addDecade() Add one decade to the instance (using date interval). * @method CarbonInterface subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subDecade() Sub one decade to the instance (using date interval). * @method CarbonInterface addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addQuarter() Add one quarter to the instance (using date interval). * @method CarbonInterface subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subQuarter() Sub one quarter to the instance (using date interval). * @method CarbonInterface addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addWeek() Add one week to the instance (using date interval). * @method CarbonInterface subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subWeek() Sub one week to the instance (using date interval). * @method CarbonInterface addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addWeekday() Add one weekday to the instance (using date interval). * @method CarbonInterface subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subWeekday() Sub one weekday to the instance (using date interval). * @method CarbonInterface addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMicro() Add one microsecond to the instance (using timestamp). * @method CarbonInterface subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMicro() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method CarbonInterface addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMicrosecond() Add one microsecond to the instance (using timestamp). * @method CarbonInterface subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method CarbonInterface addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMilli() Add one millisecond to the instance (using timestamp). * @method CarbonInterface subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMilli() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method CarbonInterface addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMillisecond() Add one millisecond to the instance (using timestamp). * @method CarbonInterface subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMillisecond() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method CarbonInterface addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCSecond() Add one second to the instance (using timestamp). * @method CarbonInterface subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCSecond() Sub one second to the instance (using timestamp). * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. * @method CarbonInterface addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMinute() Add one minute to the instance (using timestamp). * @method CarbonInterface subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMinute() Sub one minute to the instance (using timestamp). * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. * @method CarbonInterface addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCHour() Add one hour to the instance (using timestamp). * @method CarbonInterface subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCHour() Sub one hour to the instance (using timestamp). * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. * @method CarbonInterface addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCDay() Add one day to the instance (using timestamp). * @method CarbonInterface subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCDay() Sub one day to the instance (using timestamp). * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. * @method CarbonInterface addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCWeek() Add one week to the instance (using timestamp). * @method CarbonInterface subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCWeek() Sub one week to the instance (using timestamp). * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. * @method CarbonInterface addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMonth() Add one month to the instance (using timestamp). * @method CarbonInterface subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMonth() Sub one month to the instance (using timestamp). * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. * @method CarbonInterface addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCQuarter() Add one quarter to the instance (using timestamp). * @method CarbonInterface subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCQuarter() Sub one quarter to the instance (using timestamp). * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. * @method CarbonInterface addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCYear() Add one year to the instance (using timestamp). * @method CarbonInterface subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCYear() Sub one year to the instance (using timestamp). * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. * @method CarbonInterface addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCDecade() Add one decade to the instance (using timestamp). * @method CarbonInterface subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCDecade() Sub one decade to the instance (using timestamp). * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. * @method CarbonInterface addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCCentury() Add one century to the instance (using timestamp). * @method CarbonInterface subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCCentury() Sub one century to the instance (using timestamp). * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. * @method CarbonInterface addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMillennium() Add one millennium to the instance (using timestamp). * @method CarbonInterface subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMillennium() Sub one millennium to the instance (using timestamp). * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. * @method CarbonInterface roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method CarbonInterface roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method CarbonInterface floorYear(float $precision = 1) Truncate the current instance year with given precision. * @method CarbonInterface floorYears(float $precision = 1) Truncate the current instance year with given precision. * @method CarbonInterface ceilYear(float $precision = 1) Ceil the current instance year with given precision. * @method CarbonInterface ceilYears(float $precision = 1) Ceil the current instance year with given precision. * @method CarbonInterface roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method CarbonInterface roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method CarbonInterface floorMonth(float $precision = 1) Truncate the current instance month with given precision. * @method CarbonInterface floorMonths(float $precision = 1) Truncate the current instance month with given precision. * @method CarbonInterface ceilMonth(float $precision = 1) Ceil the current instance month with given precision. * @method CarbonInterface ceilMonths(float $precision = 1) Ceil the current instance month with given precision. * @method CarbonInterface roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method CarbonInterface roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method CarbonInterface floorDay(float $precision = 1) Truncate the current instance day with given precision. * @method CarbonInterface floorDays(float $precision = 1) Truncate the current instance day with given precision. * @method CarbonInterface ceilDay(float $precision = 1) Ceil the current instance day with given precision. * @method CarbonInterface ceilDays(float $precision = 1) Ceil the current instance day with given precision. * @method CarbonInterface roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method CarbonInterface roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method CarbonInterface floorHour(float $precision = 1) Truncate the current instance hour with given precision. * @method CarbonInterface floorHours(float $precision = 1) Truncate the current instance hour with given precision. * @method CarbonInterface ceilHour(float $precision = 1) Ceil the current instance hour with given precision. * @method CarbonInterface ceilHours(float $precision = 1) Ceil the current instance hour with given precision. * @method CarbonInterface roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method CarbonInterface roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method CarbonInterface floorMinute(float $precision = 1) Truncate the current instance minute with given precision. * @method CarbonInterface floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. * @method CarbonInterface ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. * @method CarbonInterface ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. * @method CarbonInterface roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method CarbonInterface roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method CarbonInterface floorSecond(float $precision = 1) Truncate the current instance second with given precision. * @method CarbonInterface floorSeconds(float $precision = 1) Truncate the current instance second with given precision. * @method CarbonInterface ceilSecond(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonInterface ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonInterface roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonInterface roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonInterface floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonInterface floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonInterface ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonInterface ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonInterface roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonInterface roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonInterface floorCentury(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonInterface floorCenturies(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonInterface ceilCentury(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonInterface ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonInterface roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonInterface roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonInterface floorDecade(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonInterface floorDecades(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonInterface ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonInterface ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonInterface roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonInterface roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonInterface floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonInterface floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonInterface ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonInterface ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonInterface roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonInterface roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonInterface floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonInterface floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonInterface ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonInterface ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonInterface roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonInterface roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonInterface floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonInterface floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonInterface ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method CarbonInterface ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value * @method int daysInCentury() Return the number of days contained in the current century * @method int daysInDecade() Return the number of days contained in the current decade * @method int daysInMillennium() Return the number of days contained in the current millennium * @method int daysInMonth() Return the number of days contained in the current month * @method int daysInQuarter() Return the number of days contained in the current quarter * @method int daysInWeek() Return the number of days contained in the current week * @method int daysInYear() Return the number of days contained in the current year * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value * @method int decadesInCentury() Return the number of decades contained in the current century * @method int decadesInMillennium() Return the number of decades contained in the current millennium * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value * @method int hoursInCentury() Return the number of hours contained in the current century * @method int hoursInDay() Return the number of hours contained in the current day * @method int hoursInDecade() Return the number of hours contained in the current decade * @method int hoursInMillennium() Return the number of hours contained in the current millennium * @method int hoursInMonth() Return the number of hours contained in the current month * @method int hoursInQuarter() Return the number of hours contained in the current quarter * @method int hoursInWeek() Return the number of hours contained in the current week * @method int hoursInYear() Return the number of hours contained in the current year * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value * @method int microsecondsInCentury() Return the number of microseconds contained in the current century * @method int microsecondsInDay() Return the number of microseconds contained in the current day * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade * @method int microsecondsInHour() Return the number of microseconds contained in the current hour * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute * @method int microsecondsInMonth() Return the number of microseconds contained in the current month * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter * @method int microsecondsInSecond() Return the number of microseconds contained in the current second * @method int microsecondsInWeek() Return the number of microseconds contained in the current week * @method int microsecondsInYear() Return the number of microseconds contained in the current year * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century * @method int millisecondsInDay() Return the number of milliseconds contained in the current day * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week * @method int millisecondsInYear() Return the number of milliseconds contained in the current year * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value * @method int minutesInCentury() Return the number of minutes contained in the current century * @method int minutesInDay() Return the number of minutes contained in the current day * @method int minutesInDecade() Return the number of minutes contained in the current decade * @method int minutesInHour() Return the number of minutes contained in the current hour * @method int minutesInMillennium() Return the number of minutes contained in the current millennium * @method int minutesInMonth() Return the number of minutes contained in the current month * @method int minutesInQuarter() Return the number of minutes contained in the current quarter * @method int minutesInWeek() Return the number of minutes contained in the current week * @method int minutesInYear() Return the number of minutes contained in the current year * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value * @method int monthsInCentury() Return the number of months contained in the current century * @method int monthsInDecade() Return the number of months contained in the current decade * @method int monthsInMillennium() Return the number of months contained in the current millennium * @method int monthsInQuarter() Return the number of months contained in the current quarter * @method int monthsInYear() Return the number of months contained in the current year * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value * @method int quartersInCentury() Return the number of quarters contained in the current century * @method int quartersInDecade() Return the number of quarters contained in the current decade * @method int quartersInMillennium() Return the number of quarters contained in the current millennium * @method int quartersInYear() Return the number of quarters contained in the current year * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value * @method int secondsInCentury() Return the number of seconds contained in the current century * @method int secondsInDay() Return the number of seconds contained in the current day * @method int secondsInDecade() Return the number of seconds contained in the current decade * @method int secondsInHour() Return the number of seconds contained in the current hour * @method int secondsInMillennium() Return the number of seconds contained in the current millennium * @method int secondsInMinute() Return the number of seconds contained in the current minute * @method int secondsInMonth() Return the number of seconds contained in the current month * @method int secondsInQuarter() Return the number of seconds contained in the current quarter * @method int secondsInWeek() Return the number of seconds contained in the current week * @method int secondsInYear() Return the number of seconds contained in the current year * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value * @method int weeksInCentury() Return the number of weeks contained in the current century * @method int weeksInDecade() Return the number of weeks contained in the current decade * @method int weeksInMillennium() Return the number of weeks contained in the current millennium * @method int weeksInMonth() Return the number of weeks contained in the current month * @method int weeksInQuarter() Return the number of weeks contained in the current quarter * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value * @method int yearsInCentury() Return the number of years contained in the current century * @method int yearsInDecade() Return the number of years contained in the current decade * @method int yearsInMillennium() Return the number of years contained in the current millennium * * * * @codeCoverageIgnore */ interface CarbonInterface extends DateTimeInterface, JsonSerializable, DiffOptions, Format, TranslationOptions, UnitValue { // /** * Dynamically handle calls to the class. * * @param string $method magic method name called * @param array $parameters parameters list * * @throws UnknownMethodException|BadMethodCallException|ReflectionException|Throwable */ public function __call(string $method, array $parameters): mixed; /** * Dynamically handle calls to the class. * * @param string $method magic method name called * @param array $parameters parameters list * * @throws BadMethodCallException */ public static function __callStatic(string $method, array $parameters): mixed; /** * Update constructedObjectId on cloned. */ public function __clone(): void; /** * Create a new Carbon instance. * * Please see the testing aids section (specifically static::setTestNow()) * for more on the possibility of this constructor returning a test instance. * * @throws InvalidFormatException */ public function __construct(DateTimeInterface|WeekDay|Month|string|int|float|null $time = null, DateTimeZone|string|int|null $timezone = null); /** * Show truthy properties on var_dump(). */ public function __debugInfo(): array; /** * Get a part of the Carbon object. * * @throws UnknownGetterException * * @return string|int|bool|DateTimeZone|null */ public function __get(string $name): mixed; /** * Check if an attribute exists on the object * * @param string $name * * @return bool */ public function __isset($name); /** * Set a part of the Carbon object * * @param string $name * @param string|int|DateTimeZone $value * * @throws UnknownSetterException|ReflectionException * * @return void */ public function __set($name, $value); /** * The __set_state handler. * * @param string|array $dump * * @return static */ #[ReturnTypeWillChange] public static function __set_state($dump): static; /** * Format the instance as a string using the set format * * @example * ``` * echo Carbon::now(); // Carbon instances can be cast to string * ``` */ public function __toString(); /** * Add given units or interval to the current instance. * * @example $date->add('hour', 3) * @example $date->add(15, 'days') * @example $date->add(CarbonInterval::days(4)) * * @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit * @param Unit|int|float|string $value * @param bool|null $overflow * * @return static */ #[ReturnTypeWillChange] public function add($unit, $value = 1, ?bool $overflow = null): static; /** * @deprecated Prefer to use add addUTCUnit() which more accurately defines what it's doing. * * Add seconds to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param string $unit * @param int|float|null $value * * @return static */ public function addRealUnit(string $unit, $value = 1): static; /** * Add seconds to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param string $unit * @param int|float|null $value * * @return static */ public function addUTCUnit(string $unit, $value = 1): static; /** * Add given units to the current instance. */ public function addUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static; /** * Add any unit to a new value without overflowing current other unit given. * * @param string $valueUnit unit name to modify * @param int $value amount to add to the input unit * @param string $overflowUnit unit name to not overflow */ public function addUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static; /** * Get the difference in a human readable format in the current locale from an other * instance given to now * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single part) * @param int $options human diff options * * @return string */ public function ago($syntax = null, $short = false, $parts = 1, $options = null); /** * Modify the current instance to the average of a given instance (default now) and the current instance * (second-precision). * * @param \Carbon\Carbon|\DateTimeInterface|null $date * * @return static */ public function average($date = null); /** * Clone the current instance if it's mutable. * * This method is convenient to ensure you don't mutate the initial object * but avoid to make a useless copy of it if it's already immutable. * * @return static */ public function avoidMutation(): static; /** * Determines if the instance is between two others. * * The third argument allow you to specify if bounds are included or not (true by default) * but for when you including/excluding bounds may produce different results in your application, * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. * * @example * ``` * Carbon::parse('2018-07-25')->between('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->between('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01'); // true * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01', false); // false * ``` * * @param bool $equal Indicates if an equal to comparison should be done */ public function between(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool; /** * Determines if the instance is between two others, bounds excluded. * * @example * ``` * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->betweenExcluded('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-25', '2018-08-01'); // false * ``` */ public function betweenExcluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool; /** * Determines if the instance is between two others, bounds included. * * @example * ``` * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->betweenIncluded('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-25', '2018-08-01'); // true * ``` */ public function betweenIncluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool; /** * Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, * or a calendar date (e.g. "10/29/2017") otherwise. * * Language, date and time formats will change according to the current locale. * * @param Carbon|\DateTimeInterface|string|null $referenceTime * @param array $formats * * @return string */ public function calendar($referenceTime = null, array $formats = []); /** * Checks if the (date)time string is in a given format and valid to create a * new instance. * * @example * ``` * Carbon::canBeCreatedFromFormat('11:12:45', 'h:i:s'); // true * Carbon::canBeCreatedFromFormat('13:12:45', 'h:i:s'); // false * ``` */ public static function canBeCreatedFromFormat(?string $date, string $format): bool; /** * Return the Carbon instance passed through, a now instance in the same timezone * if null given or parse the input if string given. * * @param Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|DateTimeInterface|string|null $date * * @return static */ public function carbonize($date = null); /** * Cast the current instance into the given class. * * @template T * * @param class-string $className The $className::instance() method will be called to cast the current object. * * @return T */ public function cast(string $className): mixed; /** * Ceil the current instance second with given precision if specified. */ public function ceil(DateInterval|string|int|float $precision = 1): static; /** * Ceil the current instance at the given unit with given precision if specified. */ public function ceilUnit(string $unit, DateInterval|string|int|float $precision = 1): static; /** * Ceil the current instance week. * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week */ public function ceilWeek(WeekDay|int|null $weekStartsAt = null): static; /** * Similar to native modify() method of DateTime but can handle more grammars. * * @example * ``` * echo Carbon::now()->change('next 2pm'); * ``` * * @link https://php.net/manual/en/datetime.modify.php * * @param string $modifier * * @return static */ public function change($modifier); /** * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. * foreach ($date as $_) {} * serializer($date) * var_export($date) * get_object_vars($date) */ public function cleanupDumpProperties(); /** * @alias copy * * Get a copy of the instance. * * @return static */ public function clone(); /** * Get the closest date from the instance (second-precision). * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * * @return static */ public function closest($date1, $date2); /** * Get a copy of the instance. * * @return static */ public function copy(); /** * Create a new Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values will * be used. * * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * * If $hour is not null then the default values for $minute and $second * will be 0. * * @param DateTimeInterface|string|int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null): ?static; /** * Create a Carbon instance from just a date. The time portion is set to now. * * @param int|null $year * @param int|null $month * @param int|null $day * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createFromDate($year = null, $month = null, $day = null, $timezone = null); /** * Create a Carbon instance from a specific format. * * @param string $format Datetime format * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ #[ReturnTypeWillChange] public static function createFromFormat($format, $time, $timezone = null): ?static; /** * Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). * * @param string $format Datetime format * @param string $time * @param DateTimeZone|string|int|null $timezone optional timezone * @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use) * @param TranslatorInterface|null $translator optional custom translator to use for macro-formats * * @throws InvalidFormatException * * @return static|null */ public static function createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null): ?static; /** * Create a Carbon instance from a specific format and a string in a given language. * * @param string $format Datetime format * @param string $locale * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null): ?static; /** * Create a Carbon instance from a specific ISO format and a string in a given language. * * @param string $format Datetime ISO format * @param string $locale * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null): ?static; /** * Create a Carbon instance from just a time. The date portion is set to today. * * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null): static; /** * Create a Carbon instance from a time string. The date portion is set to today. * * @throws InvalidFormatException */ public static function createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null): static; /** * Create a Carbon instance from a timestamp and set the timezone (UTC by default). * * Timestamp input can be given as int, float or a string containing one or more numbers. */ #[ReturnTypeWillChange] public static function createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null): static; /** * Create a Carbon instance from a timestamp in milliseconds. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public static function createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null): static; /** * Create a Carbon instance from a timestamp in milliseconds. * * Timestamp input can be given as int, float or a string containing one or more numbers. * * @param float|int|string $timestamp * * @return static */ public static function createFromTimestampMsUTC($timestamp): static; /** * Create a Carbon instance from a timestamp keeping the timezone to UTC. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public static function createFromTimestampUTC(string|int|float $timestamp): static; /** * Create a Carbon instance from just a date. The time portion is set to midnight. * * @param int|null $year * @param int|null $month * @param int|null $day * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createMidnightDate($year = null, $month = null, $day = null, $timezone = null); /** * Create a new safe Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values will * be used. * * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * * If $hour is not null then the default values for $minute and $second * will be 0. * * If one of the set values is not valid, an InvalidDateException * will be thrown. * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidDateException * * @return static|null */ public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null): ?static; /** * Create a new Carbon instance from a specific date and time using strict validation. * * @see create() * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null): static; /** * Get/set the day of year. * * @template T of int|null * * @param int|null $value new value for day of year if using as setter. * * @psalm-param T $value * * @return static|int * * @psalm-return (T is int ? static : int) */ public function dayOfYear(?int $value = null): static|int; /** * Get the difference as a CarbonInterval instance. * Return relative interval (negative if $absolute flag is not set to true and the given date is before * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return CarbonInterval */ public function diffAsCarbonInterval($date = null, bool $absolute = false, array $skip = []): CarbonInterval; /** * Get the difference as a DateInterval instance. * Return relative interval (negative if $absolute flag is not set to true and the given date is before * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return DateInterval */ public function diffAsDateInterval($date = null, bool $absolute = false): DateInterval; /** * Get the difference by the given interval using a filter closure. * * @param CarbonInterval $ci An interval to traverse by * @param Closure $callback * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false): int; /** * Get the difference in a human readable format in the current locale from current instance to an other * instance given (or now if null given). * * @example * ``` * echo Carbon::tomorrow()->diffForHumans() . "\n"; * echo Carbon::tomorrow()->diffForHumans(['parts' => 2]) . "\n"; * echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n"; * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n"; * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n"; * ``` * * @param Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * ⦿ 'syntax' entry (see below) * ⦿ 'short' entry (see below) * ⦿ 'parts' entry (see below) * ⦿ 'options' entry (see below) * ⦿ 'skip' entry, list of units to skip (array of strings or a single string, * ` it can be the unit name (singular or plural) or its shortcut * ` (y, m, w, d, h, min, s, ms, µs). * ⦿ 'aUnit' entry, prefer "an hour" over "1 hour" if true * ⦿ 'altNumbers' entry, use alternative numbers if available * ` (from the current language if true is passed, from the given language(s) * ` if array or string is passed) * ⦿ 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * ⦿ 'other' entry (see above) * ⦿ 'minimumUnit' entry determines the smallest unit of time to display can be long or * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * ⦿ 'locale' language in which the diff should be output (has no effect if 'translator' key is set) * ⦿ 'translator' a custom translator to use to translator the output. * if int passed, it adds modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options */ public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null): string; /** * Get the difference in days. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInDays($date = null, bool $absolute = false, bool $utc = false): float; /** * Get the difference in days using a filter closure. * * @param Closure $callback * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInDaysFiltered(Closure $callback, $date = null, bool $absolute = false): int; /** * Get the difference in hours. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInHours($date = null, bool $absolute = false): float; /** * Get the difference in hours using a filter closure. * * @param Closure $callback * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInHoursFiltered(Closure $callback, $date = null, bool $absolute = false): int; /** * Get the difference in microseconds. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInMicroseconds($date = null, bool $absolute = false): float; /** * Get the difference in milliseconds. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInMilliseconds($date = null, bool $absolute = false): float; /** * Get the difference in minutes. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInMinutes($date = null, bool $absolute = false): float; /** * Get the difference in months. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInMonths($date = null, bool $absolute = false, bool $utc = false): float; /** * Get the difference in quarters. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInQuarters($date = null, bool $absolute = false, bool $utc = false): float; /** * Get the difference in seconds. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInSeconds($date = null, bool $absolute = false): float; /** * @param Unit|string $unit microsecond, millisecond, second, minute, * hour, day, week, month, quarter, year, * century, millennium * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInUnit(Unit|string $unit, $date = null, bool $absolute = false, bool $utc = false): float; /** * Get the difference in weekdays. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeekdays($date = null, bool $absolute = false): int; /** * Get the difference in weekend days using a filter. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeekendDays($date = null, bool $absolute = false): int; /** * Get the difference in weeks. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInWeeks($date = null, bool $absolute = false, bool $utc = false): float; /** * Get the difference in years * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInYears($date = null, bool $absolute = false, bool $utc = false): float; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings */ public static function disableHumanDiffOption(int $humanDiffOption): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings */ public static function enableHumanDiffOption(int $humanDiffOption): void; /** * Modify to end of current given unit. * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOf(Unit::Month) * ->endOf(Unit::Week, Carbon::FRIDAY); * ``` */ public function endOf(Unit|string $unit, mixed ...$params): static; /** * Resets the date to end of the century and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury(); * ``` * * @return static */ public function endOfCentury(); /** * Resets the time to 23:59:59.999999 end of day * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfDay(); * ``` * * @return static */ public function endOfDay(); /** * Resets the date to end of the decade and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade(); * ``` * * @return static */ public function endOfDecade(); /** * Modify to end of current hour, minutes and seconds become 59 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfHour(); * ``` */ public function endOfHour(): static; /** * Resets the date to end of the millennium and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium(); * ``` * * @return static */ public function endOfMillennium(); /** * Modify to end of current millisecond, microseconds such as 12345 become 123999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->endOfSecond() * ->format('H:i:s.u'); * ``` */ public function endOfMillisecond(): static; /** * Modify to end of current minute, seconds become 59 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute(); * ``` */ public function endOfMinute(): static; /** * Resets the date to end of the month and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth(); * ``` * * @return static */ public function endOfMonth(); /** * Resets the date to end of the quarter and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter(); * ``` * * @return static */ public function endOfQuarter(); /** * Modify to end of current second, microseconds become 999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->endOfSecond() * ->format('H:i:s.u'); * ``` */ public function endOfSecond(): static; /** * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n"; * ``` * * @param WeekDay|int|null $weekEndsAt optional end allow you to specify the day of week to use to end the week * * @return static */ public function endOfWeek(WeekDay|int|null $weekEndsAt = null): static; /** * Resets the date to end of the year and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfYear(); * ``` * * @return static */ public function endOfYear(); /** * Determines if the instance is equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->eq(Carbon::parse('2018-07-25 12:45:16')); // true * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:17'); // false * ``` * * @see equalTo() */ public function eq(DateTimeInterface|string $date): bool; /** * Determines if the instance is equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->equalTo(Carbon::parse('2018-07-25 12:45:16')); // true * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:17'); // false * ``` */ public function equalTo(DateTimeInterface|string $date): bool; /** * Set the current locale to the given, execute the passed function, reset the locale to previous one, * then return the result of the closure (or null if the closure was void). * * @param string $locale locale ex. en * @param callable $func * * @return mixed */ public static function executeWithLocale(string $locale, callable $func): mixed; /** * Get the farthest date from the instance (second-precision). * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * * @return static */ public function farthest($date1, $date2); /** * Modify to the first occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * first day of the current month. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function firstOfMonth($dayOfWeek = null); /** * Modify to the first occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * first day of the current quarter. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function firstOfQuarter($dayOfWeek = null); /** * Modify to the first occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * first day of the current year. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function firstOfYear($dayOfWeek = null); /** * Round the current instance second with given precision if specified. */ public function floor(DateInterval|string|int|float $precision = 1): static; /** * Truncate the current instance at the given unit with given precision if specified. */ public function floorUnit(string $unit, DateInterval|string|int|float $precision = 1): static; /** * Truncate the current instance week. * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week */ public function floorWeek(WeekDay|int|null $weekStartsAt = null): static; /** * @alias diffForHumans * * Get the difference in a human readable format in the current locale from current instance to an other * instance given (or now if null given). * * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null); /** * Get the difference in a human readable format in the current locale from current * instance to now. * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function fromNow($syntax = null, $short = false, $parts = 1, $options = null); /** * Create an instance from a serialized string. * * If $value is not from a trusted source, consider using the allowed_classes option to limit * the types of objects that can be built, for instance: * * @example * ```php * $object = Carbon::fromSerialized($value, ['allowed_classes' => [Carbon::class, CarbonImmutable::class]]); * ``` * * @param \Stringable|string $value * @param array $options example: ['allowed_classes' => [CarbonImmutable::class]] * * @throws InvalidFormatException * * @return static */ public static function fromSerialized($value, array $options = []): static; /** * Register a custom macro. * * @param callable $macro * @param int $priority marco with higher priority is tried first * * @return void */ public static function genericMacro(callable $macro, int $priority = 0): void; /** * Get a part of the Carbon object. * * @throws UnknownGetterException * * @return string|int|bool|DateTimeZone */ public function get(Unit|string $name): mixed; /** * Returns the alternative number for a given date property if available in the current locale. * * @param string $key date property */ public function getAltNumber(string $key): string; /** * Returns the list of internally available locales and already loaded custom locales. * (It will ignore custom translator dynamic loading.) * * @return array */ public static function getAvailableLocales(); /** * Returns list of Language object for each available locale. This object allow you to get the ISO name, native * name, region and variant of the locale. * * @return Language[] */ public static function getAvailableLocalesInfo(); /** * Returns list of calendar formats for ISO formatting. * * @param string|null $locale current locale used if null */ public function getCalendarFormats(?string $locale = null): array; public function getClock(): ?WrapperClock; /** * Get the days of the week. */ public static function getDays(): array; /** * Return the number of days since the start of the week (using the current locale or the first parameter * if explicitly given). * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, * if not provided, start of week is inferred from the locale * (Sunday for en_US, Monday for de_DE, etc.) */ public function getDaysFromStartOfWeek(WeekDay|int|null $weekStartsAt = null): int; /** * Get the fallback locale. * * @see https://symfony.com/doc/current/components/translation.html#fallback-locales */ public static function getFallbackLocale(): ?string; /** * List of replacements from date() format to isoFormat(). */ public static function getFormatsToIsoReplacements(): array; /** * Return default humanDiff() options (merged flags as integer). */ public static function getHumanDiffOptions(): int; /** * Returns list of locale formats for ISO formatting. * * @param string|null $locale current locale used if null */ public function getIsoFormats(?string $locale = null): array; /** * Returns list of locale units for ISO formatting. */ public static function getIsoUnits(): array; /** * {@inheritdoc} */ public static function getLastErrors(): array|false; /** * Get the raw callable macro registered globally or locally for a given name. */ public function getLocalMacro(string $name): ?callable; /** * Get the translator of the current instance or the default if none set. */ public function getLocalTranslator(): TranslatorInterface; /** * Get the current translator locale. * * @return string */ public static function getLocale(): string; /** * Get the raw callable macro registered globally for a given name. */ public static function getMacro(string $name): ?callable; /** * get midday/noon hour * * @return int */ public static function getMidDayAt(); /** * Returns the offset hour and minute formatted with +/- and a given separator (":" by default). * For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first * argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something * like "-12:00". * * @param string $separator string to place between hours and minutes (":" by default) */ public function getOffsetString(string $separator = ':'): string; /** * Returns a unit of the instance padded with 0 by default or any other string if specified. * * @param string $unit Carbon unit name * @param int $length Length of the output (2 by default) * @param string $padString String to use for padding ("0" by default) * @param int $padType Side(s) to pad (STR_PAD_LEFT by default) */ public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = 0): string; /** * Returns a timestamp rounded with the given precision (6 by default). * * @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision) * @example getPreciseTimestamp(6) 1532087464437474 * @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision) * @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision) * @example getPreciseTimestamp(3) 1532087464437 (millisecond precision) * @example getPreciseTimestamp(2) 153208746444 (1/100 second precision) * @example getPreciseTimestamp(1) 15320874644 (1/10 second precision) * @example getPreciseTimestamp(0) 1532087464 (second precision) * @example getPreciseTimestamp(-1) 153208746 (10 second precision) * @example getPreciseTimestamp(-2) 15320875 (100 second precision) * * @param int $precision * * @return float */ public function getPreciseTimestamp($precision = 6): float; /** * Returns current local settings. */ public function getSettings(): array; /** * Get the Carbon instance (real or mock) to be returned when a "now" * instance is created. * * @return Closure|self|null the current instance used for testing */ public static function getTestNow(): Closure|self|null; /** * Return a format from H:i to H:i:s.u according to given unit precision. * * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" */ public static function getTimeFormatByPrecision(string $unitPrecision): string; /** * Returns the timestamp with millisecond precision. * * @return int */ public function getTimestampMs(): int; /** * Get the translation of the current week day name (with context for languages with multiple forms). * * @param string|null $context whole format string * @param string $keySuffix "", "_short" or "_min" * @param string|null $defaultValue default value if translation missing */ public function getTranslatedDayName(?string $context = null, string $keySuffix = '', ?string $defaultValue = null): string; /** * Get the translation of the current abbreviated week day name (with context for languages with multiple forms). * * @param string|null $context whole format string */ public function getTranslatedMinDayName(?string $context = null): string; /** * Get the translation of the current month day name (with context for languages with multiple forms). * * @param string|null $context whole format string * @param string $keySuffix "" or "_short" * @param string|null $defaultValue default value if translation missing */ public function getTranslatedMonthName(?string $context = null, string $keySuffix = '', ?string $defaultValue = null): string; /** * Get the translation of the current short week day name (with context for languages with multiple forms). * * @param string|null $context whole format string */ public function getTranslatedShortDayName(?string $context = null): string; /** * Get the translation of the current short month day name (with context for languages with multiple forms). * * @param string|null $context whole format string */ public function getTranslatedShortMonthName(?string $context = null): string; /** * Returns raw translation message for a given key. * * @param string $key key to find * @param string|null $locale current locale used if null * @param string|null $default default value if translation returns the key * @param TranslatorInterface $translator an optional translator to use * * @return string */ public function getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null); /** * Returns raw translation message for a given key. * * @param TranslatorInterface|null $translator the translator to use * @param string $key key to find * @param string|null $locale current locale used if null * @param string|null $default default value if translation returns the key * * @return string|Closure|null */ public static function getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null); /** * Initialize the default translator instance if necessary. */ public static function getTranslator(): TranslatorInterface; /** * Get the last day of week. * * @param string $locale local to consider the last day of week. * * @return int */ public static function getWeekEndsAt(?string $locale = null): int; /** * Get the first day of week. * * @return int */ public static function getWeekStartsAt(?string $locale = null): int; /** * Get weekend days */ public static function getWeekendDays(): array; /** * Determines if the instance is greater (after) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:17'); // false * ``` */ public function greaterThan(DateTimeInterface|string $date): bool; /** * Determines if the instance is greater (after) than or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:17'); // false * ``` */ public function greaterThanOrEqualTo(DateTimeInterface|string $date): bool; /** * Determines if the instance is greater (after) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:17'); // false * ``` * * @see greaterThan() */ public function gt(DateTimeInterface|string $date): bool; /** * Determines if the instance is greater (after) than or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:17'); // false * ``` * * @see greaterThanOrEqualTo() */ public function gte(DateTimeInterface|string $date): bool; /** * Checks if the (date)time string is in a given format. * * @example * ``` * Carbon::hasFormat('11:12:45', 'h:i:s'); // true * Carbon::hasFormat('13:12:45', 'h:i:s'); // false * ``` */ public static function hasFormat(string $date, string $format): bool; /** * Checks if the (date)time string is in a given format. * * @example * ``` * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false * ``` * * @param string $date * @param string $format * * @return bool */ public static function hasFormatWithModifiers(?string $date, string $format): bool; /** * Checks if macro is registered globally or locally. */ public function hasLocalMacro(string $name): bool; /** * Return true if the current instance has its own translator. */ public function hasLocalTranslator(): bool; /** * Checks if macro is registered globally. * * @param string $name * * @return bool */ public static function hasMacro(string $name): bool; /** * Determine if a time string will produce a relative date. * * @return bool true if time match a relative date, false if absolute or invalid time string */ public static function hasRelativeKeywords(?string $time): bool; /** * Determine if there is a valid test instance set. A valid test instance * is anything that is not null. * * @return bool true if there is a test instance, otherwise false */ public static function hasTestNow(): bool; /** * Create a Carbon instance from a DateTime one. */ public static function instance(DateTimeInterface $date): static; /** * Returns true if the current date matches the given string. * * @example * ``` * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false * ``` * * @param string $tester day name, month name, hour, date, etc. as string */ public function is(WeekDay|Month|string $tester): bool; /** * Determines if the instance is greater (after) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:17'); // false * ``` * * @see greaterThan() */ public function isAfter(DateTimeInterface|string $date): bool; /** * Determines if the instance is less (before) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:17'); // true * ``` * * @see lessThan() */ public function isBefore(DateTimeInterface|string $date): bool; /** * Determines if the instance is between two others * * @example * ``` * Carbon::parse('2018-07-25')->isBetween('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->isBetween('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01'); // true * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01', false); // false * ``` * * @param bool $equal Indicates if an equal to comparison should be done */ public function isBetween(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool; /** * Check if its the birthday. Compares the date/month values of the two dates. * * @example * ``` * Carbon::now()->subYears(5)->isBirthday(); // true * Carbon::now()->subYears(5)->subDay()->isBirthday(); // false * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false * ``` * * @param DateTimeInterface|string|null $date The instance to compare with or null to use current day. * * @return bool */ public function isBirthday(DateTimeInterface|string|null $date = null): bool; /** * Determines if the instance is in the current unit given. * * @example * ``` * Carbon::now()->isCurrentUnit('hour'); // true * Carbon::now()->subHours(2)->isCurrentUnit('hour'); // false * ``` * * @param string $unit The unit to test. * * @throws BadMethodCallException */ public function isCurrentUnit(string $unit): bool; /** * Checks if this day is a specific day of the week. * * @example * ``` * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::WEDNESDAY); // true * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::FRIDAY); // false * Carbon::parse('2019-07-17')->isDayOfWeek('Wednesday'); // true * Carbon::parse('2019-07-17')->isDayOfWeek('Friday'); // false * ``` * * @param int|string $dayOfWeek * * @return bool */ public function isDayOfWeek($dayOfWeek): bool; /** * Determines if the instance is end of century (last day by default but interval can be customized). */ public function isEndOfCentury(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Check if the instance is end of day. * * @example * ``` * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(); // true * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(); // true * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(); // true * Carbon::parse('2019-02-28 23:59:58.999999')->isEndOfDay(); // false * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(true); // true * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(true); // false * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(true); // false * ``` * * @param bool $checkMicroseconds check time at microseconds precision * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision * for instance with "15 minutes", it checks if current date-time * is in the last 15 minutes of the day, with Unit::Hour, it * checks if it's in the last hour of the day. */ public function isEndOfDay(Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of decade (last day by default but interval can be customized). */ public function isEndOfDecade(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of hour (last microsecond by default but interval can be customized). */ public function isEndOfHour(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of millennium (last day by default but interval can be customized). */ public function isEndOfMillennium(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of millisecond (last microsecond by default but interval can be customized). */ public function isEndOfMillisecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of minute (last microsecond by default but interval can be customized). */ public function isEndOfMinute(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of month (last day by default but interval can be customized). */ public function isEndOfMonth(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of quarter (last day by default but interval can be customized). */ public function isEndOfQuarter(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is end of second (last microsecond by default but interval can be customized). */ public function isEndOfSecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Returns true if the date was created using CarbonImmutable::endOfTime() * * @return bool */ public function isEndOfTime(): bool; /** * Check if the instance is end of a given unit (tolerating a given interval). * * @example * ``` * // Check if a date-time is the last 15 minutes of the hour it's in * Carbon::parse('2019-02-28 20:13:00')->isEndOfUnit(Unit::Hour, '15 minutes'); // false * ``` */ public function isEndOfUnit(Unit $unit, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, mixed ...$params): bool; /** * Determines if the instance is end of week (last day by default but interval can be customized). * * @example * ``` * Carbon::parse('2024-08-31')->endOfWeek()->isEndOfWeek(); // true * Carbon::parse('2024-08-31')->isEndOfWeek(); // false * ``` */ public function isEndOfWeek(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, WeekDay|int|null $weekEndsAt = null): bool; /** * Determines if the instance is end of year (last day by default but interval can be customized). */ public function isEndOfYear(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is in the future, ie. greater (after) than now. * * @example * ``` * Carbon::now()->addHours(5)->isFuture(); // true * Carbon::now()->subHours(5)->isFuture(); // false * ``` */ public function isFuture(): bool; /** * Returns true if the current class/instance is immutable. */ public static function isImmutable(): bool; /** * Check if today is the last day of the Month * * @example * ``` * Carbon::parse('2019-02-28')->isLastOfMonth(); // true * Carbon::parse('2019-03-28')->isLastOfMonth(); // false * Carbon::parse('2019-03-30')->isLastOfMonth(); // false * Carbon::parse('2019-03-31')->isLastOfMonth(); // true * Carbon::parse('2019-04-30')->isLastOfMonth(); // true * ``` */ public function isLastOfMonth(): bool; /** * Determines if the instance is a leap year. * * @example * ``` * Carbon::parse('2020-01-01')->isLeapYear(); // true * Carbon::parse('2019-01-01')->isLeapYear(); // false * ``` */ public function isLeapYear(): bool; /** * Determines if the instance is a long year (using ISO 8601 year). * * @example * ``` * Carbon::parse('2015-01-01')->isLongIsoYear(); // true * Carbon::parse('2016-01-01')->isLongIsoYear(); // true * Carbon::parse('2016-01-03')->isLongIsoYear(); // false * Carbon::parse('2019-12-29')->isLongIsoYear(); // false * Carbon::parse('2019-12-30')->isLongIsoYear(); // true * ``` * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates */ public function isLongIsoYear(): bool; /** * Determines if the instance is a long year (using calendar year). * * ⚠️ This method completely ignores month and day to use the numeric year number, * it's not correct if the exact date matters. For instance as `2019-12-30` is already * in the first week of the 2020 year, if you want to know from this date if ISO week * year 2020 is a long year, use `isLongIsoYear` instead. * * @example * ``` * Carbon::create(2015)->isLongYear(); // true * Carbon::create(2016)->isLongYear(); // false * ``` * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates */ public function isLongYear(): bool; /** * Check if the instance is midday. * * @example * ``` * Carbon::parse('2019-02-28 11:59:59.999999')->isMidday(); // false * Carbon::parse('2019-02-28 12:00:00')->isMidday(); // true * Carbon::parse('2019-02-28 12:00:00.999999')->isMidday(); // true * Carbon::parse('2019-02-28 12:00:01')->isMidday(); // false * ``` */ public function isMidday(): bool; /** * Check if the instance is start of day / midnight. * * @example * ``` * Carbon::parse('2019-02-28 00:00:00')->isMidnight(); // true * Carbon::parse('2019-02-28 00:00:00.999999')->isMidnight(); // true * Carbon::parse('2019-02-28 00:00:01')->isMidnight(); // false * ``` */ public function isMidnight(): bool; /** * Returns true if a property can be changed via setter. * * @param string $unit * * @return bool */ public static function isModifiableUnit($unit): bool; /** * Returns true if the current class/instance is mutable. */ public static function isMutable(): bool; /** * Determines if the instance is now or in the future, ie. greater (after) than or equal to now. * * @example * ``` * Carbon::now()->isNowOrFuture(); // true * Carbon::now()->addHours(5)->isNowOrFuture(); // true * Carbon::now()->subHours(5)->isNowOrFuture(); // false * ``` */ public function isNowOrFuture(): bool; /** * Determines if the instance is now or in the past, ie. less (before) than or equal to now. * * @example * ``` * Carbon::now()->isNowOrPast(); // true * Carbon::now()->subHours(5)->isNowOrPast(); // true * Carbon::now()->addHours(5)->isNowOrPast(); // false * ``` */ public function isNowOrPast(): bool; /** * Determines if the instance is in the past, ie. less (before) than now. * * @example * ``` * Carbon::now()->subHours(5)->isPast(); // true * Carbon::now()->addHours(5)->isPast(); // false * ``` */ public function isPast(): bool; /** * Compares the formatted values of the two dates. * * @example * ``` * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false * ``` * * @param string $format date formats to compare. * @param DateTimeInterface|string $date instance to compare with or null to use current day. */ public function isSameAs(string $format, DateTimeInterface|string $date): bool; /** * Checks if the passed in date is in the same month as the instance´s month. * * @example * ``` * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-01-01')); // true * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-02-01')); // false * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true * ``` * * @param DateTimeInterface|string $date The instance to compare with or null to use the current date. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameMonth(DateTimeInterface|string $date, bool $ofSameYear = true): bool; /** * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). * * @example * ``` * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-03-01')); // true * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-04-01')); // false * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01')); // false * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01'), false); // true * ``` * * @param DateTimeInterface|string $date The instance to compare with or null to use current day. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameQuarter(DateTimeInterface|string $date, bool $ofSameYear = true): bool; /** * Determines if the instance is in the current unit given. * * @example * ``` * Carbon::parse('2019-01-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // true * Carbon::parse('2018-12-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // false * ``` * * @param string $unit singular unit string * @param DateTimeInterface|string $date instance to compare with or null to use current day. * * @throws BadComparisonUnitException * * @return bool */ public function isSameUnit(string $unit, DateTimeInterface|string $date): bool; /** * Determines if the instance is start of century (first day by default but interval can be customized). */ public function isStartOfCentury(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Check if the instance is start of day / midnight. * * @example * ``` * Carbon::parse('2019-02-28 00:00:00')->isStartOfDay(); // true * Carbon::parse('2019-02-28 00:00:00.999999')->isStartOfDay(); // true * Carbon::parse('2019-02-28 00:00:01')->isStartOfDay(); // false * Carbon::parse('2019-02-28 00:00:00.000000')->isStartOfDay(true); // true * Carbon::parse('2019-02-28 00:00:00.000012')->isStartOfDay(true); // false * ``` * * @param bool $checkMicroseconds check time at microseconds precision * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision * for instance with "15 minutes", it checks if current date-time * is in the last 15 minutes of the day, with Unit::Hour, it * checks if it's in the last hour of the day. */ public function isStartOfDay(Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of decade (first day by default but interval can be customized). */ public function isStartOfDecade(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of hour (first microsecond by default but interval can be customized). */ public function isStartOfHour(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of millennium (first day by default but interval can be customized). */ public function isStartOfMillennium(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of millisecond (first microsecond by default but interval can be customized). */ public function isStartOfMillisecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of minute (first microsecond by default but interval can be customized). */ public function isStartOfMinute(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of month (first day by default but interval can be customized). */ public function isStartOfMonth(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of quarter (first day by default but interval can be customized). */ public function isStartOfQuarter(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Determines if the instance is start of second (first microsecond by default but interval can be customized). */ public function isStartOfSecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Returns true if the date was created using CarbonImmutable::startOfTime() * * @return bool */ public function isStartOfTime(): bool; /** * Check if the instance is start of a given unit (tolerating a given interval). * * @example * ``` * // Check if a date-time is the first 15 minutes of the hour it's in * Carbon::parse('2019-02-28 20:13:00')->isStartOfUnit(Unit::Hour, '15 minutes'); // true * ``` */ public function isStartOfUnit(Unit $unit, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, mixed ...$params): bool; /** * Determines if the instance is start of week (first day by default but interval can be customized). * * @example * ``` * Carbon::parse('2024-08-31')->startOfWeek()->isStartOfWeek(); // true * Carbon::parse('2024-08-31')->isStartOfWeek(); // false * ``` */ public function isStartOfWeek(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, WeekDay|int|null $weekStartsAt = null): bool; /** * Determines if the instance is start of year (first day by default but interval can be customized). */ public function isStartOfYear(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; /** * Returns true if the strict mode is globally in use, false else. * (It can be overridden in specific instances.) * * @return bool */ public static function isStrictModeEnabled(): bool; /** * Determines if the instance is today. * * @example * ``` * Carbon::today()->isToday(); // true * Carbon::tomorrow()->isToday(); // false * ``` */ public function isToday(): bool; /** * Determines if the instance is tomorrow. * * @example * ``` * Carbon::tomorrow()->isTomorrow(); // true * Carbon::yesterday()->isTomorrow(); // false * ``` */ public function isTomorrow(): bool; /** * Determines if the instance is a weekday. * * @example * ``` * Carbon::parse('2019-07-14')->isWeekday(); // false * Carbon::parse('2019-07-15')->isWeekday(); // true * ``` */ public function isWeekday(): bool; /** * Determines if the instance is a weekend day. * * @example * ``` * Carbon::parse('2019-07-14')->isWeekend(); // true * Carbon::parse('2019-07-15')->isWeekend(); // false * ``` */ public function isWeekend(): bool; /** * Determines if the instance is yesterday. * * @example * ``` * Carbon::yesterday()->isYesterday(); // true * Carbon::tomorrow()->isYesterday(); // false * ``` */ public function isYesterday(): bool; /** * Format in the current language using ISO replacement patterns. * * @param string|null $originalFormat provide context if a chunk has been passed alone */ public function isoFormat(string $format, ?string $originalFormat = null): string; /** * Get/set the week number using given first day of week and first * day of year included in the first week. Or use ISO format if no settings * given. * * @param int|null $week * @param int|null $dayOfWeek * @param int|null $dayOfYear * * @return int|static */ public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null); /** * Set/get the week number of year using given first day of week and first * day of year included in the first week. Or use ISO format if no settings * given. * * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int|static */ public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null); /** * Get/set the ISO weekday from 1 (Monday) to 7 (Sunday). * * @param WeekDay|int|null $value new value for weekday if using as setter. */ public function isoWeekday(WeekDay|int|null $value = null): static|int; /** * Get the number of weeks of the current week-year using given first day of week and first * day of year included in the first week. Or use ISO format if no settings * given. * * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int */ public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null); /** * Prepare the object for JSON serialization. */ public function jsonSerialize(): mixed; /** * Modify to the last occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * last day of the current month. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function lastOfMonth($dayOfWeek = null); /** * Modify to the last occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * last day of the current quarter. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function lastOfQuarter($dayOfWeek = null); /** * Modify to the last occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * last day of the current year. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function lastOfYear($dayOfWeek = null); /** * Determines if the instance is less (before) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:17'); // true * ``` */ public function lessThan(DateTimeInterface|string $date): bool; /** * Determines if the instance is less (before) or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:17'); // true * ``` */ public function lessThanOrEqualTo(DateTimeInterface|string $date): bool; /** * Get/set the locale for the current instance. * * @param string|null $locale * @param string ...$fallbackLocales * * @return $this|string */ public function locale(?string $locale = null, string ...$fallbackLocales): static|string; /** * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). * Support is considered enabled if the 3 words are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffOneDayWords(string $locale): bool; /** * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). * Support is considered enabled if the 4 sentences are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffSyntax(string $locale): bool; /** * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). * Support is considered enabled if the 2 words are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffTwoDayWords(string $locale): bool; /** * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). * Support is considered enabled if the 4 sentences are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasPeriodSyntax($locale); /** * Returns true if the given locale is internally supported and has short-units support. * Support is considered enabled if either year, day or hour has a short variant translated. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasShortUnits(string $locale): bool; /** * Determines if the instance is less (before) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:17'); // true * ``` * * @see lessThan() */ public function lt(DateTimeInterface|string $date): bool; /** * Determines if the instance is less (before) or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:17'); // true * ``` * * @see lessThanOrEqualTo() */ public function lte(DateTimeInterface|string $date): bool; /** * Register a custom macro. * * Pass null macro to remove it. * * @example * ``` * $userSettings = [ * 'locale' => 'pt', * 'timezone' => 'America/Sao_Paulo', * ]; * Carbon::macro('userFormat', function () use ($userSettings) { * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); * }); * echo Carbon::yesterday()->hours(11)->userFormat(); * ``` * * @param-closure-this static $macro */ public static function macro(string $name, ?callable $macro): void; /** * Make a Carbon instance from given variable if possible. * * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals * and recurrences). Throw an exception for invalid format, but otherwise return null. * * @param mixed $var * * @throws InvalidFormatException * * @return static|null */ public static function make($var, DateTimeZone|string|null $timezone = null): ?static; /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return static */ public function max($date = null); /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see max() * * @return static */ public function maximum($date = null); /** * Return the meridiem of the current time in the current locale. * * @param bool $isLower if true, returns lowercase variant if available in the current locale. */ public function meridiem(bool $isLower = false): string; /** * Modify to midday, default to self::$midDayAt * * @return static */ public function midDay(); /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return static */ public function min($date = null); /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see min() * * @return static */ public function minimum($date = null); /** * Mix another object into the class. * * @example * ``` * Carbon::mixin(new class { * public function addMoon() { * return function () { * return $this->addDays(30); * }; * } * public function subMoon() { * return function () { * return $this->subDays(30); * }; * } * }); * $fullMoon = Carbon::create('2018-12-22'); * $nextFullMoon = $fullMoon->addMoon(); * $blackMoon = Carbon::create('2019-01-06'); * $previousBlackMoon = $blackMoon->subMoon(); * echo "$nextFullMoon\n"; * echo "$previousBlackMoon\n"; * ``` * * @throws ReflectionException */ public static function mixin(object|string $mixin): void; /** * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php * * @return static */ #[ReturnTypeWillChange] public function modify($modify); /** * Determines if the instance is not equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->ne(Carbon::parse('2018-07-25 12:45:16')); // false * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:17'); // true * ``` * * @see notEqualTo() */ public function ne(DateTimeInterface|string $date): bool; /** * Modify to the next occurrence of a given modifier such as a day of * the week. If no modifier is provided, modify to the next occurrence * of the current day of the week. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param string|int|null $modifier * * @return static */ public function next($modifier = null); /** * Go forward to the next weekday. * * @return static */ public function nextWeekday(); /** * Go forward to the next weekend day. * * @return static */ public function nextWeekendDay(); /** * Determines if the instance is not equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->notEqualTo(Carbon::parse('2018-07-25 12:45:16')); // false * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:17'); // true * ``` */ public function notEqualTo(DateTimeInterface|string $date): bool; /** * Get a Carbon instance for the current date and time. */ public static function now(DateTimeZone|string|int|null $timezone = null): static; /** * Returns a present instance in the same timezone. * * @return static */ public function nowWithSameTz(): static; /** * Modify to the given occurrence of a given day of the week * in the current month. If the calculated occurrence is outside the scope * of the current month, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfMonth($nth, $dayOfWeek); /** * Modify to the given occurrence of a given day of the week * in the current quarter. If the calculated occurrence is outside the scope * of the current quarter, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfQuarter($nth, $dayOfWeek); /** * Modify to the given occurrence of a given day of the week * in the current year. If the calculated occurrence is outside the scope * of the current year, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfYear($nth, $dayOfWeek); /** * Return a property with its ordinal. */ public function ordinal(string $key, ?string $period = null): string; /** * Create a carbon instance from a string. * * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * * @throws InvalidFormatException */ public static function parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null): static; /** * Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). * * @param string $time date/time string in the given language (may also contain English). * @param string|null $locale if locale is null or not specified, current global locale will be * used instead. * @param DateTimeZone|string|int|null $timezone optional timezone for the new instance. * * @throws InvalidFormatException */ public static function parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null): static; /** * Returns standardized plural of a given singular/plural unit name (in English). */ public static function pluralUnit(string $unit): string; /** * Modify to the previous occurrence of a given modifier such as a day of * the week. If no dayOfWeek is provided, modify to the previous occurrence * of the current day of the week. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param string|int|null $modifier * * @return static */ public function previous($modifier = null); /** * Go backward to the previous weekday. * * @return static */ public function previousWeekday(); /** * Go backward to the previous weekend day. * * @return static */ public function previousWeekendDay(); /** * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). * * @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit * @param string|null $unit if specified, $interval must be an integer */ public function range($end = null, $interval = null, $unit = null): CarbonPeriod; /** * Call native PHP DateTime/DateTimeImmutable add() method. * * @param DateInterval $interval * * @return static */ public function rawAdd(DateInterval $interval): static; /** * Create a Carbon instance from a specific format. * * @param string $format Datetime format * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function rawCreateFromFormat(string $format, string $time, $timezone = null): ?static; /** * @see https://php.net/manual/en/datetime.format.php */ public function rawFormat(string $format): string; /** * Create a carbon instance from a string. * * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * * @throws InvalidFormatException */ public static function rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null): static; /** * Call native PHP DateTime/DateTimeImmutable sub() method. */ public function rawSub(DateInterval $interval): static; /** * Remove all macros and generic macros. */ public static function resetMacros(): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Reset the month overflow behavior. * * @return void */ public static function resetMonthsOverflow(): void; /** * Reset the format used to the default when type juggling a Carbon instance to a string * * @return void */ public static function resetToStringFormat(): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Reset the month overflow behavior. * * @return void */ public static function resetYearsOverflow(): void; /** * Round the current instance second with given precision if specified. */ public function round(DateInterval|string|int|float $precision = 1, callable|string $function = 'round'): static; /** * Round the current instance at the given unit with given precision if specified and the given function. */ public function roundUnit(string $unit, DateInterval|string|int|float $precision = 1, callable|string $function = 'round'): static; /** * Round the current instance week. * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week */ public function roundWeek(WeekDay|int|null $weekStartsAt = null): static; /** * The number of seconds since midnight. * * @return float */ public function secondsSinceMidnight(): float; /** * The number of seconds until 23:59:59. * * @return float */ public function secondsUntilEndOfDay(): float; /** * Return a serialized string of the instance. */ public function serialize(): string; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather transform Carbon object before the serialization. * * JSON serialize all Carbon instances using the given callback. */ public static function serializeUsing(callable|string|null $format): void; /** * Set a part of the Carbon object. * * @throws ImmutableException|UnknownSetterException * * @return $this */ public function set(Unit|array|string $name, DateTimeZone|Month|string|int|float|null $value = null): static; /** * Set the date with gregorian year, month and day numbers. * * @see https://php.net/manual/en/datetime.setdate.php */ public function setDate(int $year, int $month, int $day): static; /** * Set the year, month, and date for this instance to that of the passed instance. */ public function setDateFrom(DateTimeInterface|string $date): static; /** * Set the date and time all together. */ public function setDateTime(int $year, int $month, int $day, int $hour, int $minute, int $second = 0, int $microseconds = 0): static; /** * Set the date and time for this instance to that of the passed instance. */ public function setDateTimeFrom(DateTimeInterface|string $date): static; /** * Set the day (keeping the current time) to the start of the week + the number of days passed as the first * parameter. First day of week is driven by the locale unless explicitly set with the second parameter. * * @param int $numberOfDays number of days to add after the start of the current week * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, * if not provided, start of week is inferred from the locale * (Sunday for en_US, Monday for de_DE, etc.) */ public function setDaysFromStartOfWeek(int $numberOfDays, WeekDay|int|null $weekStartsAt = null): static; /** * Set the fallback locale. * * @see https://symfony.com/doc/current/components/translation.html#fallback-locales * * @param string $locale */ public static function setFallbackLocale(string $locale): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings */ public static function setHumanDiffOptions(int $humanDiffOptions): void; /** * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. * * @see https://php.net/manual/en/datetime.setisodate.php */ public function setISODate(int $year, int $week, int $day = 1): static; /** * Set the translator for the current instance. */ public function setLocalTranslator(TranslatorInterface $translator); /** * Set the current translator locale and indicate if the source locale file exists. * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. * * @param string $locale locale ex. en */ public static function setLocale(string $locale): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather consider mid-day is always 12pm, then if you need to test if it's an other * hour, test it explicitly: * $date->format('G') == 13 * or to set explicitly to a given hour: * $date->setTime(13, 0, 0, 0) * * Set midday/noon hour * * @param int $hour midday hour * * @return void */ public static function setMidDayAt($hour); /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * * Only the moment is mocked with setTestNow(), the timezone will still be the one passed * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). * * To clear the test instance call this method using the default * parameter of null. * * /!\ Use this method for unit tests only. * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance */ public static function setTestNow(mixed $testNow = null): void; /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * It will also align default timezone (e.g. call date_default_timezone_set()) with * the second argument or if null, with the timezone of the given date object. * * To clear the test instance call this method using the default * parameter of null. * * /!\ Use this method for unit tests only. * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance */ public static function setTestNowAndTimezone($testNow = null, $timezone = null): void; /** * Resets the current time of the DateTime object to a different time. * * @see https://php.net/manual/en/datetime.settime.php */ public function setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0): static; /** * Set the hour, minute, second and microseconds for this instance to that of the passed instance. */ public function setTimeFrom(DateTimeInterface|string $date): static; /** * Set the time by time string. */ public function setTimeFromTimeString(string $time): static; /** * Set the instance's timestamp. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public function setTimestamp(string|int|float $timestamp): static; /** * Set the instance's timezone from a string or object. */ public function setTimezone(DateTimeZone|string|int $timeZone): static; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and * use other method or custom format passed to format() method if you need to dump another string * format. * * Set the default format used when type juggling a Carbon instance to a string. * * @param string|Closure|null $format * * @return void */ public static function setToStringFormat(Closure|string|null $format): void; /** * Set the default translator instance to use. * * @param TranslatorInterface $translator * * @return void */ public static function setTranslator(TranslatorInterface $translator): void; /** * Set specified unit to new given value. * * @param string $unit year, month, day, hour, minute, second or microsecond * @param Month|int $value new value for given unit */ public function setUnit(string $unit, Month|int|float|null $value = null): static; /** * Set any unit to a new value without overflowing current other unit given. * * @param string $valueUnit unit name to modify * @param int $value new value for the input unit * @param string $overflowUnit unit name to not overflow */ public function setUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather consider week-end is always saturday and sunday, and if you have some custom * week-end days to handle, give to those days an other name and create a macro for them: * * ``` * Carbon::macro('isDayOff', function ($date) { * return $date->isSunday() || $date->isMonday(); * }); * Carbon::macro('isNotDayOff', function ($date) { * return !$date->isDayOff(); * }); * if ($someDate->isDayOff()) ... * if ($someDate->isNotDayOff()) ... * // Add 5 not-off days * $count = 5; * while ($someDate->isDayOff() || ($count-- > 0)) { * $someDate->addDay(); * } * ``` * * Set weekend days */ public static function setWeekendDays(array $days): void; /** * Set specific options. * - strictMode: true|false|null * - monthOverflow: true|false|null * - yearOverflow: true|false|null * - humanDiffOptions: int|null * - toStringFormat: string|Closure|null * - toJsonFormat: string|Closure|null * - locale: string|null * - timezone: \DateTimeZone|string|int|null * - macros: array|null * - genericMacros: array|null * * @param array $settings * * @return $this|static */ public function settings(array $settings): static; /** * Set the instance's timezone from a string or object and add/subtract the offset difference. */ public function shiftTimezone(DateTimeZone|string $value): static; /** * Get the month overflow global behavior (can be overridden in specific instances). * * @return bool */ public static function shouldOverflowMonths(): bool; /** * Get the month overflow global behavior (can be overridden in specific instances). * * @return bool */ public static function shouldOverflowYears(): bool; /** * @alias diffForHumans * * Get the difference in a human readable format in the current locale from current instance to an other * instance given (or now if null given). */ public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null); /** * Returns standardized singular of a given singular/plural unit name (in English). */ public static function singularUnit(string $unit): string; public static function sleep(int|float $seconds): void; /** * Modify to start of current given unit. * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOf(Unit::Month) * ->endOf(Unit::Week, Carbon::FRIDAY); * ``` */ public function startOf(Unit|string $unit, mixed ...$params): static; /** * Resets the date to the first day of the century and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury(); * ``` * * @return static */ public function startOfCentury(); /** * Resets the time to 00:00:00 start of day * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfDay(); * ``` * * @return static */ public function startOfDay(); /** * Resets the date to the first day of the decade and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade(); * ``` * * @return static */ public function startOfDecade(); /** * Modify to start of current hour, minutes and seconds become 0 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfHour(); * ``` */ public function startOfHour(): static; /** * Resets the date to the first day of the millennium and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium(); * ``` * * @return static */ public function startOfMillennium(); /** * Modify to start of current millisecond, microseconds such as 12345 become 123000 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOfSecond() * ->format('H:i:s.u'); * ``` */ public function startOfMillisecond(): static; /** * Modify to start of current minute, seconds become 0 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute(); * ``` */ public function startOfMinute(): static; /** * Resets the date to the first day of the month and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth(); * ``` * * @return static */ public function startOfMonth(); /** * Resets the date to the first day of the quarter and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter(); * ``` * * @return static */ public function startOfQuarter(); /** * Modify to start of current second, microseconds become 0 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOfSecond() * ->format('H:i:s.u'); * ``` */ public function startOfSecond(): static; /** * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n"; * ``` * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week * * @return static */ public function startOfWeek(WeekDay|int|null $weekStartsAt = null): static; /** * Resets the date to the first day of the year and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfYear(); * ``` * * @return static */ public function startOfYear(); /** * Subtract given units or interval to the current instance. * * @example $date->sub('hour', 3) * @example $date->sub(15, 'days') * @example $date->sub(CarbonInterval::days(4)) * * @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit * @param Unit|int|float|string $value * @param bool|null $overflow * * @return static */ #[ReturnTypeWillChange] public function sub($unit, $value = 1, ?bool $overflow = null): static; /** * @deprecated Prefer to use add subUTCUnit() which more accurately defines what it's doing. * * Subtract seconds to the instance using timestamp. Positive $value travels * into the past while negative $value travels forward. * * @param string $unit * @param int $value * * @return static */ public function subRealUnit($unit, $value = 1): static; /** * Subtract seconds to the instance using timestamp. Positive $value travels * into the past while negative $value travels forward. * * @param string $unit * @param int $value * * @return static */ public function subUTCUnit($unit, $value = 1): static; /** * Subtract given units to the current instance. */ public function subUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static; /** * Subtract any unit to a new value without overflowing current other unit given. * * @param string $valueUnit unit name to modify * @param int $value amount to subtract to the input unit * @param string $overflowUnit unit name to not overflow */ public function subUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static; /** * Subtract given units or interval to the current instance. * * @see sub() * * @param Unit|int|string|DateInterval $unit * @param Unit|int|float|string $value * @param bool|null $overflow * * @return static */ public function subtract($unit, $value = 1, ?bool $overflow = null): static; /** * Get the difference in a human-readable format in the current locale from current instance to another * instance given (or now if null given). * * @return string */ public function timespan($other = null, $timezone = null): string; /** * Set the instance's timestamp. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public function timestamp(string|int|float $timestamp): static; /** * @alias setTimezone */ public function timezone(DateTimeZone|string|int $value): static; /** * Get the difference in a human readable format in the current locale from an other * instance given (or now if null given) to current instance. * * When comparing a value in the past to default now: * 1 hour from now * 5 months from now * * When comparing a value in the future to default now: * 1 hour ago * 5 months ago * * When comparing a value in the past to another value: * 1 hour after * 5 months after * * When comparing a value in the future to another value: * 1 hour before * 5 months before * * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null); /** * Get default array representation. * * @example * ``` * var_dump(Carbon::now()->toArray()); * ``` */ public function toArray(): array; /** * Format the instance as ATOM * * @example * ``` * echo Carbon::now()->toAtomString(); * ``` */ public function toAtomString(): string; /** * Format the instance as COOKIE * * @example * ``` * echo Carbon::now()->toCookieString(); * ``` */ public function toCookieString(): string; /** * @alias toDateTime * * Return native DateTime PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDate()); * ``` */ public function toDate(): DateTime; /** * Format the instance as date * * @example * ``` * echo Carbon::now()->toDateString(); * ``` */ public function toDateString(): string; /** * Return native DateTime PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDateTime()); * ``` */ public function toDateTime(): DateTime; /** * Return native toDateTimeImmutable PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDateTimeImmutable()); * ``` */ public function toDateTimeImmutable(): DateTimeImmutable; /** * Format the instance as date and time T-separated with no timezone * * @example * ``` * echo Carbon::now()->toDateTimeLocalString(); * echo "\n"; * echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond * ``` */ public function toDateTimeLocalString(string $unitPrecision = 'second'): string; /** * Format the instance as date and time * * @example * ``` * echo Carbon::now()->toDateTimeString(); * ``` */ public function toDateTimeString(string $unitPrecision = 'second'): string; /** * Format the instance with day, date and time * * @example * ``` * echo Carbon::now()->toDayDateTimeString(); * ``` */ public function toDayDateTimeString(): string; /** * Format the instance as a readable date * * @example * ``` * echo Carbon::now()->toFormattedDateString(); * ``` */ public function toFormattedDateString(): string; /** * Format the instance with the day, and a readable date * * @example * ``` * echo Carbon::now()->toFormattedDayDateString(); * ``` */ public function toFormattedDayDateString(): string; /** * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: * 1977-04-22T01:00:00-05:00). * * @example * ``` * echo Carbon::now('America/Toronto')->toISOString() . "\n"; * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; * ``` * * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. */ public function toISOString(bool $keepOffset = false): ?string; /** * Return a immutable copy of the instance. * * @return CarbonImmutable */ public function toImmutable(); /** * Format the instance as ISO8601 * * @example * ``` * echo Carbon::now()->toIso8601String(); * ``` */ public function toIso8601String(): string; /** * Convert the instance to UTC and return as Zulu ISO8601 * * @example * ``` * echo Carbon::now()->toIso8601ZuluString(); * ``` */ public function toIso8601ZuluString(string $unitPrecision = 'second'): string; /** * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. * * @example * ``` * echo Carbon::now('America/Toronto')->toJSON(); * ``` */ public function toJSON(): ?string; /** * Return a mutable copy of the instance. * * @return Carbon */ public function toMutable(); /** * Get the difference in a human readable format in the current locale from an other * instance given to now * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single part) * @param int $options human diff options * * @return string */ public function toNow($syntax = null, $short = false, $parts = 1, $options = null); /** * Get default object representation. * * @example * ``` * var_dump(Carbon::now()->toObject()); * ``` */ public function toObject(): object; /** * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). * * @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit * @param string|null $unit if specified, $interval must be an integer */ public function toPeriod($end = null, $interval = null, $unit = null): CarbonPeriod; /** * Format the instance as RFC1036 * * @example * ``` * echo Carbon::now()->toRfc1036String(); * ``` */ public function toRfc1036String(): string; /** * Format the instance as RFC1123 * * @example * ``` * echo Carbon::now()->toRfc1123String(); * ``` */ public function toRfc1123String(): string; /** * Format the instance as RFC2822 * * @example * ``` * echo Carbon::now()->toRfc2822String(); * ``` */ public function toRfc2822String(): string; /** * Format the instance as RFC3339. * * @example * ``` * echo Carbon::now()->toRfc3339String() . "\n"; * echo Carbon::now()->toRfc3339String(true) . "\n"; * ``` */ public function toRfc3339String(bool $extended = false): string; /** * Format the instance as RFC7231 * * @example * ``` * echo Carbon::now()->toRfc7231String(); * ``` */ public function toRfc7231String(): string; /** * Format the instance as RFC822 * * @example * ``` * echo Carbon::now()->toRfc822String(); * ``` */ public function toRfc822String(): string; /** * Format the instance as RFC850 * * @example * ``` * echo Carbon::now()->toRfc850String(); * ``` */ public function toRfc850String(): string; /** * Format the instance as RSS * * @example * ``` * echo Carbon::now()->toRssString(); * ``` */ public function toRssString(): string; /** * Returns english human-readable complete date string. * * @example * ``` * echo Carbon::now()->toString(); * ``` */ public function toString(): string; /** * Format the instance as time * * @example * ``` * echo Carbon::now()->toTimeString(); * ``` */ public function toTimeString(string $unitPrecision = 'second'): string; /** * Format the instance as W3C * * @example * ``` * echo Carbon::now()->toW3cString(); * ``` */ public function toW3cString(): string; /** * Create a Carbon instance for today. */ public static function today(DateTimeZone|string|int|null $timezone = null): static; /** * Create a Carbon instance for tomorrow. */ public static function tomorrow(DateTimeZone|string|int|null $timezone = null): static; /** * Translate using translation string or callback available. * * @param string $key key to find * @param array $parameters replacement parameters * @param string|int|float|null $number number if plural * @param TranslatorInterface|null $translator an optional translator to use * @param bool $altNumbers pass true to use alternative numbers * * @return string */ public function translate(string $key, array $parameters = [], string|int|float|null $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false): string; /** * Returns the alternative number for a given integer if available in the current locale. * * @param int $number * * @return string */ public function translateNumber(int $number): string; /** * Translate a time string from a locale to an other. * * @param string $timeString date/time/duration string to translate (may also contain English) * @param string|null $from input locale of the $timeString parameter (`Carbon::getLocale()` by default) * @param string|null $to output locale of the result returned (`"en"` by default) * @param int $mode specify what to translate with options: * - self::TRANSLATE_ALL (default) * - CarbonInterface::TRANSLATE_MONTHS * - CarbonInterface::TRANSLATE_DAYS * - CarbonInterface::TRANSLATE_UNITS * - CarbonInterface::TRANSLATE_MERIDIEM * You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS * * @return string */ public static function translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = self::TRANSLATE_ALL): string; /** * Translate a time string from the current locale (`$date->locale()`) to another one. * * @param string $timeString time string to translate * @param string|null $to output locale of the result returned ("en" by default) * * @return string */ public function translateTimeStringTo(string $timeString, ?string $to = null): string; /** * Translate using translation string or callback available. * * @param TranslatorInterface $translator an optional translator to use * @param string $key key to find * @param array $parameters replacement parameters * @param int|float|null $number number if plural * * @return string */ public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; /** * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) * but translate words whenever possible (months, day names, etc.) using the current locale. */ public function translatedFormat(string $format): string; /** * Set the timezone or returns the timezone name if no arguments passed. * * @return ($value is null ? string : static) */ public function tz(DateTimeZone|string|int|null $value = null): static|string; /** * @alias getTimestamp * * Returns the UNIX timestamp for the current date. * * @return int */ public function unix(): int; /** * @alias to * * Get the difference in a human readable format in the current locale from an other * instance given (or now if null given) to current instance. * * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null); /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Indicates if months should be calculated with overflow. * * @param bool $monthsOverflow * * @return void */ public static function useMonthsOverflow(bool $monthsOverflow = true): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings * * Enable the strict mode (or disable with passing false). * * @param bool $strictModeEnabled */ public static function useStrictMode(bool $strictModeEnabled = true): void; /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Indicates if years should be calculated with overflow. * * @param bool $yearsOverflow * * @return void */ public static function useYearsOverflow(bool $yearsOverflow = true): void; /** * Set the instance's timezone to UTC. */ public function utc(): static; /** * Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed. */ public function utcOffset(?int $minuteOffset = null): static|int; /** * Returns the milliseconds timestamps used amongst other by Date javascript objects. * * @return float */ public function valueOf(): float; /** * Get/set the week number using given first day of week and first * day of year included in the first week. Or use US format if no settings * given (Sunday / Jan 6). * * @param int|null $week * @param int|null $dayOfWeek * @param int|null $dayOfYear * * @return int|static */ public function week($week = null, $dayOfWeek = null, $dayOfYear = null); /** * Set/get the week number of year using given first day of week and first * day of year included in the first week. Or use US format if no settings * given (Sunday / Jan 6). * * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int|static */ public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null); /** * Get/set the weekday from 0 (Sunday) to 6 (Saturday). * * @param WeekDay|int|null $value new value for weekday if using as setter. */ public function weekday(WeekDay|int|null $value = null): static|int; /** * Get the number of weeks of the current week-year using given first day of week and first * day of year included in the first week. Or use US format if no settings * given (Sunday / Jan 6). * * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int */ public function weeksInYear($dayOfWeek = null, $dayOfYear = null); /** * Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then * clearing the test instance. * * /!\ Use this method for unit tests only. * * @template T * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance * @param Closure(): T $callback * * @return T */ public static function withTestNow(mixed $testNow, callable $callback): mixed; /** * Create a Carbon instance for yesterday. */ public static function yesterday(DateTimeZone|string|int|null $timezone = null): static; // } ================================================ FILE: src/Carbon/CarbonInterval.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Constants\UnitValue; use Carbon\Exceptions\BadFluentConstructorException; use Carbon\Exceptions\BadFluentSetterException; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidIntervalException; use Carbon\Exceptions\OutOfRangeException; use Carbon\Exceptions\ParseErrorException; use Carbon\Exceptions\UnitNotConfiguredException; use Carbon\Exceptions\UnknownGetterException; use Carbon\Exceptions\UnknownSetterException; use Carbon\Exceptions\UnknownUnitException; use Carbon\Traits\IntervalRounding; use Carbon\Traits\IntervalStep; use Carbon\Traits\LocalFactory; use Carbon\Traits\MagicParameter; use Carbon\Traits\Mixin; use Carbon\Traits\Options; use Carbon\Traits\ToStringFormat; use Closure; use DateInterval; use DateTime; use DateTimeInterface; use DateTimeZone; use Exception; use InvalidArgumentException; use ReflectionException; use ReturnTypeWillChange; use RuntimeException; use Symfony\Contracts\Translation\TranslatorInterface; use Throwable; /** * A simple API extension for DateInterval. * The implementation provides helpers to handle weeks but only days are saved. * Weeks are calculated based on the total days of the current instance. * * @property int $years Year component of the current interval. (For P2Y6M, the value will be 2) * @property int $months Month component of the current interval. (For P1Y6M10D, the value will be 6) * @property int $weeks Week component of the current interval calculated from the days. (For P1Y6M17D, the value will be 2) * @property int $dayz Day component of the current interval (weeks * 7 + days). (For P6M17DT20H, the value will be 17) * @property int $hours Hour component of the current interval. (For P7DT20H5M, the value will be 20) * @property int $minutes Minute component of the current interval. (For PT20H5M30S, the value will be 5) * @property int $seconds Second component of the current interval. (CarbonInterval::minutes(2)->seconds(34)->microseconds(567_890)->seconds = 34) * @property int $milliseconds Milliseconds component of the current interval. (CarbonInterval::seconds(34)->microseconds(567_890)->milliseconds = 567) * @property int $microseconds Microseconds component of the current interval. (CarbonInterval::seconds(34)->microseconds(567_890)->microseconds = 567_890) * @property int $microExcludeMilli Remaining microseconds without the milliseconds. * @property int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). * @property int $daysExcludeWeeks alias of dayzExcludeWeeks * @property-read float $totalYears Number of years equivalent to the interval. (For P1Y6M, the value will be 1.5) * @property-read float $totalMonths Number of months equivalent to the interval. (For P1Y6M10D, the value will be ~12.357) * @property-read float $totalWeeks Number of weeks equivalent to the interval. (For P6M17DT20H, the value will be ~26.548) * @property-read float $totalDays Number of days equivalent to the interval. (For P17DT20H, the value will be ~17.833) * @property-read float $totalDayz Alias for totalDays. * @property-read float $totalHours Number of hours equivalent to the interval. (For P1DT20H5M, the value will be ~44.083) * @property-read float $totalMinutes Number of minutes equivalent to the interval. (For PT20H5M30S, the value will be 1205.5) * @property-read float $totalSeconds Number of seconds equivalent to the interval. (CarbonInterval::minutes(2)->seconds(34)->microseconds(567_890)->totalSeconds = 154.567_890) * @property-read float $totalMilliseconds Number of milliseconds equivalent to the interval. (CarbonInterval::seconds(34)->microseconds(567_890)->totalMilliseconds = 34567.890) * @property-read float $totalMicroseconds Number of microseconds equivalent to the interval. (CarbonInterval::seconds(34)->microseconds(567_890)->totalMicroseconds = 34567890) * @property-read string $locale locale of the current instance * * @method static CarbonInterval years($years = 1) Create instance specifying a number of years or modify the number of years if called on an instance. * @method static CarbonInterval year($years = 1) Alias for years() * @method static CarbonInterval months($months = 1) Create instance specifying a number of months or modify the number of months if called on an instance. * @method static CarbonInterval month($months = 1) Alias for months() * @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks or modify the number of weeks if called on an instance. * @method static CarbonInterval week($weeks = 1) Alias for weeks() * @method static CarbonInterval days($days = 1) Create instance specifying a number of days or modify the number of days if called on an instance. * @method static CarbonInterval dayz($days = 1) Alias for days() * @method static CarbonInterval daysExcludeWeeks($days = 1) Create instance specifying a number of days or modify the number of days (keeping the current number of weeks) if called on an instance. * @method static CarbonInterval dayzExcludeWeeks($days = 1) Alias for daysExcludeWeeks() * @method static CarbonInterval day($days = 1) Alias for days() * @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours or modify the number of hours if called on an instance. * @method static CarbonInterval hour($hours = 1) Alias for hours() * @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes or modify the number of minutes if called on an instance. * @method static CarbonInterval minute($minutes = 1) Alias for minutes() * @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds or modify the number of seconds if called on an instance. * @method static CarbonInterval second($seconds = 1) Alias for seconds() * @method static CarbonInterval milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds or modify the number of milliseconds if called on an instance. * @method static CarbonInterval millisecond($milliseconds = 1) Alias for milliseconds() * @method static CarbonInterval microseconds($microseconds = 1) Create instance specifying a number of microseconds or modify the number of microseconds if called on an instance. * @method static CarbonInterval microsecond($microseconds = 1) Alias for microseconds() * @method $this addYears(int $years) Add given number of years to the current interval * @method $this subYears(int $years) Subtract given number of years to the current interval * @method $this addMonths(int $months) Add given number of months to the current interval * @method $this subMonths(int $months) Subtract given number of months to the current interval * @method $this addWeeks(int|float $weeks) Add given number of weeks to the current interval * @method $this subWeeks(int|float $weeks) Subtract given number of weeks to the current interval * @method $this addDays(int|float $days) Add given number of days to the current interval * @method $this subDays(int|float $days) Subtract given number of days to the current interval * @method $this addHours(int|float $hours) Add given number of hours to the current interval * @method $this subHours(int|float $hours) Subtract given number of hours to the current interval * @method $this addMinutes(int|float $minutes) Add given number of minutes to the current interval * @method $this subMinutes(int|float $minutes) Subtract given number of minutes to the current interval * @method $this addSeconds(int|float $seconds) Add given number of seconds to the current interval * @method $this subSeconds(int|float $seconds) Subtract given number of seconds to the current interval * @method $this addMilliseconds(int|float $milliseconds) Add given number of milliseconds to the current interval * @method $this subMilliseconds(int|float $milliseconds) Subtract given number of milliseconds to the current interval * @method $this addMicroseconds(int|float $microseconds) Add given number of microseconds to the current interval * @method $this subMicroseconds(int|float $microseconds) Subtract given number of microseconds to the current interval * @method $this roundYear(int|float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this roundYears(int|float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this floorYear(int|float $precision = 1) Truncate the current instance year with given precision. * @method $this floorYears(int|float $precision = 1) Truncate the current instance year with given precision. * @method $this ceilYear(int|float $precision = 1) Ceil the current instance year with given precision. * @method $this ceilYears(int|float $precision = 1) Ceil the current instance year with given precision. * @method $this roundMonth(int|float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method $this roundMonths(int|float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method $this floorMonth(int|float $precision = 1) Truncate the current instance month with given precision. * @method $this floorMonths(int|float $precision = 1) Truncate the current instance month with given precision. * @method $this ceilMonth(int|float $precision = 1) Ceil the current instance month with given precision. * @method $this ceilMonths(int|float $precision = 1) Ceil the current instance month with given precision. * @method $this roundWeek(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this roundWeeks(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this floorWeek(int|float $precision = 1) Truncate the current instance day with given precision. * @method $this floorWeeks(int|float $precision = 1) Truncate the current instance day with given precision. * @method $this ceilWeek(int|float $precision = 1) Ceil the current instance day with given precision. * @method $this ceilWeeks(int|float $precision = 1) Ceil the current instance day with given precision. * @method $this roundDay(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this roundDays(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this floorDay(int|float $precision = 1) Truncate the current instance day with given precision. * @method $this floorDays(int|float $precision = 1) Truncate the current instance day with given precision. * @method $this ceilDay(int|float $precision = 1) Ceil the current instance day with given precision. * @method $this ceilDays(int|float $precision = 1) Ceil the current instance day with given precision. * @method $this roundHour(int|float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method $this roundHours(int|float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method $this floorHour(int|float $precision = 1) Truncate the current instance hour with given precision. * @method $this floorHours(int|float $precision = 1) Truncate the current instance hour with given precision. * @method $this ceilHour(int|float $precision = 1) Ceil the current instance hour with given precision. * @method $this ceilHours(int|float $precision = 1) Ceil the current instance hour with given precision. * @method $this roundMinute(int|float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method $this roundMinutes(int|float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method $this floorMinute(int|float $precision = 1) Truncate the current instance minute with given precision. * @method $this floorMinutes(int|float $precision = 1) Truncate the current instance minute with given precision. * @method $this ceilMinute(int|float $precision = 1) Ceil the current instance minute with given precision. * @method $this ceilMinutes(int|float $precision = 1) Ceil the current instance minute with given precision. * @method $this roundSecond(int|float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method $this roundSeconds(int|float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method $this floorSecond(int|float $precision = 1) Truncate the current instance second with given precision. * @method $this floorSeconds(int|float $precision = 1) Truncate the current instance second with given precision. * @method $this ceilSecond(int|float $precision = 1) Ceil the current instance second with given precision. * @method $this ceilSeconds(int|float $precision = 1) Ceil the current instance second with given precision. * @method $this roundMillennium(int|float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method $this roundMillennia(int|float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method $this floorMillennium(int|float $precision = 1) Truncate the current instance millennium with given precision. * @method $this floorMillennia(int|float $precision = 1) Truncate the current instance millennium with given precision. * @method $this ceilMillennium(int|float $precision = 1) Ceil the current instance millennium with given precision. * @method $this ceilMillennia(int|float $precision = 1) Ceil the current instance millennium with given precision. * @method $this roundCentury(int|float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method $this roundCenturies(int|float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method $this floorCentury(int|float $precision = 1) Truncate the current instance century with given precision. * @method $this floorCenturies(int|float $precision = 1) Truncate the current instance century with given precision. * @method $this ceilCentury(int|float $precision = 1) Ceil the current instance century with given precision. * @method $this ceilCenturies(int|float $precision = 1) Ceil the current instance century with given precision. * @method $this roundDecade(int|float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method $this roundDecades(int|float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method $this floorDecade(int|float $precision = 1) Truncate the current instance decade with given precision. * @method $this floorDecades(int|float $precision = 1) Truncate the current instance decade with given precision. * @method $this ceilDecade(int|float $precision = 1) Ceil the current instance decade with given precision. * @method $this ceilDecades(int|float $precision = 1) Ceil the current instance decade with given precision. * @method $this roundQuarter(int|float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method $this roundQuarters(int|float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method $this floorQuarter(int|float $precision = 1) Truncate the current instance quarter with given precision. * @method $this floorQuarters(int|float $precision = 1) Truncate the current instance quarter with given precision. * @method $this ceilQuarter(int|float $precision = 1) Ceil the current instance quarter with given precision. * @method $this ceilQuarters(int|float $precision = 1) Ceil the current instance quarter with given precision. * @method $this roundMillisecond(int|float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method $this roundMilliseconds(int|float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method $this floorMillisecond(int|float $precision = 1) Truncate the current instance millisecond with given precision. * @method $this floorMilliseconds(int|float $precision = 1) Truncate the current instance millisecond with given precision. * @method $this ceilMillisecond(int|float $precision = 1) Ceil the current instance millisecond with given precision. * @method $this ceilMilliseconds(int|float $precision = 1) Ceil the current instance millisecond with given precision. * @method $this roundMicrosecond(int|float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method $this roundMicroseconds(int|float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method $this floorMicrosecond(int|float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this floorMicroseconds(int|float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this ceilMicrosecond(int|float $precision = 1) Ceil the current instance microsecond with given precision. * @method $this ceilMicroseconds(int|float $precision = 1) Ceil the current instance microsecond with given precision. */ class CarbonInterval extends DateInterval implements CarbonConverterInterface, UnitValue { use LocalFactory; use IntervalRounding; use IntervalStep; use MagicParameter; use Mixin { Mixin::mixin as baseMixin; } use Options; use ToStringFormat; /** * Unlimited parts for forHumans() method. * * INF constant can be used instead. */ public const NO_LIMIT = -1; public const POSITIVE = 1; public const NEGATIVE = -1; /** * Interval spec period designators */ public const PERIOD_PREFIX = 'P'; public const PERIOD_YEARS = 'Y'; public const PERIOD_MONTHS = 'M'; public const PERIOD_DAYS = 'D'; public const PERIOD_TIME_PREFIX = 'T'; public const PERIOD_HOURS = 'H'; public const PERIOD_MINUTES = 'M'; public const PERIOD_SECONDS = 'S'; public const SPECIAL_TRANSLATIONS = [ 1 => [ 'option' => CarbonInterface::ONE_DAY_WORDS, 'future' => 'diff_tomorrow', 'past' => 'diff_yesterday', ], 2 => [ 'option' => CarbonInterface::TWO_DAY_WORDS, 'future' => 'diff_after_tomorrow', 'past' => 'diff_before_yesterday', ], ]; protected static ?array $cascadeFactors = null; protected static array $formats = [ 'y' => 'y', 'Y' => 'y', 'o' => 'y', 'm' => 'm', 'n' => 'm', 'W' => 'weeks', 'd' => 'd', 'j' => 'd', 'z' => 'd', 'h' => 'h', 'g' => 'h', 'H' => 'h', 'G' => 'h', 'i' => 'i', 's' => 's', 'u' => 'micro', 'v' => 'milli', ]; private static ?array $flipCascadeFactors = null; private static bool $floatSettersEnabled = false; /** * The registered macros. */ protected static array $macros = []; /** * Timezone handler for settings() method. */ protected DateTimeZone|string|int|null $timezoneSetting = null; /** * The input used to create the interval. */ protected mixed $originalInput = null; /** * Start date if interval was created from a difference between 2 dates. */ protected ?CarbonInterface $startDate = null; /** * End date if interval was created from a difference between 2 dates. */ protected ?CarbonInterface $endDate = null; /** * End date if interval was created from a difference between 2 dates. */ protected ?DateInterval $rawInterval = null; /** * Flag if the interval was made from a diff with absolute flag on. */ protected bool $absolute = false; protected ?array $initialValues = null; /** * Set the instance's timezone from a string or object. */ public function setTimezone(DateTimeZone|string|int $timezone): static { $this->timezoneSetting = $timezone; $this->checkStartAndEnd(); if ($this->startDate) { $this->startDate = $this->startDate ->avoidMutation() ->setTimezone($timezone); $this->rawInterval = null; } if ($this->endDate) { $this->endDate = $this->endDate ->avoidMutation() ->setTimezone($timezone); $this->rawInterval = null; } return $this; } /** * Set the instance's timezone from a string or object and add/subtract the offset difference. */ public function shiftTimezone(DateTimeZone|string|int $timezone): static { $this->timezoneSetting = $timezone; $this->checkStartAndEnd(); if ($this->startDate) { $this->startDate = $this->startDate ->avoidMutation() ->shiftTimezone($timezone); $this->rawInterval = null; } if ($this->endDate) { $this->endDate = $this->endDate ->avoidMutation() ->shiftTimezone($timezone); $this->rawInterval = null; } return $this; } /** * Mapping of units and factors for cascading. * * Should only be modified by changing the factors or referenced constants. */ public static function getCascadeFactors(): array { return static::$cascadeFactors ?: static::getDefaultCascadeFactors(); } protected static function getDefaultCascadeFactors(): array { return [ 'milliseconds' => [CarbonInterface::MICROSECONDS_PER_MILLISECOND, 'microseconds'], 'seconds' => [CarbonInterface::MILLISECONDS_PER_SECOND, 'milliseconds'], 'minutes' => [CarbonInterface::SECONDS_PER_MINUTE, 'seconds'], 'hours' => [CarbonInterface::MINUTES_PER_HOUR, 'minutes'], 'dayz' => [CarbonInterface::HOURS_PER_DAY, 'hours'], 'weeks' => [CarbonInterface::DAYS_PER_WEEK, 'dayz'], 'months' => [CarbonInterface::WEEKS_PER_MONTH, 'weeks'], 'years' => [CarbonInterface::MONTHS_PER_YEAR, 'months'], ]; } /** * Set default cascading factors for ->cascade() method. * * @param array $cascadeFactors */ public static function setCascadeFactors(array $cascadeFactors) { self::$flipCascadeFactors = null; static::$cascadeFactors = $cascadeFactors; } /** * This option allow you to opt-in for the Carbon 3 behavior where float * values will no longer be cast to integer (so truncated). * * ⚠️ This settings will be applied globally, which mean your whole application * code including the third-party dependencies that also may use Carbon will * adopt the new behavior. */ public static function enableFloatSetters(bool $floatSettersEnabled = true): void { self::$floatSettersEnabled = $floatSettersEnabled; } /////////////////////////////////////////////////////////////////// //////////////////////////// CONSTRUCTORS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Create a new CarbonInterval instance. * * @param Closure|DateInterval|string|int|null $years * @param int|float|null $months * @param int|float|null $weeks * @param int|float|null $days * @param int|float|null $hours * @param int|float|null $minutes * @param int|float|null $seconds * @param int|float|null $microseconds * * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. */ public function __construct($years = null, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null) { $this->originalInput = \func_num_args() === 1 ? $years : \func_get_args(); if ($years instanceof Closure) { $this->step = $years; $years = null; } if ($years instanceof DateInterval) { parent::__construct(static::getDateIntervalSpec($years)); $this->f = $years->f; self::copyNegativeUnits($years, $this); return; } $spec = $years; $isStringSpec = (\is_string($spec) && !preg_match('/^[\d.]/', $spec)); if (!$isStringSpec || (float) $years) { $spec = static::PERIOD_PREFIX; $spec .= $years > 0 ? $years.static::PERIOD_YEARS : ''; $spec .= $months > 0 ? $months.static::PERIOD_MONTHS : ''; $specDays = 0; $specDays += $weeks > 0 ? $weeks * static::getDaysPerWeek() : 0; $specDays += $days > 0 ? $days : 0; $spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : ''; if ($hours > 0 || $minutes > 0 || $seconds > 0) { $spec .= static::PERIOD_TIME_PREFIX; $spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : ''; $spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : ''; $spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : ''; } if ($spec === static::PERIOD_PREFIX) { // Allow the zero interval. $spec .= '0'.static::PERIOD_YEARS; } } try { parent::__construct($spec); } catch (Throwable $exception) { try { parent::__construct('PT0S'); if ($isStringSpec) { if (!preg_match('/^P (?:(?[+-]?\d*(?:\.\d+)?)Y)? (?:(?[+-]?\d*(?:\.\d+)?)M)? (?:(?[+-]?\d*(?:\.\d+)?)W)? (?:(?[+-]?\d*(?:\.\d+)?)D)? (?:T (?:(?[+-]?\d*(?:\.\d+)?)H)? (?:(?[+-]?\d*(?:\.\d+)?)M)? (?:(?[+-]?\d*(?:\.\d+)?)S)? )? $/x', $spec, $match)) { throw new InvalidArgumentException("Invalid duration: $spec"); } $years = (float) ($match['year'] ?? 0); $this->assertSafeForInteger('year', $years); $months = (float) ($match['month'] ?? 0); $this->assertSafeForInteger('month', $months); $weeks = (float) ($match['week'] ?? 0); $this->assertSafeForInteger('week', $weeks); $days = (float) ($match['day'] ?? 0); $this->assertSafeForInteger('day', $days); $hours = (float) ($match['hour'] ?? 0); $this->assertSafeForInteger('hour', $hours); $minutes = (float) ($match['minute'] ?? 0); $this->assertSafeForInteger('minute', $minutes); $seconds = (float) ($match['second'] ?? 0); $this->assertSafeForInteger('second', $seconds); $microseconds = (int) str_pad( substr(explode('.', $match['second'] ?? '0.0')[1] ?? '0', 0, 6), 6, '0', ); } $totalDays = (($weeks * static::getDaysPerWeek()) + $days); $this->assertSafeForInteger('days total (including weeks)', $totalDays); $this->y = (int) $years; $this->m = (int) $months; $this->d = (int) $totalDays; $this->h = (int) $hours; $this->i = (int) $minutes; $this->s = (int) $seconds; $secondFloatPart = (float) ($microseconds / CarbonInterface::MICROSECONDS_PER_SECOND); $this->f = $secondFloatPart; $intervalMicroseconds = (int) ($this->f * CarbonInterface::MICROSECONDS_PER_SECOND); $intervalSeconds = $seconds - $secondFloatPart; if ( ((float) $this->y) !== $years || ((float) $this->m) !== $months || ((float) $this->d) !== $totalDays || ((float) $this->h) !== $hours || ((float) $this->i) !== $minutes || ((float) $this->s) !== $intervalSeconds || $intervalMicroseconds !== ((int) $microseconds) ) { $this->add(static::fromString( ($years - $this->y).' years '. ($months - $this->m).' months '. ($totalDays - $this->d).' days '. ($hours - $this->h).' hours '. ($minutes - $this->i).' minutes '. number_format($intervalSeconds - $this->s, 6, '.', '').' seconds '. ($microseconds - $intervalMicroseconds).' microseconds ', )); } } catch (Throwable $secondException) { throw $secondException instanceof OutOfRangeException ? $secondException : $exception; } } if ($microseconds !== null) { $this->f = $microseconds / CarbonInterface::MICROSECONDS_PER_SECOND; } foreach (['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds'] as $unit) { if ($$unit < 0) { $this->set($unit, $$unit); } } } /** * Returns the factor for a given source-to-target couple. * * @param string $source * @param string $target * * @return int|float|null */ public static function getFactor($source, $target) { $source = self::standardizeUnit($source); $target = self::standardizeUnit($target); $factors = self::getFlipCascadeFactors(); if (isset($factors[$source])) { [$to, $factor] = $factors[$source]; if ($to === $target) { return $factor; } return $factor * static::getFactor($to, $target); } return null; } /** * Returns the factor for a given source-to-target couple if set, * else try to find the appropriate constant as the factor, such as Carbon::DAYS_PER_WEEK. * * @param string $source * @param string $target * * @return int|float|null */ public static function getFactorWithDefault($source, $target) { $factor = self::getFactor($source, $target); if ($factor) { return $factor; } static $defaults = [ 'month' => ['year' => Carbon::MONTHS_PER_YEAR], 'week' => ['month' => Carbon::WEEKS_PER_MONTH], 'day' => ['week' => Carbon::DAYS_PER_WEEK], 'hour' => ['day' => Carbon::HOURS_PER_DAY], 'minute' => ['hour' => Carbon::MINUTES_PER_HOUR], 'second' => ['minute' => Carbon::SECONDS_PER_MINUTE], 'millisecond' => ['second' => Carbon::MILLISECONDS_PER_SECOND], 'microsecond' => ['millisecond' => Carbon::MICROSECONDS_PER_MILLISECOND], ]; return $defaults[$source][$target] ?? null; } /** * Returns current config for days per week. * * @return int|float */ public static function getDaysPerWeek() { return static::getFactor('dayz', 'weeks') ?: Carbon::DAYS_PER_WEEK; } /** * Returns current config for hours per day. * * @return int|float */ public static function getHoursPerDay() { return static::getFactor('hours', 'dayz') ?: Carbon::HOURS_PER_DAY; } /** * Returns current config for minutes per hour. * * @return int|float */ public static function getMinutesPerHour() { return static::getFactor('minutes', 'hours') ?: Carbon::MINUTES_PER_HOUR; } /** * Returns current config for seconds per minute. * * @return int|float */ public static function getSecondsPerMinute() { return static::getFactor('seconds', 'minutes') ?: Carbon::SECONDS_PER_MINUTE; } /** * Returns current config for microseconds per second. * * @return int|float */ public static function getMillisecondsPerSecond() { return static::getFactor('milliseconds', 'seconds') ?: Carbon::MILLISECONDS_PER_SECOND; } /** * Returns current config for microseconds per second. * * @return int|float */ public static function getMicrosecondsPerMillisecond() { return static::getFactor('microseconds', 'milliseconds') ?: Carbon::MICROSECONDS_PER_MILLISECOND; } /** * Create a new CarbonInterval instance from specific values. * This is an alias for the constructor that allows better fluent * syntax as it allows you to do CarbonInterval::create(1)->fn() rather than * (new CarbonInterval(1))->fn(). * * @param int $years * @param int $months * @param int $weeks * @param int $days * @param int $hours * @param int $minutes * @param int $seconds * @param int $microseconds * * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. * * @return static */ public static function create($years = null, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null) { return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $microseconds); } /** * Parse a string into a new CarbonInterval object according to the specified format. * * @example * ``` * echo Carboninterval::createFromFormat('H:i', '1:30'); * ``` * * @param string $format Format of the $interval input string * @param string|null $interval Input string to convert into an interval * * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval. * * @return static */ public static function createFromFormat(string $format, ?string $interval): static { $instance = new static(0); $length = mb_strlen($format); if (preg_match('/s([,.])([uv])$/', $format, $match)) { $interval = explode($match[1], $interval); $index = \count($interval) - 1; $interval[$index] = str_pad($interval[$index], $match[2] === 'v' ? 3 : 6, '0'); $interval = implode($match[1], $interval); } $interval ??= ''; for ($index = 0; $index < $length; $index++) { $expected = mb_substr($format, $index, 1); $nextCharacter = mb_substr($interval, 0, 1); $unit = static::$formats[$expected] ?? null; if ($unit) { if (!preg_match('/^-?\d+/', $interval, $match)) { throw new ParseErrorException('number', $nextCharacter); } $interval = mb_substr($interval, mb_strlen($match[0])); self::incrementUnit($instance, $unit, (int) ($match[0])); continue; } if ($nextCharacter !== $expected) { throw new ParseErrorException( "'$expected'", $nextCharacter, 'Allowed substitutes for interval formats are '.implode(', ', array_keys(static::$formats))."\n". 'See https://php.net/manual/en/function.date.php for their meaning', ); } $interval = mb_substr($interval, 1); } if ($interval !== '') { throw new ParseErrorException( 'end of string', $interval, ); } return $instance; } /** * Return the original source used to create the current interval. * * @return array|int|string|DateInterval|mixed|null */ public function original() { return $this->originalInput; } /** * Return the start date if interval was created from a difference between 2 dates. * * @return CarbonInterface|null */ public function start(): ?CarbonInterface { $this->checkStartAndEnd(); return $this->startDate; } /** * Return the end date if interval was created from a difference between 2 dates. * * @return CarbonInterface|null */ public function end(): ?CarbonInterface { $this->checkStartAndEnd(); return $this->endDate; } /** * Get rid of the original input, start date and end date that may be kept in memory. * * @return $this */ public function optimize(): static { $this->originalInput = null; $this->startDate = null; $this->endDate = null; $this->rawInterval = null; $this->absolute = false; return $this; } /** * Get a copy of the instance. * * @return static */ public function copy(): static { $date = new static(0); $date->copyProperties($this); $date->step = $this->step; return $date; } /** * Get a copy of the instance. * * @return static */ public function clone(): static { return $this->copy(); } /** * Provide static helpers to create instances. Allows CarbonInterval::years(3). * * Note: This is done using the magic method to allow static and instance methods to * have the same names. * * @param string $method magic method name called * @param array $parameters parameters list * * @return static|mixed|null */ public static function __callStatic(string $method, array $parameters) { try { $interval = new static(0); $localStrictModeEnabled = $interval->localStrictModeEnabled; $interval->localStrictModeEnabled = true; $result = static::hasMacro($method) ? static::bindMacroContext(null, function () use (&$method, &$parameters, &$interval) { return $interval->callMacro($method, $parameters); }) : $interval->$method(...$parameters); $interval->localStrictModeEnabled = $localStrictModeEnabled; return $result; } catch (BadFluentSetterException $exception) { if (Carbon::isStrictModeEnabled()) { throw new BadFluentConstructorException($method, 0, $exception); } return null; } } /** * Evaluate the PHP generated by var_export() and recreate the exported CarbonInterval instance. * * @param array $dump data as exported by var_export() * * @return static */ #[ReturnTypeWillChange] public static function __set_state($dump) { /** @noinspection PhpVoidFunctionResultUsedInspection */ /** @var DateInterval $dateInterval */ $dateInterval = parent::__set_state($dump); return static::instance($dateInterval); } /** * Return the current context from inside a macro callee or a new one if static. * * @return static */ protected static function this(): static { return end(static::$macroContextStack) ?: new static(0); } /** * Creates a CarbonInterval from string. * * Format: * * Suffix | Unit | Example | DateInterval expression * -------|---------|---------|------------------------ * y | years | 1y | P1Y * mo | months | 3mo | P3M * w | weeks | 2w | P2W * d | days | 28d | P28D * h | hours | 4h | PT4H * m | minutes | 12m | PT12M * s | seconds | 59s | PT59S * * e. g. `1w 3d 4h 32m 23s` is converted to 10 days 4 hours 32 minutes and 23 seconds. * * Special cases: * - An empty string will return a zero interval * - Fractions are allowed for weeks, days, hours and minutes and will be converted * and rounded to the next smaller value (caution: 0.5w = 4d) * * @param string $intervalDefinition * * @throws InvalidIntervalException * * @return static */ public static function fromString(string $intervalDefinition): static { if (empty($intervalDefinition)) { return self::withOriginal(new static(0), $intervalDefinition); } $years = 0; $months = 0; $weeks = 0; $days = 0; $hours = 0; $minutes = 0; $seconds = 0; $milliseconds = 0; $microseconds = 0; $pattern = '/(-?\d+(?:\.\d+)?)\h*([^\d\h]*)/i'; preg_match_all($pattern, $intervalDefinition, $parts, PREG_SET_ORDER); while ([$part, $value, $unit] = array_shift($parts)) { $intValue = (int) $value; $fraction = (float) $value - $intValue; // Fix calculation precision switch (round($fraction, 6)) { case 1: $fraction = 0; $intValue++; break; case 0: $fraction = 0; break; } switch ($unit === 'µs' ? 'µs' : strtolower($unit)) { case 'millennia': case 'millennium': $years += $intValue * CarbonInterface::YEARS_PER_MILLENNIUM; break; case 'century': case 'centuries': $years += $intValue * CarbonInterface::YEARS_PER_CENTURY; break; case 'decade': case 'decades': $years += $intValue * CarbonInterface::YEARS_PER_DECADE; break; case 'year': case 'years': case 'y': case 'yr': case 'yrs': $years += $intValue; break; case 'quarter': case 'quarters': $months += $intValue * CarbonInterface::MONTHS_PER_QUARTER; break; case 'month': case 'months': case 'mo': case 'mos': $months += $intValue; break; case 'week': case 'weeks': case 'w': $weeks += $intValue; if ($fraction) { $parts[] = [null, $fraction * static::getDaysPerWeek(), 'd']; } break; case 'day': case 'days': case 'd': $days += $intValue; if ($fraction) { $parts[] = [null, $fraction * static::getHoursPerDay(), 'h']; } break; case 'hour': case 'hours': case 'h': $hours += $intValue; if ($fraction) { $parts[] = [null, $fraction * static::getMinutesPerHour(), 'm']; } break; case 'minute': case 'minutes': case 'm': $minutes += $intValue; if ($fraction) { $parts[] = [null, $fraction * static::getSecondsPerMinute(), 's']; } break; case 'second': case 'seconds': case 's': $seconds += $intValue; if ($fraction) { $parts[] = [null, $fraction * static::getMillisecondsPerSecond(), 'ms']; } break; case 'millisecond': case 'milliseconds': case 'milli': case 'ms': $milliseconds += $intValue; if ($fraction) { $microseconds += round($fraction * static::getMicrosecondsPerMillisecond()); } break; case 'microsecond': case 'microseconds': case 'micro': case 'µs': $microseconds += $intValue; break; default: throw new InvalidIntervalException( "Invalid part $part in definition $intervalDefinition", ); } } return self::withOriginal( new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $milliseconds * Carbon::MICROSECONDS_PER_MILLISECOND + $microseconds), $intervalDefinition, ); } /** * Creates a CarbonInterval from string using a different locale. * * @param string $interval interval string in the given language (may also contain English). * @param string|null $locale if locale is null or not specified, current global locale will be used instead. * * @return static */ public static function parseFromLocale(string $interval, ?string $locale = null): static { return static::fromString(Carbon::translateTimeString($interval, $locale ?: static::getLocale(), CarbonInterface::DEFAULT_LOCALE)); } /** * Create an interval from the difference between 2 dates. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $start * @param \Carbon\Carbon|\DateTimeInterface|mixed $end * * @return static */ public static function diff($start, $end = null, bool $absolute = false, array $skip = []): static { $start = $start instanceof CarbonInterface ? $start : Carbon::make($start); $end = $end instanceof CarbonInterface ? $end : Carbon::make($end); $rawInterval = $start->diffAsDateInterval($end, $absolute); $interval = static::instance($rawInterval, $skip); $interval->absolute = $absolute; $interval->rawInterval = $rawInterval; $interval->startDate = $start; $interval->endDate = $end; $interval->initialValues = $interval->getInnerValues(); return $interval; } /** * Invert the interval if it's inverted. * * @param bool $absolute do nothing if set to false * * @return $this */ public function abs(bool $absolute = false): static { if ($absolute && $this->invert) { $this->invert(); } return $this; } /** * @alias abs * * Invert the interval if it's inverted. * * @param bool $absolute do nothing if set to false * * @return $this */ public function absolute(bool $absolute = true): static { return $this->abs($absolute); } /** * Cast the current instance into the given class. * * @template T of DateInterval * * @psalm-param class-string $className The $className::instance() method will be called to cast the current object. * * @return T */ public function cast(string $className): mixed { return self::castIntervalToClass($this, $className); } /** * Create a CarbonInterval instance from a DateInterval one. Can not instance * DateInterval objects created from DateTime::diff() as you can't externally * set the $days field. * * @param DateInterval $interval * @param bool $skipCopy set to true to return the passed object * (without copying it) if it's already of the * current class * * @return static */ public static function instance(DateInterval $interval, array $skip = [], bool $skipCopy = false): static { if ($skipCopy && $interval instanceof static) { return $interval; } return self::castIntervalToClass($interval, static::class, $skip); } /** * Make a CarbonInterval instance from given variable if possible. * * Always return a new instance. Parse only strings and only these likely to be intervals (skip dates * and recurrences). Throw an exception for invalid format, but otherwise return null. * * @param mixed|int|DateInterval|string|Closure|Unit|null $interval interval or number of the given $unit * @param Unit|string|null $unit if specified, $interval must be an integer * @param bool $skipCopy set to true to return the passed object * (without copying it) if it's already of the * current class * * @return static|null */ public static function make($interval, $unit = null, bool $skipCopy = false): ?self { if ($interval instanceof Unit) { $interval = $interval->interval(); } if ($unit instanceof Unit) { $unit = $unit->value; } if ($unit) { $interval = "$interval $unit"; } if ($interval instanceof DateInterval) { return static::instance($interval, [], $skipCopy); } if ($interval instanceof Closure) { return self::withOriginal(new static($interval), $interval); } if (!\is_string($interval)) { return null; } return static::makeFromString($interval); } protected static function makeFromString(string $interval): ?self { $interval = preg_replace('/\s+/', ' ', trim($interval)); if (preg_match('/^P[T\d]/', $interval)) { return new static($interval); } if (preg_match('/^(?:\h*-?\d+(?:\.\d+)?\h*[a-z]+)+$/i', $interval)) { return static::fromString($interval); } $intervalInstance = static::createFromDateString($interval); return $intervalInstance->isEmpty() ? null : $intervalInstance; } protected function resolveInterval($interval): ?self { if (!($interval instanceof self)) { return self::make($interval); } return $interval; } /** * Sets up a DateInterval from the relative parts of the string. * * @param string $datetime * * @return static * * @link https://php.net/manual/en/dateinterval.createfromdatestring.php */ public static function createFromDateString(string $datetime): static { $string = strtr($datetime, [ ',' => ' ', ' and ' => ' ', ]); $previousException = null; try { $interval = parent::createFromDateString($string); } catch (Throwable $exception) { $interval = null; $previousException = $exception; } $interval ?: throw new InvalidFormatException( 'Could not create interval from: '.var_export($datetime, true), previous: $previousException, ); if (!($interval instanceof static)) { $interval = static::instance($interval); } return self::withOriginal($interval, $datetime); } /////////////////////////////////////////////////////////////////// ///////////////////////// GETTERS AND SETTERS ///////////////////// /////////////////////////////////////////////////////////////////// /** * Get a part of the CarbonInterval object. */ public function get(Unit|string $name): int|float|string|null { $name = Unit::toName($name); if (str_starts_with($name, 'total')) { return $this->total(substr($name, 5)); } $resolvedUnit = Carbon::singularUnit(rtrim($name, 'z')); return match ($resolvedUnit) { 'tzname', 'tz_name' => match (true) { ($this->timezoneSetting === null) => null, \is_string($this->timezoneSetting) => $this->timezoneSetting, ($this->timezoneSetting instanceof DateTimeZone) => $this->timezoneSetting->getName(), default => CarbonTimeZone::instance($this->timezoneSetting)->getName(), }, 'year' => $this->y, 'month' => $this->m, 'day' => $this->d, 'hour' => $this->h, 'minute' => $this->i, 'second' => $this->s, 'milli', 'millisecond' => (int) (round($this->f * Carbon::MICROSECONDS_PER_SECOND) / Carbon::MICROSECONDS_PER_MILLISECOND), 'micro', 'microsecond' => (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND), 'microexcludemilli' => (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND) % Carbon::MICROSECONDS_PER_MILLISECOND, 'week' => (int) ($this->d / (int) static::getDaysPerWeek()), 'daysexcludeweek', 'dayzexcludeweek' => $this->d % (int) static::getDaysPerWeek(), 'locale' => $this->getTranslatorLocale(), default => throw new UnknownGetterException($name, previous: new UnknownGetterException($resolvedUnit)), }; } /** * Get a part of the CarbonInterval object. */ public function __get(string $name): int|float|string|null { return $this->get($name); } /** * Set a part of the CarbonInterval object. * * @param Unit|string|array $name * @param int $value * * @throws UnknownSetterException * * @return $this */ public function set($name, $value = null): static { $properties = \is_array($name) ? $name : [$name => $value]; foreach ($properties as $key => $value) { switch (Carbon::singularUnit($key instanceof Unit ? $key->value : rtrim((string) $key, 'z'))) { case 'year': $this->checkIntegerValue($key, $value); $this->y = $value; $this->handleDecimalPart('year', $value, $this->y); break; case 'month': $this->checkIntegerValue($key, $value); $this->m = $value; $this->handleDecimalPart('month', $value, $this->m); break; case 'week': $this->checkIntegerValue($key, $value); $days = $value * (int) static::getDaysPerWeek(); $this->assertSafeForInteger('days total (including weeks)', $days); $this->d = $days; $this->handleDecimalPart('day', $days, $this->d); break; case 'day': if ($value === false) { break; } $this->checkIntegerValue($key, $value); $this->d = $value; $this->handleDecimalPart('day', $value, $this->d); break; case 'daysexcludeweek': case 'dayzexcludeweek': $this->checkIntegerValue($key, $value); $days = $this->weeks * (int) static::getDaysPerWeek() + $value; $this->assertSafeForInteger('days total (including weeks)', $days); $this->d = $days; $this->handleDecimalPart('day', $days, $this->d); break; case 'hour': $this->checkIntegerValue($key, $value); $this->h = $value; $this->handleDecimalPart('hour', $value, $this->h); break; case 'minute': $this->checkIntegerValue($key, $value); $this->i = $value; $this->handleDecimalPart('minute', $value, $this->i); break; case 'second': $this->checkIntegerValue($key, $value); $this->s = $value; $this->handleDecimalPart('second', $value, $this->s); break; case 'milli': case 'millisecond': $this->microseconds = $value * Carbon::MICROSECONDS_PER_MILLISECOND + $this->microseconds % Carbon::MICROSECONDS_PER_MILLISECOND; break; case 'micro': case 'microsecond': $this->f = $value / Carbon::MICROSECONDS_PER_SECOND; break; default: if (str_starts_with($key, ' * ')) { return $this->setSetting(substr($key, 3), $value); } if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { throw new UnknownSetterException($key); } $this->$key = $value; } } return $this; } /** * Set a part of the CarbonInterval object. * * @param string $name * @param int $value * * @throws UnknownSetterException */ public function __set(string $name, $value) { $this->set($name, $value); } /** * Allow setting of weeks and days to be cumulative. * * @param int $weeks Number of weeks to set * @param int $days Number of days to set * * @return static */ public function weeksAndDays(int $weeks, int $days): static { $this->dayz = ($weeks * static::getDaysPerWeek()) + $days; return $this; } /** * Returns true if the interval is empty for each unit. * * @return bool */ public function isEmpty(): bool { return $this->years === 0 && $this->months === 0 && $this->dayz === 0 && !$this->days && $this->hours === 0 && $this->minutes === 0 && $this->seconds === 0 && $this->microseconds === 0; } /** * Register a custom macro. * * Pass null macro to remove it. * * @example * ``` * CarbonInterval::macro('twice', function () { * return $this->times(2); * }); * echo CarbonInterval::hours(2)->twice(); * ``` * * @param-closure-this static $macro */ public static function macro(string $name, ?callable $macro): void { static::$macros[$name] = $macro; } /** * Register macros from a mixin object. * * @example * ``` * CarbonInterval::mixin(new class { * public function daysToHours() { * return function () { * $this->hours += $this->days; * $this->days = 0; * * return $this; * }; * } * public function hoursToDays() { * return function () { * $this->days += $this->hours; * $this->hours = 0; * * return $this; * }; * } * }); * echo CarbonInterval::hours(5)->hoursToDays() . "\n"; * echo CarbonInterval::days(5)->daysToHours() . "\n"; * ``` * * @param object|string $mixin * * @throws ReflectionException * * @return void */ public static function mixin($mixin): void { static::baseMixin($mixin); } /** * Check if macro is registered. * * @param string $name * * @return bool */ public static function hasMacro(string $name): bool { return isset(static::$macros[$name]); } /** * Call given macro. * * @param string $name * @param array $parameters * * @return mixed */ protected function callMacro(string $name, array $parameters) { $macro = static::$macros[$name]; if ($macro instanceof Closure) { $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); return ($boundMacro ?: $macro)(...$parameters); } return $macro(...$parameters); } /** * Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day(). * * Note: This is done using the magic method to allow static and instance methods to * have the same names. * * @param string $method magic method name called * @param array $parameters parameters list * * @throws BadFluentSetterException|Throwable * * @return static|int|float|string */ public function __call(string $method, array $parameters) { if (static::hasMacro($method)) { return static::bindMacroContext($this, function () use (&$method, &$parameters) { return $this->callMacro($method, $parameters); }); } $roundedValue = $this->callRoundMethod($method, $parameters); if ($roundedValue !== null) { return $roundedValue; } if (preg_match('/^(?add|sub)(?[A-Z].*)$/', $method, $match)) { $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($match['unit']), 0); return $this->{$match['method']}($value, $match['unit']); } $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($method), 1); try { $this->set($method, $value); } catch (UnknownSetterException $exception) { if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { throw new BadFluentSetterException($method, 0, $exception); } } return $this; } protected function getForHumansInitialVariables($syntax, $short): array { if (\is_array($syntax)) { return $syntax; } if (\is_int($short)) { return [ 'parts' => $short, 'short' => false, ]; } if (\is_bool($syntax)) { return [ 'short' => $syntax, 'syntax' => CarbonInterface::DIFF_ABSOLUTE, ]; } return []; } /** * @param mixed $syntax * @param mixed $short * @param mixed $parts * @param mixed $options * * @return array */ protected function getForHumansParameters($syntax = null, $short = false, $parts = self::NO_LIMIT, $options = null): array { $optionalSpace = ' '; $default = $this->getTranslationMessage('list.0') ?? $this->getTranslationMessage('list') ?? ' '; /** @var bool|string $join */ $join = $default === '' ? '' : ' '; /** @var bool|array|string $altNumbers */ $altNumbers = false; $aUnit = false; $minimumUnit = 's'; $skip = []; extract($this->getForHumansInitialVariables($syntax, $short)); $skip = array_map( static fn ($unit) => $unit instanceof Unit ? $unit->value : $unit, (array) $skip, ); $skip = array_map( 'strtolower', array_filter($skip, static fn ($unit) => \is_string($unit) && $unit !== ''), ); $syntax ??= CarbonInterface::DIFF_ABSOLUTE; if ($parts === self::NO_LIMIT) { $parts = INF; } $options ??= static::getHumanDiffOptions(); if ($join === false) { $join = ' '; } elseif ($join === true) { $join = [ $default, $this->getTranslationMessage('list.1') ?? $default, ]; } if ($altNumbers && $altNumbers !== true) { $language = new Language($this->locale); $altNumbers = \in_array($language->getCode(), (array) $altNumbers, true); } if (\is_array($join)) { [$default, $last] = $join; if ($default !== ' ') { $optionalSpace = ''; } $join = function ($list) use ($default, $last) { if (\count($list) < 2) { return implode('', $list); } $end = array_pop($list); return implode($default, $list).$last.$end; }; } if (\is_string($join)) { if ($join !== ' ') { $optionalSpace = ''; } $glue = $join; $join = static fn ($list) => implode($glue, $list); } $interpolations = [ ':optional-space' => $optionalSpace, ]; $translator ??= isset($locale) ? Translator::get($locale) : null; return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip, $translator]; } protected static function getRoundingMethodFromOptions(int $options): ?string { if ($options & CarbonInterface::ROUND) { return 'round'; } if ($options & CarbonInterface::CEIL) { return 'ceil'; } if ($options & CarbonInterface::FLOOR) { return 'floor'; } return null; } /** * Returns interval values as an array where key are the unit names and values the counts. * * @return int[] */ public function toArray(): array { return [ 'years' => $this->years, 'months' => $this->months, 'weeks' => $this->weeks, 'days' => $this->daysExcludeWeeks, 'hours' => $this->hours, 'minutes' => $this->minutes, 'seconds' => $this->seconds, 'microseconds' => $this->microseconds, ]; } /** * Returns interval non-zero values as an array where key are the unit names and values the counts. * * @return int[] */ public function getNonZeroValues(): array { return array_filter($this->toArray(), 'intval'); } /** * Returns interval values as an array where key are the unit names and values the counts * from the biggest non-zero one the the smallest non-zero one. * * @return int[] */ public function getValuesSequence(): array { $nonZeroValues = $this->getNonZeroValues(); if ($nonZeroValues === []) { return []; } $keys = array_keys($nonZeroValues); $firstKey = $keys[0]; $lastKey = $keys[\count($keys) - 1]; $values = []; $record = false; foreach ($this->toArray() as $unit => $count) { if ($unit === $firstKey) { $record = true; } if ($record) { $values[$unit] = $count; } if ($unit === $lastKey) { $record = false; } } return $values; } /** * Get the current interval in a human readable format in the current locale. * * @example * ``` * echo CarbonInterval::fromString('4d 3h 40m')->forHumans() . "\n"; * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['parts' => 2]) . "\n"; * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['parts' => 3, 'join' => true]) . "\n"; * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['short' => true]) . "\n"; * echo CarbonInterval::fromString('1d 24h')->forHumans(['join' => ' or ']) . "\n"; * echo CarbonInterval::fromString('1d 24h')->forHumans(['minimumUnit' => 'hour']) . "\n"; * ``` * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contain: * ⦿ 'syntax' entry (see below) * ⦿ 'short' entry (see below) * ⦿ 'parts' entry (see below) * ⦿ 'options' entry (see below) * ⦿ 'skip' entry, list of units to skip (array of strings or a single string, * ` it can be the unit name (singular or plural) or its shortcut * ` (y, m, w, d, h, min, s, ms, µs). * ⦿ 'aUnit' entry, prefer "an hour" over "1 hour" if true * ⦿ 'altNumbers' entry, use alternative numbers if available * ` (from the current language if true is passed, from the given language(s) * ` if array or string is passed) * ⦿ 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * ⦿ 'minimumUnit' entry determines the smallest unit of time to display can be long or * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * ⦿ 'locale' language in which the diff should be output (has no effect if 'translator' key is set) * ⦿ 'translator' a custom translator to use to translator the output. * if int passed, it adds modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: -1: no limits) * @param int $options human diff options * * @throws Exception * * @return string */ public function forHumans($syntax = null, $short = false, $parts = self::NO_LIMIT, $options = null): string { /* @var TranslatorInterface|null $translator */ [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip, $translator] = $this ->getForHumansParameters($syntax, $short, $parts, $options); $interval = []; $syntax = (int) ($syntax ?? CarbonInterface::DIFF_ABSOLUTE); $absolute = $syntax === CarbonInterface::DIFF_ABSOLUTE; $relativeToNow = $syntax === CarbonInterface::DIFF_RELATIVE_TO_NOW; $count = 1; $unit = $short ? 's' : 'second'; $isFuture = $this->invert === 1; $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); $declensionMode = null; $translator ??= $this->getLocalTranslator(); $handleDeclensions = function ($unit, $count, $index = 0, $parts = 1) use ($interpolations, $transId, $translator, $altNumbers, $absolute, &$declensionMode) { if (!$absolute) { $declensionMode = $declensionMode ?? $this->translate($transId.'_mode'); if ($this->needsDeclension($declensionMode, $index, $parts)) { // Some languages have special pluralization for past and future tense. $key = $unit.'_'.$transId; $result = $this->translate($key, $interpolations, $count, $translator, $altNumbers); if ($result !== $key) { return $result; } } } $result = $this->translate($unit, $interpolations, $count, $translator, $altNumbers); if ($result !== $unit) { return $result; } return null; }; $intervalValues = $this; $method = static::getRoundingMethodFromOptions($options); if ($method) { $previousCount = INF; while ( \count($intervalValues->getNonZeroValues()) > $parts && ($count = \count($keys = array_keys($intervalValues->getValuesSequence()))) > 1 ) { $index = min($count, $previousCount - 1) - 2; if ($index < 0) { break; } $intervalValues = $this->copy()->roundUnit( $keys[$index], 1, $method, ); $previousCount = $count; } } $diffIntervalArray = [ ['value' => $intervalValues->years, 'unit' => 'year', 'unitShort' => 'y'], ['value' => $intervalValues->months, 'unit' => 'month', 'unitShort' => 'm'], ['value' => $intervalValues->weeks, 'unit' => 'week', 'unitShort' => 'w'], ['value' => $intervalValues->daysExcludeWeeks, 'unit' => 'day', 'unitShort' => 'd'], ['value' => $intervalValues->hours, 'unit' => 'hour', 'unitShort' => 'h'], ['value' => $intervalValues->minutes, 'unit' => 'minute', 'unitShort' => 'min'], ['value' => $intervalValues->seconds, 'unit' => 'second', 'unitShort' => 's'], ['value' => $intervalValues->milliseconds, 'unit' => 'millisecond', 'unitShort' => 'ms'], ['value' => $intervalValues->microExcludeMilli, 'unit' => 'microsecond', 'unitShort' => 'µs'], ]; if (!empty($skip)) { foreach ($diffIntervalArray as $index => &$unitData) { $nextIndex = $index + 1; if ($unitData['value'] && isset($diffIntervalArray[$nextIndex]) && \count(array_intersect([$unitData['unit'], $unitData['unit'].'s', $unitData['unitShort']], $skip)) ) { $diffIntervalArray[$nextIndex]['value'] += $unitData['value'] * self::getFactorWithDefault($diffIntervalArray[$nextIndex]['unit'], $unitData['unit']); $unitData['value'] = 0; } } } $transChoice = function ($short, $unitData, $index, $parts) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) { $count = $unitData['value']; if ($short) { $result = $handleDeclensions($unitData['unitShort'], $count, $index, $parts); if ($result !== null) { return $result; } } elseif ($aUnit) { $result = $handleDeclensions('a_'.$unitData['unit'], $count, $index, $parts); if ($result !== null) { return $result; } } if (!$absolute) { return $handleDeclensions($unitData['unit'], $count, $index, $parts); } return $this->translate($unitData['unit'], $interpolations, $count, $translator, $altNumbers); }; $fallbackUnit = ['second', 's']; foreach ($diffIntervalArray as $diffIntervalData) { if ($diffIntervalData['value'] > 0) { $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; $count = $diffIntervalData['value']; $interval[] = [$short, $diffIntervalData]; } elseif ($options & CarbonInterface::SEQUENTIAL_PARTS_ONLY && \count($interval) > 0) { break; } // break the loop after we get the required number of parts in array if (\count($interval) >= $parts) { break; } // break the loop after we have reached the minimum unit if (\in_array($minimumUnit, [$diffIntervalData['unit'], $diffIntervalData['unitShort']], true)) { $fallbackUnit = [$diffIntervalData['unit'], $diffIntervalData['unitShort']]; break; } } $actualParts = \count($interval); foreach ($interval as $index => &$item) { $item = $transChoice($item[0], $item[1], $index, $actualParts); } if (\count($interval) === 0) { if ($relativeToNow && $options & CarbonInterface::JUST_NOW) { $key = 'diff_now'; $translation = $this->translate($key, $interpolations, null, $translator); if ($translation !== $key) { return $translation; } } $count = $options & CarbonInterface::NO_ZERO_DIFF ? 1 : 0; $unit = $fallbackUnit[$short ? 1 : 0]; $interval[] = $this->translate($unit, $interpolations, $count, $translator, $altNumbers); } // join the interval parts by a space $time = $join($interval); unset($diffIntervalArray, $interval); if ($absolute) { return $time; } $isFuture = $this->invert === 1; $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); if ($parts === 1) { if ($relativeToNow && $unit === 'day') { $specialTranslations = static::SPECIAL_TRANSLATIONS[$count] ?? null; if ($specialTranslations && $options & $specialTranslations['option']) { $key = $specialTranslations[$isFuture ? 'future' : 'past']; $translation = $this->translate($key, $interpolations, null, $translator); if ($translation !== $key) { return $translation; } } } $aTime = $aUnit ? $handleDeclensions('a_'.$unit, $count) : null; $time = $aTime ?: $handleDeclensions($unit, $count) ?: $time; } $time = [':time' => $time]; return $this->translate($transId, array_merge($time, $interpolations, $time), null, $translator); } public function format(string $format): string { $output = parent::format($format); if (!str_contains($format, '%a') || !isset($this->startDate, $this->endDate)) { return $output; } $this->rawInterval ??= $this->startDate->diffAsDateInterval($this->endDate); return str_replace('(unknown)', $this->rawInterval->format('%a'), $output); } /** * Format the instance as a string using the forHumans() function. * * @throws Exception * * @return string */ public function __toString(): string { $format = $this->localToStringFormat ?? $this->getFactory()->getSettings()['toStringFormat'] ?? null; if (!$format) { return $this->forHumans(); } if ($format instanceof Closure) { return $format($this); } return $this->format($format); } /** * Return native DateInterval PHP object matching the current instance. * * @example * ``` * var_dump(CarbonInterval::hours(2)->toDateInterval()); * ``` * * @return DateInterval */ public function toDateInterval(): DateInterval { return self::castIntervalToClass($this, DateInterval::class); } /** * Convert the interval to a CarbonPeriod. * * @param DateTimeInterface|string|int ...$params Start date, [end date or recurrences] and optional settings. * * @return CarbonPeriod */ public function toPeriod(...$params): CarbonPeriod { if ($this->timezoneSetting) { $timeZone = \is_string($this->timezoneSetting) ? new DateTimeZone($this->timezoneSetting) : $this->timezoneSetting; if ($timeZone instanceof DateTimeZone) { array_unshift($params, $timeZone); } } $class = ($params[0] ?? null) instanceof DateTime ? CarbonPeriod::class : CarbonPeriodImmutable::class; return $class::create($this, ...$params); } /** * Decompose the current interval into * * @param mixed|int|DateInterval|string|Closure|Unit|null $interval interval or number of the given $unit * @param Unit|string|null $unit if specified, $interval must be an integer * * @return CarbonPeriod */ public function stepBy($interval, Unit|string|null $unit = null): CarbonPeriod { $this->checkStartAndEnd(); $start = $this->startDate ?? CarbonImmutable::make('now'); $end = $this->endDate ?? $start->copy()->add($this); try { $step = static::make($interval, $unit); } catch (InvalidFormatException $exception) { if ($unit || (\is_string($interval) ? preg_match('/(\s|\d)/', $interval) : !($interval instanceof Unit))) { throw $exception; } $step = static::make(1, $interval); } $class = $start instanceof DateTime ? CarbonPeriod::class : CarbonPeriodImmutable::class; return $class::create($step, $start, $end); } /** * Invert the interval. * * @param bool|int $inverted if a parameter is passed, the passed value cast as 1 or 0 is used * as the new value of the ->invert property. * * @return $this */ public function invert($inverted = null): static { $this->invert = (\func_num_args() === 0 ? !$this->invert : $inverted) ? 1 : 0; return $this; } protected function solveNegativeInterval(): static { if (!$this->isEmpty() && $this->years <= 0 && $this->months <= 0 && $this->dayz <= 0 && $this->hours <= 0 && $this->minutes <= 0 && $this->seconds <= 0 && $this->microseconds <= 0) { $this->years *= self::NEGATIVE; $this->months *= self::NEGATIVE; $this->dayz *= self::NEGATIVE; $this->hours *= self::NEGATIVE; $this->minutes *= self::NEGATIVE; $this->seconds *= self::NEGATIVE; $this->microseconds *= self::NEGATIVE; $this->invert(); } return $this; } /** * Add the passed interval to the current instance. * * @param string|DateInterval $unit * @param int|float $value * * @return $this */ public function add($unit, $value = 1): static { if (is_numeric($unit)) { [$value, $unit] = [$unit, $value]; } if (\is_string($unit) && !preg_match('/^\s*-?\d/', $unit)) { $unit = "$value $unit"; $value = 1; } $interval = static::make($unit); if (!$interval) { throw new InvalidIntervalException('This type of data cannot be added/subtracted.'); } if ($value !== 1) { $interval->times($value); } $sign = ($this->invert === 1) !== ($interval->invert === 1) ? self::NEGATIVE : self::POSITIVE; $this->years += $interval->y * $sign; $this->months += $interval->m * $sign; $this->dayz += ($interval->days === false ? $interval->d : $interval->days) * $sign; $this->hours += $interval->h * $sign; $this->minutes += $interval->i * $sign; $this->seconds += $interval->s * $sign; $this->microseconds += $interval->microseconds * $sign; $this->solveNegativeInterval(); return $this; } /** * Subtract the passed interval to the current instance. * * @param string|DateInterval $unit * @param int|float $value * * @return $this */ public function sub($unit, $value = 1): static { if (is_numeric($unit)) { [$value, $unit] = [$unit, $value]; } return $this->add($unit, -(float) $value); } /** * Subtract the passed interval to the current instance. * * @param string|DateInterval $unit * @param int|float $value * * @return $this */ public function subtract($unit, $value = 1): static { return $this->sub($unit, $value); } /** * Add given parameters to the current interval. * * @param int $years * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours * @param int|float $minutes * @param int|float $seconds * @param int|float $microseconds * * @return $this */ public function plus( $years = 0, $months = 0, $weeks = 0, $days = 0, $hours = 0, $minutes = 0, $seconds = 0, $microseconds = 0 ): static { return $this->add(" $years years $months months $weeks weeks $days days $hours hours $minutes minutes $seconds seconds $microseconds microseconds "); } /** * Add given parameters to the current interval. * * @param int $years * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours * @param int|float $minutes * @param int|float $seconds * @param int|float $microseconds * * @return $this */ public function minus( $years = 0, $months = 0, $weeks = 0, $days = 0, $hours = 0, $minutes = 0, $seconds = 0, $microseconds = 0 ): static { return $this->sub(" $years years $months months $weeks weeks $days days $hours hours $minutes minutes $seconds seconds $microseconds microseconds "); } /** * Multiply current instance given number of times. times() is naive, it multiplies each unit * (so day can be greater than 31, hour can be greater than 23, etc.) and the result is rounded * separately for each unit. * * Use times() when you want a fast and approximated calculation that does not cascade units. * * For a precise and cascaded calculation, * * @see multiply() * * @param float|int $factor * * @return $this */ public function times($factor): static { if ($factor < 0) { $this->invert = $this->invert ? 0 : 1; $factor = -$factor; } $this->years = (int) round($this->years * $factor); $this->months = (int) round($this->months * $factor); $this->dayz = (int) round($this->dayz * $factor); $this->hours = (int) round($this->hours * $factor); $this->minutes = (int) round($this->minutes * $factor); $this->seconds = (int) round($this->seconds * $factor); $this->microseconds = (int) round($this->microseconds * $factor); return $this; } /** * Divide current instance by a given divider. shares() is naive, it divides each unit separately * and the result is rounded for each unit. So 5 hours and 20 minutes shared by 3 becomes 2 hours * and 7 minutes. * * Use shares() when you want a fast and approximated calculation that does not cascade units. * * For a precise and cascaded calculation, * * @see divide() * * @param float|int $divider * * @return $this */ public function shares($divider): static { return $this->times(1 / $divider); } protected function copyProperties(self $interval, $ignoreSign = false): static { $this->years = $interval->years; $this->months = $interval->months; $this->dayz = $interval->dayz; $this->hours = $interval->hours; $this->minutes = $interval->minutes; $this->seconds = $interval->seconds; $this->microseconds = $interval->microseconds; if (!$ignoreSign) { $this->invert = $interval->invert; } return $this; } /** * Multiply and cascade current instance by a given factor. * * @param float|int $factor * * @return $this */ public function multiply($factor): static { if ($factor < 0) { $this->invert = $this->invert ? 0 : 1; $factor = -$factor; } $yearPart = (int) floor($this->years * $factor); // Split calculation to prevent imprecision if ($yearPart) { $this->years -= $yearPart / $factor; } return $this->copyProperties( static::create($yearPart) ->microseconds(abs($this->totalMicroseconds) * $factor) ->cascade(), true, ); } /** * Divide and cascade current instance by a given divider. * * @param float|int $divider * * @return $this */ public function divide($divider): static { return $this->multiply(1 / $divider); } /** * Get the interval_spec string of a date interval. * * @param DateInterval $interval * * @return string */ public static function getDateIntervalSpec(DateInterval $interval, bool $microseconds = false, array $skip = []): string { $date = array_filter([ static::PERIOD_YEARS => abs($interval->y), static::PERIOD_MONTHS => abs($interval->m), static::PERIOD_DAYS => abs($interval->d), ]); $skip = array_map([Unit::class, 'toNameIfUnit'], $skip); if ( $interval->days >= CarbonInterface::DAYS_PER_WEEK * CarbonInterface::WEEKS_PER_MONTH && (!isset($date[static::PERIOD_YEARS]) || \count(array_intersect(['y', 'year', 'years'], $skip))) && (!isset($date[static::PERIOD_MONTHS]) || \count(array_intersect(['m', 'month', 'months'], $skip))) ) { $date = [ static::PERIOD_DAYS => abs($interval->days), ]; } $seconds = abs($interval->s); if ($microseconds && $interval->f > 0) { $seconds = \sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000); } $time = array_filter([ static::PERIOD_HOURS => abs($interval->h), static::PERIOD_MINUTES => abs($interval->i), static::PERIOD_SECONDS => $seconds, ]); $specString = static::PERIOD_PREFIX; foreach ($date as $key => $value) { $specString .= $value.$key; } if (\count($time) > 0) { $specString .= static::PERIOD_TIME_PREFIX; foreach ($time as $key => $value) { $specString .= $value.$key; } } return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString; } /** * Get the interval_spec string. * * @return string */ public function spec(bool $microseconds = false): string { return static::getDateIntervalSpec($this, $microseconds); } /** * Comparing 2 date intervals. * * @param DateInterval $first * @param DateInterval $second * * @return int 0, 1 or -1 */ public static function compareDateIntervals(DateInterval $first, DateInterval $second): int { $current = Carbon::now(); $passed = $current->avoidMutation()->add($second); $current->add($first); return $current <=> $passed; } /** * Comparing with passed interval. * * @param DateInterval $interval * * @return int 0, 1 or -1 */ public function compare(DateInterval $interval): int { return static::compareDateIntervals($this, $interval); } /** * Convert overflowed values into bigger units. * * @return $this */ public function cascade(): static { return $this->doCascade(false); } public function hasNegativeValues(): bool { foreach ($this->toArray() as $value) { if ($value < 0) { return true; } } return false; } public function hasPositiveValues(): bool { foreach ($this->toArray() as $value) { if ($value > 0) { return true; } } return false; } /** * Get amount of given unit equivalent to the interval. * * @param string $unit * * @throws UnknownUnitException|UnitNotConfiguredException * * @return float */ public function total(string $unit): float { $realUnit = $unit = strtolower($unit); if (\in_array($unit, ['days', 'weeks'])) { $realUnit = 'dayz'; } elseif (!\in_array($unit, ['microseconds', 'milliseconds', 'seconds', 'minutes', 'hours', 'dayz', 'months', 'years'])) { throw new UnknownUnitException($unit); } $this->checkStartAndEnd(); if ($this->startDate && $this->endDate) { $diff = $this->startDate->diffInUnit($unit, $this->endDate); return $this->absolute ? abs($diff) : $diff; } $result = 0; $cumulativeFactor = 0; $unitFound = false; $factors = self::getFlipCascadeFactors(); $daysPerWeek = (int) static::getDaysPerWeek(); $values = [ 'years' => $this->years, 'months' => $this->months, 'weeks' => (int) ($this->d / $daysPerWeek), 'dayz' => fmod($this->d, $daysPerWeek), 'hours' => $this->hours, 'minutes' => $this->minutes, 'seconds' => $this->seconds, 'milliseconds' => (int) ($this->microseconds / Carbon::MICROSECONDS_PER_MILLISECOND), 'microseconds' => $this->microseconds % Carbon::MICROSECONDS_PER_MILLISECOND, ]; if (isset($factors['dayz']) && $factors['dayz'][0] !== 'weeks') { $values['dayz'] += $values['weeks'] * $daysPerWeek; $values['weeks'] = 0; } foreach ($factors as $source => [$target, $factor]) { if ($source === $realUnit) { $unitFound = true; $value = $values[$source]; $result += $value; $cumulativeFactor = 1; } if ($factor === false) { if ($unitFound) { break; } $result = 0; $cumulativeFactor = 0; continue; } if ($target === $realUnit) { $unitFound = true; } if ($cumulativeFactor) { $cumulativeFactor *= $factor; $result += $values[$target] * $cumulativeFactor; continue; } $value = $values[$source]; $result = ($result + $value) / $factor; } if (isset($target) && !$cumulativeFactor) { $result += $values[$target]; } if (!$unitFound) { throw new UnitNotConfiguredException($unit); } if ($this->invert) { $result *= self::NEGATIVE; } if ($unit === 'weeks') { $result /= $daysPerWeek; } // Cast as int numbers with no decimal part return fmod($result, 1) === 0.0 ? (int) $result : $result; } /** * Determines if the instance is equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @see equalTo() * * @return bool */ public function eq($interval): bool { return $this->equalTo($interval); } /** * Determines if the instance is equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @return bool */ public function equalTo($interval): bool { $interval = $this->resolveInterval($interval); if ($interval === null) { return false; } $step = $this->getStep(); if ($step) { return $step === $interval->getStep(); } if ($this->isEmpty()) { return $interval->isEmpty(); } $cascadedInterval = $this->copy()->cascade(); $comparedInterval = $interval->copy()->cascade(); return $cascadedInterval->invert === $comparedInterval->invert && $cascadedInterval->getNonZeroValues() === $comparedInterval->getNonZeroValues(); } /** * Determines if the instance is not equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @see notEqualTo() * * @return bool */ public function ne($interval): bool { return $this->notEqualTo($interval); } /** * Determines if the instance is not equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @return bool */ public function notEqualTo($interval): bool { return !$this->eq($interval); } /** * Determines if the instance is greater (longer) than another * * @param CarbonInterval|DateInterval|mixed $interval * * @see greaterThan() * * @return bool */ public function gt($interval): bool { return $this->greaterThan($interval); } /** * Determines if the instance is greater (longer) than another * * @param CarbonInterval|DateInterval|mixed $interval * * @return bool */ public function greaterThan($interval): bool { $interval = $this->resolveInterval($interval); return $interval === null || $this->totalMicroseconds > $interval->totalMicroseconds; } /** * Determines if the instance is greater (longer) than or equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @see greaterThanOrEqualTo() * * @return bool */ public function gte($interval): bool { return $this->greaterThanOrEqualTo($interval); } /** * Determines if the instance is greater (longer) than or equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @return bool */ public function greaterThanOrEqualTo($interval): bool { return $this->greaterThan($interval) || $this->equalTo($interval); } /** * Determines if the instance is less (shorter) than another * * @param CarbonInterval|DateInterval|mixed $interval * * @see lessThan() * * @return bool */ public function lt($interval): bool { return $this->lessThan($interval); } /** * Determines if the instance is less (shorter) than another * * @param CarbonInterval|DateInterval|mixed $interval * * @return bool */ public function lessThan($interval): bool { $interval = $this->resolveInterval($interval); return $interval !== null && $this->totalMicroseconds < $interval->totalMicroseconds; } /** * Determines if the instance is less (shorter) than or equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @see lessThanOrEqualTo() * * @return bool */ public function lte($interval): bool { return $this->lessThanOrEqualTo($interval); } /** * Determines if the instance is less (shorter) than or equal to another * * @param CarbonInterval|DateInterval|mixed $interval * * @return bool */ public function lessThanOrEqualTo($interval): bool { return $this->lessThan($interval) || $this->equalTo($interval); } /** * Determines if the instance is between two others. * * The third argument allow you to specify if bounds are included or not (true by default) * but for when you including/excluding bounds may produce different results in your application, * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. * * @example * ``` * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(3)); // true * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::hours(36)); // false * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(2)); // true * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(2), false); // false * ``` * * @param CarbonInterval|DateInterval|mixed $interval1 * @param CarbonInterval|DateInterval|mixed $interval2 * @param bool $equal Indicates if an equal to comparison should be done * * @return bool */ public function between($interval1, $interval2, bool $equal = true): bool { return $equal ? $this->greaterThanOrEqualTo($interval1) && $this->lessThanOrEqualTo($interval2) : $this->greaterThan($interval1) && $this->lessThan($interval2); } /** * Determines if the instance is between two others, bounds excluded. * * @example * ``` * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(3)); // true * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::hours(36)); // false * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2)); // true * ``` * * @param CarbonInterval|DateInterval|mixed $interval1 * @param CarbonInterval|DateInterval|mixed $interval2 * * @return bool */ public function betweenIncluded($interval1, $interval2): bool { return $this->between($interval1, $interval2, true); } /** * Determines if the instance is between two others, bounds excluded. * * @example * ``` * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(3)); // true * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::hours(36)); // false * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2)); // false * ``` * * @param CarbonInterval|DateInterval|mixed $interval1 * @param CarbonInterval|DateInterval|mixed $interval2 * * @return bool */ public function betweenExcluded($interval1, $interval2): bool { return $this->between($interval1, $interval2, false); } /** * Determines if the instance is between two others * * @example * ``` * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(3)); // true * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::hours(36)); // false * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(2)); // true * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(2), false); // false * ``` * * @param CarbonInterval|DateInterval|mixed $interval1 * @param CarbonInterval|DateInterval|mixed $interval2 * @param bool $equal Indicates if an equal to comparison should be done * * @return bool */ public function isBetween($interval1, $interval2, bool $equal = true): bool { return $this->between($interval1, $interval2, $equal); } /** * Round the current instance at the given unit with given precision if specified and the given function. * * @throws Exception */ public function roundUnit(string $unit, DateInterval|string|int|float $precision = 1, string $function = 'round'): static { if (static::getCascadeFactors() !== static::getDefaultCascadeFactors()) { $value = $function($this->total($unit) / $precision) * $precision; $inverted = $value < 0; return $this->copyProperties(self::fromString( number_format(abs($value), 12, '.', '').' '.$unit )->invert($inverted)->cascade()); } $base = CarbonImmutable::parse('2000-01-01 00:00:00', 'UTC') ->roundUnit($unit, $precision, $function); $next = $base->add($this); $inverted = $next < $base; if ($inverted) { $next = $base->sub($this); } $this->copyProperties( $next ->roundUnit($unit, $precision, $function) ->diff($base), ); return $this->invert($inverted); } /** * Truncate the current instance at the given unit with given precision if specified. * * @param string $unit * @param float|int|string|DateInterval|null $precision * * @throws Exception * * @return $this */ public function floorUnit(string $unit, $precision = 1): static { return $this->roundUnit($unit, $precision, 'floor'); } /** * Ceil the current instance at the given unit with given precision if specified. * * @param string $unit * @param float|int|string|DateInterval|null $precision * * @throws Exception * * @return $this */ public function ceilUnit(string $unit, $precision = 1): static { return $this->roundUnit($unit, $precision, 'ceil'); } /** * Round the current instance second with given precision if specified. * * @param float|int|string|DateInterval|null $precision * @param string $function * * @throws Exception * * @return $this */ public function round($precision = 1, string $function = 'round'): static { return $this->roundWith($precision, $function); } /** * Round the current instance second with given precision if specified. * * @throws Exception * * @return $this */ public function floor(DateInterval|string|float|int $precision = 1): static { return $this->round($precision, 'floor'); } /** * Ceil the current instance second with given precision if specified. * * @throws Exception * * @return $this */ public function ceil(DateInterval|string|float|int $precision = 1): static { return $this->round($precision, 'ceil'); } public function __unserialize(array $data): void { $properties = array_combine( array_map( static fn (mixed $key) => \is_string($key) ? str_replace('tzName', 'timezoneSetting', $key) : $key, array_keys($data), ), $data, ); if (method_exists(parent::class, '__unserialize')) { // PHP >= 8.2 parent::__unserialize($properties); return; } // PHP <= 8.1 // @codeCoverageIgnoreStart $properties = array_combine( array_map( static fn (string $property) => preg_replace('/^\0.+\0/', '', $property), array_keys($data), ), $data, ); $localStrictMode = $this->localStrictModeEnabled; $this->localStrictModeEnabled = false; $days = $properties['days'] ?? false; $this->days = $days === false ? false : (int) $days; $this->y = (int) ($properties['y'] ?? 0); $this->m = (int) ($properties['m'] ?? 0); $this->d = (int) ($properties['d'] ?? 0); $this->h = (int) ($properties['h'] ?? 0); $this->i = (int) ($properties['i'] ?? 0); $this->s = (int) ($properties['s'] ?? 0); $this->f = (float) ($properties['f'] ?? 0.0); // @phpstan-ignore-next-line $this->weekday = (int) ($properties['weekday'] ?? 0); // @phpstan-ignore-next-line $this->weekday_behavior = (int) ($properties['weekday_behavior'] ?? 0); // @phpstan-ignore-next-line $this->first_last_day_of = (int) ($properties['first_last_day_of'] ?? 0); $this->invert = (int) ($properties['invert'] ?? 0); // @phpstan-ignore-next-line $this->special_type = (int) ($properties['special_type'] ?? 0); // @phpstan-ignore-next-line $this->special_amount = (int) ($properties['special_amount'] ?? 0); // @phpstan-ignore-next-line $this->have_weekday_relative = (int) ($properties['have_weekday_relative'] ?? 0); // @phpstan-ignore-next-line $this->have_special_relative = (int) ($properties['have_special_relative'] ?? 0); parent::__construct(self::getDateIntervalSpec($this)); foreach ($properties as $property => $value) { if ($property === 'localStrictModeEnabled') { continue; } $this->$property = $value; } $this->localStrictModeEnabled = $properties['localStrictModeEnabled'] ?? $localStrictMode; // @codeCoverageIgnoreEnd } /** * @template T * * @param T $interval * @param mixed $original * * @return T */ private static function withOriginal(mixed $interval, mixed $original): mixed { if ($interval instanceof self) { $interval->originalInput = $original; } return $interval; } private static function standardizeUnit(string $unit): string { $unit = rtrim($unit, 'sz').'s'; return $unit === 'days' ? 'dayz' : $unit; } private static function getFlipCascadeFactors(): array { if (!self::$flipCascadeFactors) { self::$flipCascadeFactors = []; foreach (self::getCascadeFactors() as $to => [$factor, $from]) { self::$flipCascadeFactors[self::standardizeUnit($from)] = [self::standardizeUnit($to), $factor]; } } return self::$flipCascadeFactors; } /** * @template T of DateInterval * * @param DateInterval $interval * * @psalm-param class-string $className * * @return T */ private static function castIntervalToClass(DateInterval $interval, string $className, array $skip = []): object { $mainClass = DateInterval::class; if (!is_a($className, $mainClass, true)) { throw new InvalidCastException("$className is not a sub-class of $mainClass."); } $microseconds = $interval->f; $instance = self::buildInstance($interval, $className, $skip); if ($instance instanceof self) { $instance->originalInput = $interval; } if ($microseconds) { $instance->f = $microseconds; } if ($interval instanceof self && is_a($className, self::class, true)) { self::copyStep($interval, $instance); } self::copyNegativeUnits($interval, $instance); return self::withOriginal($instance, $interval); } /** * @template T of DateInterval * * @param DateInterval $interval * * @psalm-param class-string $className * * @return T */ private static function buildInstance( DateInterval $interval, string $className, array $skip = [], ): object { $serialization = self::buildSerializationString($interval, $className, $skip); return match ($serialization) { null => new $className(static::getDateIntervalSpec($interval, false, $skip)), default => unserialize($serialization), }; } /** * As demonstrated by rlanvin (https://github.com/rlanvin) in * https://github.com/briannesbitt/Carbon/issues/3018#issuecomment-2888538438 * * Modifying the output of serialize() to change the class name and unserializing * the tweaked string allows creating new interval instances where the ->days * property can be set. It's not possible neither with `new` nto with `__set_state`. * * It has a non-negligible performance cost, so we'll use this method only if * $interval->days !== false. */ private static function buildSerializationString( DateInterval $interval, string $className, array $skip = [], ): ?string { if ($interval->days === false || PHP_VERSION_ID < 8_02_00 || $skip !== []) { return null; } // De-enhance CarbonInterval objects to be serializable back to DateInterval if ($interval instanceof self && !is_a($className, self::class, true)) { $interval = clone $interval; unset($interval->timezoneSetting); unset($interval->originalInput); unset($interval->startDate); unset($interval->endDate); unset($interval->rawInterval); unset($interval->absolute); unset($interval->initialValues); unset($interval->clock); unset($interval->step); unset($interval->localMonthsOverflow); unset($interval->localYearsOverflow); unset($interval->localStrictModeEnabled); unset($interval->localHumanDiffOptions); unset($interval->localToStringFormat); unset($interval->localSerializer); unset($interval->localMacros); unset($interval->localGenericMacros); unset($interval->localFormatFunction); unset($interval->localTranslator); } $serialization = serialize($interval); $inputClass = $interval::class; $expectedStart = 'O:'.\strlen($inputClass).':"'.$inputClass.'":'; if (!str_starts_with($serialization, $expectedStart)) { return null; // @codeCoverageIgnore } return 'O:'.\strlen($className).':"'.$className.'":'.substr($serialization, \strlen($expectedStart)); } private static function copyStep(self $from, self $to): void { $to->setStep($from->getStep()); } private static function copyNegativeUnits(DateInterval $from, DateInterval $to): void { $to->invert = $from->invert; foreach (['y', 'm', 'd', 'h', 'i', 's'] as $unit) { if ($from->$unit < 0) { self::setIntervalUnit($to, $unit, $to->$unit * self::NEGATIVE); } } } private function invertCascade(array $values): static { return $this->set(array_map(function ($value) { return -$value; }, $values))->doCascade(true)->invert(); } private function doCascade(bool $deep): static { $originalData = $this->toArray(); $originalData['milliseconds'] = (int) ($originalData['microseconds'] / static::getMicrosecondsPerMillisecond()); $originalData['microseconds'] = $originalData['microseconds'] % static::getMicrosecondsPerMillisecond(); $originalData['weeks'] = (int) ($this->d / static::getDaysPerWeek()); $originalData['daysExcludeWeeks'] = fmod($this->d, static::getDaysPerWeek()); unset($originalData['days']); $newData = $originalData; $previous = []; foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) { foreach (['source', 'target'] as $key) { if ($$key === 'dayz') { $$key = 'daysExcludeWeeks'; } } $value = $newData[$source]; $modulo = fmod($factor + fmod($value, $factor), $factor); $newData[$source] = $modulo; $newData[$target] += ($value - $modulo) / $factor; $decimalPart = fmod($newData[$source], 1); if ($decimalPart !== 0.0) { $unit = $source; foreach ($previous as [$subUnit, $subFactor]) { $newData[$unit] -= $decimalPart; $newData[$subUnit] += $decimalPart * $subFactor; $decimalPart = fmod($newData[$subUnit], 1); if ($decimalPart === 0.0) { break; } $unit = $subUnit; } } array_unshift($previous, [$source, $factor]); } $positive = null; if (!$deep) { foreach ($newData as $value) { if ($value) { if ($positive === null) { $positive = ($value > 0); continue; } if (($value > 0) !== $positive) { return $this->invertCascade($originalData) ->solveNegativeInterval(); } } } } return $this->set($newData) ->solveNegativeInterval(); } private function needsDeclension(string $mode, int $index, int $parts): bool { return match ($mode) { 'last' => $index === $parts - 1, default => true, }; } private function checkIntegerValue(string $name, mixed $value): void { if (\is_int($value)) { return; } $this->assertSafeForInteger($name, $value); if (\is_float($value) && (((float) (int) $value) === $value)) { return; } if (!self::$floatSettersEnabled) { $type = \gettype($value); @trigger_error( "Since 2.70.0, it's deprecated to pass $type value for $name.\n". "It's truncated when stored as an integer interval unit.\n". "From 3.0.0, decimal part will no longer be truncated and will be cascaded to smaller units.\n". "- To maintain the current behavior, use explicit cast: $name((int) \$value)\n". "- To adopt the new behavior globally, call CarbonInterval::enableFloatSetters()\n", \E_USER_DEPRECATED, ); } } /** * Throw an exception if precision loss when storing the given value as an integer would be >= 1.0. */ private function assertSafeForInteger(string $name, mixed $value): void { if ($value && !\is_int($value) && ($value >= 0x7fffffffffffffff || $value <= -0x7fffffffffffffff)) { throw new OutOfRangeException($name, -0x7fffffffffffffff, 0x7fffffffffffffff, $value); } } private function handleDecimalPart(string $unit, mixed $value, mixed $integerValue): void { if (self::$floatSettersEnabled) { $floatValue = (float) $value; $base = (float) $integerValue; if ($floatValue === $base) { return; } $units = [ 'y' => 'year', 'm' => 'month', 'd' => 'day', 'h' => 'hour', 'i' => 'minute', 's' => 'second', ]; $upper = true; foreach ($units as $property => $name) { if ($name === $unit) { $upper = false; continue; } if (!$upper && $this->$property !== 0) { throw new RuntimeException( "You cannot set $unit to a float value as $name would be overridden, ". 'set it first to 0 explicitly if you really want to erase its value' ); } } $this->add($unit, $floatValue - $base); } } private function getInnerValues(): array { return [$this->y, $this->m, $this->d, $this->h, $this->i, $this->s, $this->f, $this->invert, $this->days]; } private function checkStartAndEnd(): void { if ( $this->initialValues !== null && ($this->startDate !== null || $this->endDate !== null) && $this->initialValues !== $this->getInnerValues() ) { $this->absolute = false; $this->startDate = null; $this->endDate = null; $this->rawInterval = null; } } /** @return $this */ private function setSetting(string $setting, mixed $value): self { switch ($setting) { case 'timezoneSetting': return $value === null ? $this : $this->setTimezone($value); case 'step': $this->setStep($value); return $this; case 'localMonthsOverflow': return $value === null ? $this : $this->settings(['monthOverflow' => $value]); case 'localYearsOverflow': return $value === null ? $this : $this->settings(['yearOverflow' => $value]); case 'localStrictModeEnabled': case 'localHumanDiffOptions': case 'localToStringFormat': case 'localSerializer': case 'localMacros': case 'localGenericMacros': case 'localFormatFunction': case 'localTranslator': $this->$setting = $value; return $this; default: // Drop unknown settings return $this; } } private static function incrementUnit(DateInterval $instance, string $unit, int $value): void { if ($value === 0) { return; } // @codeCoverageIgnoreStart if (PHP_VERSION_ID !== 8_03_20) { $instance->$unit += $value; return; } // Cannot use +=, nor set to a negative value directly as it segfaults in PHP 8.3.20 self::setIntervalUnit($instance, $unit, ($instance->$unit ?? 0) + $value); // @codeCoverageIgnoreEnd } /** @codeCoverageIgnore */ private static function setIntervalUnit(DateInterval $instance, string $unit, mixed $value): void { switch ($unit) { case 'y': $instance->y = $value; break; case 'm': $instance->m = $value; break; case 'd': $instance->d = $value; break; case 'h': $instance->h = $value; break; case 'i': $instance->i = $value; break; case 's': $instance->s = $value; break; default: $instance->$unit = $value; } } } ================================================ FILE: src/Carbon/CarbonPeriod.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Constants\UnitValue; use Carbon\Exceptions\EndLessPeriodException; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidIntervalException; use Carbon\Exceptions\InvalidPeriodDateException; use Carbon\Exceptions\InvalidPeriodParameterException; use Carbon\Exceptions\NotACarbonClassException; use Carbon\Exceptions\NotAPeriodException; use Carbon\Exceptions\UnknownGetterException; use Carbon\Exceptions\UnknownMethodException; use Carbon\Exceptions\UnreachableException; use Carbon\Traits\DeprecatedPeriodProperties; use Carbon\Traits\IntervalRounding; use Carbon\Traits\LocalFactory; use Carbon\Traits\Mixin; use Carbon\Traits\Options; use Carbon\Traits\ToStringFormat; use Closure; use Countable; use DateInterval; use DatePeriod; use DateTime; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Generator; use InvalidArgumentException; use JsonSerializable; use ReflectionException; use ReturnTypeWillChange; use RuntimeException; use Throwable; // @codeCoverageIgnoreStart require PHP_VERSION < 8.2 ? __DIR__.'/../../lazy/Carbon/ProtectedDatePeriod.php' : __DIR__.'/../../lazy/Carbon/UnprotectedDatePeriod.php'; // @codeCoverageIgnoreEnd /** * Substitution of DatePeriod with some modifications and many more features. * * @method static static|CarbonInterface start($date = null, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance. * @method static static since($date = null, $inclusive = null) Alias for start(). * @method static static sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance. * @method static static|CarbonInterface end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance. * @method static static until($date = null, $inclusive = null) Alias for end(). * @method static static untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance. * @method static static dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. * @method static static between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. * @method static static recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance. * @method static static times($recurrences = null) Alias for recurrences(). * @method static static|int|null options($options = null) Create instance with options or modify the options if called on an instance. * @method static static toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance. * @method static static filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance. * @method static static push($callback, $name = null) Alias for filter(). * @method static static prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance. * @method static static|array filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance. * @method static static|CarbonInterval interval($interval = null) Create instance with given date interval or modify the interval if called on an instance. * @method static static each($interval) Create instance with given date interval or modify the interval if called on an instance. * @method static static every($interval) Create instance with given date interval or modify the interval if called on an instance. * @method static static step($interval) Create instance with given date interval or modify the interval if called on an instance. * @method static static stepBy($interval) Create instance with given date interval or modify the interval if called on an instance. * @method static static invert() Create instance with inverted date interval or invert the interval if called on an instance. * @method static static years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance. * @method static static year($years = 1) Alias for years(). * @method static static months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance. * @method static static month($months = 1) Alias for months(). * @method static static weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance. * @method static static week($weeks = 1) Alias for weeks(). * @method static static days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance. * @method static static dayz($days = 1) Alias for days(). * @method static static day($days = 1) Alias for days(). * @method static static hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance. * @method static static hour($hours = 1) Alias for hours(). * @method static static minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance. * @method static static minute($minutes = 1) Alias for minutes(). * @method static static seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance. * @method static static second($seconds = 1) Alias for seconds(). * @method static static milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds for date interval or replace the interval by the given a number of milliseconds if called on an instance. * @method static static millisecond($milliseconds = 1) Alias for milliseconds(). * @method static static microseconds($microseconds = 1) Create instance specifying a number of microseconds for date interval or replace the interval by the given a number of microseconds if called on an instance. * @method static static microsecond($microseconds = 1) Alias for microseconds(). * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. * @method $this roundWeek(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this roundWeeks(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this floorWeek(float $precision = 1) Truncate the current instance day with given precision. * @method $this floorWeeks(float $precision = 1) Truncate the current instance day with given precision. * @method $this ceilWeek(float $precision = 1) Ceil the current instance day with given precision. * @method $this ceilWeeks(float $precision = 1) Ceil the current instance day with given precision. * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. * * @mixin DeprecatedPeriodProperties * * @SuppressWarnings(TooManyFields) * @SuppressWarnings(CamelCasePropertyName) * @SuppressWarnings(CouplingBetweenObjects) */ class CarbonPeriod extends DatePeriodBase implements Countable, JsonSerializable, UnitValue { use LocalFactory; use IntervalRounding; use Mixin { Mixin::mixin as baseMixin; } use Options { Options::__debugInfo as baseDebugInfo; } use ToStringFormat; /** * Built-in filter for limit by recurrences. * * @var callable */ public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; /** * Built-in filter for limit to an end. * * @var callable */ public const END_DATE_FILTER = [self::class, 'filterEndDate']; /** * Special value which can be returned by filters to end iteration. Also a filter. * * @var callable */ public const END_ITERATION = [self::class, 'endIteration']; /** * Exclude end date from iteration. * * @var int */ public const EXCLUDE_END_DATE = 8; /** * Yield CarbonImmutable instances. * * @var int */ public const IMMUTABLE = 4; /** * Number of maximum attempts before giving up on finding next valid date. * * @var int */ public const NEXT_MAX_ATTEMPTS = 1000; /** * Number of maximum attempts before giving up on finding end date. * * @var int */ public const END_MAX_ATTEMPTS = 10000; /** * Default date class of iteration items. * * @var string */ protected const DEFAULT_DATE_CLASS = Carbon::class; /** * The registered macros. */ protected static array $macros = []; /** * Date class of iteration items. */ protected string $dateClass = Carbon::class; /** * Underlying date interval instance. Always present, one day by default. */ protected ?CarbonInterval $dateInterval = null; /** * True once __construct is finished. */ protected bool $constructed = false; /** * Whether current date interval was set by default. */ protected bool $isDefaultInterval = false; /** * The filters stack. */ protected array $filters = []; /** * Period start date. Applied on rewind. Always present, now by default. */ protected ?CarbonInterface $startDate = null; /** * Period end date. For inverted interval should be before the start date. Applied via a filter. */ protected ?CarbonInterface $endDate = null; /** * Limit for number of recurrences. Applied via a filter. */ protected int|float|null $carbonRecurrences = null; /** * Iteration options. */ protected ?int $options = null; /** * Index of current date. Always sequential, even if some dates are skipped by filters. * Equal to null only before the first iteration. */ protected int $key = 0; /** * Current date. May temporarily hold unaccepted value when looking for a next valid date. * Equal to null only before the first iteration. */ protected ?CarbonInterface $carbonCurrent = null; /** * Timezone of current date. Taken from the start date. */ protected ?DateTimeZone $timezone = null; /** * The cached validation result for current date. */ protected array|string|bool|null $validationResult = null; /** * Timezone handler for settings() method. */ protected DateTimeZone|string|int|null $timezoneSetting = null; public function getIterator(): Generator { $this->rewind(); while ($this->valid()) { $key = $this->key(); $value = $this->current(); yield $key => $value; $this->next(); } } /** * Make a CarbonPeriod instance from given variable if possible. */ public static function make(mixed $var): ?static { try { return static::instance($var); } catch (NotAPeriodException) { return static::create($var); } } /** * Create a new instance from a DatePeriod or CarbonPeriod object. */ public static function instance(mixed $period): static { if ($period instanceof static) { return $period->copy(); } if ($period instanceof self) { return new static( $period->getStartDate(), $period->getEndDate() ?? $period->getRecurrences(), $period->getDateInterval(), $period->getOptions(), ); } if ($period instanceof DatePeriod) { return new static( $period->start, $period->end ?: ($period->recurrences - 1), $period->interval, $period->include_start_date ? 0 : static::EXCLUDE_START_DATE, ); } $class = static::class; $type = \gettype($period); $chunks = explode('::', __METHOD__); throw new NotAPeriodException( 'Argument 1 passed to '.$class.'::'.end($chunks).'() '. 'must be an instance of DatePeriod or '.$class.', '. ($type === 'object' ? 'instance of '.\get_class($period) : $type).' given.', ); } /** * Create a new instance. */ public static function create(...$params): static { return static::createFromArray($params); } /** * Create a new instance from an array of parameters. */ public static function createFromArray(array $params): static { return new static(...$params); } /** * Create CarbonPeriod from ISO 8601 string. */ public static function createFromIso(string $iso, ?int $options = null): static { $params = static::parseIso8601($iso); $instance = static::createFromArray($params); $instance->options = ($instance instanceof CarbonPeriodImmutable ? static::IMMUTABLE : 0) | $options; $instance->handleChangedParameters(); return $instance; } public static function createFromISO8601String(string $iso, ?int $options = null): static { return self::createFromIso($iso, $options); } /** * Return whether the given interval contains non-zero value of any time unit. */ protected static function intervalHasTime(DateInterval $interval): bool { return $interval->h || $interval->i || $interval->s || $interval->f; } /** * Return whether given variable is an ISO 8601 specification. * * Note: Check is very basic, as actual validation will be done later when parsing. * We just want to ensure that variable is not any other type of valid parameter. */ protected static function isIso8601(mixed $var): bool { if (!\is_string($var)) { return false; } // Match slash but not within a timezone name. $part = '[a-z]+(?:[_-][a-z]+)*'; preg_match("#\b$part/$part\b|(/)#i", $var, $match); return isset($match[1]); } /** * Parse given ISO 8601 string into an array of arguments. * * @SuppressWarnings(ElseExpression) */ protected static function parseIso8601(string $iso): array { $result = []; $interval = null; $start = null; $end = null; $dateClass = static::DEFAULT_DATE_CLASS; foreach (explode('/', $iso) as $key => $part) { if ($key === 0 && preg_match('/^R(\d*|INF)$/', $part, $match)) { $parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null; } elseif ($interval === null && $parsed = self::makeInterval($part)) { $interval = $part; } elseif ($start === null && $parsed = $dateClass::make($part)) { $start = $part; } elseif ($end === null && $parsed = $dateClass::make(static::addMissingParts($start ?? '', $part))) { $end = $part; } else { throw new InvalidPeriodParameterException("Invalid ISO 8601 specification: $iso."); } $result[] = $parsed; } return $result; } /** * Add missing parts of the target date from the source date. */ protected static function addMissingParts(string $source, string $target): string { $pattern = '/'.preg_replace('/\d+/', '[0-9]+', preg_quote($target, '/')).'$/'; $result = preg_replace($pattern, $target, $source, 1, $count); return $count ? $result : $target; } private static function makeInterval(mixed $input): ?CarbonInterval { try { return CarbonInterval::make($input); } catch (Throwable) { return null; } } private static function makeTimezone(mixed $input): ?CarbonTimeZone { if (!\is_string($input)) { return null; } try { return CarbonTimeZone::create($input); } catch (Throwable) { return null; } } /** * Register a custom macro. * * Pass null macro to remove it. * * @example * ``` * CarbonPeriod::macro('middle', function () { * return $this->getStartDate()->average($this->getEndDate()); * }); * echo CarbonPeriod::since('2011-05-12')->until('2011-06-03')->middle(); * ``` * * @param-closure-this static $macro */ public static function macro(string $name, ?callable $macro): void { static::$macros[$name] = $macro; } /** * Register macros from a mixin object. * * @example * ``` * CarbonPeriod::mixin(new class { * public function addDays() { * return function ($count = 1) { * return $this->setStartDate( * $this->getStartDate()->addDays($count) * )->setEndDate( * $this->getEndDate()->addDays($count) * ); * }; * } * public function subDays() { * return function ($count = 1) { * return $this->setStartDate( * $this->getStartDate()->subDays($count) * )->setEndDate( * $this->getEndDate()->subDays($count) * ); * }; * } * }); * echo CarbonPeriod::create('2000-01-01', '2000-02-01')->addDays(5)->subDays(3); * ``` * * @throws ReflectionException */ public static function mixin(object|string $mixin): void { static::baseMixin($mixin); } /** * Check if macro is registered. */ public static function hasMacro(string $name): bool { return isset(static::$macros[$name]); } /** * Provide static proxy for instance aliases. */ public static function __callStatic(string $method, array $parameters): mixed { $date = new static(); if (static::hasMacro($method)) { return static::bindMacroContext(null, static fn () => $date->callMacro($method, $parameters)); } return $date->$method(...$parameters); } /** * CarbonPeriod constructor. * * @SuppressWarnings(ElseExpression) * * @throws InvalidArgumentException */ public function __construct(...$arguments) { $raw = null; if (isset($arguments['raw'])) { $raw = $arguments['raw']; $this->isDefaultInterval = $arguments['isDefaultInterval'] ?? false; if (isset($arguments['dateClass'])) { $this->dateClass = $arguments['dateClass']; } $arguments = $raw; } // Parse and assign arguments one by one. First argument may be an ISO 8601 spec, // which will be first parsed into parts and then processed the same way. $argumentsCount = \count($arguments); if ($argumentsCount && static::isIso8601($iso = $arguments[0])) { array_splice($arguments, 0, 1, static::parseIso8601($iso)); } if ($argumentsCount === 1) { if ($arguments[0] instanceof self) { $arguments = [ $arguments[0]->getStartDate(), $arguments[0]->getEndDate() ?? $arguments[0]->getRecurrences(), $arguments[0]->getDateInterval(), $arguments[0]->getOptions(), ]; } elseif ($arguments[0] instanceof DatePeriod) { $arguments = [ $arguments[0]->start, $arguments[0]->end ?: ($arguments[0]->recurrences - 1), $arguments[0]->interval, $arguments[0]->include_start_date ? 0 : static::EXCLUDE_START_DATE, ]; } } if (is_a($this->dateClass, DateTimeImmutable::class, true)) { $this->options = static::IMMUTABLE; } $optionsSet = false; $originalArguments = []; $sortedArguments = []; foreach ($arguments as $argument) { $parsedDate = null; if ($argument instanceof DateTimeZone) { $sortedArguments = $this->configureTimezone($argument, $sortedArguments, $originalArguments); } elseif (!isset($sortedArguments['interval']) && ( (\is_string($argument) && preg_match( '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T\d].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i', $argument, )) || $argument instanceof DateInterval || $argument instanceof Closure || $argument instanceof Unit ) && $parsedInterval = self::makeInterval($argument) ) { $sortedArguments['interval'] = $parsedInterval; } elseif (!isset($sortedArguments['start']) && $parsedDate = $this->makeDateTime($argument)) { $sortedArguments['start'] = $parsedDate; $originalArguments['start'] = $argument; } elseif (!isset($sortedArguments['end']) && ($parsedDate = $parsedDate ?? $this->makeDateTime($argument))) { $sortedArguments['end'] = $parsedDate; $originalArguments['end'] = $argument; } elseif (!isset($sortedArguments['recurrences']) && !isset($sortedArguments['end']) && (\is_int($argument) || \is_float($argument)) && $argument >= 0 ) { $sortedArguments['recurrences'] = $argument; } elseif (!$optionsSet && (\is_int($argument) || $argument === null)) { $optionsSet = true; $sortedArguments['options'] = (((int) $this->options) | ((int) $argument)); } elseif ($parsedTimezone = self::makeTimezone($argument)) { $sortedArguments = $this->configureTimezone($parsedTimezone, $sortedArguments, $originalArguments); } else { throw new InvalidPeriodParameterException('Invalid constructor parameters.'); } } if ($raw === null && isset($sortedArguments['start'])) { $end = $sortedArguments['end'] ?? max(1, $sortedArguments['recurrences'] ?? 1); if (\is_float($end)) { $end = $end === INF ? PHP_INT_MAX : (int) round($end); } $raw = [ $sortedArguments['start'], $sortedArguments['interval'] ?? CarbonInterval::day(), $end, ]; } $this->setFromAssociativeArray($sortedArguments); if ($this->startDate === null) { $dateClass = $this->dateClass; $this->setStartDate($dateClass::now()); } if ($this->dateInterval === null) { $this->setDateInterval(CarbonInterval::day()); $this->isDefaultInterval = true; } if ($this->options === null) { $this->setOptions(0); } parent::__construct( $this->startDate, $this->dateInterval, $this->endDate ?? max(1, min(2147483639, $this->recurrences ?? 1)), $this->options, ); $this->constructed = true; } /** * Get a copy of the instance. */ public function copy(): static { return clone $this; } /** * Prepare the instance to be set (self if mutable to be mutated, * copy if immutable to generate a new instance). */ protected function copyIfImmutable(): static { return $this; } /** * Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names. */ protected function getGetter(string $name): ?callable { return match (strtolower(preg_replace('/[A-Z]/', '_$0', $name))) { 'start', 'start_date' => [$this, 'getStartDate'], 'end', 'end_date' => [$this, 'getEndDate'], 'interval', 'date_interval' => [$this, 'getDateInterval'], 'recurrences' => [$this, 'getRecurrences'], 'include_start_date' => [$this, 'isStartIncluded'], 'include_end_date' => [$this, 'isEndIncluded'], 'current' => [$this, 'current'], 'locale' => [$this, 'locale'], 'tzname', 'tz_name' => fn () => match (true) { $this->timezoneSetting === null => null, \is_string($this->timezoneSetting) => $this->timezoneSetting, $this->timezoneSetting instanceof DateTimeZone => $this->timezoneSetting->getName(), default => CarbonTimeZone::instance($this->timezoneSetting)->getName(), }, default => null, }; } /** * Get a property allowing both `DatePeriod` snakeCase and camelCase names. * * @param string $name * * @return bool|CarbonInterface|CarbonInterval|int|null */ public function get(string $name) { $getter = $this->getGetter($name); if ($getter) { return $getter(); } throw new UnknownGetterException($name); } /** * Get a property allowing both `DatePeriod` snakeCase and camelCase names. * * @param string $name * * @return bool|CarbonInterface|CarbonInterval|int|null */ public function __get(string $name) { return $this->get($name); } /** * Check if an attribute exists on the object * * @param string $name * * @return bool */ public function __isset(string $name): bool { return $this->getGetter($name) !== null; } /** * @alias copy * * Get a copy of the instance. * * @return static */ public function clone() { return clone $this; } /** * Set the iteration item class. * * @param string $dateClass * * @return static */ public function setDateClass(string $dateClass) { if (!is_a($dateClass, CarbonInterface::class, true)) { throw new NotACarbonClassException($dateClass); } $self = $this->copyIfImmutable(); $self->dateClass = $dateClass; if (is_a($dateClass, Carbon::class, true)) { $self->options = $self->options & ~static::IMMUTABLE; } elseif (is_a($dateClass, CarbonImmutable::class, true)) { $self->options = $self->options | static::IMMUTABLE; } return $self; } /** * Returns iteration item date class. * * @return string */ public function getDateClass(): string { return $this->dateClass; } /** * Change the period date interval. * * @param DateInterval|Unit|string|int $interval * @param Unit|string $unit the unit of $interval if it's a number * * @throws InvalidIntervalException * * @return static */ public function setDateInterval(mixed $interval, Unit|string|null $unit = null): static { if ($interval instanceof Unit) { $interval = $interval->interval(); } if ($unit instanceof Unit) { $unit = $unit->name; } if (!$interval = CarbonInterval::make($interval, $unit)) { throw new InvalidIntervalException('Invalid interval.'); } if ($interval->spec() === 'PT0S' && !$interval->f && !$interval->getStep()) { throw new InvalidIntervalException('Empty interval is not accepted.'); } $self = $this->copyIfImmutable(); $self->dateInterval = $interval; $self->isDefaultInterval = false; $self->handleChangedParameters(); return $self; } /** * Reset the date interval to the default value. * * Difference with simply setting interval to 1-day is that P1D will not appear when calling toIso8601String() * and also next adding to the interval won't include the default 1-day. */ public function resetDateInterval(): static { $self = $this->copyIfImmutable(); $self->setDateInterval(CarbonInterval::day()); $self->isDefaultInterval = true; return $self; } /** * Invert the period date interval. */ public function invertDateInterval(): static { return $this->setDateInterval($this->dateInterval->invert()); } /** * Set start and end date. * * @param DateTime|DateTimeInterface|string $start * @param DateTime|DateTimeInterface|string|null $end * * @return static */ public function setDates(mixed $start, mixed $end): static { return $this->setStartDate($start)->setEndDate($end); } /** * Change the period options. * * @param int|null $options * * @return static */ public function setOptions(?int $options): static { $self = $this->copyIfImmutable(); $self->options = $options ?? 0; $self->handleChangedParameters(); return $self; } /** * Get the period options. */ public function getOptions(): int { return $this->options ?? 0; } /** * Toggle given options on or off. * * @param int $options * @param bool|null $state * * @throws InvalidArgumentException * * @return static */ public function toggleOptions(int $options, ?bool $state = null): static { $self = $this->copyIfImmutable(); if ($state === null) { $state = ($this->options & $options) !== $options; } return $self->setOptions( $state ? $this->options | $options : $this->options & ~$options, ); } /** * Toggle EXCLUDE_START_DATE option. */ public function excludeStartDate(bool $state = true): static { return $this->toggleOptions(static::EXCLUDE_START_DATE, $state); } /** * Toggle EXCLUDE_END_DATE option. */ public function excludeEndDate(bool $state = true): static { return $this->toggleOptions(static::EXCLUDE_END_DATE, $state); } /** * Get the underlying date interval. */ public function getDateInterval(): CarbonInterval { return $this->dateInterval->copy(); } /** * Get start date of the period. * * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. */ public function getStartDate(?string $rounding = null): CarbonInterface { $date = $this->startDate->avoidMutation(); return $rounding ? $date->round($this->getDateInterval(), $rounding) : $date; } /** * Get end date of the period. * * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. */ public function getEndDate(?string $rounding = null): ?CarbonInterface { if (!$this->endDate) { return null; } $date = $this->endDate->avoidMutation(); return $rounding ? $date->round($this->getDateInterval(), $rounding) : $date; } /** * Get number of recurrences. */ #[ReturnTypeWillChange] public function getRecurrences(): int|float|null { return $this->carbonRecurrences; } /** * Returns true if the start date should be excluded. */ public function isStartExcluded(): bool { return ($this->options & static::EXCLUDE_START_DATE) !== 0; } /** * Returns true if the end date should be excluded. */ public function isEndExcluded(): bool { return ($this->options & static::EXCLUDE_END_DATE) !== 0; } /** * Returns true if the start date should be included. */ public function isStartIncluded(): bool { return !$this->isStartExcluded(); } /** * Returns true if the end date should be included. */ public function isEndIncluded(): bool { return !$this->isEndExcluded(); } /** * Return the start if it's included by option, else return the start + 1 period interval. */ public function getIncludedStartDate(): CarbonInterface { $start = $this->getStartDate(); if ($this->isStartExcluded()) { return $start->add($this->getDateInterval()); } return $start; } /** * Return the end if it's included by option, else return the end - 1 period interval. * Warning: if the period has no fixed end, this method will iterate the period to calculate it. */ public function getIncludedEndDate(): CarbonInterface { $end = $this->getEndDate(); if (!$end) { return $this->calculateEnd(); } if ($this->isEndExcluded()) { return $end->sub($this->getDateInterval()); } return $end; } /** * Add a filter to the stack. * * @SuppressWarnings(UnusedFormalParameter) */ public function addFilter(callable|string $callback, ?string $name = null): static { $self = $this->copyIfImmutable(); $tuple = $self->createFilterTuple(\func_get_args()); $self->filters[] = $tuple; $self->handleChangedParameters(); return $self; } /** * Prepend a filter to the stack. * * @SuppressWarnings(UnusedFormalParameter) */ public function prependFilter(callable|string $callback, ?string $name = null): static { $self = $this->copyIfImmutable(); $tuple = $self->createFilterTuple(\func_get_args()); array_unshift($self->filters, $tuple); $self->handleChangedParameters(); return $self; } /** * Remove a filter by instance or name. */ public function removeFilter(callable|string $filter): static { $self = $this->copyIfImmutable(); $key = \is_callable($filter) ? 0 : 1; $self->filters = array_values(array_filter( $this->filters, static fn ($tuple) => $tuple[$key] !== $filter, )); $self->updateInternalState(); $self->handleChangedParameters(); return $self; } /** * Return whether given instance or name is in the filter stack. */ public function hasFilter(callable|string $filter): bool { $key = \is_callable($filter) ? 0 : 1; foreach ($this->filters as $tuple) { if ($tuple[$key] === $filter) { return true; } } return false; } /** * Get filters stack. */ public function getFilters(): array { return $this->filters; } /** * Set filters stack. */ public function setFilters(array $filters): static { $self = $this->copyIfImmutable(); $self->filters = $filters; $self->updateInternalState(); $self->handleChangedParameters(); return $self; } /** * Reset filters stack. */ public function resetFilters(): static { $self = $this->copyIfImmutable(); $self->filters = []; if ($self->endDate !== null) { $self->filters[] = [static::END_DATE_FILTER, null]; } if ($self->carbonRecurrences !== null) { $self->filters[] = [static::RECURRENCES_FILTER, null]; } $self->handleChangedParameters(); return $self; } /** * Add a recurrences filter (set maximum number of recurrences). * * @throws InvalidArgumentException */ public function setRecurrences(int|float|null $recurrences): static { if ($recurrences === null) { return $this->removeFilter(static::RECURRENCES_FILTER); } if ($recurrences < 0) { throw new InvalidPeriodParameterException('Invalid number of recurrences.'); } /** @var self $self */ $self = $this->copyIfImmutable(); $self->carbonRecurrences = $recurrences === INF ? INF : (int) $recurrences; if (!$self->hasFilter(static::RECURRENCES_FILTER)) { return $self->addFilter(static::RECURRENCES_FILTER); } $self->handleChangedParameters(); return $self; } /** * Change the period start date. * * @param DateTime|DateTimeInterface|string $date * @param bool|null $inclusive * * @throws InvalidPeriodDateException * * @return static */ public function setStartDate(mixed $date, ?bool $inclusive = null): static { if (!$this->isInfiniteDate($date) && !($date = ([$this->dateClass, 'make'])($date, $this->timezone))) { throw new InvalidPeriodDateException('Invalid start date.'); } $self = $this->copyIfImmutable(); $self->startDate = $date; if ($inclusive !== null) { $self = $self->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive); } return $self; } /** * Change the period end date. * * @param DateTime|DateTimeInterface|string|null $date * @param bool|null $inclusive * * @throws \InvalidArgumentException * * @return static */ public function setEndDate(mixed $date, ?bool $inclusive = null): static { if ($date !== null && !$this->isInfiniteDate($date) && !$date = ([$this->dateClass, 'make'])($date, $this->timezone)) { throw new InvalidPeriodDateException('Invalid end date.'); } if (!$date) { return $this->removeFilter(static::END_DATE_FILTER); } $self = $this->copyIfImmutable(); $self->endDate = $date; if ($inclusive !== null) { $self = $self->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive); } if (!$self->hasFilter(static::END_DATE_FILTER)) { return $self->addFilter(static::END_DATE_FILTER); } $self->handleChangedParameters(); return $self; } /** * Check if the current position is valid. */ public function valid(): bool { return $this->validateCurrentDate() === true; } /** * Return the current key. */ public function key(): ?int { return $this->valid() ? $this->key : null; } /** * Return the current date. */ public function current(): ?CarbonInterface { return $this->valid() ? $this->prepareForReturn($this->carbonCurrent) : null; } /** * Move forward to the next date. * * @throws RuntimeException */ public function next(): void { if ($this->carbonCurrent === null) { $this->rewind(); } if ($this->validationResult !== static::END_ITERATION) { $this->key++; $this->incrementCurrentDateUntilValid(); } } /** * Rewind to the start date. * * Iterating over a date in the UTC timezone avoids bug during backward DST change. * * @see https://bugs.php.net/bug.php?id=72255 * @see https://bugs.php.net/bug.php?id=74274 * @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time * * @throws RuntimeException */ public function rewind(): void { $this->key = 0; $this->carbonCurrent = ([$this->dateClass, 'make'])($this->startDate); $settings = $this->getSettings(); if ($this->hasLocalTranslator()) { $settings['locale'] = $this->getTranslatorLocale(); } $this->carbonCurrent->settings($settings); $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->carbonCurrent->getTimezone() : null; if ($this->timezone) { $this->carbonCurrent = $this->carbonCurrent->utc(); } $this->validationResult = null; if ($this->isStartExcluded() || $this->validateCurrentDate() === false) { $this->incrementCurrentDateUntilValid(); } } /** * Skip iterations and returns iteration state (false if ended, true if still valid). * * @param int $count steps number to skip (1 by default) * * @return bool */ public function skip(int $count = 1): bool { for ($i = $count; $this->valid() && $i > 0; $i--) { $this->next(); } return $this->valid(); } /** * Format the date period as ISO 8601. */ public function toIso8601String(): string { $parts = []; if ($this->carbonRecurrences !== null) { $parts[] = 'R'.$this->carbonRecurrences; } $parts[] = $this->startDate->toIso8601String(); if (!$this->isDefaultInterval) { $parts[] = $this->dateInterval->spec(); } if ($this->endDate !== null) { $parts[] = $this->endDate->toIso8601String(); } return implode('/', $parts); } /** * Convert the date period into a string. */ public function toString(): string { $format = $this->localToStringFormat ?? $this->getFactory()->getSettings()['toStringFormat'] ?? null; if ($format instanceof Closure) { return $format($this); } $translator = ([$this->dateClass, 'getTranslator'])(); $parts = []; $format = $format ?? ( !$this->startDate->isStartOfDay() || ($this->endDate && !$this->endDate->isStartOfDay()) ? 'Y-m-d H:i:s' : 'Y-m-d' ); if ($this->carbonRecurrences !== null) { $parts[] = $this->translate('period_recurrences', [], $this->carbonRecurrences, $translator); } $parts[] = $this->translate('period_interval', [':interval' => $this->dateInterval->forHumans([ 'join' => true, ])], null, $translator); $parts[] = $this->translate('period_start_date', [':date' => $this->startDate->rawFormat($format)], null, $translator); if ($this->endDate !== null) { $parts[] = $this->translate('period_end_date', [':date' => $this->endDate->rawFormat($format)], null, $translator); } $result = implode(' ', $parts); return mb_strtoupper(mb_substr($result, 0, 1)).mb_substr($result, 1); } /** * Format the date period as ISO 8601. */ public function spec(): string { return $this->toIso8601String(); } /** * Cast the current instance into the given class. * * @param string $className The $className::instance() method will be called to cast the current object. * * @return DatePeriod|object */ public function cast(string $className): object { if (!method_exists($className, 'instance')) { if (is_a($className, DatePeriod::class, true)) { return new $className( $this->rawDate($this->getStartDate()), $this->getDateInterval(), $this->getEndDate() ? $this->rawDate($this->getIncludedEndDate()) : $this->getRecurrences(), $this->isStartExcluded() ? DatePeriod::EXCLUDE_START_DATE : 0, ); } throw new InvalidCastException("$className has not the instance() method needed to cast the date."); } return $className::instance($this); } /** * Return native DatePeriod PHP object matching the current instance. * * @example * ``` * var_dump(CarbonPeriod::create('2021-01-05', '2021-02-15')->toDatePeriod()); * ``` */ public function toDatePeriod(): DatePeriod { return $this->cast(DatePeriod::class); } /** * Return `true` if the period has no custom filter and is guaranteed to be endless. * * Note that we can't check if a period is endless as soon as it has custom filters * because filters can emit `CarbonPeriod::END_ITERATION` to stop the iteration in * a way we can't predict without actually iterating the period. */ public function isUnfilteredAndEndLess(): bool { foreach ($this->filters as $filter) { switch ($filter) { case [static::RECURRENCES_FILTER, null]: if ($this->carbonRecurrences !== null && is_finite($this->carbonRecurrences)) { return false; } break; case [static::END_DATE_FILTER, null]: if ($this->endDate !== null && !$this->endDate->isEndOfTime()) { return false; } break; default: return false; } } return true; } /** * Convert the date period into an array without changing current iteration state. * * @return CarbonInterface[] */ public function toArray(): array { if ($this->isUnfilteredAndEndLess()) { throw new EndLessPeriodException("Endless period can't be converted to array nor counted."); } $state = [ $this->key, $this->carbonCurrent ? $this->carbonCurrent->avoidMutation() : null, $this->validationResult, ]; $result = iterator_to_array($this); [$this->key, $this->carbonCurrent, $this->validationResult] = $state; return $result; } /** * Count dates in the date period. */ public function count(): int { return \count($this->toArray()); } /** * Return the first date in the date period. */ public function first(): ?CarbonInterface { if ($this->isUnfilteredAndEndLess()) { foreach ($this as $date) { $this->rewind(); return $date; } return null; } return ($this->toArray() ?: [])[0] ?? null; } /** * Return the last date in the date period. */ public function last(): ?CarbonInterface { $array = $this->toArray(); return $array ? $array[\count($array) - 1] : null; } /** * Convert the date period into a string. */ public function __toString(): string { return $this->toString(); } /** * Add aliases for setters. * * CarbonPeriod::days(3)->hours(5)->invert() * ->sinceNow()->until('2010-01-10') * ->filter(...) * ->count() * * Note: We use magic method to let static and instance aliases with the same names. */ public function __call(string $method, array $parameters): mixed { if (static::hasMacro($method)) { return static::bindMacroContext($this, fn () => $this->callMacro($method, $parameters)); } $roundedValue = $this->callRoundMethod($method, $parameters); if ($roundedValue !== null) { return $roundedValue; } $count = \count($parameters); switch ($method) { case 'start': case 'since': if ($count === 0) { return $this->getStartDate(); } self::setDefaultParameters($parameters, [ [0, 'date', null], ]); return $this->setStartDate(...$parameters); case 'sinceNow': return $this->setStartDate(new Carbon(), ...$parameters); case 'end': case 'until': if ($count === 0) { return $this->getEndDate(); } self::setDefaultParameters($parameters, [ [0, 'date', null], ]); return $this->setEndDate(...$parameters); case 'untilNow': return $this->setEndDate(new Carbon(), ...$parameters); case 'dates': case 'between': self::setDefaultParameters($parameters, [ [0, 'start', null], [1, 'end', null], ]); return $this->setDates(...$parameters); case 'recurrences': case 'times': if ($count === 0) { return $this->getRecurrences(); } self::setDefaultParameters($parameters, [ [0, 'recurrences', null], ]); return $this->setRecurrences(...$parameters); case 'options': if ($count === 0) { return $this->getOptions(); } self::setDefaultParameters($parameters, [ [0, 'options', null], ]); return $this->setOptions(...$parameters); case 'toggle': self::setDefaultParameters($parameters, [ [0, 'options', null], ]); return $this->toggleOptions(...$parameters); case 'filter': case 'push': return $this->addFilter(...$parameters); case 'prepend': return $this->prependFilter(...$parameters); case 'filters': if ($count === 0) { return $this->getFilters(); } self::setDefaultParameters($parameters, [ [0, 'filters', []], ]); return $this->setFilters(...$parameters); case 'interval': case 'each': case 'every': case 'step': case 'stepBy': if ($count === 0) { return $this->getDateInterval(); } return $this->setDateInterval(...$parameters); case 'invert': return $this->invertDateInterval(); case 'years': case 'year': case 'months': case 'month': case 'weeks': case 'week': case 'days': case 'dayz': case 'day': case 'hours': case 'hour': case 'minutes': case 'minute': case 'seconds': case 'second': case 'milliseconds': case 'millisecond': case 'microseconds': case 'microsecond': return $this->setDateInterval(( // Override default P1D when instantiating via fluent setters. [$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method] )(...$parameters)); } $dateClass = $this->dateClass; if ($this->localStrictModeEnabled ?? $dateClass::isStrictModeEnabled()) { throw new UnknownMethodException($method); } return $this; } /** * Set the instance's timezone from a string or object and apply it to start/end. */ public function setTimezone(DateTimeZone|string|int $timezone): static { $self = $this->copyIfImmutable(); $self->timezoneSetting = $timezone; $self->timezone = CarbonTimeZone::instance($timezone); if ($self->startDate) { $self = $self->setStartDate($self->startDate->setTimezone($timezone)); } if ($self->endDate) { $self = $self->setEndDate($self->endDate->setTimezone($timezone)); } return $self; } /** * Set the instance's timezone from a string or object and add/subtract the offset difference to start/end. */ public function shiftTimezone(DateTimeZone|string|int $timezone): static { $self = $this->copyIfImmutable(); $self->timezoneSetting = $timezone; $self->timezone = CarbonTimeZone::instance($timezone); if ($self->startDate) { $self = $self->setStartDate($self->startDate->shiftTimezone($timezone)); } if ($self->endDate) { $self = $self->setEndDate($self->endDate->shiftTimezone($timezone)); } return $self; } /** * Returns the end is set, else calculated from start and recurrences. * * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. * * @return CarbonInterface */ public function calculateEnd(?string $rounding = null): CarbonInterface { if ($end = $this->getEndDate($rounding)) { return $end; } if ($this->dateInterval->isEmpty()) { return $this->getStartDate($rounding); } $date = $this->getEndFromRecurrences() ?? $this->iterateUntilEnd(); if ($date && $rounding) { $date = $date->avoidMutation()->round($this->getDateInterval(), $rounding); } return $date; } private function getEndFromRecurrences(): ?CarbonInterface { if ($this->carbonRecurrences === null) { throw new UnreachableException( "Could not calculate period end without either explicit end or recurrences.\n". "If you're looking for a forever-period, use ->setRecurrences(INF).", ); } if ($this->carbonRecurrences === INF) { $start = $this->getStartDate(); return $start < $start->avoidMutation()->add($this->getDateInterval()) ? CarbonImmutable::endOfTime() : CarbonImmutable::startOfTime(); } if ($this->filters === [[static::RECURRENCES_FILTER, null]]) { return $this->getStartDate()->avoidMutation()->add( $this->getDateInterval()->times( $this->carbonRecurrences - ($this->isStartExcluded() ? 0 : 1), ), ); } return null; } private function iterateUntilEnd(): ?CarbonInterface { $attempts = 0; $date = null; foreach ($this as $date) { if (++$attempts > static::END_MAX_ATTEMPTS) { throw new UnreachableException( 'Could not calculate period end after iterating '.static::END_MAX_ATTEMPTS.' times.', ); } } return $date; } /** * Returns true if the current period overlaps the given one (if 1 parameter passed) * or the period between 2 dates (if 2 parameters passed). * * @param CarbonPeriod|\DateTimeInterface|Carbon|CarbonImmutable|string $rangeOrRangeStart * @param \DateTimeInterface|Carbon|CarbonImmutable|string|null $rangeEnd * * @return bool */ public function overlaps(mixed $rangeOrRangeStart, mixed $rangeEnd = null): bool { $range = $rangeEnd ? static::create($rangeOrRangeStart, $rangeEnd) : $rangeOrRangeStart; if (!($range instanceof self)) { $range = static::create($range); } [$start, $end] = $this->orderCouple($this->getStartDate(), $this->calculateEnd()); [$rangeStart, $rangeEnd] = $this->orderCouple($range->getStartDate(), $range->calculateEnd()); return $end > $rangeStart && $rangeEnd > $start; } /** * Execute a given function on each date of the period. * * @example * ``` * Carbon::create('2020-11-29')->daysUntil('2020-12-24')->forEach(function (Carbon $date) { * echo $date->diffInDays('2020-12-25')." days before Christmas!\n"; * }); * ``` */ public function forEach(callable $callback): void { foreach ($this as $date) { $callback($date); } } /** * Execute a given function on each date of the period and yield the result of this function. * * @example * ``` * $period = Carbon::create('2020-11-29')->daysUntil('2020-12-24'); * echo implode("\n", iterator_to_array($period->map(function (Carbon $date) { * return $date->diffInDays('2020-12-25').' days before Christmas!'; * }))); * ``` */ public function map(callable $callback): Generator { foreach ($this as $date) { yield $callback($date); } } /** * Determines if the instance is equal to another. * Warning: if options differ, instances will never be equal. * * @see equalTo() */ public function eq(mixed $period): bool { return $this->equalTo($period); } /** * Determines if the instance is equal to another. * Warning: if options differ, instances will never be equal. */ public function equalTo(mixed $period): bool { if (!($period instanceof self)) { $period = self::make($period); } $end = $this->getEndDate(); return $period !== null && $this->getDateInterval()->eq($period->getDateInterval()) && $this->getStartDate()->eq($period->getStartDate()) && ($end ? $end->eq($period->getEndDate()) : $this->getRecurrences() === $period->getRecurrences()) && ($this->getOptions() & (~static::IMMUTABLE)) === ($period->getOptions() & (~static::IMMUTABLE)); } /** * Determines if the instance is not equal to another. * Warning: if options differ, instances will never be equal. * * @see notEqualTo() */ public function ne(mixed $period): bool { return $this->notEqualTo($period); } /** * Determines if the instance is not equal to another. * Warning: if options differ, instances will never be equal. */ public function notEqualTo(mixed $period): bool { return !$this->eq($period); } /** * Determines if the start date is before another given date. * (Rather start/end are included by options is ignored.) */ public function startsBefore(mixed $date = null): bool { return $this->getStartDate()->lessThan($this->resolveCarbon($date)); } /** * Determines if the start date is before or the same as a given date. * (Rather start/end are included by options is ignored.) */ public function startsBeforeOrAt(mixed $date = null): bool { return $this->getStartDate()->lessThanOrEqualTo($this->resolveCarbon($date)); } /** * Determines if the start date is after another given date. * (Rather start/end are included by options is ignored.) */ public function startsAfter(mixed $date = null): bool { return $this->getStartDate()->greaterThan($this->resolveCarbon($date)); } /** * Determines if the start date is after or the same as a given date. * (Rather start/end are included by options is ignored.) */ public function startsAfterOrAt(mixed $date = null): bool { return $this->getStartDate()->greaterThanOrEqualTo($this->resolveCarbon($date)); } /** * Determines if the start date is the same as a given date. * (Rather start/end are included by options is ignored.) */ public function startsAt(mixed $date = null): bool { return $this->getStartDate()->equalTo($this->resolveCarbon($date)); } /** * Determines if the end date is before another given date. * (Rather start/end are included by options is ignored.) */ public function endsBefore(mixed $date = null): bool { return $this->calculateEnd()->lessThan($this->resolveCarbon($date)); } /** * Determines if the end date is before or the same as a given date. * (Rather start/end are included by options is ignored.) */ public function endsBeforeOrAt(mixed $date = null): bool { return $this->calculateEnd()->lessThanOrEqualTo($this->resolveCarbon($date)); } /** * Determines if the end date is after another given date. * (Rather start/end are included by options is ignored.) */ public function endsAfter(mixed $date = null): bool { return $this->calculateEnd()->greaterThan($this->resolveCarbon($date)); } /** * Determines if the end date is after or the same as a given date. * (Rather start/end are included by options is ignored.) */ public function endsAfterOrAt(mixed $date = null): bool { return $this->calculateEnd()->greaterThanOrEqualTo($this->resolveCarbon($date)); } /** * Determines if the end date is the same as a given date. * (Rather start/end are included by options is ignored.) */ public function endsAt(mixed $date = null): bool { return $this->calculateEnd()->equalTo($this->resolveCarbon($date)); } /** * Return true if start date is now or later. * (Rather start/end are included by options is ignored.) */ public function isStarted(): bool { return $this->startsBeforeOrAt(); } /** * Return true if end date is now or later. * (Rather start/end are included by options is ignored.) */ public function isEnded(): bool { return $this->endsBeforeOrAt(); } /** * Return true if now is between start date (included) and end date (excluded). * (Rather start/end are included by options is ignored.) */ public function isInProgress(): bool { return $this->isStarted() && !$this->isEnded(); } /** * Round the current instance at the given unit with given precision if specified and the given function. */ public function roundUnit( string $unit, DateInterval|float|int|string|null $precision = 1, callable|string $function = 'round', ): static { $self = $this->copyIfImmutable(); $self = $self->setStartDate($self->getStartDate()->roundUnit($unit, $precision, $function)); if ($self->endDate) { $self = $self->setEndDate($self->getEndDate()->roundUnit($unit, $precision, $function)); } return $self->setDateInterval($self->getDateInterval()->roundUnit($unit, $precision, $function)); } /** * Truncate the current instance at the given unit with given precision if specified. */ public function floorUnit(string $unit, DateInterval|float|int|string|null $precision = 1): static { return $this->roundUnit($unit, $precision, 'floor'); } /** * Ceil the current instance at the given unit with given precision if specified. */ public function ceilUnit(string $unit, DateInterval|float|int|string|null $precision = 1): static { return $this->roundUnit($unit, $precision, 'ceil'); } /** * Round the current instance second with given precision if specified (else period interval is used). */ public function round( DateInterval|float|int|string|null $precision = null, callable|string $function = 'round', ): static { return $this->roundWith( $precision ?? $this->getDateInterval()->setLocalTranslator(TranslatorImmutable::get('en'))->forHumans(), $function ); } /** * Round the current instance second with given precision if specified (else period interval is used). */ public function floor(DateInterval|float|int|string|null $precision = null): static { return $this->round($precision, 'floor'); } /** * Ceil the current instance second with given precision if specified (else period interval is used). */ public function ceil(DateInterval|float|int|string|null $precision = null): static { return $this->round($precision, 'ceil'); } /** * Specify data which should be serialized to JSON. * * @link https://php.net/manual/en/jsonserializable.jsonserialize.php * * @return CarbonInterface[] */ public function jsonSerialize(): array { return $this->toArray(); } /** * Return true if the given date is between start and end. */ public function contains(mixed $date = null): bool { $startMethod = 'startsBefore'.($this->isStartIncluded() ? 'OrAt' : ''); $endMethod = 'endsAfter'.($this->isEndIncluded() ? 'OrAt' : ''); return $this->$startMethod($date) && $this->$endMethod($date); } /** * Return true if the current period follows a given other period (with no overlap). * For instance, [2019-08-01 -> 2019-08-12] follows [2019-07-29 -> 2019-07-31] * Note than in this example, follows() would be false if 2019-08-01 or 2019-07-31 was excluded by options. */ public function follows(mixed $period, mixed ...$arguments): bool { $period = $this->resolveCarbonPeriod($period, ...$arguments); return $this->getIncludedStartDate()->equalTo($period->getIncludedEndDate()->add($period->getDateInterval())); } /** * Return true if the given other period follows the current one (with no overlap). * For instance, [2019-07-29 -> 2019-07-31] is followed by [2019-08-01 -> 2019-08-12] * Note than in this example, isFollowedBy() would be false if 2019-08-01 or 2019-07-31 was excluded by options. */ public function isFollowedBy(mixed $period, mixed ...$arguments): bool { $period = $this->resolveCarbonPeriod($period, ...$arguments); return $period->follows($this); } /** * Return true if the given period either follows or is followed by the current one. * * @see follows() * @see isFollowedBy() */ public function isConsecutiveWith(mixed $period, mixed ...$arguments): bool { return $this->follows($period, ...$arguments) || $this->isFollowedBy($period, ...$arguments); } public function __debugInfo(): array { $info = $this->baseDebugInfo(); unset( $info['start'], $info['end'], $info['interval'], $info['include_start_date'], $info['include_end_date'], $info['constructed'], $info["\0*\0constructed"], ); return $info; } public function __unserialize(array $data): void { try { $values = array_combine( array_map( static fn (string $key): string => preg_replace('/^\0\*\0/', '', $key), array_keys($data), ), $data, ); $this->initializeSerialization($values); foreach ($values as $key => $value) { if ($value === null) { continue; } $property = match ($key) { 'tzName' => $this->setTimezone(...), 'options' => $this->setOptions(...), 'recurrences' => $this->setRecurrences(...), 'current' => function (mixed $current): void { if (!($current instanceof CarbonInterface)) { $current = $this->resolveCarbon($current); } $this->carbonCurrent = $current; }, 'start' => 'startDate', 'interval' => $this->setDateInterval(...), 'end' => 'endDate', 'key' => null, 'include_start_date' => function (bool $included): void { $this->excludeStartDate(!$included); }, 'include_end_date' => function (bool $included): void { $this->excludeEndDate(!$included); }, default => $key, }; if ($property === null) { continue; } if (\is_callable($property)) { $property($value); continue; } if ($value instanceof DateTimeInterface && !($value instanceof CarbonInterface)) { $value = ($value instanceof DateTime) ? Carbon::instance($value) : CarbonImmutable::instance($value); } try { $this->$property = $value; } catch (Throwable) { // Must be ignored for backward-compatibility } } if (\array_key_exists('carbonRecurrences', $values)) { $this->carbonRecurrences = $values['carbonRecurrences']; } elseif (((int) ($values['recurrences'] ?? 0)) <= 1 && $this->endDate !== null) { $this->carbonRecurrences = null; } } catch (Throwable $e) { // @codeCoverageIgnoreStart if (!method_exists(parent::class, '__unserialize')) { throw $e; } parent::__unserialize($data); // @codeCoverageIgnoreEnd } } /** * Update properties after removing built-in filters. */ protected function updateInternalState(): void { if (!$this->hasFilter(static::END_DATE_FILTER)) { $this->endDate = null; } if (!$this->hasFilter(static::RECURRENCES_FILTER)) { $this->carbonRecurrences = null; } } /** * Create a filter tuple from raw parameters. * * Will create an automatic filter callback for one of Carbon's is* methods. */ protected function createFilterTuple(array $parameters): array { $method = array_shift($parameters); if (!$this->isCarbonPredicateMethod($method)) { return [$method, array_shift($parameters)]; } return [static fn ($date) => ([$date, $method])(...$parameters), $method]; } /** * Return whether given callable is a string pointing to one of Carbon's is* methods * and should be automatically converted to a filter callback. */ protected function isCarbonPredicateMethod(callable|string $callable): bool { return \is_string($callable) && str_starts_with($callable, 'is') && (method_exists($this->dateClass, $callable) || ([$this->dateClass, 'hasMacro'])($callable)); } /** * Recurrences filter callback (limits number of recurrences). * * @SuppressWarnings(UnusedFormalParameter) */ protected function filterRecurrences(CarbonInterface $current, int $key): bool|callable { if ($key < $this->carbonRecurrences) { return true; } return static::END_ITERATION; } /** * End date filter callback. * * @return bool|static::END_ITERATION */ protected function filterEndDate(CarbonInterface $current): bool|callable { if (!$this->isEndExcluded() && $current == $this->endDate) { return true; } if ($this->dateInterval->invert ? $current > $this->endDate : $current < $this->endDate) { return true; } return static::END_ITERATION; } /** * End iteration filter callback. * * @return static::END_ITERATION */ protected function endIteration(): callable { return static::END_ITERATION; } /** * Handle change of the parameters. */ protected function handleChangedParameters(): void { if (($this->getOptions() & static::IMMUTABLE) && $this->dateClass === Carbon::class) { $this->dateClass = CarbonImmutable::class; } elseif (!($this->getOptions() & static::IMMUTABLE) && $this->dateClass === CarbonImmutable::class) { $this->dateClass = Carbon::class; } $this->validationResult = null; } /** * Validate current date and stop iteration when necessary. * * Returns true when current date is valid, false if it is not, or static::END_ITERATION * when iteration should be stopped. * * @return bool|static::END_ITERATION */ protected function validateCurrentDate(): bool|callable { if ($this->carbonCurrent === null) { $this->rewind(); } // Check after the first rewind to avoid repeating the initial validation. return $this->validationResult ?? ($this->validationResult = $this->checkFilters()); } /** * Check whether current value and key pass all the filters. * * @return bool|static::END_ITERATION */ protected function checkFilters(): bool|callable { $current = $this->prepareForReturn($this->carbonCurrent); foreach ($this->filters as $tuple) { $result = \call_user_func($tuple[0], $current->avoidMutation(), $this->key, $this); if ($result === static::END_ITERATION) { return static::END_ITERATION; } if (!$result) { return false; } } return true; } /** * Prepare given date to be returned to the external logic. * * @param CarbonInterface $date * * @return CarbonInterface */ protected function prepareForReturn(CarbonInterface $date) { $date = ([$this->dateClass, 'make'])($date); if ($this->timezone) { return $date->setTimezone($this->timezone); } return $date; } /** * Keep incrementing the current date until a valid date is found or the iteration is ended. * * @throws RuntimeException */ protected function incrementCurrentDateUntilValid(): void { $attempts = 0; do { $this->carbonCurrent = $this->carbonCurrent->add($this->dateInterval); $this->validationResult = null; if (++$attempts > static::NEXT_MAX_ATTEMPTS) { throw new UnreachableException('Could not find next valid date.'); } } while ($this->validateCurrentDate() === false); } /** * Call given macro. */ protected function callMacro(string $name, array $parameters): mixed { $macro = static::$macros[$name]; if ($macro instanceof Closure) { $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); return ($boundMacro ?: $macro)(...$parameters); } return $macro(...$parameters); } /** * Return the Carbon instance passed through, a now instance in the same timezone * if null given or parse the input if string given. * * @param \Carbon\Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|\DateTimeInterface|string|null $date * * @return \Carbon\CarbonInterface */ protected function resolveCarbon($date = null) { return $this->getStartDate()->nowWithSameTz()->carbonize($date); } /** * Resolve passed arguments or DatePeriod to a CarbonPeriod object. */ protected function resolveCarbonPeriod(mixed $period, mixed ...$arguments): self { if ($period instanceof self) { return $period; } return $period instanceof DatePeriod ? static::instance($period) : static::create($period, ...$arguments); } private function orderCouple($first, $second): array { return $first > $second ? [$second, $first] : [$first, $second]; } private function makeDateTime($value): ?DateTimeInterface { if ($value instanceof DateTimeInterface) { return $value; } if ($value instanceof WeekDay || $value instanceof Month) { $dateClass = $this->dateClass; return new $dateClass($value, $this->timezoneSetting); } if (\is_string($value)) { $value = trim($value); if (!preg_match('/^P[\dT]/', $value) && !preg_match('/^R\d/', $value) && preg_match('/[a-z\d]/i', $value) ) { $dateClass = $this->dateClass; return $dateClass::parse($value, $this->timezoneSetting); } } return null; } private function isInfiniteDate($date): bool { return $date instanceof CarbonInterface && ($date->isEndOfTime() || $date->isStartOfTime()); } private function rawDate($date): ?DateTimeInterface { if ($date === false || $date === null) { return null; } if ($date instanceof CarbonInterface) { return $date->isMutable() ? $date->toDateTime() : $date->toDateTimeImmutable(); } if (\in_array(\get_class($date), [DateTime::class, DateTimeImmutable::class], true)) { return $date; } $class = $date instanceof DateTime ? DateTime::class : DateTimeImmutable::class; return new $class($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); } private static function setDefaultParameters(array &$parameters, array $defaults): void { foreach ($defaults as [$index, $name, $value]) { if (!\array_key_exists($index, $parameters) && !\array_key_exists($name, $parameters)) { $parameters[$index] = $value; } } } private function setFromAssociativeArray(array $parameters): void { if (isset($parameters['start'])) { $this->setStartDate($parameters['start']); } if (isset($parameters['start'])) { $this->setStartDate($parameters['start']); } if (isset($parameters['end'])) { $this->setEndDate($parameters['end']); } if (isset($parameters['recurrences'])) { $this->setRecurrences($parameters['recurrences']); } if (isset($parameters['interval'])) { $this->setDateInterval($parameters['interval']); } if (isset($parameters['options'])) { $this->setOptions($parameters['options']); } } private function configureTimezone(DateTimeZone $timezone, array $sortedArguments, array $originalArguments): array { $this->setTimezone($timezone); if (\is_string($originalArguments['start'] ?? null)) { $sortedArguments['start'] = $this->makeDateTime($originalArguments['start']); } if (\is_string($originalArguments['end'] ?? null)) { $sortedArguments['end'] = $this->makeDateTime($originalArguments['end']); } return $sortedArguments; } private function initializeSerialization(array $values): void { $serializationBase = [ 'start' => $values['start'] ?? $values['startDate'] ?? null, 'current' => $values['current'] ?? $values['carbonCurrent'] ?? null, 'end' => $values['end'] ?? $values['endDate'] ?? null, 'interval' => $values['interval'] ?? $values['dateInterval'] ?? null, 'recurrences' => max(1, (int) ($values['recurrences'] ?? $values['carbonRecurrences'] ?? 1)), 'include_start_date' => $values['include_start_date'] ?? true, 'include_end_date' => $values['include_end_date'] ?? false, ]; foreach (['start', 'current', 'end'] as $dateProperty) { if ($serializationBase[$dateProperty] instanceof Carbon) { $serializationBase[$dateProperty] = $serializationBase[$dateProperty]->toDateTime(); } elseif ($serializationBase[$dateProperty] instanceof CarbonInterface) { $serializationBase[$dateProperty] = $serializationBase[$dateProperty]->toDateTimeImmutable(); } } if ($serializationBase['interval'] instanceof CarbonInterval) { $serializationBase['interval'] = $serializationBase['interval']->toDateInterval(); } // @codeCoverageIgnoreStart if (method_exists(parent::class, '__unserialize')) { parent::__unserialize($serializationBase); return; } $excludeStart = !($values['include_start_date'] ?? true); $includeEnd = $values['include_end_date'] ?? true; parent::__construct( $serializationBase['start'], $serializationBase['interval'], $serializationBase['end'] ?? $serializationBase['recurrences'], ($excludeStart ? self::EXCLUDE_START_DATE : 0) | ($includeEnd && \defined('DatePeriod::INCLUDE_END_DATE') ? self::INCLUDE_END_DATE : 0), ); // @codeCoverageIgnoreEnd } } ================================================ FILE: src/Carbon/CarbonPeriodImmutable.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; class CarbonPeriodImmutable extends CarbonPeriod { /** * Default date class of iteration items. * * @var string */ protected const DEFAULT_DATE_CLASS = CarbonImmutable::class; /** * Date class of iteration items. */ protected string $dateClass = CarbonImmutable::class; /** * Prepare the instance to be set (self if mutable to be mutated, * copy if immutable to generate a new instance). */ protected function copyIfImmutable(): static { return $this->constructed ? clone $this : $this; } } ================================================ FILE: src/Carbon/CarbonTimeZone.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidTimeZoneException; use Carbon\Traits\LocalFactory; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Exception; use Throwable; class CarbonTimeZone extends DateTimeZone { use LocalFactory; public const MAXIMUM_TIMEZONE_OFFSET = 99; public function __construct(string|int|float $timezone) { $this->initLocalFactory(); parent::__construct(static::getDateTimeZoneNameFromMixed($timezone)); } protected static function parseNumericTimezone(string|int|float $timezone): string { if (abs((float) $timezone) > static::MAXIMUM_TIMEZONE_OFFSET) { throw new InvalidTimeZoneException( 'Absolute timezone offset cannot be greater than '. static::MAXIMUM_TIMEZONE_OFFSET.'.', ); } return ($timezone >= 0 ? '+' : '').ltrim((string) $timezone, '+').':00'; } protected static function getDateTimeZoneNameFromMixed(string|int|float $timezone): string { if (\is_string($timezone)) { $timezone = preg_replace('/^\s*([+-]\d+)(\d{2})\s*$/', '$1:$2', $timezone); } if (is_numeric($timezone)) { return static::parseNumericTimezone($timezone); } return $timezone; } /** * Cast the current instance into the given class. * * @param class-string $className The $className::instance() method will be called to cast the current object. * * @return DateTimeZone|mixed */ public function cast(string $className): mixed { if (!method_exists($className, 'instance')) { if (is_a($className, DateTimeZone::class, true)) { return new $className($this->getName()); } throw new InvalidCastException("$className has not the instance() method needed to cast the date."); } return $className::instance($this); } /** * Create a CarbonTimeZone from mixed input. * * @param DateTimeZone|string|int|false|null $object original value to get CarbonTimeZone from it. * @param DateTimeZone|string|int|false|null $objectDump dump of the object for error messages. * * @throws InvalidTimeZoneException * * @return static|null */ public static function instance( DateTimeZone|string|int|false|null $object, DateTimeZone|string|int|false|null $objectDump = null, ): ?self { $timezone = $object; if ($timezone instanceof static) { return $timezone; } if ($timezone === null || $timezone === false) { return null; } try { if (!($timezone instanceof DateTimeZone)) { $name = static::getDateTimeZoneNameFromMixed($object); $timezone = new static($name); } return $timezone instanceof static ? $timezone : new static($timezone->getName()); } catch (Exception $exception) { throw new InvalidTimeZoneException( 'Unknown or bad timezone ('.($objectDump ?: $object).')', previous: $exception, ); } } /** * Returns abbreviated name of the current timezone according to DST setting. * * @param bool $dst * * @return string */ public function getAbbreviatedName(bool $dst = false): string { $name = $this->getName(); $date = new DateTimeImmutable($dst ? 'July 1' : 'January 1', $this); $timezone = $date->format('T'); $abbreviations = $this->listAbbreviations(); $matchingZones = array_merge($abbreviations[$timezone] ?? [], $abbreviations[strtolower($timezone)] ?? []); if ($matchingZones !== []) { foreach ($matchingZones as $zone) { if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) { return $timezone; } } } foreach ($abbreviations as $abbreviation => $zones) { foreach ($zones as $zone) { if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) { return strtoupper($abbreviation); } } } return 'unknown'; } /** * @alias getAbbreviatedName * * Returns abbreviated name of the current timezone according to DST setting. * * @param bool $dst * * @return string */ public function getAbbr(bool $dst = false): string { return $this->getAbbreviatedName($dst); } /** * Get the offset as string "sHH:MM" (such as "+00:00" or "-12:30"). */ public function toOffsetName(?DateTimeInterface $date = null): string { return static::getOffsetNameFromMinuteOffset( $this->getOffset($this->resolveCarbon($date)) / 60, ); } /** * Returns a new CarbonTimeZone object using the offset string instead of region string. */ public function toOffsetTimeZone(?DateTimeInterface $date = null): static { return new static($this->toOffsetName($date)); } /** * Returns the first region string (such as "America/Toronto") that matches the current timezone or * false if no match is found. * * @see timezone_name_from_abbr native PHP function. */ public function toRegionName(?DateTimeInterface $date = null, int $isDST = 1): ?string { $name = $this->getName(); $firstChar = substr($name, 0, 1); if ($firstChar !== '+' && $firstChar !== '-') { return $name; } $date = $this->resolveCarbon($date); // Integer construction no longer supported since PHP 8 // @codeCoverageIgnoreStart try { $offset = @$this->getOffset($date) ?: 0; } catch (Throwable) { $offset = 0; } // @codeCoverageIgnoreEnd $name = @timezone_name_from_abbr('', $offset, $isDST); if ($name) { return $name; } foreach (timezone_identifiers_list() as $timezone) { if (Carbon::instance($date)->setTimezone($timezone)->getOffset() === $offset) { return $timezone; } } return null; } /** * Returns a new CarbonTimeZone object using the region string instead of offset string. */ public function toRegionTimeZone(?DateTimeInterface $date = null): ?self { $timezone = $this->toRegionName($date); if ($timezone !== null) { return new static($timezone); } if (Carbon::isStrictModeEnabled()) { throw new InvalidTimeZoneException('Unknown timezone for offset '.$this->getOffset($this->resolveCarbon($date)).' seconds.'); } return null; } /** * Cast to string (get timezone name). * * @return string */ public function __toString() { return $this->getName(); } /** * Return the type number: * * Type 1; A UTC offset, such as -0300 * Type 2; A timezone abbreviation, such as GMT * Type 3: A timezone identifier, such as Europe/London */ public function getType(): int { return preg_match('/"timezone_type";i:(\d)/', serialize($this), $match) ? (int) $match[1] : 3; } /** * Create a CarbonTimeZone from mixed input. * * @param DateTimeZone|string|int|null $object * * @return false|static */ public static function create($object = null) { return static::instance($object); } /** * Create a CarbonTimeZone from int/float hour offset. * * @param float $hourOffset number of hour of the timezone shift (can be decimal). * * @return false|static */ public static function createFromHourOffset(float $hourOffset) { return static::createFromMinuteOffset($hourOffset * Carbon::MINUTES_PER_HOUR); } /** * Create a CarbonTimeZone from int/float minute offset. * * @param float $minuteOffset number of total minutes of the timezone shift. * * @return false|static */ public static function createFromMinuteOffset(float $minuteOffset) { return static::instance(static::getOffsetNameFromMinuteOffset($minuteOffset)); } /** * Convert a total minutes offset into a standardized timezone offset string. * * @param float $minutes number of total minutes of the timezone shift. * * @return string */ public static function getOffsetNameFromMinuteOffset(float $minutes): string { $minutes = round($minutes); $unsignedMinutes = abs($minutes); return ($minutes < 0 ? '-' : '+'). str_pad((string) floor($unsignedMinutes / 60), 2, '0', STR_PAD_LEFT). ':'. str_pad((string) ($unsignedMinutes % 60), 2, '0', STR_PAD_LEFT); } private function resolveCarbon(?DateTimeInterface $date): DateTimeInterface { if ($date) { return $date; } if (isset($this->clock)) { return $this->clock->now()->setTimezone($this); } return Carbon::now($this); } } ================================================ FILE: src/Carbon/Cli/Invoker.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Cli; class Invoker { public const CLI_CLASS_NAME = 'Carbon\\Cli'; protected function runWithCli(string $className, array $parameters): bool { $cli = new $className(); return $cli(...$parameters); } public function __invoke(...$parameters): bool { if (class_exists(self::CLI_CLASS_NAME)) { return $this->runWithCli(self::CLI_CLASS_NAME, $parameters); } $function = (($parameters[1] ?? '') === 'install' ? ($parameters[2] ?? null) : null) ?: 'shell_exec'; $function('composer require carbon-cli/carbon-cli --no-interaction'); echo 'Installation succeeded.'; return true; } } ================================================ FILE: src/Carbon/Constants/DiffOptions.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Constants; interface DiffOptions { /** * Diff wording options(expressed in octal). */ public const NO_ZERO_DIFF = 01; public const JUST_NOW = 02; public const ONE_DAY_WORDS = 04; public const TWO_DAY_WORDS = 010; public const SEQUENTIAL_PARTS_ONLY = 020; public const ROUND = 040; public const FLOOR = 0100; public const CEIL = 0200; /** * Diff syntax options. */ public const DIFF_ABSOLUTE = 1; // backward compatibility with true public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false public const DIFF_RELATIVE_TO_NOW = 2; public const DIFF_RELATIVE_TO_OTHER = 3; } ================================================ FILE: src/Carbon/Constants/Format.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Constants; interface Format { /** * RFC7231 DateTime format. * * @var string */ public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T'; /** * Default format to use for __toString method when type juggling occurs. * * @var string */ public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; /** * Format for converting mocked time, includes microseconds. * * @var string */ public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u'; /** * Pattern detection for ->isoFormat and ::createFromIsoFormat. * * @var string */ public const ISO_FORMAT_REGEXP = '(O[YMDHhms]|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)'; } ================================================ FILE: src/Carbon/Constants/TranslationOptions.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Constants; interface TranslationOptions { /** * Translate string options. */ public const TRANSLATE_MONTHS = 1; public const TRANSLATE_DAYS = 2; public const TRANSLATE_UNITS = 4; public const TRANSLATE_MERIDIEM = 8; public const TRANSLATE_DIFF = 0x10; public const TRANSLATE_ALL = self::TRANSLATE_MONTHS | self::TRANSLATE_DAYS | self::TRANSLATE_UNITS | self::TRANSLATE_MERIDIEM | self::TRANSLATE_DIFF; /** * Special settings to get the start of week from current locale culture. */ public const WEEK_DAY_AUTO = 'auto'; /** * Default locale (language and region). * * @var string */ public const DEFAULT_LOCALE = 'en'; } ================================================ FILE: src/Carbon/Constants/UnitValue.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Constants; interface UnitValue { /** * The day constants. */ public const SUNDAY = 0; public const MONDAY = 1; public const TUESDAY = 2; public const WEDNESDAY = 3; public const THURSDAY = 4; public const FRIDAY = 5; public const SATURDAY = 6; /** * The month constants. * These aren't used by Carbon itself but exist for * convenience's sake alone. */ public const JANUARY = 1; public const FEBRUARY = 2; public const MARCH = 3; public const APRIL = 4; public const MAY = 5; public const JUNE = 6; public const JULY = 7; public const AUGUST = 8; public const SEPTEMBER = 9; public const OCTOBER = 10; public const NOVEMBER = 11; public const DECEMBER = 12; /** * Number of X in Y. */ public const YEARS_PER_MILLENNIUM = 1_000; public const YEARS_PER_CENTURY = 100; public const YEARS_PER_DECADE = 10; public const MONTHS_PER_YEAR = 12; public const MONTHS_PER_QUARTER = 3; public const QUARTERS_PER_YEAR = 4; public const WEEKS_PER_YEAR = 52; public const WEEKS_PER_MONTH = 4; public const DAYS_PER_YEAR = 365; public const DAYS_PER_WEEK = 7; public const HOURS_PER_DAY = 24; public const MINUTES_PER_HOUR = 60; public const SECONDS_PER_MINUTE = 60; public const MILLISECONDS_PER_SECOND = 1_000; public const MICROSECONDS_PER_MILLISECOND = 1_000; public const MICROSECONDS_PER_SECOND = 1_000_000; } ================================================ FILE: src/Carbon/Exceptions/BadComparisonUnitException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use Throwable; class BadComparisonUnitException extends UnitException { /** * The unit. * * @var string */ protected $unit; /** * Constructor. * * @param string $unit * @param int $code * @param Throwable|null $previous */ public function __construct($unit, $code = 0, ?Throwable $previous = null) { $this->unit = $unit; parent::__construct("Bad comparison unit: '$unit'", $code, $previous); } /** * Get the unit. * * @return string */ public function getUnit(): string { return $this->unit; } } ================================================ FILE: src/Carbon/Exceptions/BadFluentConstructorException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; use Throwable; class BadFluentConstructorException extends BaseBadMethodCallException implements BadMethodCallException { /** * The method. * * @var string */ protected $method; /** * Constructor. * * @param string $method * @param int $code * @param Throwable|null $previous */ public function __construct($method, $code = 0, ?Throwable $previous = null) { $this->method = $method; parent::__construct(\sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous); } /** * Get the method. * * @return string */ public function getMethod(): string { return $this->method; } } ================================================ FILE: src/Carbon/Exceptions/BadFluentSetterException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; use Throwable; class BadFluentSetterException extends BaseBadMethodCallException implements BadMethodCallException { /** * The setter. * * @var string */ protected $setter; /** * Constructor. * * @param string $setter * @param int $code * @param Throwable|null $previous */ public function __construct($setter, $code = 0, ?Throwable $previous = null) { $this->setter = $setter; parent::__construct(\sprintf("Unknown fluent setter '%s'", $setter), $code, $previous); } /** * Get the setter. * * @return string */ public function getSetter(): string { return $this->setter; } } ================================================ FILE: src/Carbon/Exceptions/BadMethodCallException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; interface BadMethodCallException extends Exception { // } ================================================ FILE: src/Carbon/Exceptions/EndLessPeriodException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use RuntimeException as BaseRuntimeException; final class EndLessPeriodException extends BaseRuntimeException implements RuntimeException { // } ================================================ FILE: src/Carbon/Exceptions/Exception.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; interface Exception { // } ================================================ FILE: src/Carbon/Exceptions/ImmutableException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use RuntimeException as BaseRuntimeException; use Throwable; class ImmutableException extends BaseRuntimeException implements RuntimeException { /** * The value. * * @var string */ protected $value; /** * Constructor. * * @param string $value the immutable type/value * @param int $code * @param Throwable|null $previous */ public function __construct($value, $code = 0, ?Throwable $previous = null) { $this->value = $value; parent::__construct("$value is immutable.", $code, $previous); } /** * Get the value. * * @return string */ public function getValue(): string { return $this->value; } } ================================================ FILE: src/Carbon/Exceptions/InvalidArgumentException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; interface InvalidArgumentException extends Exception { // } ================================================ FILE: src/Carbon/Exceptions/InvalidCastException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidCastException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/InvalidDateException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException { /** * The invalid field. * * @var string */ private $field; /** * The invalid value. * * @var mixed */ private $value; /** * Constructor. * * @param string $field * @param mixed $value * @param int $code * @param Throwable|null $previous */ public function __construct($field, $value, $code = 0, ?Throwable $previous = null) { $this->field = $field; $this->value = $value; parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous); } /** * Get the invalid field. * * @return string */ public function getField() { return $this->field; } /** * Get the invalid value. * * @return mixed */ public function getValue() { return $this->value; } } ================================================ FILE: src/Carbon/Exceptions/InvalidFormatException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidFormatException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/InvalidIntervalException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidIntervalException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/InvalidPeriodDateException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidPeriodDateException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/InvalidPeriodParameterException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidPeriodParameterException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/InvalidTimeZoneException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidTimeZoneException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/InvalidTypeException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class InvalidTypeException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/NotACarbonClassException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use Carbon\CarbonInterface; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException { /** * The className. * * @var string */ protected $className; /** * Constructor. * * @param string $className * @param int $code * @param Throwable|null $previous */ public function __construct($className, $code = 0, ?Throwable $previous = null) { $this->className = $className; parent::__construct(\sprintf( 'Given class does not implement %s: %s', CarbonInterface::class, $className, ), $code, $previous); } /** * Get the className. * * @return string */ public function getClassName(): string { return $this->className; } } ================================================ FILE: src/Carbon/Exceptions/NotAPeriodException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class NotAPeriodException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/NotLocaleAwareException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; class NotLocaleAwareException extends BaseInvalidArgumentException implements InvalidArgumentException { /** * Constructor. * * @param mixed $object * @param int $code * @param Throwable|null $previous */ public function __construct($object, $code = 0, ?Throwable $previous = null) { $dump = \is_object($object) ? \get_class($object) : \gettype($object); parent::__construct("$dump does neither implements Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.", $code, $previous); } } ================================================ FILE: src/Carbon/Exceptions/OutOfRangeException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; // This will extends OutOfRangeException instead of InvalidArgumentException since 3.0.0 // use OutOfRangeException as BaseOutOfRangeException; class OutOfRangeException extends BaseInvalidArgumentException implements InvalidArgumentException { /** * The unit or name of the value. * * @var string */ private $unit; /** * The range minimum. * * @var mixed */ private $min; /** * The range maximum. * * @var mixed */ private $max; /** * The invalid value. * * @var mixed */ private $value; /** * Constructor. * * @param string $unit * @param mixed $min * @param mixed $max * @param mixed $value * @param int $code * @param Throwable|null $previous */ public function __construct($unit, $min, $max, $value, $code = 0, ?Throwable $previous = null) { $this->unit = $unit; $this->min = $min; $this->max = $max; $this->value = $value; parent::__construct("$unit must be between $min and $max, $value given", $code, $previous); } /** * @return mixed */ public function getMax() { return $this->max; } /** * @return mixed */ public function getMin() { return $this->min; } /** * @return mixed */ public function getUnit() { return $this->unit; } /** * @return mixed */ public function getValue() { return $this->value; } } ================================================ FILE: src/Carbon/Exceptions/ParseErrorException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; class ParseErrorException extends BaseInvalidArgumentException implements InvalidArgumentException { /** * The expected. * * @var string */ protected $expected; /** * The actual. * * @var string */ protected $actual; /** * The help message. * * @var string */ protected $help; /** * Constructor. * * @param string $expected * @param string $actual * @param int $code * @param Throwable|null $previous */ public function __construct($expected, $actual, $help = '', $code = 0, ?Throwable $previous = null) { $this->expected = $expected; $this->actual = $actual; $this->help = $help; $actual = $actual === '' ? 'data is missing' : "get '$actual'"; parent::__construct(trim("Format expected $expected but $actual\n$help"), $code, $previous); } /** * Get the expected. * * @return string */ public function getExpected(): string { return $this->expected; } /** * Get the actual. * * @return string */ public function getActual(): string { return $this->actual; } /** * Get the help message. * * @return string */ public function getHelp(): string { return $this->help; } } ================================================ FILE: src/Carbon/Exceptions/RuntimeException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; interface RuntimeException extends Exception { // } ================================================ FILE: src/Carbon/Exceptions/UnitException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; class UnitException extends BaseInvalidArgumentException implements InvalidArgumentException { // } ================================================ FILE: src/Carbon/Exceptions/UnitNotConfiguredException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use Throwable; class UnitNotConfiguredException extends UnitException { /** * The unit. * * @var string */ protected $unit; /** * Constructor. * * @param string $unit * @param int $code * @param Throwable|null $previous */ public function __construct($unit, $code = 0, ?Throwable $previous = null) { $this->unit = $unit; parent::__construct("Unit $unit have no configuration to get total from other units.", $code, $previous); } /** * Get the unit. * * @return string */ public function getUnit(): string { return $this->unit; } } ================================================ FILE: src/Carbon/Exceptions/UnknownGetterException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; class UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException { /** * The getter. * * @var string */ protected $getter; /** * Constructor. * * @param string $getter getter name * @param int $code * @param Throwable|null $previous */ public function __construct($getter, $code = 0, ?Throwable $previous = null) { $this->getter = $getter; parent::__construct("Unknown getter '$getter'", $code, $previous); } /** * Get the getter. * * @return string */ public function getGetter(): string { return $this->getter; } } ================================================ FILE: src/Carbon/Exceptions/UnknownMethodException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; use Throwable; class UnknownMethodException extends BaseBadMethodCallException implements BadMethodCallException { /** * The method. * * @var string */ protected $method; /** * Constructor. * * @param string $method * @param int $code * @param Throwable|null $previous */ public function __construct($method, $code = 0, ?Throwable $previous = null) { $this->method = $method; parent::__construct("Method $method does not exist.", $code, $previous); } /** * Get the method. * * @return string */ public function getMethod(): string { return $this->method; } } ================================================ FILE: src/Carbon/Exceptions/UnknownSetterException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use InvalidArgumentException as BaseInvalidArgumentException; use Throwable; class UnknownSetterException extends BaseInvalidArgumentException implements BadMethodCallException { /** * The setter. * * @var string */ protected $setter; /** * Constructor. * * @param string $setter setter name * @param int $code * @param Throwable|null $previous */ public function __construct($setter, $code = 0, ?Throwable $previous = null) { $this->setter = $setter; parent::__construct("Unknown setter '$setter'", $code, $previous); } /** * Get the setter. * * @return string */ public function getSetter(): string { return $this->setter; } } ================================================ FILE: src/Carbon/Exceptions/UnknownUnitException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use Throwable; class UnknownUnitException extends UnitException { /** * The unit. * * @var string */ protected $unit; /** * Constructor. * * @param string $unit * @param int $code * @param Throwable|null $previous */ public function __construct($unit, $code = 0, ?Throwable $previous = null) { $this->unit = $unit; parent::__construct("Unknown unit '$unit'.", $code, $previous); } /** * Get the unit. * * @return string */ public function getUnit(): string { return $this->unit; } } ================================================ FILE: src/Carbon/Exceptions/UnreachableException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use RuntimeException as BaseRuntimeException; class UnreachableException extends BaseRuntimeException implements RuntimeException { // } ================================================ FILE: src/Carbon/Exceptions/UnsupportedUnitException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Exceptions; use Exception; /** * @codeCoverageIgnore */ class UnsupportedUnitException extends UnitException { public function __construct(string $unit, int $code = 0, ?Exception $previous = null) { parent::__construct("Unsupported unit '$unit'", $code, $previous); } } ================================================ FILE: src/Carbon/Factory.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Closure; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use InvalidArgumentException; use ReflectionMethod; use RuntimeException; use Symfony\Contracts\Translation\TranslatorInterface; use Throwable; /** * A factory to generate Carbon instances with common settings. * * * * @method bool canBeCreatedFromFormat(?string $date, string $format) Checks if the (date)time string is in a given format and valid to create a * new instance. * @method ?Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time. * If any of $year, $month or $day are set to null their now() values will * be used. * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * If $hour is not null then the default values for $minute and $second * will be 0. * @method Carbon createFromDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to now. * @method ?Carbon createFromFormat($format, $time, $timezone = null) Create a Carbon instance from a specific format. * @method ?Carbon createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). * @method ?Carbon createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific format and a string in a given language. * @method ?Carbon createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific ISO format and a string in a given language. * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null) Create a Carbon instance from just a time. The date portion is set to today. * @method Carbon createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a time string. The date portion is set to today. * @method Carbon createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp and set the timezone (UTC by default). * Timestamp input can be given as int, float or a string containing one or more numbers. * @method Carbon createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp in milliseconds. * Timestamp input can be given as int, float or a string containing one or more numbers. * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. * Timestamp input can be given as int, float or a string containing one or more numbers. * @method Carbon createFromTimestampUTC(string|int|float $timestamp) Create a Carbon instance from a timestamp keeping the timezone to UTC. * Timestamp input can be given as int, float or a string containing one or more numbers. * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to midnight. * @method ?Carbon createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) Create a new safe Carbon instance from a specific date and time. * If any of $year, $month or $day are set to null their now() values will * be used. * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * If $hour is not null then the default values for $minute and $second * will be 0. * If one of the set values is not valid, an InvalidDateException * will be thrown. * @method Carbon createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time using strict validation. * @method mixed executeWithLocale(string $locale, callable $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, * then return the result of the closure (or null if the closure was void). * @method Carbon fromSerialized($value, array $options = []) Create an instance from a serialized string. * If $value is not from a trusted source, consider using the allowed_classes option to limit * the types of objects that can be built, for instance: * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. * (It will ignore custom translator dynamic loading.) * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native * name, region and variant of the locale. * @method array getDays() Get the days of the week. * @method ?string getFallbackLocale() Get the fallback locale. * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). * @method array getIsoUnits() Returns list of locale units for ISO formatting. * @method array|false getLastErrors() {@inheritdoc} * @method string getLocale() Get the current translator locale. * @method int getMidDayAt() get midday/noon hour * @method string getTimeFormatByPrecision(string $unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. * @method string|Closure|null getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. * @method int getWeekEndsAt(?string $locale = null) Get the last day of week. * @method int getWeekStartsAt(?string $locale = null) Get the first day of week. * @method bool hasRelativeKeywords(?string $time) Determine if a time string will produce a relative date. * @method Carbon instance(DateTimeInterface $date) Create a Carbon instance from a DateTime one. * @method bool isImmutable() Returns true if the current class/instance is immutable. * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. * @method bool isMutable() Returns true if the current class/instance is mutable. * @method bool localeHasDiffOneDayWords(string $locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). * Support is considered enabled if the 3 words are translated in the given locale. * @method bool localeHasDiffSyntax(string $locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). * Support is considered enabled if the 4 sentences are translated in the given locale. * @method bool localeHasDiffTwoDayWords(string $locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). * Support is considered enabled if the 2 words are translated in the given locale. * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). * Support is considered enabled if the 4 sentences are translated in the given locale. * @method bool localeHasShortUnits(string $locale) Returns true if the given locale is internally supported and has short-units support. * Support is considered enabled if either year, day or hour has a short variant translated. * @method ?Carbon make($var, DateTimeZone|string|null $timezone = null) Make a Carbon instance from given variable if possible. * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals * and recurrences). Throw an exception for invalid format, but otherwise return null. * @method void mixin(object|string $mixin) Mix another object into the class. * @method Carbon now(DateTimeZone|string|int|null $timezone = null) Get a Carbon instance for the current date and time. * @method Carbon parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * @method Carbon parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). * @method ?Carbon rawCreateFromFormat(string $format, string $time, $timezone = null) Create a Carbon instance from a specific format. * @method Carbon rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * @method void setFallbackLocale(string $locale) Set the fallback locale. * @method void setLocale(string $locale) Set the current translator locale and indicate if the source locale file exists. * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather consider mid-day is always 12pm, then if you need to test if it's an other * hour, test it explicitly: * $date->format('G') == 13 * or to set explicitly to a given hour: * $date->setTime(13, 0, 0, 0) * Set midday/noon hour * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). * @method void sleep(int|float $seconds) * @method Carbon today(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for today. * @method Carbon tomorrow(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for tomorrow. * @method string translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. * @method Carbon yesterday(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for yesterday. * * */ class Factory { protected string $className = Carbon::class; protected array $settings = []; /** * A test Carbon instance to be returned when now instances are created. */ protected Closure|CarbonInterface|null $testNow = null; /** * The timezone to restore to when clearing the time mock. */ protected ?string $testDefaultTimezone = null; /** * Is true when test-now is generated by a closure and timezone should be taken on the fly from it. */ protected bool $useTimezoneFromTestNow = false; /** * Default translator. */ protected TranslatorInterface $translator; /** * Days of weekend. */ protected array $weekendDays = [ CarbonInterface::SATURDAY, CarbonInterface::SUNDAY, ]; /** * Format regex patterns. * * @var array */ protected array $regexFormats = [ 'd' => '(3[01]|[12][0-9]|0[1-9])', 'D' => '(Sun|Mon|Tue|Wed|Thu|Fri|Sat)', 'j' => '([123][0-9]|[1-9])', 'l' => '([a-zA-Z]{2,})', 'N' => '([1-7])', 'S' => '(st|nd|rd|th)', 'w' => '([0-6])', 'z' => '(36[0-5]|3[0-5][0-9]|[12][0-9]{2}|[1-9]?[0-9])', 'W' => '(5[012]|[1-4][0-9]|0?[1-9])', 'F' => '([a-zA-Z]{2,})', 'm' => '(1[012]|0[1-9])', 'M' => '([a-zA-Z]{3})', 'n' => '(1[012]|[1-9])', 't' => '(2[89]|3[01])', 'L' => '(0|1)', 'o' => '([1-9][0-9]{0,4})', 'Y' => '([1-9]?[0-9]{4})', 'y' => '([0-9]{2})', 'a' => '(am|pm)', 'A' => '(AM|PM)', 'B' => '([0-9]{3})', 'g' => '(1[012]|[1-9])', 'G' => '(2[0-3]|1?[0-9])', 'h' => '(1[012]|0[1-9])', 'H' => '(2[0-3]|[01][0-9])', 'i' => '([0-5][0-9])', 's' => '([0-5][0-9])', 'u' => '([0-9]{1,6})', 'v' => '([0-9]{1,3})', 'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\\/[a-zA-Z]*)', 'I' => '(0|1)', 'O' => '([+-](1[0123]|0[0-9])[0134][05])', 'P' => '([+-](1[0123]|0[0-9]):[0134][05])', 'p' => '(Z|[+-](1[0123]|0[0-9]):[0134][05])', 'T' => '([a-zA-Z]{1,5})', 'Z' => '(-?[1-5]?[0-9]{1,4})', 'U' => '([0-9]*)', // The formats below are combinations of the above formats. 'c' => '(([1-9]?[0-9]{4})-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[+-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP 'r' => '(([a-zA-Z]{3}), ([123][0-9]|0[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [+-](1[012]|0[0-9])([0134][05]))', // D, d M Y H:i:s O ]; /** * Format modifiers (such as available in createFromFormat) regex patterns. * * @var array */ protected array $regexFormatModifiers = [ '*' => '.+', ' ' => '[ ]', '#' => '[;:\\/.,()-]', '?' => '([^a]|[a])', '!' => '', '|' => '', '+' => '', ]; public function __construct(array $settings = [], ?string $className = null) { if ($className) { $this->className = $className; } $this->settings = $settings; } public function getClassName(): string { return $this->className; } public function setClassName(string $className): self { $this->className = $className; return $this; } public function className(?string $className = null): self|string { return $className === null ? $this->getClassName() : $this->setClassName($className); } public function getSettings(): array { return $this->settings; } public function setSettings(array $settings): self { $this->settings = $settings; return $this; } public function settings(?array $settings = null): self|array { return $settings === null ? $this->getSettings() : $this->setSettings($settings); } public function mergeSettings(array $settings): self { $this->settings = array_merge($this->settings, $settings); return $this; } public function setHumanDiffOptions(int $humanDiffOptions): void { $this->mergeSettings([ 'humanDiffOptions' => $humanDiffOptions, ]); } public function enableHumanDiffOption($humanDiffOption): void { $this->setHumanDiffOptions($this->getHumanDiffOptions() | $humanDiffOption); } public function disableHumanDiffOption(int $humanDiffOption): void { $this->setHumanDiffOptions($this->getHumanDiffOptions() & ~$humanDiffOption); } public function getHumanDiffOptions(): int { return (int) ($this->getSettings()['humanDiffOptions'] ?? 0); } /** * Register a custom macro. * * Pass null macro to remove it. * * @example * ``` * $userSettings = [ * 'locale' => 'pt', * 'timezone' => 'America/Sao_Paulo', * ]; * $factory->macro('userFormat', function () use ($userSettings) { * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); * }); * echo $factory->yesterday()->hours(11)->userFormat(); * ``` * * @param-closure-this static $macro */ public function macro(string $name, ?callable $macro): void { $macros = $this->getSettings()['macros'] ?? []; $macros[$name] = $macro; $this->mergeSettings([ 'macros' => $macros, ]); } /** * Remove all macros and generic macros. */ public function resetMacros(): void { $this->mergeSettings([ 'macros' => null, 'genericMacros' => null, ]); } /** * Register a custom macro. * * @param callable $macro * @param int $priority marco with higher priority is tried first * * @return void */ public function genericMacro(callable $macro, int $priority = 0): void { $genericMacros = $this->getSettings()['genericMacros'] ?? []; if (!isset($genericMacros[$priority])) { $genericMacros[$priority] = []; krsort($genericMacros, SORT_NUMERIC); } $genericMacros[$priority][] = $macro; $this->mergeSettings([ 'genericMacros' => $genericMacros, ]); } /** * Checks if macro is registered globally. */ public function hasMacro(string $name): bool { return isset($this->getSettings()['macros'][$name]); } /** * Get the raw callable macro registered globally for a given name. */ public function getMacro(string $name): ?callable { return $this->getSettings()['macros'][$name] ?? null; } /** * Set the default translator instance to use. */ public function setTranslator(TranslatorInterface $translator): void { $this->translator = $translator; } /** * Initialize the default translator instance if necessary. */ public function getTranslator(): TranslatorInterface { return $this->translator ??= Translator::get(); } /** * Reset the format used to the default when type juggling a Carbon instance to a string * * @return void */ public function resetToStringFormat(): void { $this->setToStringFormat(null); } /** * Set the default format used when type juggling a Carbon instance to a string. */ public function setToStringFormat(string|Closure|null $format): void { $this->mergeSettings([ 'toStringFormat' => $format, ]); } /** * JSON serialize all Carbon instances using the given callback. */ public function serializeUsing(string|callable|null $format): void { $this->mergeSettings([ 'toJsonFormat' => $format, ]); } /** * Enable the strict mode (or disable with passing false). */ public function useStrictMode(bool $strictModeEnabled = true): void { $this->mergeSettings([ 'strictMode' => $strictModeEnabled, ]); } /** * Returns true if the strict mode is globally in use, false else. * (It can be overridden in specific instances.) */ public function isStrictModeEnabled(): bool { return $this->getSettings()['strictMode'] ?? true; } /** * Indicates if months should be calculated with overflow. */ public function useMonthsOverflow(bool $monthsOverflow = true): void { $this->mergeSettings([ 'monthOverflow' => $monthsOverflow, ]); } /** * Reset the month overflow behavior. */ public function resetMonthsOverflow(): void { $this->useMonthsOverflow(); } /** * Get the month overflow global behavior (can be overridden in specific instances). */ public function shouldOverflowMonths(): bool { return $this->getSettings()['monthOverflow'] ?? true; } /** * Indicates if years should be calculated with overflow. */ public function useYearsOverflow(bool $yearsOverflow = true): void { $this->mergeSettings([ 'yearOverflow' => $yearsOverflow, ]); } /** * Reset the month overflow behavior. */ public function resetYearsOverflow(): void { $this->useYearsOverflow(); } /** * Get the month overflow global behavior (can be overridden in specific instances). */ public function shouldOverflowYears(): bool { return $this->getSettings()['yearOverflow'] ?? true; } /** * Get weekend days * * @return array */ public function getWeekendDays(): array { return $this->weekendDays; } /** * Set weekend days */ public function setWeekendDays(array $days): void { $this->weekendDays = $days; } /** * Checks if the (date)time string is in a given format. * * @example * ``` * Carbon::hasFormat('11:12:45', 'h:i:s'); // true * Carbon::hasFormat('13:12:45', 'h:i:s'); // false * ``` */ public function hasFormat(string $date, string $format): bool { // createFromFormat() is known to handle edge cases silently. // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format. // To ensure we're really testing against our desired format, perform an additional regex validation. return $this->matchFormatPattern($date, preg_quote($format, '/'), $this->regexFormats); } /** * Checks if the (date)time string is in a given format. * * @example * ``` * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false * ``` */ public function hasFormatWithModifiers(string $date, string $format): bool { return $this->matchFormatPattern($date, $format, array_merge($this->regexFormats, $this->regexFormatModifiers)); } /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * * Only the moment is mocked with setTestNow(), the timezone will still be the one passed * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). * * To clear the test instance call this method using the default * parameter of null. * * /!\ Use this method for unit tests only. * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance */ public function setTestNow(mixed $testNow = null): void { $this->useTimezoneFromTestNow = false; $this->testNow = $testNow instanceof self || $testNow instanceof Closure ? $testNow : $this->make($testNow); } /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * It will also align default timezone (e.g. call date_default_timezone_set()) with * the second argument or if null, with the timezone of the given date object. * * To clear the test instance call this method using the default * parameter of null. * * /!\ Use this method for unit tests only. * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance */ public function setTestNowAndTimezone(mixed $testNow = null, $timezone = null): void { if ($testNow) { $this->testDefaultTimezone ??= date_default_timezone_get(); } $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; if ($useDateInstanceTimezone) { $this->setDefaultTimezone($testNow->getTimezone()->getName(), $testNow); } $this->setTestNow($testNow); $this->useTimezoneFromTestNow = ($timezone === null && $testNow instanceof Closure); if (!$useDateInstanceTimezone) { $now = $this->getMockedTestNow(\func_num_args() === 1 ? null : $timezone); $this->setDefaultTimezone($now?->tzName ?? $this->testDefaultTimezone ?? 'UTC', $now); } if (!$testNow) { $this->testDefaultTimezone = null; } } /** * Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then * clearing the test instance. * * /!\ Use this method for unit tests only. * * @template T * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance * @param Closure(): T $callback * * @return T */ public function withTestNow(mixed $testNow, callable $callback): mixed { $previousTestNow = $this->getTestNow(); $this->setTestNow($testNow); try { $result = $callback(); } finally { $this->setTestNow($previousTestNow); } return $result; } /** * Get the Carbon instance (real or mock) to be returned when a "now" * instance is created. * * @return Closure|CarbonInterface|null the current instance used for testing */ public function getTestNow(): Closure|CarbonInterface|null { if ($this->testNow === null) { $factory = FactoryImmutable::getDefaultInstance(); if ($factory !== $this) { return $factory->getTestNow(); } } return $this->testNow; } public function handleTestNowClosure( Closure|CarbonInterface|null $testNow, DateTimeZone|string|int|null $timezone = null, ): ?CarbonInterface { if ($testNow instanceof Closure) { $callback = Callback::fromClosure($testNow); $realNow = new DateTimeImmutable('now'); $testNow = $testNow($callback->prepareParameter($this->parse( $realNow->format('Y-m-d H:i:s.u'), $timezone ?? $realNow->getTimezone(), ))); if ($testNow !== null && !($testNow instanceof DateTimeInterface)) { $function = $callback->getReflectionFunction(); $type = \is_object($testNow) ? $testNow::class : \gettype($testNow); throw new RuntimeException( 'The test closure defined in '.$function->getFileName(). ' at line '.$function->getStartLine().' returned '.$type. '; expected '.CarbonInterface::class.'|null', ); } if (!($testNow instanceof CarbonInterface)) { $timezone ??= $this->useTimezoneFromTestNow ? $testNow->getTimezone() : null; $testNow = $this->__call('instance', [$testNow, $timezone]); } } return $testNow; } /** * Determine if there is a valid test instance set. A valid test instance * is anything that is not null. * * @return bool true if there is a test instance, otherwise false */ public function hasTestNow(): bool { return $this->getTestNow() !== null; } public function withTimeZone(DateTimeZone|string|int|null $timezone): static { $factory = clone $this; $factory->settings['timezone'] = $timezone; return $factory; } public function __call(string $name, array $arguments): mixed { $method = new ReflectionMethod($this->className, $name); $settings = $this->settings; if ($settings && isset($settings['timezone'])) { $timezoneParameters = array_filter($method->getParameters(), function ($parameter) { return \in_array($parameter->getName(), ['tz', 'timezone'], true); }); $timezoneSetting = $settings['timezone']; if (isset($arguments[0]) && \in_array($name, ['instance', 'make', 'create', 'parse'], true)) { if ($arguments[0] instanceof DateTimeInterface) { $settings['innerTimezone'] = $settings['timezone']; } elseif (\is_string($arguments[0]) && date_parse($arguments[0])['is_localtime']) { unset($settings['timezone'], $settings['innerTimezone']); } } if (\count($timezoneParameters)) { $index = key($timezoneParameters); if (!isset($arguments[$index])) { array_splice($arguments, key($timezoneParameters), 0, [$timezoneSetting]); } unset($settings['timezone']); } } $clock = FactoryImmutable::getCurrentClock(); FactoryImmutable::setCurrentClock($this); try { $result = $this->className::$name(...$arguments); } finally { FactoryImmutable::setCurrentClock($clock); } if (isset($this->translator)) { $settings['translator'] = $this->translator; } return $result instanceof CarbonInterface && !empty($settings) ? $result->settings($settings) : $result; } /** * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. */ protected function getMockedTestNow(DateTimeZone|string|int|null $timezone): ?CarbonInterface { $testNow = $this->handleTestNowClosure($this->getTestNow()); if ($testNow instanceof CarbonInterface) { $testNow = $testNow->avoidMutation(); if ($timezone !== null) { return $testNow->setTimezone($timezone); } } return $testNow; } /** * Checks if the (date)time string is in a given format with * given list of pattern replacements. * * @example * ``` * Carbon::hasFormat('11:12:45', 'h:i:s'); // true * Carbon::hasFormat('13:12:45', 'h:i:s'); // false * ``` * * @param string $date * @param string $format * @param array $replacements * * @return bool */ private function matchFormatPattern(string $date, string $format, array $replacements): bool { // Preg quote, but remove escaped backslashes since we'll deal with escaped characters in the format string. $regex = str_replace('\\\\', '\\', $format); // Replace not-escaped letters $regex = preg_replace_callback( '/(? $match[1].strtr($match[2], $replacements), $regex, ); // Replace escaped letters by the letter itself $regex = preg_replace('/(?toRegionName($date); throw new InvalidArgumentException( "Timezone ID '$timezone' is invalid". ($suggestion && $suggestion !== $timezone ? ", did you mean '$suggestion'?" : '.')."\n". "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". 'For the record, hours/minutes offset are relevant only for a particular moment, '. 'but not as a default timezone.', 0, $previous ); } } } ================================================ FILE: src/Carbon/FactoryImmutable.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Closure; use DateTimeInterface; use DateTimeZone; use Symfony\Component\Clock\ClockInterface; use Symfony\Component\Clock\NativeClock; use Symfony\Contracts\Translation\TranslatorInterface; /** * A factory to generate CarbonImmutable instances with common settings. * * * * @method bool canBeCreatedFromFormat(?string $date, string $format) Checks if the (date)time string is in a given format and valid to create a * new instance. * @method ?CarbonImmutable create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time. * If any of $year, $month or $day are set to null their now() values will * be used. * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * If $hour is not null then the default values for $minute and $second * will be 0. * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to now. * @method ?CarbonImmutable createFromFormat($format, $time, $timezone = null) Create a Carbon instance from a specific format. * @method ?CarbonImmutable createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). * @method ?CarbonImmutable createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific format and a string in a given language. * @method ?CarbonImmutable createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific ISO format and a string in a given language. * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null) Create a Carbon instance from just a time. The date portion is set to today. * @method CarbonImmutable createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a time string. The date portion is set to today. * @method CarbonImmutable createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp and set the timezone (UTC by default). * Timestamp input can be given as int, float or a string containing one or more numbers. * @method CarbonImmutable createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp in milliseconds. * Timestamp input can be given as int, float or a string containing one or more numbers. * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. * Timestamp input can be given as int, float or a string containing one or more numbers. * @method CarbonImmutable createFromTimestampUTC(string|int|float $timestamp) Create a Carbon instance from a timestamp keeping the timezone to UTC. * Timestamp input can be given as int, float or a string containing one or more numbers. * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to midnight. * @method ?CarbonImmutable createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) Create a new safe Carbon instance from a specific date and time. * If any of $year, $month or $day are set to null their now() values will * be used. * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * If $hour is not null then the default values for $minute and $second * will be 0. * If one of the set values is not valid, an InvalidDateException * will be thrown. * @method CarbonImmutable createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time using strict validation. * @method mixed executeWithLocale(string $locale, callable $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, * then return the result of the closure (or null if the closure was void). * @method CarbonImmutable fromSerialized($value, array $options = []) Create an instance from a serialized string. * If $value is not from a trusted source, consider using the allowed_classes option to limit * the types of objects that can be built, for instance: * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. * (It will ignore custom translator dynamic loading.) * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native * name, region and variant of the locale. * @method array getDays() Get the days of the week. * @method ?string getFallbackLocale() Get the fallback locale. * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). * @method array getIsoUnits() Returns list of locale units for ISO formatting. * @method array|false getLastErrors() {@inheritdoc} * @method string getLocale() Get the current translator locale. * @method int getMidDayAt() get midday/noon hour * @method string getTimeFormatByPrecision(string $unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. * @method string|Closure|null getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. * @method int getWeekEndsAt(?string $locale = null) Get the last day of week. * @method int getWeekStartsAt(?string $locale = null) Get the first day of week. * @method bool hasRelativeKeywords(?string $time) Determine if a time string will produce a relative date. * @method CarbonImmutable instance(DateTimeInterface $date) Create a Carbon instance from a DateTime one. * @method bool isImmutable() Returns true if the current class/instance is immutable. * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. * @method bool isMutable() Returns true if the current class/instance is mutable. * @method bool localeHasDiffOneDayWords(string $locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). * Support is considered enabled if the 3 words are translated in the given locale. * @method bool localeHasDiffSyntax(string $locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). * Support is considered enabled if the 4 sentences are translated in the given locale. * @method bool localeHasDiffTwoDayWords(string $locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). * Support is considered enabled if the 2 words are translated in the given locale. * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). * Support is considered enabled if the 4 sentences are translated in the given locale. * @method bool localeHasShortUnits(string $locale) Returns true if the given locale is internally supported and has short-units support. * Support is considered enabled if either year, day or hour has a short variant translated. * @method ?CarbonImmutable make($var, DateTimeZone|string|null $timezone = null) Make a Carbon instance from given variable if possible. * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals * and recurrences). Throw an exception for invalid format, but otherwise return null. * @method void mixin(object|string $mixin) Mix another object into the class. * @method CarbonImmutable parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * @method CarbonImmutable parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). * @method ?CarbonImmutable rawCreateFromFormat(string $format, string $time, $timezone = null) Create a Carbon instance from a specific format. * @method CarbonImmutable rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * @method void setFallbackLocale(string $locale) Set the fallback locale. * @method void setLocale(string $locale) Set the current translator locale and indicate if the source locale file exists. * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather consider mid-day is always 12pm, then if you need to test if it's an other * hour, test it explicitly: * $date->format('G') == 13 * or to set explicitly to a given hour: * $date->setTime(13, 0, 0, 0) * Set midday/noon hour * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). * @method CarbonImmutable today(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for today. * @method CarbonImmutable tomorrow(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for tomorrow. * @method string translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. * @method CarbonImmutable yesterday(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for yesterday. * * */ class FactoryImmutable extends Factory implements ClockInterface { protected string $className = CarbonImmutable::class; private static ?self $defaultInstance = null; private static ?WrapperClock $currentClock = null; /** * @internal Instance used for static calls, such as Carbon::getTranslator(), CarbonImmutable::setTestNow(), etc. */ public static function getDefaultInstance(): self { return self::$defaultInstance ??= new self(); } /** * @internal Instance used for static calls possibly called by non-static methods. */ public static function getInstance(): Factory { return self::$currentClock?->getFactory() ?? self::getDefaultInstance(); } /** * @internal Set instance before creating new dates. */ public static function setCurrentClock(ClockInterface|Factory|DateTimeInterface|null $currentClock): void { if ($currentClock && !($currentClock instanceof WrapperClock)) { $currentClock = new WrapperClock($currentClock); } self::$currentClock = $currentClock; } /** * @internal Instance used to link new object to their factory creator. */ public static function getCurrentClock(): ?WrapperClock { return self::$currentClock; } /** * Get a Carbon instance for the current date and time. */ public function now(DateTimeZone|string|int|null $timezone = null): CarbonImmutable { return $this->__call('now', [$timezone]); } public function sleep(int|float $seconds): void { if ($this->hasTestNow()) { $this->setTestNow($this->getTestNow()->avoidMutation()->addSeconds($seconds)); return; } (new NativeClock('UTC'))->sleep($seconds); } } ================================================ FILE: src/Carbon/Lang/aa.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/aa_DJ.php'; ================================================ FILE: src/Carbon/Lang/aa_DJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Qunxa Garablu', 'Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Liiqen', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], 'months_short' => ['qun', 'nah', 'cig', 'agd', 'cax', 'qas', 'qad', 'leq', 'way', 'dit', 'xim', 'kax'], 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], 'weekdays_short' => ['aca', 'etl', 'tal', 'arb', 'kam', 'gum', 'sab'], 'weekdays_min' => ['aca', 'etl', 'tal', 'arb', 'kam', 'gum', 'sab'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'meridiem' => ['saaku', 'carra'], 'year' => ':count gaqambo', // less reliable 'y' => ':count gaqambo', // less reliable 'a_year' => ':count gaqambo', // less reliable 'month' => ':count àlsa', 'm' => ':count àlsa', 'a_month' => ':count àlsa', 'day' => ':count saaku', // less reliable 'd' => ':count saaku', // less reliable 'a_day' => ':count saaku', // less reliable 'hour' => ':count ayti', // less reliable 'h' => ':count ayti', // less reliable 'a_hour' => ':count ayti', // less reliable ]); ================================================ FILE: src/Carbon/Lang/aa_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Qunxa Garablu', 'Naharsi Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Leqeeni', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], 'months_short' => ['Qun', 'Nah', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], 'weekdays_short' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], 'weekdays_min' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['saaku', 'carra'], ]); ================================================ FILE: src/Carbon/Lang/aa_ER@saaho.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Qunxa Garablu', 'Naharsi Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Leqeeni', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], 'months_short' => ['Qun', 'Nah', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], 'weekdays' => ['Naba Sambat', 'Sani', 'Salus', 'Rabuq', 'Camus', 'Jumqata', 'Qunxa Sambat'], 'weekdays_short' => ['Nab', 'San', 'Sal', 'Rab', 'Cam', 'Jum', 'Qun'], 'weekdays_min' => ['Nab', 'San', 'Sal', 'Rab', 'Cam', 'Jum', 'Qun'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['saaku', 'carra'], ]); ================================================ FILE: src/Carbon/Lang/aa_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Qunxa Garablu', 'Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Liiqen', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], 'months_short' => ['Qun', 'Kud', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], 'weekdays_short' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], 'weekdays_min' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['saaku', 'carra'], ]); ================================================ FILE: src/Carbon/Lang/af.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - JD Isaacks * - Pierre du Plessis */ return [ 'year' => ':count jaar', 'a_year' => '\'n jaar|:count jaar', 'y' => ':count j.', 'month' => ':count maand|:count maande', 'a_month' => '\'n maand|:count maande', 'm' => ':count maa.', 'week' => ':count week|:count weke', 'a_week' => '\'n week|:count weke', 'w' => ':count w.', 'day' => ':count dag|:count dae', 'a_day' => '\'n dag|:count dae', 'd' => ':count d.', 'hour' => ':count uur', 'a_hour' => '\'n uur|:count uur', 'h' => ':count u.', 'minute' => ':count minuut|:count minute', 'a_minute' => '\'n minuut|:count minute', 'min' => ':count min.', 'second' => ':count sekond|:count sekondes', 'a_second' => '\'n paar sekondes|:count sekondes', 's' => ':count s.', 'ago' => ':time gelede', 'from_now' => 'oor :time', 'after' => ':time na', 'before' => ':time voor', 'diff_now' => 'Nou', 'diff_today' => 'Vandag', 'diff_today_regexp' => 'Vandag(?:\\s+om)?', 'diff_yesterday' => 'Gister', 'diff_yesterday_regexp' => 'Gister(?:\\s+om)?', 'diff_tomorrow' => 'Môre', 'diff_tomorrow_regexp' => 'Môre(?:\\s+om)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Vandag om] LT', 'nextDay' => '[Môre om] LT', 'nextWeek' => 'dddd [om] LT', 'lastDay' => '[Gister om] LT', 'lastWeek' => '[Laas] dddd [om] LT', 'sameElse' => 'L', ], 'ordinal' => static fn ($number) => $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'), 'meridiem' => ['VM', 'NM'], 'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'], 'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], 'weekdays_short' => ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], 'weekdays_min' => ['So', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' en '], ]; ================================================ FILE: src/Carbon/Lang/af_NA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/af.php', [ 'meridiem' => ['v', 'n'], 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], 'weekdays_short' => ['So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.'], 'weekdays_min' => ['So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.'], 'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'], 'months_short' => ['Jan.', 'Feb.', 'Mrt.', 'Apr.', 'Mei', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Des.'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'DD MMM YYYY', 'LLL' => 'DD MMMM YYYY HH:mm', 'LLLL' => 'dddd, DD MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/af_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/af.php'; ================================================ FILE: src/Carbon/Lang/agq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a.g', 'a.k'], 'weekdays' => ['tsuʔntsɨ', 'tsuʔukpà', 'tsuʔughɔe', 'tsuʔutɔ̀mlò', 'tsuʔumè', 'tsuʔughɨ̂m', 'tsuʔndzɨkɔʔɔ'], 'weekdays_short' => ['nts', 'kpa', 'ghɔ', 'tɔm', 'ume', 'ghɨ', 'dzk'], 'weekdays_min' => ['nts', 'kpa', 'ghɔ', 'tɔm', 'ume', 'ghɨ', 'dzk'], 'months' => ['ndzɔ̀ŋɔ̀nùm', 'ndzɔ̀ŋɔ̀kƗ̀zùʔ', 'ndzɔ̀ŋɔ̀tƗ̀dʉ̀ghà', 'ndzɔ̀ŋɔ̀tǎafʉ̄ghā', 'ndzɔ̀ŋèsèe', 'ndzɔ̀ŋɔ̀nzùghò', 'ndzɔ̀ŋɔ̀dùmlo', 'ndzɔ̀ŋɔ̀kwîfɔ̀e', 'ndzɔ̀ŋɔ̀tƗ̀fʉ̀ghàdzughù', 'ndzɔ̀ŋɔ̀ghǔuwelɔ̀m', 'ndzɔ̀ŋɔ̀chwaʔàkaa wo', 'ndzɔ̀ŋèfwòo'], 'months_short' => ['nùm', 'kɨz', 'tɨd', 'taa', 'see', 'nzu', 'dum', 'fɔe', 'dzu', 'lɔm', 'kaa', 'fwo'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/agr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/agr_PE.php'; ================================================ FILE: src/Carbon/Lang/agr_PE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - somosazucar.org libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Petsatin', 'Kupitin', 'Uyaitin', 'Tayutin', 'Kegketin', 'Tegmatin', 'Kuntutin', 'Yagkujutin', 'Daiktatin', 'Ipamtatin', 'Shinutin', 'Sakamtin'], 'months_short' => ['Pet', 'Kup', 'Uya', 'Tay', 'Keg', 'Teg', 'Kun', 'Yag', 'Dait', 'Ipam', 'Shin', 'Sak'], 'weekdays' => ['Tuntuamtin', 'Achutin', 'Kugkuktin', 'Saketin', 'Shimpitin', 'Imaptin', 'Bataetin'], 'weekdays_short' => ['Tun', 'Ach', 'Kug', 'Sak', 'Shim', 'Im', 'Bat'], 'weekdays_min' => ['Tun', 'Ach', 'Kug', 'Sak', 'Shim', 'Im', 'Bat'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 7, 'meridiem' => ['VM', 'NM'], 'year' => ':count yaya', // less reliable 'y' => ':count yaya', // less reliable 'a_year' => ':count yaya', // less reliable 'month' => ':count nantu', // less reliable 'm' => ':count nantu', // less reliable 'a_month' => ':count nantu', // less reliable 'day' => ':count nayaim', // less reliable 'd' => ':count nayaim', // less reliable 'a_day' => ':count nayaim', // less reliable 'hour' => ':count kuwiš', // less reliable 'h' => ':count kuwiš', // less reliable 'a_hour' => ':count kuwiš', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ak.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ak_GH.php'; ================================================ FILE: src/Carbon/Lang/ak_GH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY/MM/DD', ], 'months' => ['Sanda-Ɔpɛpɔn', 'Kwakwar-Ɔgyefuo', 'Ebɔw-Ɔbenem', 'Ebɔbira-Oforisuo', 'Esusow Aketseaba-Kɔtɔnimba', 'Obirade-Ayɛwohomumu', 'Ayɛwoho-Kitawonsa', 'Difuu-Ɔsandaa', 'Fankwa-Ɛbɔ', 'Ɔbɛsɛ-Ahinime', 'Ɔberɛfɛw-Obubuo', 'Mumu-Ɔpɛnimba'], 'months_short' => ['S-Ɔ', 'K-Ɔ', 'E-Ɔ', 'E-O', 'E-K', 'O-A', 'A-K', 'D-Ɔ', 'F-Ɛ', 'Ɔ-A', 'Ɔ-O', 'M-Ɔ'], 'weekdays' => ['Kwesida', 'Dwowda', 'Benada', 'Wukuda', 'Yawda', 'Fida', 'Memeneda'], 'weekdays_short' => ['Kwe', 'Dwo', 'Ben', 'Wuk', 'Yaw', 'Fia', 'Mem'], 'weekdays_min' => ['Kwe', 'Dwo', 'Ben', 'Wuk', 'Yaw', 'Fia', 'Mem'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['AN', 'EW'], 'year' => ':count afe', 'y' => ':count afe', 'a_year' => ':count afe', 'month' => ':count bosume', 'm' => ':count bosume', 'a_month' => ':count bosume', 'day' => ':count ɛda', 'd' => ':count ɛda', 'a_day' => ':count ɛda', ]); ================================================ FILE: src/Carbon/Lang/am.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/am_ET.php'; ================================================ FILE: src/Carbon/Lang/am_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕሪል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክቶበር', 'ኖቬምበር', 'ዲሴምበር'], 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], 'weekdays' => ['እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], 'weekdays_short' => ['እሑድ', 'ሰኞ ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], 'weekdays_min' => ['እሑድ', 'ሰኞ ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ጡዋት', 'ከሰዓት'], 'year' => ':count አመት', 'y' => ':count አመት', 'a_year' => ':count አመት', 'month' => ':count ወር', 'm' => ':count ወር', 'a_month' => ':count ወር', 'week' => ':count ሳምንት', 'w' => ':count ሳምንት', 'a_week' => ':count ሳምንት', 'day' => ':count ቀን', 'd' => ':count ቀን', 'a_day' => ':count ቀን', 'hour' => ':count ሰዓት', 'h' => ':count ሰዓት', 'a_hour' => ':count ሰዓት', 'minute' => ':count ደቂቃ', 'min' => ':count ደቂቃ', 'a_minute' => ':count ደቂቃ', 'second' => ':count ሴኮንድ', 's' => ':count ሴኮንድ', 'a_second' => ':count ሴኮንድ', 'ago' => 'ከ:time በፊት', 'from_now' => 'በ:time ውስጥ', ]); ================================================ FILE: src/Carbon/Lang/an.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/an_ES.php'; ================================================ FILE: src/Carbon/Lang/an_ES.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Softaragones Jordi Mallach Pérez, Juan Pablo Martínez bug-glibc-locales@gnu.org, softaragones@softaragones.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['chinero', 'febrero', 'marzo', 'abril', 'mayo', 'chunyo', 'chuliol', 'agosto', 'setiembre', 'octubre', 'noviembre', 'aviento'], 'months_short' => ['chi', 'feb', 'mar', 'abr', 'may', 'chn', 'chl', 'ago', 'set', 'oct', 'nov', 'avi'], 'weekdays' => ['domingo', 'luns', 'martes', 'mierques', 'chueves', 'viernes', 'sabado'], 'weekdays_short' => ['dom', 'lun', 'mar', 'mie', 'chu', 'vie', 'sab'], 'weekdays_min' => ['dom', 'lun', 'mar', 'mie', 'chu', 'vie', 'sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count año', 'y' => ':count año', 'a_year' => ':count año', 'month' => ':count mes', 'm' => ':count mes', 'a_month' => ':count mes', 'week' => ':count semana', 'w' => ':count semana', 'a_week' => ':count semana', 'day' => ':count día', 'd' => ':count día', 'a_day' => ':count día', 'hour' => ':count reloch', // less reliable 'h' => ':count reloch', // less reliable 'a_hour' => ':count reloch', // less reliable 'minute' => ':count minuto', 'min' => ':count minuto', 'a_minute' => ':count minuto', 'second' => ':count segundo', 's' => ':count segundo', 'a_second' => ':count segundo', ]); ================================================ FILE: src/Carbon/Lang/anp.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/anp_IN.php'; ================================================ FILE: src/Carbon/Lang/anp_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bhashaghar@googlegroups.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर"'], 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'], 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'बृहस्पतिवार', 'शुक्रवार', 'शनिवार'], 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], ]); ================================================ FILE: src/Carbon/Lang/ar.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Atef Ben Ali (atefBB) * - Ibrahim AshShohail * - MLTDev * - Mohamed Sabil (mohamedsabil83) * - Yazan Alnugnugh (yazan-alnugnugh) */ $months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; return [ 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'ago' => 'منذ :time', 'from_now' => ':time من الآن', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم عند الساعة] LT', 'nextDay' => '[غدًا عند الساعة] LT', 'nextWeek' => 'dddd [عند الساعة] LT', 'lastDay' => '[أمس عند الساعة] LT', 'lastWeek' => 'dddd [عند الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/ar_AE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت '], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_BH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_DJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_DZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Authors: * - Josh Soref * - Noureddine LOUAHEDJ * - JD Isaacks * - Atef Ben Ali (atefBB) * - Mohamed Sabil (mohamedsabil83) */ $months = [ 'جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; return [ 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'ago' => 'منذ :time', 'from_now' => 'في :time', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['أح', 'إث', 'ثلا', 'أر', 'خم', 'جم', 'سب'], 'list' => ['، ', ' و '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 4, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم على الساعة] LT', 'nextDay' => '[غدا على الساعة] LT', 'nextWeek' => 'dddd [على الساعة] LT', 'lastDay' => '[أمس على الساعة] LT', 'lastWeek' => 'dddd [على الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], ]; ================================================ FILE: src/Carbon/Lang/ar_EG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_EH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_IL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/ar_IQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_JO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_KM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_KW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Authors: * - Josh Soref * - Nusret Parlak * - JD Isaacks * - Atef Ben Ali (atefBB) * - Mohamed Sabil (mohamedsabil83) * - Abdullah-Alhariri */ $months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر', ]; return [ 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'ago' => 'منذ :time', 'from_now' => 'في :time', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم على الساعة] LT', 'nextDay' => '[غدا على الساعة] LT', 'nextWeek' => 'dddd [على الساعة] LT', 'lastDay' => '[أمس على الساعة] LT', 'lastWeek' => 'dddd [على الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]; ================================================ FILE: src/Carbon/Lang/ar_LB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_LY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Atef Ben Ali (atefBB) * - Ibrahim AshShohail * - MLTDev */ $months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; return [ 'year' => implode('|', [':count سنة', 'سنة', 'سنتين', ':count سنوات', ':count سنة']), 'a_year' => implode('|', [':count سنة', 'سنة', 'سنتين', ':count سنوات', ':count سنة']), 'month' => implode('|', [':count شهر', 'شهر', 'شهرين', ':count أشهر', ':count شهر']), 'a_month' => implode('|', [':count شهر', 'شهر', 'شهرين', ':count أشهر', ':count شهر']), 'week' => implode('|', [':count أسبوع', 'أسبوع', 'أسبوعين', ':count أسابيع', ':count أسبوع']), 'a_week' => implode('|', [':count أسبوع', 'أسبوع', 'أسبوعين', ':count أسابيع', ':count أسبوع']), 'day' => implode('|', [':count يوم', 'يوم', 'يومين', ':count أيام', ':count يوم']), 'a_day' => implode('|', [':count يوم', 'يوم', 'يومين', ':count أيام', ':count يوم']), 'hour' => implode('|', [':count ساعة', 'ساعة', 'ساعتين', ':count ساعات', ':count ساعة']), 'a_hour' => implode('|', [':count ساعة', 'ساعة', 'ساعتين', ':count ساعات', ':count ساعة']), 'minute' => implode('|', [':count دقيقة', 'دقيقة', 'دقيقتين', ':count دقائق', ':count دقيقة']), 'a_minute' => implode('|', [':count دقيقة', 'دقيقة', 'دقيقتين', ':count دقائق', ':count دقيقة']), 'second' => implode('|', [':count ثانية', 'ثانية', 'ثانيتين', ':count ثواني', ':count ثانية']), 'a_second' => implode('|', [':count ثانية', 'ثانية', 'ثانيتين', ':count ثواني', ':count ثانية']), 'ago' => 'منذ :time', 'from_now' => ':time من الآن', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['مرة', 'مرة', ':count مرتين', ':count مرات', ':count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم عند الساعة] LT', 'nextDay' => '[غدًا عند الساعة] LT', 'nextWeek' => 'dddd [عند الساعة] LT', 'lastDay' => '[أمس عند الساعة] LT', 'lastWeek' => 'dddd [عند الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/ar_MA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Authors: * - Josh Soref * - JD Isaacks * - Atef Ben Ali (atefBB) * - Mohamed Sabil (mohamedsabil83) */ $months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'ماي', 'يونيو', 'يوليوز', 'غشت', 'شتنبر', 'أكتوبر', 'نونبر', 'دجنبر', ]; return [ 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'ago' => 'منذ :time', 'from_now' => 'في :time', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم على الساعة] LT', 'nextDay' => '[غدا على الساعة] LT', 'nextWeek' => 'dddd [على الساعة] LT', 'lastDay' => '[أمس على الساعة] LT', 'lastWeek' => 'dddd [على الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/ar_MR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_OM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_PS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_QA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_SA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Authors: * - Josh Soref * - JD Isaacks * - Atef Ben Ali (atefBB) * - Mohamed Sabil (mohamedsabil83) * - Abdullah-Alhariri */ $months = [ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; return [ 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'ago' => 'منذ :time', 'from_now' => 'في :time', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم على الساعة] LT', 'nextDay' => '[غدا على الساعة] LT', 'nextWeek' => 'dddd [على الساعة] LT', 'lastDay' => '[أمس على الساعة] LT', 'lastWeek' => 'dddd [على الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]; ================================================ FILE: src/Carbon/Lang/ar_SD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_SO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_SS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/ar_SY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/ar_Shakl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Abdellah Chadidi * - Atef Ben Ali (atefBB) * - Mohamed Sabil (mohamedsabil83) */ // Same for long and short $months = [ // @TODO add shakl to months 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; return [ 'year' => implode('|', ['{0}:count سَنَة', '{1}سَنَة', '{2}سَنَتَيْن', ']2,11[:count سَنَوَات', ']10,Inf[:count سَنَة']), 'a_year' => implode('|', ['{0}:count سَنَة', '{1}سَنَة', '{2}سَنَتَيْن', ']2,11[:count سَنَوَات', ']10,Inf[:count سَنَة']), 'month' => implode('|', ['{0}:count شَهْرَ', '{1}شَهْرَ', '{2}شَهْرَيْن', ']2,11[:count أَشْهُر', ']10,Inf[:count شَهْرَ']), 'a_month' => implode('|', ['{0}:count شَهْرَ', '{1}شَهْرَ', '{2}شَهْرَيْن', ']2,11[:count أَشْهُر', ']10,Inf[:count شَهْرَ']), 'week' => implode('|', ['{0}:count أُسْبُوع', '{1}أُسْبُوع', '{2}أُسْبُوعَيْن', ']2,11[:count أَسَابِيع', ']10,Inf[:count أُسْبُوع']), 'a_week' => implode('|', ['{0}:count أُسْبُوع', '{1}أُسْبُوع', '{2}أُسْبُوعَيْن', ']2,11[:count أَسَابِيع', ']10,Inf[:count أُسْبُوع']), 'day' => implode('|', ['{0}:count يَوْم', '{1}يَوْم', '{2}يَوْمَيْن', ']2,11[:count أَيَّام', ']10,Inf[:count يَوْم']), 'a_day' => implode('|', ['{0}:count يَوْم', '{1}يَوْم', '{2}يَوْمَيْن', ']2,11[:count أَيَّام', ']10,Inf[:count يَوْم']), 'hour' => implode('|', ['{0}:count سَاعَة', '{1}سَاعَة', '{2}سَاعَتَيْن', ']2,11[:count سَاعَات', ']10,Inf[:count سَاعَة']), 'a_hour' => implode('|', ['{0}:count سَاعَة', '{1}سَاعَة', '{2}سَاعَتَيْن', ']2,11[:count سَاعَات', ']10,Inf[:count سَاعَة']), 'minute' => implode('|', ['{0}:count دَقِيقَة', '{1}دَقِيقَة', '{2}دَقِيقَتَيْن', ']2,11[:count دَقَائِق', ']10,Inf[:count دَقِيقَة']), 'a_minute' => implode('|', ['{0}:count دَقِيقَة', '{1}دَقِيقَة', '{2}دَقِيقَتَيْن', ']2,11[:count دَقَائِق', ']10,Inf[:count دَقِيقَة']), 'second' => implode('|', ['{0}:count ثَانِيَة', '{1}ثَانِيَة', '{2}ثَانِيَتَيْن', ']2,11[:count ثَوَان', ']10,Inf[:count ثَانِيَة']), 'a_second' => implode('|', ['{0}:count ثَانِيَة', '{1}ثَانِيَة', '{2}ثَانِيَتَيْن', ']2,11[:count ثَوَان', ']10,Inf[:count ثَانِيَة']), 'ago' => 'مُنْذُ :time', 'from_now' => 'مِنَ الْآن :time', 'after' => 'بَعْدَ :time', 'before' => 'قَبْلَ :time', // @TODO add shakl to translations below 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم عند الساعة] LT', 'nextDay' => '[غدًا عند الساعة] LT', 'nextWeek' => 'dddd [عند الساعة] LT', 'lastDay' => '[أمس عند الساعة] LT', 'lastWeek' => 'dddd [عند الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/ar_TD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ar.php', [ ]); ================================================ FILE: src/Carbon/Lang/ar_TN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Authors: * - JD Isaacks * - Atef Ben Ali (atefBB) * - Mohamed Sabil (mohamedsabil83) */ $months = [ 'جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', 'جويلية', 'أوت', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر', ]; return [ 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), 'ago' => 'منذ :time', 'from_now' => 'في :time', 'after' => 'بعد :time', 'before' => 'قبل :time', 'diff_now' => 'الآن', 'diff_today' => 'اليوم', 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', 'diff_yesterday' => 'أمس', 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', 'diff_tomorrow' => 'غداً', 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', 'diff_before_yesterday' => 'قبل الأمس', 'diff_after_tomorrow' => 'بعد غد', 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), 'period_interval' => 'كل :interval', 'period_start_date' => 'من :date', 'period_end_date' => 'إلى :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'list' => ['، ', ' و '], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اليوم على الساعة] LT', 'nextDay' => '[غدا على الساعة] LT', 'nextWeek' => 'dddd [على الساعة] LT', 'lastDay' => '[أمس على الساعة] LT', 'lastWeek' => 'dddd [على الساعة] LT', 'sameElse' => 'L', ], 'meridiem' => ['ص', 'م'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/ar_YE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org * - Abdullah-Alhariri */ return array_replace_recursive(require __DIR__.'/ar.php', [ 'formats' => [ 'L' => 'DD MMM, YYYY', ], 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/as.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/as_IN.php'; ================================================ FILE: src/Carbon/Lang/as_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Amitakhya Phukan, Red Hat bug-glibc@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D-MM-YYYY', ], 'months' => ['জানুৱাৰী', 'ফেব্ৰুৱাৰী', 'মাৰ্চ', 'এপ্ৰিল', 'মে', 'জুন', 'জুলাই', 'আগষ্ট', 'ছেপ্তেম্বৰ', 'অক্টোবৰ', 'নৱেম্বৰ', 'ডিচেম্বৰ'], 'months_short' => ['জানু', 'ফেব্ৰু', 'মাৰ্চ', 'এপ্ৰিল', 'মে', 'জুন', 'জুলাই', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'], 'weekdays' => ['দেওবাৰ', 'সোমবাৰ', 'মঙ্গলবাৰ', 'বুধবাৰ', 'বৃহষ্পতিবাৰ', 'শুক্ৰবাৰ', 'শনিবাৰ'], 'weekdays_short' => ['দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহষ্পতি', 'শুক্ৰ', 'শনি'], 'weekdays_min' => ['দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহষ্পতি', 'শুক্ৰ', 'শনি'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['পূৰ্ব্বাহ্ন', 'অপৰাহ্ন'], 'year' => ':count বছৰ', 'y' => ':count বছৰ', 'a_year' => ':count বছৰ', 'month' => ':count মাহ', 'm' => ':count মাহ', 'a_month' => ':count মাহ', 'week' => ':count সপ্তাহ', 'w' => ':count সপ্তাহ', 'a_week' => ':count সপ্তাহ', 'day' => ':count বাৰ', 'd' => ':count বাৰ', 'a_day' => ':count বাৰ', 'hour' => ':count ঘণ্টা', 'h' => ':count ঘণ্টা', 'a_hour' => ':count ঘণ্টা', 'minute' => ':count মিনিট', 'min' => ':count মিনিট', 'a_minute' => ':count মিনিট', 'second' => ':count দ্বিতীয়', 's' => ':count দ্বিতীয়', 'a_second' => ':count দ্বিতীয়', ]); ================================================ FILE: src/Carbon/Lang/asa.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['icheheavo', 'ichamthi'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Ijm', 'Jmo'], 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Ijm', 'Jmo'], 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Dec'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ast.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Jordi Mallach jordi@gnu.org * - Adolfo Jayme-Barrientos (fitojb) */ return array_replace_recursive(require __DIR__.'/es.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['de xineru', 'de febreru', 'de marzu', 'd’abril', 'de mayu', 'de xunu', 'de xunetu', 'd’agostu', 'de setiembre', 'd’ochobre', 'de payares', 'd’avientu'], 'months_short' => ['xin', 'feb', 'mar', 'abr', 'may', 'xun', 'xnt', 'ago', 'set', 'och', 'pay', 'avi'], 'weekdays' => ['domingu', 'llunes', 'martes', 'miércoles', 'xueves', 'vienres', 'sábadu'], 'weekdays_short' => ['dom', 'llu', 'mar', 'mié', 'xue', 'vie', 'sáb'], 'weekdays_min' => ['dom', 'llu', 'mar', 'mié', 'xue', 'vie', 'sáb'], 'year' => ':count añu|:count años', 'y' => ':count añu|:count años', 'a_year' => 'un añu|:count años', 'month' => ':count mes', 'm' => ':count mes', 'a_month' => 'un mes|:count mes', 'week' => ':count selmana|:count selmanes', 'w' => ':count selmana|:count selmanes', 'a_week' => 'una selmana|:count selmanes', 'day' => ':count día|:count díes', 'd' => ':count día|:count díes', 'a_day' => 'un día|:count díes', 'hour' => ':count hora|:count hores', 'h' => ':count hora|:count hores', 'a_hour' => 'una hora|:count hores', 'minute' => ':count minutu|:count minutos', 'min' => ':count minutu|:count minutos', 'a_minute' => 'un minutu|:count minutos', 'second' => ':count segundu|:count segundos', 's' => ':count segundu|:count segundos', 'a_second' => 'un segundu|:count segundos', 'ago' => 'hai :time', 'from_now' => 'en :time', 'after' => ':time dempués', 'before' => ':time enantes', ]); ================================================ FILE: src/Carbon/Lang/ast_ES.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ast.php'; ================================================ FILE: src/Carbon/Lang/ayc.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ayc_PE.php'; ================================================ FILE: src/Carbon/Lang/ayc_PE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - runasimipi.org libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['inïru', 'phiwriru', 'marsu', 'awrila', 'mayu', 'junyu', 'julyu', 'awustu', 'sitimri', 'uktuwri', 'nuwimri', 'risimri'], 'months_short' => ['ini', 'phi', 'mar', 'awr', 'may', 'jun', 'jul', 'awu', 'sit', 'ukt', 'nuw', 'ris'], 'weekdays' => ['tuminku', 'lunisa', 'martisa', 'mirkulisa', 'juywisa', 'wirnisa', 'sawäru'], 'weekdays_short' => ['tum', 'lun', 'mar', 'mir', 'juy', 'wir', 'saw'], 'weekdays_min' => ['tum', 'lun', 'mar', 'mir', 'juy', 'wir', 'saw'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['VM', 'NM'], ]); ================================================ FILE: src/Carbon/Lang/az.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - Kunal Marwaha * - François B * - JD Isaacks * - Orxan * - Şəhriyar İmanov * - Baran Şengül * - Novruz Rahimov */ return [ 'year' => ':count il', 'a_year' => '{1}bir il|[-Inf,Inf]:count il', 'y' => ':count il', 'month' => ':count ay', 'a_month' => '{1}bir ay|[-Inf,Inf]:count ay', 'm' => ':count ay', 'week' => ':count həftə', 'a_week' => '{1}bir həftə|[-Inf,Inf]:count həftə', 'w' => ':count h.', 'day' => ':count gün', 'a_day' => '{1}bir gün|[-Inf,Inf]:count gün', 'd' => ':count g.', 'hour' => ':count saat', 'a_hour' => '{1}bir saat|[-Inf,Inf]:count saat', 'h' => ':count s.', 'minute' => ':count dəqiqə', 'a_minute' => '{1}bir dəqiqə|[-Inf,Inf]:count dəqiqə', 'min' => ':count d.', 'second' => ':count saniyə', 'a_second' => '{1}birneçə saniyə|[-Inf,Inf]:count saniyə', 's' => ':count san.', 'ago' => ':time əvvəl', 'from_now' => ':time sonra', 'after' => ':time sonra', 'before' => ':time əvvəl', 'diff_now' => 'indi', 'diff_today' => 'bugün', 'diff_today_regexp' => 'bugün(?:\\s+saat)?', 'diff_yesterday' => 'dünən', 'diff_tomorrow' => 'sabah', 'diff_tomorrow_regexp' => 'sabah(?:\\s+saat)?', 'diff_before_yesterday' => 'srağagün', 'diff_after_tomorrow' => 'birisi gün', 'period_recurrences' => ':count dəfədən bir', 'period_interval' => 'hər :interval', 'period_start_date' => ':date tarixindən başlayaraq', 'period_end_date' => ':date tarixinədək', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[bugün saat] LT', 'nextDay' => '[sabah saat] LT', 'nextWeek' => '[gələn həftə] dddd [saat] LT', 'lastDay' => '[dünən] LT', 'lastWeek' => '[keçən həftə] dddd [saat] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { if ($number === 0) { // special case for zero return "$number-ıncı"; } static $suffixes = [ 1 => '-inci', 5 => '-inci', 8 => '-inci', 70 => '-inci', 80 => '-inci', 2 => '-nci', 7 => '-nci', 20 => '-nci', 50 => '-nci', 3 => '-üncü', 4 => '-üncü', 100 => '-üncü', 6 => '-ncı', 9 => '-uncu', 10 => '-uncu', 30 => '-uncu', 60 => '-ıncı', 90 => '-ıncı', ]; $lastDigit = $number % 10; return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); }, 'meridiem' => static function ($hour) { if ($hour < 4) { return 'gecə'; } if ($hour < 12) { return 'səhər'; } if ($hour < 17) { return 'gündüz'; } return 'axşam'; }, 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], 'weekdays_short' => ['baz', 'bze', 'çax', 'çər', 'cax', 'cüm', 'şən'], 'weekdays_min' => ['bz', 'be', 'ça', 'çə', 'ca', 'cü', 'şə'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' və '], ]; ================================================ FILE: src/Carbon/Lang/az_AZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Pablo Saratxaga pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/az.php', [ 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], 'weekdays' => ['bazar günü', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], 'weekdays_short' => ['baz', 'ber', 'çax', 'çər', 'cax', 'cüm', 'şnb'], 'weekdays_min' => ['baz', 'ber', 'çax', 'çər', 'cax', 'cüm', 'şnb'], ]); ================================================ FILE: src/Carbon/Lang/az_Arab.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Mousa Moradi mousamk@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'OY/OM/OD', ], 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], 'weekdays_min' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], 'first_day_of_week' => 6, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/az_Cyrl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/az.php', [ 'weekdays' => ['базар', 'базар ертәси', 'чәршәнбә ахшамы', 'чәршәнбә', 'ҹүмә ахшамы', 'ҹүмә', 'шәнбә'], 'weekdays_short' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], 'weekdays_min' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], 'months' => ['јанвар', 'феврал', 'март', 'апрел', 'май', 'ијун', 'ијул', 'август', 'сентјабр', 'октјабр', 'нојабр', 'декабр'], 'months_short' => ['јан', 'фев', 'мар', 'апр', 'май', 'ијн', 'ијл', 'авг', 'сен', 'окт', 'ној', 'дек'], 'meridiem' => ['а', 'п'], ]); ================================================ FILE: src/Carbon/Lang/az_IR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'OY/OM/OD', ], 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], 'weekdays_min' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], 'first_day_of_week' => 6, 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], ]); ================================================ FILE: src/Carbon/Lang/az_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/az.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], 'weekdays_short' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'], 'weekdays_min' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'], 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'D MMMM YYYY, dddd HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/bas.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['I bikɛ̂glà', 'I ɓugajɔp'], 'weekdays' => ['ŋgwà nɔ̂y', 'ŋgwà njaŋgumba', 'ŋgwà ûm', 'ŋgwà ŋgê', 'ŋgwà mbɔk', 'ŋgwà kɔɔ', 'ŋgwà jôn'], 'weekdays_short' => ['nɔy', 'nja', 'uum', 'ŋge', 'mbɔ', 'kɔɔ', 'jon'], 'weekdays_min' => ['nɔy', 'nja', 'uum', 'ŋge', 'mbɔ', 'kɔɔ', 'jon'], 'months' => ['Kɔndɔŋ', 'Màcɛ̂l', 'Màtùmb', 'Màtop', 'M̀puyɛ', 'Hìlòndɛ̀', 'Njèbà', 'Hìkaŋ', 'Dìpɔ̀s', 'Bìòôm', 'Màyɛsèp', 'Lìbuy li ńyèe'], 'months_short' => ['kɔn', 'mac', 'mat', 'mto', 'mpu', 'hil', 'nje', 'hik', 'dip', 'bio', 'may', 'liɓ'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'second' => ':count móndî', // less reliable 's' => ':count móndî', // less reliable 'a_second' => ':count móndî', // less reliable ]); ================================================ FILE: src/Carbon/Lang/be.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonInterface; use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'be'); } // @codeCoverageIgnoreEnd /* * Authors: * - Josh Soref * - SobakaSlava * - François B * - Serhan Apaydın * - JD Isaacks * - AbadonnaAbbys * - Siomkin Alexander */ return [ 'year' => ':count год|:count гады|:count гадоў', 'a_year' => '{1}год|:count год|:count гады|:count гадоў', 'y' => ':count год|:count гады|:count гадоў', 'month' => ':count месяц|:count месяцы|:count месяцаў', 'a_month' => '{1}месяц|:count месяц|:count месяцы|:count месяцаў', 'm' => ':count месяц|:count месяцы|:count месяцаў', 'week' => ':count тыдзень|:count тыдні|:count тыдняў', 'a_week' => '{1}тыдзень|:count тыдзень|:count тыдні|:count тыдняў', 'w' => ':count тыдзень|:count тыдні|:count тыдняў', 'day' => ':count дзень|:count дні|:count дзён', 'a_day' => '{1}дзень|:count дзень|:count дні|:count дзён', 'd' => ':count дн', 'hour' => ':count гадзіну|:count гадзіны|:count гадзін', 'a_hour' => '{1}гадзіна|:count гадзіна|:count гадзіны|:count гадзін', 'h' => ':count гадзіна|:count гадзіны|:count гадзін', 'minute' => ':count хвіліна|:count хвіліны|:count хвілін', 'a_minute' => '{1}хвіліна|:count хвіліна|:count хвіліны|:count хвілін', 'min' => ':count хв', 'second' => ':count секунда|:count секунды|:count секунд', 'a_second' => '{1}некалькі секунд|:count секунда|:count секунды|:count секунд', 's' => ':count сек', 'hour_ago' => ':count гадзіну|:count гадзіны|:count гадзін', 'a_hour_ago' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', 'h_ago' => ':count гадзіну|:count гадзіны|:count гадзін', 'minute_ago' => ':count хвіліну|:count хвіліны|:count хвілін', 'a_minute_ago' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', 'min_ago' => ':count хвіліну|:count хвіліны|:count хвілін', 'second_ago' => ':count секунду|:count секунды|:count секунд', 'a_second_ago' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', 's_ago' => ':count секунду|:count секунды|:count секунд', 'hour_from_now' => ':count гадзіну|:count гадзіны|:count гадзін', 'a_hour_from_now' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', 'h_from_now' => ':count гадзіну|:count гадзіны|:count гадзін', 'minute_from_now' => ':count хвіліну|:count хвіліны|:count хвілін', 'a_minute_from_now' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', 'min_from_now' => ':count хвіліну|:count хвіліны|:count хвілін', 'second_from_now' => ':count секунду|:count секунды|:count секунд', 'a_second_from_now' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', 's_from_now' => ':count секунду|:count секунды|:count секунд', 'hour_after' => ':count гадзіну|:count гадзіны|:count гадзін', 'a_hour_after' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', 'h_after' => ':count гадзіну|:count гадзіны|:count гадзін', 'minute_after' => ':count хвіліну|:count хвіліны|:count хвілін', 'a_minute_after' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', 'min_after' => ':count хвіліну|:count хвіліны|:count хвілін', 'second_after' => ':count секунду|:count секунды|:count секунд', 'a_second_after' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', 's_after' => ':count секунду|:count секунды|:count секунд', 'hour_before' => ':count гадзіну|:count гадзіны|:count гадзін', 'a_hour_before' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', 'h_before' => ':count гадзіну|:count гадзіны|:count гадзін', 'minute_before' => ':count хвіліну|:count хвіліны|:count хвілін', 'a_minute_before' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', 'min_before' => ':count хвіліну|:count хвіліны|:count хвілін', 'second_before' => ':count секунду|:count секунды|:count секунд', 'a_second_before' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', 's_before' => ':count секунду|:count секунды|:count секунд', 'ago' => ':time таму', 'from_now' => 'праз :time', 'after' => ':time пасля', 'before' => ':time да', 'diff_now' => 'цяпер', 'diff_today' => 'Сёння', 'diff_today_regexp' => 'Сёння(?:\\s+ў)?', 'diff_yesterday' => 'учора', 'diff_yesterday_regexp' => 'Учора(?:\\s+ў)?', 'diff_tomorrow' => 'заўтра', 'diff_tomorrow_regexp' => 'Заўтра(?:\\s+ў)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY г.', 'LLL' => 'D MMMM YYYY г., HH:mm', 'LLLL' => 'dddd, D MMMM YYYY г., HH:mm', ], 'calendar' => [ 'sameDay' => '[Сёння ў] LT', 'nextDay' => '[Заўтра ў] LT', 'nextWeek' => '[У] dddd [ў] LT', 'lastDay' => '[Учора ў] LT', 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { 1, 2, 4 => '[У мінулы] dddd [ў] LT', default => '[У мінулую] dddd [ў] LT', }, 'sameElse' => 'L', ], 'ordinal' => static fn ($number, $period) => match ($period) { 'M', 'd', 'DDD', 'w', 'W' => ($number % 10 === 2 || $number % 10 === 3) && ($number % 100 !== 12 && $number % 100 !== 13) ? $number.'-і' : $number.'-ы', 'D' => $number.'-га', default => $number, }, 'meridiem' => static function ($hour) { if ($hour < 4) { return 'ночы'; } if ($hour < 12) { return 'раніцы'; } if ($hour < 17) { return 'дня'; } return 'вечара'; }, 'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'траўня', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'], 'months_standalone' => ['студзень', 'люты', 'сакавік', 'красавік', 'травень', 'чэрвень', 'ліпень', 'жнівень', 'верасень', 'кастрычнік', 'лістапад', 'снежань'], 'months_short' => ['студ', 'лют', 'сак', 'крас', 'трав', 'чэрв', 'ліп', 'жнів', 'вер', 'каст', 'ліст', 'снеж'], 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['нядзелю', 'панядзелак', 'аўторак', 'сераду', 'чацвер', 'пятніцу', 'суботу'], 'weekdays_standalone' => ['нядзеля', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота'], 'weekdays_short' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'], 'weekdays_min' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'], 'weekdays_regexp' => '/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' і '], 'months_short_standalone' => ['сту', 'лют', 'сак', 'кра', 'май', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне'], ]; ================================================ FILE: src/Carbon/Lang/be_BY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/be.php', [ 'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'мая', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'], 'months_short' => ['сту', 'лют', 'сак', 'кра', 'мая', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне'], 'weekdays' => ['Нядзеля', 'Панядзелак', 'Аўторак', 'Серада', 'Чацвер', 'Пятніца', 'Субота'], 'weekdays_short' => ['Няд', 'Пан', 'Аўт', 'Срд', 'Чцв', 'Пят', 'Суб'], 'weekdays_min' => ['Няд', 'Пан', 'Аўт', 'Срд', 'Чцв', 'Пят', 'Суб'], ]); ================================================ FILE: src/Carbon/Lang/be_BY@latin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['studzienia', 'lutaha', 'sakavika', 'krasavika', 'maja', 'červienia', 'lipienia', 'žniŭnia', 'vieraśnia', 'kastryčnika', 'listapada', 'śniežnia'], 'months_short' => ['Stu', 'Lut', 'Sak', 'Kra', 'Maj', 'Čer', 'Lip', 'Žni', 'Vie', 'Kas', 'Lis', 'Śni'], 'weekdays' => ['Niadziela', 'Paniadziełak', 'Aŭtorak', 'Sierada', 'Čaćvier', 'Piatnica', 'Subota'], 'weekdays_short' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'], 'weekdays_min' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/bem.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/bem_ZM.php'; ================================================ FILE: src/Carbon/Lang/bem_ZM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - ANLoc Martin Benjamin locales@africanlocalization.net */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'MM/DD/YYYY', ], 'months' => ['Januari', 'Februari', 'Machi', 'Epreo', 'Mei', 'Juni', 'Julai', 'Ogasti', 'Septemba', 'Oktoba', 'Novemba', 'Disemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Epr', 'Mei', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Dis'], 'weekdays' => ['Pa Mulungu', 'Palichimo', 'Palichibuli', 'Palichitatu', 'Palichine', 'Palichisano', 'Pachibelushi'], 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 'weekdays_min' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['uluchelo', 'akasuba'], 'year' => 'myaka :count', 'y' => 'myaka :count', 'a_year' => 'myaka :count', 'month' => 'myeshi :count', 'm' => 'myeshi :count', 'a_month' => 'myeshi :count', 'week' => 'umulungu :count', 'w' => 'umulungu :count', 'a_week' => 'umulungu :count', 'day' => 'inshiku :count', 'd' => 'inshiku :count', 'a_day' => 'inshiku :count', 'hour' => 'awala :count', 'h' => 'awala :count', 'a_hour' => 'awala :count', 'minute' => 'miniti :count', 'min' => 'miniti :count', 'a_minute' => 'miniti :count', 'second' => 'sekondi :count', 's' => 'sekondi :count', 'a_second' => 'sekondi :count', ]); ================================================ FILE: src/Carbon/Lang/ber.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ber_DZ.php'; ================================================ FILE: src/Carbon/Lang/ber_DZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Pablo Saratxaga pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], 'weekdays' => ['bazar günü', 'birinci gün', 'ikinci gün', 'üçüncü gün', 'dördüncü gün', 'beşinci gün', 'altıncı gün'], 'weekdays_short' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], 'weekdays_min' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/ber_MA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Pablo Saratxaga pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], 'weekdays' => ['bazar günü', 'birinci gün', 'ikinci gün', 'üçüncü gün', 'dördüncü gün', 'beşinci gün', 'altıncı gün'], 'weekdays_short' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], 'weekdays_min' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/bez.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['pamilau', 'pamunyi'], 'weekdays' => ['pa mulungu', 'pa shahuviluha', 'pa hivili', 'pa hidatu', 'pa hitayi', 'pa hihanu', 'pa shahulembela'], 'weekdays_short' => ['Mul', 'Vil', 'Hiv', 'Hid', 'Hit', 'Hih', 'Lem'], 'weekdays_min' => ['Mul', 'Vil', 'Hiv', 'Hid', 'Hit', 'Hih', 'Lem'], 'months' => ['pa mwedzi gwa hutala', 'pa mwedzi gwa wuvili', 'pa mwedzi gwa wudatu', 'pa mwedzi gwa wutai', 'pa mwedzi gwa wuhanu', 'pa mwedzi gwa sita', 'pa mwedzi gwa saba', 'pa mwedzi gwa nane', 'pa mwedzi gwa tisa', 'pa mwedzi gwa kumi', 'pa mwedzi gwa kumi na moja', 'pa mwedzi gwa kumi na mbili'], 'months_short' => ['Hut', 'Vil', 'Dat', 'Tai', 'Han', 'Sit', 'Sab', 'Nan', 'Tis', 'Kum', 'Kmj', 'Kmb'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/bg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - Serhan Apaydın * - JD Isaacks * - Glavić */ use Carbon\CarbonInterface; return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', 'y' => ':count година|:count години', 'month' => ':count месец|:count месеца', 'a_month' => 'месец|:count месеца', 'm' => ':count месец|:count месеца', 'week' => ':count седмица|:count седмици', 'a_week' => 'седмица|:count седмици', 'w' => ':count седмица|:count седмици', 'day' => ':count ден|:count дни', 'a_day' => 'ден|:count дни', 'd' => ':count ден|:count дни', 'hour' => ':count час|:count часа', 'a_hour' => 'час|:count часа', 'h' => ':count час|:count часа', 'minute' => ':count минута|:count минути', 'a_minute' => 'минута|:count минути', 'min' => ':count минута|:count минути', 'second' => ':count секунда|:count секунди', 'a_second' => 'няколко секунди|:count секунди', 's' => ':count секунда|:count секунди', 'ago' => 'преди :time', 'from_now' => 'след :time', 'after' => 'след :time', 'before' => 'преди :time', 'diff_now' => 'сега', 'diff_today' => 'Днес', 'diff_today_regexp' => 'Днес(?:\\s+в)?', 'diff_yesterday' => 'вчера', 'diff_yesterday_regexp' => 'Вчера(?:\\s+в)?', 'diff_tomorrow' => 'утре', 'diff_tomorrow_regexp' => 'Утре(?:\\s+в)?', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'D.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY H:mm', 'LLLL' => 'dddd, D MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[Днес в] LT', 'nextDay' => '[Утре в] LT', 'nextWeek' => 'dddd [в] LT', 'lastDay' => '[Вчера в] LT', 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { 0, 3, 6 => '[В изминалата] dddd [в] LT', default => '[В изминалия] dddd [в] LT', }, 'sameElse' => 'L', ], 'ordinal' => static function ($number) { $lastDigit = $number % 10; $last2Digits = $number % 100; if ($number === 0) { return "$number-ев"; } if ($last2Digits === 0) { return "$number-ен"; } if ($last2Digits > 10 && $last2Digits < 20) { return "$number-ти"; } if ($lastDigit === 1) { return "$number-ви"; } if ($lastDigit === 2) { return "$number-ри"; } if ($lastDigit === 7 || $lastDigit === 8) { return "$number-ми"; } return "$number-ти"; }, 'months' => ['януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември'], 'months_short' => ['яну', 'фев', 'мар', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек'], 'weekdays' => ['неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота'], 'weekdays_short' => ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'], 'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' и '], 'meridiem' => ['преди обяд', 'следобед'], ]; ================================================ FILE: src/Carbon/Lang/bg_BG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/bg.php'; ================================================ FILE: src/Carbon/Lang/bhb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/bhb_IN.php'; ================================================ FILE: src/Carbon/Lang/bhb_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Samsung Electronics Co., Ltd. alexey.merzlyakov@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 'weekdays_min' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/bho.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/bho_IN.php'; ================================================ FILE: src/Carbon/Lang/bho_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bhashaghar@googlegroups.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर"'], 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर"'], 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'], 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], 'hour' => ':count मौसम', 'h' => ':count मौसम', 'a_hour' => ':count मौसम', 'minute' => ':count कला', 'min' => ':count कला', 'a_minute' => ':count कला', 'second' => ':count सोमार', 's' => ':count सोमार', 'a_second' => ':count सोमार', 'year' => ':count साल', 'y' => ':count साल', 'a_year' => ':count साल', 'month' => ':count महिना', 'm' => ':count महिना', 'a_month' => ':count महिना', 'week' => ':count सप्ताह', 'w' => ':count सप्ताह', 'a_week' => ':count सप्ताह', 'day' => ':count दिन', 'd' => ':count दिन', 'a_day' => ':count दिन', ]); ================================================ FILE: src/Carbon/Lang/bi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/bi_VU.php'; ================================================ FILE: src/Carbon/Lang/bi_VU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com & maninder1.s@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'dddd DD MMM YYYY', ], 'months' => ['jenuware', 'febwari', 'maj', 'epril', 'mei', 'jun', 'julae', 'ogis', 'septemba', 'oktoba', 'novemba', 'disemba'], 'months_short' => ['jen', 'feb', 'maj', 'epr', 'mei', 'jun', 'jul', 'ogi', 'sep', 'okt', 'nov', 'dis'], 'weekdays' => ['sande', 'mande', 'maj', 'wota', 'fraede', 'sarede'], 'weekdays_short' => ['san', 'man', 'maj', 'wot', 'fra', 'sar'], 'weekdays_min' => ['san', 'man', 'maj', 'wot', 'fra', 'sar'], 'year' => ':count seven', // less reliable 'y' => ':count seven', // less reliable 'a_year' => ':count seven', // less reliable 'month' => ':count mi', // less reliable 'm' => ':count mi', // less reliable 'a_month' => ':count mi', // less reliable 'week' => ':count sarede', // less reliable 'w' => ':count sarede', // less reliable 'a_week' => ':count sarede', // less reliable 'day' => ':count betde', // less reliable 'd' => ':count betde', // less reliable 'a_day' => ':count betde', // less reliable 'hour' => ':count klok', // less reliable 'h' => ':count klok', // less reliable 'a_hour' => ':count klok', // less reliable 'minute' => ':count smol', // less reliable 'min' => ':count smol', // less reliable 'a_minute' => ':count smol', // less reliable 'second' => ':count tu', // less reliable 's' => ':count tu', // less reliable 'a_second' => ':count tu', // less reliable ]); ================================================ FILE: src/Carbon/Lang/bm.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Estelle Comment */ return [ 'year' => 'san :count', 'a_year' => '{1}san kelen|san :count', 'y' => 'san :count', 'month' => 'kalo :count', 'a_month' => '{1}kalo kelen|kalo :count', 'm' => 'k. :count', 'week' => 'dɔgɔkun :count', 'a_week' => 'dɔgɔkun kelen', 'w' => 'd. :count', 'day' => 'tile :count', 'd' => 't. :count', 'a_day' => '{1}tile kelen|tile :count', 'hour' => 'lɛrɛ :count', 'a_hour' => '{1}lɛrɛ kelen|lɛrɛ :count', 'h' => 'l. :count', 'minute' => 'miniti :count', 'a_minute' => '{1}miniti kelen|miniti :count', 'min' => 'm. :count', 'second' => 'sekondi :count', 'a_second' => '{1}sanga dama dama|sekondi :count', 's' => 'sek. :count', 'ago' => 'a bɛ :time bɔ', 'from_now' => ':time kɔnɔ', 'diff_today' => 'Bi', 'diff_yesterday' => 'Kunu', 'diff_yesterday_regexp' => 'Kunu(?:\\s+lɛrɛ)?', 'diff_tomorrow' => 'Sini', 'diff_tomorrow_regexp' => 'Sini(?:\\s+lɛrɛ)?', 'diff_today_regexp' => 'Bi(?:\\s+lɛrɛ)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'MMMM [tile] D [san] YYYY', 'LLL' => 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', 'LLLL' => 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', ], 'calendar' => [ 'sameDay' => '[Bi lɛrɛ] LT', 'nextDay' => '[Sini lɛrɛ] LT', 'nextWeek' => 'dddd [don lɛrɛ] LT', 'lastDay' => '[Kunu lɛrɛ] LT', 'lastWeek' => 'dddd [tɛmɛnen lɛrɛ] LT', 'sameElse' => 'L', ], 'months' => ['Zanwuyekalo', 'Fewuruyekalo', 'Marisikalo', 'Awirilikalo', 'Mɛkalo', 'Zuwɛnkalo', 'Zuluyekalo', 'Utikalo', 'Sɛtanburukalo', 'ɔkutɔburukalo', 'Nowanburukalo', 'Desanburukalo'], 'months_short' => ['Zan', 'Few', 'Mar', 'Awi', 'Mɛ', 'Zuw', 'Zul', 'Uti', 'Sɛt', 'ɔku', 'Now', 'Des'], 'weekdays' => ['Kari', 'Ntɛnɛn', 'Tarata', 'Araba', 'Alamisa', 'Juma', 'Sibiri'], 'weekdays_short' => ['Kar', 'Ntɛ', 'Tar', 'Ara', 'Ala', 'Jum', 'Sib'], 'weekdays_min' => ['Ka', 'Nt', 'Ta', 'Ar', 'Al', 'Ju', 'Si'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' ni '], ]; ================================================ FILE: src/Carbon/Lang/bn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $bengaliNumbers = ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯']; /* * Authors: * - Josh Soref * - Shakib Hossain * - Raju * - Aniruddha Adhikary * - JD Isaacks * - Saiful Islam * - Faisal Islam * - Hayatunnabi Nabil */ return [ 'year' => ':count বছর', 'a_year' => 'এক বছর|:count বছর', 'y' => '১ বছর|:count বছর', 'month' => ':count মাস', 'a_month' => 'এক মাস|:count মাস', 'm' => '১ মাস|:count মাস', 'week' => ':count সপ্তাহ', 'a_week' => '১ সপ্তাহ|:count সপ্তাহ', 'w' => '১ সপ্তাহ|:count সপ্তাহ', 'day' => ':count দিন', 'a_day' => 'এক দিন|:count দিন', 'd' => '১ দিন|:count দিন', 'hour' => ':count ঘন্টা', 'a_hour' => 'এক ঘন্টা|:count ঘন্টা', 'h' => '১ ঘন্টা|:count ঘন্টা', 'minute' => ':count মিনিট', 'a_minute' => 'এক মিনিট|:count মিনিট', 'min' => '১ মিনিট|:count মিনিট', 'second' => ':count সেকেন্ড', 'a_second' => 'কয়েক সেকেন্ড|:count সেকেন্ড', 's' => '১ সেকেন্ড|:count সেকেন্ড', 'millisecond' => ':count মিলিসেকেন্ড', 'a_millisecond' => 'এক মিলিসেকেন্ড|:count মিলিসেকেন্ড', 'ms' => '১ মিলিসেকেন্ড|:count মিলিসেকেন্ড', 'microsecond' => ':count মাইক্রোসেকেন্ড', 'a_microsecond' => 'এক মাইক্রোসেকেন্ড|:count মাইক্রোসেকেন্ড', 'µs' => '১ মাইক্রোসেকেন্ড|:count মাইক্রোসেকেন্ড', 'ago' => ':time আগে', 'from_now' => ':time পরে', 'after' => ':time পরে', 'before' => ':time আগে', 'diff_now' => 'এখন', 'diff_today' => 'আজ', 'diff_yesterday' => 'গতকাল', 'diff_tomorrow' => 'আগামীকাল', 'diff_before_yesterday' => 'গত পরশু', 'diff_after_tomorrow' => 'আগামী পরশু', 'period_recurrences' => ':count বার|:count বার', 'period_interval' => 'প্রতি :interval', 'period_start_date' => ':date থেকে', 'period_end_date' => ':date পর্যন্ত', 'formats' => [ 'LT' => 'A Oh:Om সময়', 'LTS' => 'A Oh:Om:Os সময়', 'L' => 'OD/OM/OY', 'LL' => 'OD MMMM OY', 'LLL' => 'OD MMMM OY, A Oh:Om সময়', 'LLLL' => 'dddd, OD MMMM OY, A Oh:Om সময়', ], 'calendar' => [ 'sameDay' => '[আজ] LT', 'nextDay' => '[আগামীকাল] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[গতকাল] LT', 'lastWeek' => '[গত] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'রাত'; } if ($hour < 10) { return 'সকাল'; } if ($hour < 17) { return 'দুপুর'; } if ($hour < 20) { return 'বিকাল'; } return 'রাত'; }, 'months' => ['জানুয়ারী', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্র', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'], 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গ', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], 'ordinal' => static function ($number) use ($bengaliNumbers) { // Convert to Bengali numerals $bengaliNumber = str_replace( ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], $bengaliNumbers, (string) $number ); // Apply Bengali ordinal rules $lastDigit = $number % 10; $lastTwoDigits = $number % 100; // Special cases for teens (11-19) always use তম if ($lastTwoDigits >= 11 && $lastTwoDigits <= 19) { return $bengaliNumber.'তম'; } // For numbers 1-10, use specific rules if ($number <= 10) { switch ($number) { case 1: case 5: case 7: case 8: case 9: case 10: return $bengaliNumber.'ম'; case 2: case 3: return $bengaliNumber.'য়'; case 4: return $bengaliNumber.'র্থ'; case 6: return $bengaliNumber.'ষ্ঠ'; default: return $bengaliNumber.'তম'; } } // For numbers > 20, all use তম return $bengaliNumber.'তম'; }, 'list' => [', ', ' এবং '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'weekdays_standalone' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহষ্পতিবার', 'শুক্রবার', 'শনিবার'], 'weekdays_min_standalone' => ['রঃ', 'সোঃ', 'মঃ', 'বুঃ', 'বৃঃ', 'শুঃ', 'শনি'], 'months_short_standalone' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 'alt_numbers' => $bengaliNumbers, ]; ================================================ FILE: src/Carbon/Lang/bn_BD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ankur Group, Taneem Ahmed, Jamil Ahmed */ return array_replace_recursive(require __DIR__.'/bn.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], 'first_day_of_week' => 5, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/bn_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/bn.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/bo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - JD Isaacks */ return [ 'year' => 'ལོ:count', 'a_year' => '{1}ལོ་གཅིག|[-Inf,Inf]ལོ:count', 'month' => 'ཟླ་བ:count', 'a_month' => '{1}ཟླ་བ་གཅིག|[-Inf,Inf]ཟླ་བ:count', 'week' => 'གཟའ་འཁོར་:count', 'a_week' => 'གཟའ་འཁོར་གཅིག', 'day' => 'ཉིན:count་', 'a_day' => '{1}ཉིན་གཅིག|[-Inf,Inf]ཉིན:count', 'hour' => 'ཆུ་ཚོད:count', 'a_hour' => '{1}ཆུ་ཚོད་གཅིག|[-Inf,Inf]ཆུ་ཚོད:count', 'minute' => 'སྐར་མ་:count', 'a_minute' => '{1}སྐར་མ་གཅིག|[-Inf,Inf]སྐར་མ་:count', 'second' => 'སྐར་ཆ:count', 'a_second' => '{01}ལམ་སང|[-Inf,Inf]སྐར་ཆ:count', 'ago' => ':time སྔན་ལ', 'from_now' => ':time ལ་', 'diff_yesterday' => 'ཁ་སང', 'diff_today' => 'དི་རིང', 'diff_tomorrow' => 'སང་ཉིན', 'formats' => [ 'LT' => 'A h:mm', 'LTS' => 'A h:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', ], 'calendar' => [ 'sameDay' => '[དི་རིང] LT', 'nextDay' => '[སང་ཉིན] LT', 'nextWeek' => '[བདུན་ཕྲག་རྗེས་མ], LT', 'lastDay' => '[ཁ་སང] LT', 'lastWeek' => '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'མཚན་མོ'; } if ($hour < 10) { return 'ཞོགས་ཀས'; } if ($hour < 17) { return 'ཉིན་གུང'; } if ($hour < 20) { return 'དགོང་དག'; } return 'མཚན་མོ'; }, 'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], 'months_short' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], 'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'], 'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'], 'list' => [', ', ' ཨནད་ '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'months_standalone' => ['ཟླ་བ་དང་པོ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་པ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུན་པ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], ]; ================================================ FILE: src/Carbon/Lang/bo_CN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/bo.php'; ================================================ FILE: src/Carbon/Lang/bo_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/bo.php', [ 'meridiem' => ['སྔ་དྲོ་', 'ཕྱི་དྲོ་'], 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], 'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ་', 'པ་སངས་', 'སྤེན་པ་'], 'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ་', 'པ་སངས་', 'སྤེན་པ་'], 'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], 'months_short' => ['ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥', 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠', 'ཟླ་༡༡', 'ཟླ་༡༢'], 'months_standalone' => ['ཟླ་བ་དང་པོ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་པ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུན་པ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], 'weekend' => [0, 0], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'YYYY-MM-DD', 'LL' => 'YYYY ལོའི་MMMཚེས་D', 'LLL' => 'སྤྱི་ལོ་YYYY MMMMའི་ཚེས་D h:mm a', 'LLLL' => 'YYYY MMMMའི་ཚེས་D, dddd h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/br.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Serhan Apaydın * - JD Isaacks */ return [ 'year' => '{1}:count bloaz|{3,4,5,9}:count bloaz|[0,Inf[:count vloaz', 'a_year' => '{1}ur bloaz|{3,4,5,9}:count bloaz|[0,Inf[:count vloaz', 'month' => '{1}:count miz|{2}:count viz|[0,Inf[:count miz', 'a_month' => '{1}ur miz|{2}:count viz|[0,Inf[:count miz', 'week' => ':count sizhun', 'a_week' => '{1}ur sizhun|:count sizhun', 'day' => '{1}:count devezh|{2}:count zevezh|[0,Inf[:count devezh', 'a_day' => '{1}un devezh|{2}:count zevezh|[0,Inf[:count devezh', 'hour' => ':count eur', 'a_hour' => '{1}un eur|:count eur', 'minute' => '{1}:count vunutenn|{2}:count vunutenn|[0,Inf[:count munutenn', 'a_minute' => '{1}ur vunutenn|{2}:count vunutenn|[0,Inf[:count munutenn', 'second' => ':count eilenn', 'a_second' => '{1}un nebeud segondennoù|[0,Inf[:count eilenn', 'ago' => ':time \'zo', 'from_now' => 'a-benn :time', 'diff_now' => 'bremañ', 'diff_today' => 'Hiziv', 'diff_today_regexp' => 'Hiziv(?:\\s+da)?', 'diff_yesterday' => 'decʼh', 'diff_yesterday_regexp' => 'Dec\'h(?:\\s+da)?', 'diff_tomorrow' => 'warcʼhoazh', 'diff_tomorrow_regexp' => 'Warc\'hoazh(?:\\s+da)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D [a viz] MMMM YYYY', 'LLL' => 'D [a viz] MMMM YYYY HH:mm', 'LLLL' => 'dddd, D [a viz] MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Hiziv da] LT', 'nextDay' => '[Warc\'hoazh da] LT', 'nextWeek' => 'dddd [da] LT', 'lastDay' => '[Dec\'h da] LT', 'lastWeek' => 'dddd [paset da] LT', 'sameElse' => 'L', ], 'ordinal' => static fn ($number) => $number.($number === 1 ? 'añ' : 'vet'), 'months' => ['Genver', 'C\'hwevrer', 'Meurzh', 'Ebrel', 'Mae', 'Mezheven', 'Gouere', 'Eost', 'Gwengolo', 'Here', 'Du', 'Kerzu'], 'months_short' => ['Gen', 'C\'hwe', 'Meu', 'Ebr', 'Mae', 'Eve', 'Gou', 'Eos', 'Gwe', 'Her', 'Du', 'Ker'], 'weekdays' => ['Sul', 'Lun', 'Meurzh', 'Merc\'her', 'Yaou', 'Gwener', 'Sadorn'], 'weekdays_short' => ['Sul', 'Lun', 'Meu', 'Mer', 'Yao', 'Gwe', 'Sad'], 'weekdays_min' => ['Su', 'Lu', 'Me', 'Mer', 'Ya', 'Gw', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' hag '], 'meridiem' => ['A.M.', 'G.M.'], 'y' => ':count bl.', 'd' => ':count d', 'h' => ':count e', 'min' => ':count min', 's' => ':count s', ]; ================================================ FILE: src/Carbon/Lang/br_FR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/br.php'; ================================================ FILE: src/Carbon/Lang/brx.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/brx_IN.php'; ================================================ FILE: src/Carbon/Lang/brx_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'M/D/YY', ], 'months' => ['जानुवारी', 'फेब्रुवारी', 'मार्स', 'एफ्रिल', 'मे', 'जुन', 'जुलाइ', 'आगस्थ', 'सेबथेज्ब़र', 'अखथबर', 'नबेज्ब़र', 'दिसेज्ब़र'], 'months_short' => ['जानुवारी', 'फेब्रुवारी', 'मार्स', 'एप्रिल', 'मे', 'जुन', 'जुलाइ', 'आगस्थ', 'सेबथेज्ब़र', 'अखथबर', 'नबेज्ब़र', 'दिसेज्ब़र'], 'weekdays' => ['रबिबार', 'सोबार', 'मंगलबार', 'बुदबार', 'बिसथिबार', 'सुखुरबार', 'सुनिबार'], 'weekdays_short' => ['रबि', 'सम', 'मंगल', 'बुद', 'बिसथि', 'सुखुर', 'सुनि'], 'weekdays_min' => ['रबि', 'सम', 'मंगल', 'बुद', 'बिसथि', 'सुखुर', 'सुनि'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['फुं.', 'बेलासे.'], ]); ================================================ FILE: src/Carbon/Lang/bs.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bokideckonja * - Josh Soref * - François B * - shaishavgandhi05 * - Serhan Apaydın * - JD Isaacks * - Ademir Šehić */ use Carbon\CarbonInterface; return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'm' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count sedmica|:count sedmice|:count sedmica', 'w' => ':count sedmica|:count sedmice|:count sedmica', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count dan|:count dana|:count dana', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count sat|:count sata|:count sati', 'minute' => ':count minut|:count minuta|:count minuta', 'min' => ':count minut|:count minuta|:count minuta', 'second' => ':count sekund|:count sekunda|:count sekundi', 's' => ':count sekund|:count sekunda|:count sekundi', 'ago' => 'prije :time', 'from_now' => 'za :time', 'after' => 'nakon :time', 'before' => ':time ranije', 'year_ago' => ':count godinu|:count godine|:count godina', 'year_from_now' => ':count godinu|:count godine|:count godina', 'week_ago' => ':count sedmicu|:count sedmice|:count sedmica', 'week_from_now' => ':count sedmicu|:count sedmice|:count sedmica', 'diff_now' => 'sada', 'diff_today' => 'danas', 'diff_today_regexp' => 'danas(?:\\s+u)?', 'diff_yesterday' => 'jučer', 'diff_yesterday_regexp' => 'jučer(?:\\s+u)?', 'diff_tomorrow' => 'sutra', 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY H:mm', 'LLLL' => 'dddd, D. MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', 'nextWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { 0 => '[u] [nedjelju] [u] LT', 3 => '[u] [srijedu] [u] LT', 6 => '[u] [subotu] [u] LT', default => '[u] dddd [u] LT', }, 'lastDay' => '[jučer u] LT', 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { 0, 3 => '[prošlu] dddd [u] LT', 6 => '[prošle] [subote] [u] LT', default => '[prošli] dddd [u] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar'], 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' i '], 'meridiem' => ['prijepodne', 'popodne'], ]; ================================================ FILE: src/Carbon/Lang/bs_BA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/bs.php'; ================================================ FILE: src/Carbon/Lang/bs_Cyrl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/bs.php', [ 'meridiem' => ['пре подне', 'поподне'], 'weekdays' => ['недјеља', 'понедјељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], 'weekdays_short' => ['нед', 'пон', 'уто', 'сри', 'чет', 'пет', 'суб'], 'weekdays_min' => ['нед', 'пон', 'уто', 'сри', 'чет', 'пет', 'суб'], 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јуни', 'јули', 'аугуст', 'септембар', 'октобар', 'новембар', 'децембар'], 'months_short' => ['јан', 'феб', 'мар', 'апр', 'мај', 'јун', 'јул', 'ауг', 'сеп', 'окт', 'нов', 'дец'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D.M.YYYY.', 'LL' => 'DD.MM.YYYY.', 'LLL' => 'DD. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/bs_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/bs.php', [ ]); ================================================ FILE: src/Carbon/Lang/byn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/byn_ER.php'; ================================================ FILE: src/Carbon/Lang/byn_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ልደትሪ', 'ካብኽብቲ', 'ክብላ', 'ፋጅኺሪ', 'ክቢቅሪ', 'ምኪኤል ትጓ̅ኒሪ', 'ኰርኩ', 'ማርያም ትሪ', 'ያኸኒ መሳቅለሪ', 'መተሉ', 'ምኪኤል መሽወሪ', 'ተሕሳስሪ'], 'months_short' => ['ልደት', 'ካብኽ', 'ክብላ', 'ፋጅኺ', 'ክቢቅ', 'ም/ት', 'ኰር', 'ማርያ', 'ያኸኒ', 'መተሉ', 'ም/ም', 'ተሕሳ'], 'weekdays' => ['ሰንበር ቅዳዅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ ወሪ ለብዋ', 'ኣምድ', 'ኣርብ', 'ሰንበር ሽጓዅ'], 'weekdays_short' => ['ሰ/ቅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ', 'ኣምድ', 'ኣርብ', 'ሰ/ሽ'], 'weekdays_min' => ['ሰ/ቅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ', 'ኣምድ', 'ኣርብ', 'ሰ/ሽ'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ፋዱስ ጃብ', 'ፋዱስ ደምቢ'], ]); ================================================ FILE: src/Carbon/Lang/ca.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - mestremuten * - François B * - Marc Ordinas i Llopis * - Pere Orga * - JD Isaacks * - Quentí * - Víctor Díaz * - Xavi * - qcardona */ use Carbon\CarbonInterface; return [ 'year' => ':count any|:count anys', 'a_year' => 'un any|:count anys', 'y' => ':count any|:count anys', 'month' => ':count mes|:count mesos', 'a_month' => 'un mes|:count mesos', 'm' => ':count mes|:count mesos', 'week' => ':count setmana|:count setmanes', 'a_week' => 'una setmana|:count setmanes', 'w' => ':count setmana|:count setmanes', 'day' => ':count dia|:count dies', 'a_day' => 'un dia|:count dies', 'd' => ':count d', 'hour' => ':count hora|:count hores', 'a_hour' => 'una hora|:count hores', 'h' => ':count h', 'minute' => ':count minut|:count minuts', 'a_minute' => 'un minut|:count minuts', 'min' => ':count min', 'second' => ':count segon|:count segons', 'a_second' => 'uns segons|:count segons', 's' => ':count s', 'ago' => 'fa :time', 'from_now' => 'd\'aquí a :time', 'after' => ':time després', 'before' => ':time abans', 'diff_now' => 'ara mateix', 'diff_today' => 'avui', 'diff_today_regexp' => 'avui(?:\\s+a)?(?:\\s+les)?', 'diff_yesterday' => 'ahir', 'diff_yesterday_regexp' => 'ahir(?:\\s+a)?(?:\\s+les)?', 'diff_tomorrow' => 'demà', 'diff_tomorrow_regexp' => 'demà(?:\\s+a)?(?:\\s+les)?', 'diff_before_yesterday' => 'abans d\'ahir', 'diff_after_tomorrow' => 'demà passat', 'period_recurrences' => ':count cop|:count cops', 'period_interval' => 'cada :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'fins a :date', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM [de] YYYY', 'LLL' => 'D MMMM [de] YYYY [a les] H:mm', 'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm', ], 'calendar' => [ 'sameDay' => static function (CarbonInterface $current) { return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'nextDay' => static function (CarbonInterface $current) { return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'nextWeek' => static function (CarbonInterface $current) { return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'lastDay' => static function (CarbonInterface $current) { return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'lastWeek' => static function (CarbonInterface $current) { return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return $number.( ($period === 'w' || $period === 'W') ? 'a' : ( ($number === 1) ? 'r' : ( ($number === 2) ? 'n' : ( ($number === 3) ? 'r' : ( ($number === 4) ? 't' : 'è' ) ) ) ) ); }, 'months' => ['de gener', 'de febrer', 'de març', 'd\'abril', 'de maig', 'de juny', 'de juliol', 'd\'agost', 'de setembre', 'd\'octubre', 'de novembre', 'de desembre'], 'months_standalone' => ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre'], 'months_short' => ['de gen.', 'de febr.', 'de març', 'd\'abr.', 'de maig', 'de juny', 'de jul.', 'd\'ag.', 'de set.', 'd\'oct.', 'de nov.', 'de des.'], 'months_short_standalone' => ['gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.'], 'months_regexp' => '/(D[oD]?[\s,]+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'], 'weekdays_short' => ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'], 'weekdays_min' => ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' i '], 'meridiem' => ['a. m.', 'p. m.'], ]; ================================================ FILE: src/Carbon/Lang/ca_AD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ca.php', [ ]); ================================================ FILE: src/Carbon/Lang/ca_ES.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ca.php'; ================================================ FILE: src/Carbon/Lang/ca_ES_Valencia.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'ca'); }, 'ca_ES_Valencia'); } // @codeCoverageIgnoreEnd return array_replace_recursive(require __DIR__.'/ca.php', [ ]); ================================================ FILE: src/Carbon/Lang/ca_FR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ca.php', [ ]); ================================================ FILE: src/Carbon/Lang/ca_IT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ca.php', [ ]); ================================================ FILE: src/Carbon/Lang/ccp.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['𑄢𑄧𑄝𑄨𑄝𑄢𑄴', '𑄥𑄧𑄟𑄴𑄝𑄢𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴', '𑄝𑄪𑄖𑄴𑄝𑄢𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴', '𑄥𑄧𑄚𑄨𑄝𑄢𑄴'], 'weekdays_short' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], 'weekdays_min' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], 'months' => ['𑄎𑄚𑄪𑄠𑄢𑄨', '𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴'], 'months_short' => ['𑄎𑄚𑄪', '𑄜𑄬𑄛𑄴', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴'], 'months_short_standalone' => ['𑄎𑄚𑄪𑄠𑄢𑄨', '𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴'], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY h:mm a', 'LLLL' => 'dddd, D MMMM, YYYY h:mm a', ], 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/ccp_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ccp.php', [ 'weekend' => [0, 0], ]); ================================================ FILE: src/Carbon/Lang/ce.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ce_RU.php'; ================================================ FILE: src/Carbon/Lang/ce_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - ANCHR */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY.DD.MM', ], 'months' => ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'], 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'weekdays' => ['КӀиранан де', 'Оршотан де', 'Шинарин де', 'Кхаарин де', 'Еарин де', 'ПӀераскан де', 'Шот де'], 'weekdays_short' => ['КӀ', 'Ор', 'Ши', 'Кх', 'Еа', 'ПӀ', 'Шо'], 'weekdays_min' => ['КӀ', 'Ор', 'Ши', 'Кх', 'Еа', 'ПӀ', 'Шо'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count шо', 'y' => ':count шо', 'a_year' => ':count шо', 'month' => ':count бутт', 'm' => ':count бутт', 'a_month' => ':count бутт', 'week' => ':count кӏира', 'w' => ':count кӏира', 'a_week' => ':count кӏира', 'day' => ':count де', 'd' => ':count де', 'a_day' => ':count де', 'hour' => ':count сахьт', 'h' => ':count сахьт', 'a_hour' => ':count сахьт', 'minute' => ':count минот', 'min' => ':count минот', 'a_minute' => ':count минот', 'second' => ':count секунд', 's' => ':count секунд', 'a_second' => ':count секунд', ]); ================================================ FILE: src/Carbon/Lang/cgg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], 'weekdays_min' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], 'months' => ['Okwokubanza', 'Okwakabiri', 'Okwakashatu', 'Okwakana', 'Okwakataana', 'Okwamukaaga', 'Okwamushanju', 'Okwamunaana', 'Okwamwenda', 'Okwaikumi', 'Okwaikumi na kumwe', 'Okwaikumi na ibiri'], 'months_short' => ['KBZ', 'KBR', 'KST', 'KKN', 'KTN', 'KMK', 'KMS', 'KMN', 'KMW', 'KKM', 'KNK', 'KNB'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'day' => ':count ruhanga', // less reliable 'd' => ':count ruhanga', // less reliable 'a_day' => ':count ruhanga', // less reliable ]); ================================================ FILE: src/Carbon/Lang/chr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/chr_US.php'; ================================================ FILE: src/Carbon/Lang/chr_US.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Cherokee Nation Joseph Erb josepherb7@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'MM/DD/YYYY', ], 'months' => ['ᎤᏃᎸᏔᏅ', 'ᎧᎦᎵ', 'ᎠᏅᏱ', 'ᎧᏬᏂ', 'ᎠᏂᏍᎬᏘ', 'ᏕᎭᎷᏱ', 'ᎫᏰᏉᏂ', 'ᎦᎶᏂ', 'ᏚᎵᏍᏗ', 'ᏚᏂᏅᏗ', 'ᏅᏓᏕᏆ', 'ᎥᏍᎩᏱ'], 'months_short' => ['ᎤᏃ', 'ᎧᎦ', 'ᎠᏅ', 'ᎧᏬ', 'ᎠᏂ', 'ᏕᎭ', 'ᎫᏰ', 'ᎦᎶ', 'ᏚᎵ', 'ᏚᏂ', 'ᏅᏓ', 'ᎥᏍ'], 'weekdays' => ['ᎤᎾᏙᏓᏆᏍᎬ', 'ᎤᎾᏙᏓᏉᏅᎯ', 'ᏔᎵᏁᎢᎦ', 'ᏦᎢᏁᎢᎦ', 'ᏅᎩᏁᎢᎦ', 'ᏧᎾᎩᎶᏍᏗ', 'ᎤᎾᏙᏓᏈᏕᎾ'], 'weekdays_short' => ['ᏆᏍᎬ', 'ᏉᏅᎯ', 'ᏔᎵᏁ', 'ᏦᎢᏁ', 'ᏅᎩᏁ', 'ᏧᎾᎩ', 'ᏈᏕᎾ'], 'weekdays_min' => ['ᏆᏍᎬ', 'ᏉᏅᎯ', 'ᏔᎵᏁ', 'ᏦᎢᏁ', 'ᏅᎩᏁ', 'ᏧᎾᎩ', 'ᏈᏕᎾ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ᏌᎾᎴ', 'ᏒᎯᏱᎢᏗᏢ', 'ꮜꮎꮄ', 'ꮢꭿᏹꭲꮧꮲ'], 'second' => ':count ᏐᎢ', // less reliable 's' => ':count ᏐᎢ', // less reliable 'a_second' => ':count ᏐᎢ', // less reliable 'year' => ':count ᏑᏕᏘᏴᏓ', 'y' => ':count ᏑᏕᏘᏴᏓ', 'a_year' => ':count ᏑᏕᏘᏴᏓ', 'month' => ':count ᏏᏅᏙ', 'm' => ':count ᏏᏅᏙ', 'a_month' => ':count ᏏᏅᏙ', 'week' => ':count ᏑᎾᏙᏓᏆᏍᏗ', 'w' => ':count ᏑᎾᏙᏓᏆᏍᏗ', 'a_week' => ':count ᏑᎾᏙᏓᏆᏍᏗ', 'day' => ':count ᎢᎦ', 'd' => ':count ᎢᎦ', 'a_day' => ':count ᎢᎦ', 'hour' => ':count ᏑᏟᎶᏛ', 'h' => ':count ᏑᏟᎶᏛ', 'a_hour' => ':count ᏑᏟᎶᏛ', 'minute' => ':count ᎢᏯᏔᏬᏍᏔᏅ', 'min' => ':count ᎢᏯᏔᏬᏍᏔᏅ', 'a_minute' => ':count ᎢᏯᏔᏬᏍᏔᏅ', 'ago' => ':time ᏥᎨᏒ', 'from_now' => 'ᎾᎿ :time', ]); ================================================ FILE: src/Carbon/Lang/ckb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Swara Mohammed * - Kawan Pshtiwan */ $months = [ 'کانونی دووەم', 'شوبات', 'ئازار', 'نیسان', 'ئایار', 'حوزەیران', 'تەمموز', 'ئاب', 'ئەیلوول', 'تشرینی یەکەم', 'تشرینی دووەم', 'کانونی یەکەم', ]; return [ 'year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']), 'a_year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']), 'month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']), 'a_month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']), 'week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']), 'a_week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']), 'day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']), 'a_day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']), 'hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']), 'a_hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']), 'minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']), 'a_minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']), 'second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']), 'a_second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']), 'ago' => 'پێش :time', 'from_now' => ':time لە ئێستاوە', 'after' => 'دوای :time', 'before' => 'پێش :time', 'diff_now' => 'ئێستا', 'diff_today' => 'ئەمڕۆ', 'diff_today_regexp' => 'ڕۆژ(?:\\s+لە)?(?:\\s+کاتژمێر)?', 'diff_yesterday' => 'دوێنێ', 'diff_yesterday_regexp' => 'دوێنێ(?:\\s+لە)?(?:\\s+کاتژمێر)?', 'diff_tomorrow' => 'سبەینێ', 'diff_tomorrow_regexp' => 'سبەینێ(?:\\s+لە)?(?:\\s+کاتژمێر)?', 'diff_before_yesterday' => 'پێش دوێنێ', 'diff_after_tomorrow' => 'دوای سبەینێ', 'period_recurrences' => implode('|', ['{0}جار', '{1}جار', '{2}:count دووجار', ']2,11[:count جار', ']10,Inf[:count جار']), 'period_interval' => 'هەموو :interval', 'period_start_date' => 'لە :date', 'period_end_date' => 'بۆ :date', 'months' => $months, 'months_short' => $months, 'weekdays' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], 'weekdays_short' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], 'weekdays_min' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], 'list' => ['، ', ' و '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[ئەمڕۆ لە کاتژمێر] LT', 'nextDay' => '[سبەینێ لە کاتژمێر] LT', 'nextWeek' => 'dddd [لە کاتژمێر] LT', 'lastDay' => '[دوێنێ لە کاتژمێر] LT', 'lastWeek' => 'dddd [لە کاتژمێر] LT', 'sameElse' => 'L', ], 'meridiem' => ['پ.ن', 'د.ن'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/cmn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/cmn_TW.php'; ================================================ FILE: src/Carbon/Lang/cmn_TW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'YYYY年MM月DD號', ], 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'meridiem' => ['上午', '下午'], 'year' => ':count 年', 'y' => ':count 年', 'a_year' => ':count 年', 'month' => ':count 月', 'm' => ':count 月', 'a_month' => ':count 月', 'week' => ':count 周', 'w' => ':count 周', 'a_week' => ':count 周', 'day' => ':count 白天', 'd' => ':count 白天', 'a_day' => ':count 白天', 'hour' => ':count 小时', 'h' => ':count 小时', 'a_hour' => ':count 小时', 'minute' => ':count 分钟', 'min' => ':count 分钟', 'a_minute' => ':count 分钟', 'second' => ':count 秒', 's' => ':count 秒', 'a_second' => ':count 秒', ]); ================================================ FILE: src/Carbon/Lang/crh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/crh_UA.php'; ================================================ FILE: src/Carbon/Lang/crh_UA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Reşat SABIQ tilde.birlik@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'Mayıs', 'İyun', 'İyul', 'Avgust', 'Sentâbr', 'Oktâbr', 'Noyabr', 'Dekabr'], 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], 'weekdays' => ['Bazar', 'Bazarertesi', 'Salı', 'Çarşembe', 'Cumaaqşamı', 'Cuma', 'Cumaertesi'], 'weekdays_short' => ['Baz', 'Ber', 'Sal', 'Çar', 'Caq', 'Cum', 'Cer'], 'weekdays_min' => ['Baz', 'Ber', 'Sal', 'Çar', 'Caq', 'Cum', 'Cer'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ÜE', 'ÜS'], 'year' => ':count yıl', 'y' => ':count yıl', 'a_year' => ':count yıl', 'month' => ':count ay', 'm' => ':count ay', 'a_month' => ':count ay', 'week' => ':count afta', 'w' => ':count afta', 'a_week' => ':count afta', 'day' => ':count kün', 'd' => ':count kün', 'a_day' => ':count kün', 'hour' => ':count saat', 'h' => ':count saat', 'a_hour' => ':count saat', 'minute' => ':count daqqa', 'min' => ':count daqqa', 'a_minute' => ':count daqqa', 'second' => ':count ekinci', 's' => ':count ekinci', 'a_second' => ':count ekinci', ]); ================================================ FILE: src/Carbon/Lang/cs.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Jakub Tesinsky * - Martin Suja * - Nikos Timiopulos * - Bohuslav Blín * - Tsutomu Kuroda * - tjku * - Lukas Svoboda * - Max Melentiev * - Juanito Fatas * - Akira Matsuda * - Christopher Dell * - Václav Pávek * - CodeSkills * - Tlapi * - newman101 * - Petr Kadlec * - tommaskraus * - Karel Sommer (calvera) */ $za = function ($time) { return 'za '.strtr($time, [ 'hodina' => 'hodinu', 'minuta' => 'minutu', 'sekunda' => 'sekundu', ]); }; $pred = function ($time) { $time = strtr($time, [ 'hodina' => 'hodinou', 'minuta' => 'minutou', 'sekunda' => 'sekundou', ]); $time = preg_replace('/hodiny?(?!\w)/', 'hodinami', $time); $time = preg_replace('/minuty?(?!\w)/', 'minutami', $time); $time = preg_replace('/sekundy?(?!\w)/', 'sekundami', $time); return "před $time"; }; return [ 'year' => ':count rok|:count roky|:count let', 'y' => ':count rok|:count roky|:count let', 'a_year' => 'rok|:count roky|:count let', 'month' => ':count měsíc|:count měsíce|:count měsíců', 'm' => ':count měs.', 'a_month' => 'měsíc|:count měsíce|:count měsíců', 'week' => ':count týden|:count týdny|:count týdnů', 'w' => ':count týd.', 'a_week' => 'týden|:count týdny|:count týdnů', 'day' => ':count den|:count dny|:count dní', 'd' => ':count den|:count dny|:count dní', 'a_day' => 'den|:count dny|:count dní', 'hour' => ':count hodina|:count hodiny|:count hodin', 'h' => ':count hod.', 'a_hour' => 'hodina|:count hodiny|:count hodin', 'minute' => ':count minuta|:count minuty|:count minut', 'min' => ':count min.', 'a_minute' => 'minuta|:count minuty|:count minut', 'second' => ':count sekunda|:count sekundy|:count sekund', 's' => ':count sek.', 'a_second' => 'pár sekund|:count sekundy|:count sekund', 'month_ago' => ':count měsícem|:count měsíci|:count měsíci', 'a_month_ago' => 'měsícem|:count měsíci|:count měsíci', 'day_ago' => ':count dnem|:count dny|:count dny', 'a_day_ago' => 'dnem|:count dny|:count dny', 'week_ago' => ':count týdnem|:count týdny|:count týdny', 'a_week_ago' => 'týdnem|:count týdny|:count týdny', 'year_ago' => ':count rokem|:count roky|:count lety', 'y_ago' => ':count rok.|:count rok.|:count let.', 'a_year_ago' => 'rokem|:count roky|:count lety', 'month_before' => ':count měsícem|:count měsíci|:count měsíci', 'a_month_before' => 'měsícem|:count měsíci|:count měsíci', 'day_before' => ':count dnem|:count dny|:count dny', 'a_day_before' => 'dnem|:count dny|:count dny', 'week_before' => ':count týdnem|:count týdny|:count týdny', 'a_week_before' => 'týdnem|:count týdny|:count týdny', 'year_before' => ':count rokem|:count roky|:count lety', 'y_before' => ':count rok.|:count rok.|:count let.', 'a_year_before' => 'rokem|:count roky|:count lety', 'ago' => $pred, 'from_now' => $za, 'before' => $pred, 'after' => $za, 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'months' => ['ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince'], 'months_standalone' => ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], 'months_short' => ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], 'weekdays_short' => ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'], 'weekdays_min' => ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], 'list' => [', ', ' a '], 'diff_now' => 'nyní', 'diff_yesterday' => 'včera', 'diff_tomorrow' => 'zítra', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD. MM. YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd D. MMMM YYYY HH:mm', ], 'meridiem' => ['dopoledne', 'odpoledne'], ]; ================================================ FILE: src/Carbon/Lang/cs_CZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/cs.php'; ================================================ FILE: src/Carbon/Lang/csb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/csb_PL.php'; ================================================ FILE: src/Carbon/Lang/csb_PL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - csb_PL locale Michal Ostrowski bug-glibc-locales@gnu.org */ return [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'MMMM DD, YYYY', 'LLL' => 'DD MMM HH:mm', 'LLLL' => 'MMMM DD, YYYY HH:mm', ], 'months' => ['stëcznika', 'gromicznika', 'strëmiannika', 'łżëkwiata', 'maja', 'czerwińca', 'lëpińca', 'zélnika', 'séwnika', 'rujana', 'lëstopadnika', 'gòdnika'], 'months_short' => ['stë', 'gro', 'str', 'łżë', 'maj', 'cze', 'lëp', 'zél', 'séw', 'ruj', 'lës', 'gòd'], 'weekdays' => ['niedzela', 'pòniedzôłk', 'wtórk', 'strzoda', 'czwiôrtk', 'piątk', 'sobòta'], 'weekdays_short' => ['nie', 'pòn', 'wtó', 'str', 'czw', 'pią', 'sob'], 'weekdays_min' => ['nie', 'pòn', 'wtó', 'str', 'czw', 'pią', 'sob'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' a téż '], 'two_words_connector' => ' a téż ', 'year' => ':count rok', 'month' => ':count miesiąc', 'week' => ':count tidzéń', 'day' => ':count dzéń', 'hour' => ':count gòdzëna', 'minute' => ':count minuta', 'second' => ':count sekunda', ]; ================================================ FILE: src/Carbon/Lang/cu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'YYYY MMMM D, dddd HH:mm', ], 'year' => ':count лѣто', 'y' => ':count лѣто', 'a_year' => ':count лѣто', 'month' => ':count мѣсѧць', 'm' => ':count мѣсѧць', 'a_month' => ':count мѣсѧць', 'week' => ':count сєдмица', 'w' => ':count сєдмица', 'a_week' => ':count сєдмица', 'day' => ':count дьнь', 'd' => ':count дьнь', 'a_day' => ':count дьнь', 'hour' => ':count година', 'h' => ':count година', 'a_hour' => ':count година', 'minute' => ':count малъ', // less reliable 'min' => ':count малъ', // less reliable 'a_minute' => ':count малъ', // less reliable 'second' => ':count въторъ', 's' => ':count въторъ', 'a_second' => ':count въторъ', ]); ================================================ FILE: src/Carbon/Lang/cv.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - JD Isaacks */ return [ 'year' => ':count ҫул', 'a_year' => '{1}пӗр ҫул|:count ҫул', 'month' => ':count уйӑх', 'a_month' => '{1}пӗр уйӑх|:count уйӑх', 'week' => ':count эрне', 'a_week' => '{1}пӗр эрне|:count эрне', 'day' => ':count кун', 'a_day' => '{1}пӗр кун|:count кун', 'hour' => ':count сехет', 'a_hour' => '{1}пӗр сехет|:count сехет', 'minute' => ':count минут', 'a_minute' => '{1}пӗр минут|:count минут', 'second' => ':count ҫеккунт', 'a_second' => '{1}пӗр-ик ҫеккунт|:count ҫеккунт', 'ago' => ':time каялла', 'from_now' => static function ($time) { return $time.(preg_match('/сехет$/u', $time) ? 'рен' : (preg_match('/ҫул/', $time) ? 'тан' : 'ран')); }, 'diff_yesterday' => 'Ӗнер', 'diff_today' => 'Паян', 'diff_tomorrow' => 'Ыран', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD-MM-YYYY', 'LL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', 'LLL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', 'LLLL' => 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', ], 'calendar' => [ 'sameDay' => '[Паян] LT [сехетре]', 'nextDay' => '[Ыран] LT [сехетре]', 'nextWeek' => '[Ҫитес] dddd LT [сехетре]', 'lastDay' => '[Ӗнер] LT [сехетре]', 'lastWeek' => '[Иртнӗ] dddd LT [сехетре]', 'sameElse' => 'L', ], 'ordinal' => ':number-мӗш', 'months' => ['кӑрлач', 'нарӑс', 'пуш', 'ака', 'май', 'ҫӗртме', 'утӑ', 'ҫурла', 'авӑн', 'юпа', 'чӳк', 'раштав'], 'months_short' => ['кӑр', 'нар', 'пуш', 'ака', 'май', 'ҫӗр', 'утӑ', 'ҫур', 'авн', 'юпа', 'чӳк', 'раш'], 'weekdays' => ['вырсарникун', 'тунтикун', 'ытларикун', 'юнкун', 'кӗҫнерникун', 'эрнекун', 'шӑматкун'], 'weekdays_short' => ['выр', 'тун', 'ытл', 'юн', 'кӗҫ', 'эрн', 'шӑм'], 'weekdays_min' => ['вр', 'тн', 'ыт', 'юн', 'кҫ', 'эр', 'шм'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' тата '], ]; ================================================ FILE: src/Carbon/Lang/cv_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/cv.php'; ================================================ FILE: src/Carbon/Lang/cy.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - JD Isaacks * - Daniel Monaghan */ return [ 'year' => '{1}:count flwyddyn|[-Inf,Inf]:count flynedd', 'a_year' => '{1}blwyddyn|[-Inf,Inf]:count flynedd', 'y' => ':countbl', 'month' => ':count mis', 'a_month' => '{1}mis|[-Inf,Inf]:count mis', 'm' => ':countmi', 'week' => ':count wythnos', 'a_week' => '{1}wythnos|[-Inf,Inf]:count wythnos', 'w' => ':countw', 'day' => ':count diwrnod', 'a_day' => '{1}diwrnod|[-Inf,Inf]:count diwrnod', 'd' => ':countd', 'hour' => ':count awr', 'a_hour' => '{1}awr|[-Inf,Inf]:count awr', 'h' => ':counth', 'minute' => ':count munud', 'a_minute' => '{1}munud|[-Inf,Inf]:count munud', 'min' => ':countm', 'second' => ':count eiliad', 'a_second' => '{0,1}ychydig eiliadau|[-Inf,Inf]:count eiliad', 's' => ':counts', 'ago' => ':time yn ôl', 'from_now' => 'mewn :time', 'after' => ':time ar ôl', 'before' => ':time o\'r blaen', 'diff_now' => 'nawr', 'diff_today' => 'Heddiw', 'diff_today_regexp' => 'Heddiw(?:\\s+am)?', 'diff_yesterday' => 'ddoe', 'diff_yesterday_regexp' => 'Ddoe(?:\\s+am)?', 'diff_tomorrow' => 'yfory', 'diff_tomorrow_regexp' => 'Yfory(?:\\s+am)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Heddiw am] LT', 'nextDay' => '[Yfory am] LT', 'nextWeek' => 'dddd [am] LT', 'lastDay' => '[Ddoe am] LT', 'lastWeek' => 'dddd [diwethaf am] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { return $number.( $number > 20 ? (\in_array((int) $number, [40, 50, 60, 80, 100], true) ? 'fed' : 'ain') : ([ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed', // 11eg to 20fed ])[$number] ?? '' ); }, 'months' => ['Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr'], 'months_short' => ['Ion', 'Chwe', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gor', 'Aws', 'Med', 'Hyd', 'Tach', 'Rhag'], 'weekdays' => ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'], 'weekdays_short' => ['Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'], 'weekdays_min' => ['Su', 'Ll', 'Ma', 'Me', 'Ia', 'Gw', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' a '], 'meridiem' => ['yb', 'yh'], ]; ================================================ FILE: src/Carbon/Lang/cy_GB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/cy.php'; ================================================ FILE: src/Carbon/Lang/da.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Rune Mønnike * - François B * - codenhagen * - JD Isaacks * - Jens Herlevsen * - Ulrik McArdle (mcardle) * - Frederik Sauer (FrittenKeeZ) * - Janus Bahs Jacquet (kokoshneta) */ return [ 'year' => ':count år|:count år', 'a_year' => 'et år|:count år', 'y' => ':count år|:count år', 'month' => ':count måned|:count måneder', 'a_month' => 'en måned|:count måneder', 'm' => ':count mdr.', 'week' => ':count uge|:count uger', 'a_week' => 'en uge|:count uger', 'w' => ':count u.', 'day' => ':count dag|:count dage', 'a_day' => ':count dag|:count dage', 'd' => ':count d.', 'hour' => ':count time|:count timer', 'a_hour' => 'en time|:count timer', 'h' => ':count t.', 'minute' => ':count minut|:count minutter', 'a_minute' => 'et minut|:count minutter', 'min' => ':count min.', 'second' => ':count sekund|:count sekunder', 'a_second' => 'få sekunder|:count sekunder', 's' => ':count s.', 'ago' => 'for :time siden', 'from_now' => 'om :time', 'after' => ':time efter', 'before' => ':time før', 'diff_now' => 'nu', 'diff_today' => 'i dag', 'diff_today_regexp' => 'i dag(?:\\s+kl.)?', 'diff_yesterday' => 'i går', 'diff_yesterday_regexp' => 'i går(?:\\s+kl.)?', 'diff_tomorrow' => 'i morgen', 'diff_tomorrow_regexp' => 'i morgen(?:\\s+kl.)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', ], 'calendar' => [ 'sameDay' => '[i dag kl.] LT', 'nextDay' => '[i morgen kl.] LT', 'nextWeek' => 'på dddd [kl.] LT', 'lastDay' => '[i går kl.] LT', 'lastWeek' => '[i] dddd[s kl.] LT', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], 'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], 'weekdays_short' => ['søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.'], 'weekdays_min' => ['sø.', 'ma.', 'ti.', 'on.', 'to.', 'fr.', 'lø.'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' og '], ]; ================================================ FILE: src/Carbon/Lang/da_DK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/da.php'; ================================================ FILE: src/Carbon/Lang/da_GL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/da.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', 'LL' => 'D. MMM YYYY', 'LLL' => 'D. MMMM YYYY HH.mm', 'LLLL' => 'dddd [den] D. MMMM YYYY HH.mm', ], ]); ================================================ FILE: src/Carbon/Lang/dav.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['Luma lwa K', 'luma lwa p'], 'weekdays' => ['Ituku ja jumwa', 'Kuramuka jimweri', 'Kuramuka kawi', 'Kuramuka kadadu', 'Kuramuka kana', 'Kuramuka kasanu', 'Kifula nguwo'], 'weekdays_short' => ['Jum', 'Jim', 'Kaw', 'Kad', 'Kan', 'Kas', 'Ngu'], 'weekdays_min' => ['Jum', 'Jim', 'Kaw', 'Kad', 'Kan', 'Kas', 'Ngu'], 'months' => ['Mori ghwa imbiri', 'Mori ghwa kawi', 'Mori ghwa kadadu', 'Mori ghwa kana', 'Mori ghwa kasanu', 'Mori ghwa karandadu', 'Mori ghwa mfungade', 'Mori ghwa wunyanya', 'Mori ghwa ikenda', 'Mori ghwa ikumi', 'Mori ghwa ikumi na imweri', 'Mori ghwa ikumi na iwi'], 'months_short' => ['Imb', 'Kaw', 'Kad', 'Kan', 'Kas', 'Kar', 'Mfu', 'Wun', 'Ike', 'Iku', 'Imw', 'Iwi'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/de.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Michael Hohl * - sheriffmarley * - dennisoderwald * - Timo * - Karag2006 * - Pete Scopes (pdscopes) */ return [ 'year' => ':count Jahr|:count Jahre', 'a_year' => 'ein Jahr|:count Jahre', 'y' => ':count J.', 'month' => ':count Monat|:count Monate', 'a_month' => 'ein Monat|:count Monate', 'm' => ':count Mon.', 'week' => ':count Woche|:count Wochen', 'a_week' => 'eine Woche|:count Wochen', 'w' => ':count Wo.', 'day' => ':count Tag|:count Tage', 'a_day' => 'ein Tag|:count Tage', 'd' => ':count Tg.', 'hour' => ':count Stunde|:count Stunden', 'a_hour' => 'eine Stunde|:count Stunden', 'h' => ':count Std.', 'minute' => ':count Minute|:count Minuten', 'a_minute' => 'eine Minute|:count Minuten', 'min' => ':count Min.', 'second' => ':count Sekunde|:count Sekunden', 'a_second' => 'ein paar Sekunden|:count Sekunden', 's' => ':count Sek.', 'millisecond' => ':count Millisekunde|:count Millisekunden', 'a_millisecond' => 'eine Millisekunde|:count Millisekunden', 'ms' => ':countms', 'microsecond' => ':count Mikrosekunde|:count Mikrosekunden', 'a_microsecond' => 'eine Mikrosekunde|:count Mikrosekunden', 'µs' => ':countµs', 'ago' => 'vor :time', 'from_now' => 'in :time', 'after' => ':time später', 'before' => ':time zuvor', 'year_from_now' => ':count Jahr|:count Jahren', 'month_from_now' => ':count Monat|:count Monaten', 'week_from_now' => ':count Woche|:count Wochen', 'day_from_now' => ':count Tag|:count Tagen', 'year_ago' => ':count Jahr|:count Jahren', 'month_ago' => ':count Monat|:count Monaten', 'week_ago' => ':count Woche|:count Wochen', 'day_ago' => ':count Tag|:count Tagen', 'a_year_from_now' => 'ein Jahr|:count Jahren', 'a_month_from_now' => 'ein Monat|:count Monaten', 'a_week_from_now' => 'eine Woche|:count Wochen', 'a_day_from_now' => 'ein Tag|:count Tagen', 'a_year_ago' => 'ein Jahr|:count Jahren', 'a_month_ago' => 'ein Monat|:count Monaten', 'a_week_ago' => 'eine Woche|:count Wochen', 'a_day_ago' => 'ein Tag|:count Tagen', 'diff_now' => 'Gerade eben', 'diff_today' => 'heute', 'diff_today_regexp' => 'heute(?:\\s+um)?', 'diff_yesterday' => 'Gestern', 'diff_yesterday_regexp' => 'gestern(?:\\s+um)?', 'diff_tomorrow' => 'Morgen', 'diff_tomorrow_regexp' => 'morgen(?:\\s+um)?', 'diff_before_yesterday' => 'Vorgestern', 'diff_after_tomorrow' => 'Übermorgen', 'period_recurrences' => 'einmal|:count mal', 'period_interval' => static function (string $interval = '') { /** @var string $output */ $output = preg_replace('/^(ein|eine|1)\s+/u', '', $interval); if (preg_match('/^(ein|1)( Monat| Mon.| Tag| Tg.)/u', $interval)) { return "jeden $output"; } if (preg_match('/^(ein|1)( Jahr| J.)/u', $interval)) { return "jedes $output"; } return "jede $output"; }, 'period_start_date' => 'von :date', 'period_end_date' => 'bis :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[heute um] LT [Uhr]', 'nextDay' => '[morgen um] LT [Uhr]', 'nextWeek' => 'dddd [um] LT [Uhr]', 'lastDay' => '[gestern um] LT [Uhr]', 'lastWeek' => '[letzten] dddd [um] LT [Uhr]', 'sameElse' => 'L', ], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], 'weekdays' => ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], 'weekdays_short' => ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], 'weekdays_min' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], 'ordinal' => ':number.', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' und '], 'ordinal_words' => [ 'of' => 'im', 'first' => 'erster', 'second' => 'zweiter', 'third' => 'dritter', 'fourth' => 'vierten', 'fifth' => 'fünfter', 'last' => 'letzten', ], ]; ================================================ FILE: src/Carbon/Lang/de_AT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - sheriffmarley * - Timo * - Michael Hohl * - Namoshek * - Bernhard Baumrock (BernhardBaumrock) */ return array_replace_recursive(require __DIR__.'/de.php', [ 'months' => [ 0 => 'Jänner', ], 'months_short' => [ 0 => 'Jän', ], ]); ================================================ FILE: src/Carbon/Lang/de_BE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/de.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], ]); ================================================ FILE: src/Carbon/Lang/de_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - sheriffmarley * - Timo * - Michael Hohl */ return array_replace_recursive(require __DIR__.'/de.php', [ 'weekdays_short' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], ]); ================================================ FILE: src/Carbon/Lang/de_DE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return require __DIR__.'/de.php'; ================================================ FILE: src/Carbon/Lang/de_IT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Matthias Dieter Wallno:fer libc-locales@sourceware.org */ return require __DIR__.'/de.php'; ================================================ FILE: src/Carbon/Lang/de_LI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/de.php'; ================================================ FILE: src/Carbon/Lang/de_LU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/de.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], ]); ================================================ FILE: src/Carbon/Lang/dje.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamisi', 'Alzuma', 'Asibti'], 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'year' => ':count hari', // less reliable 'y' => ':count hari', // less reliable 'a_year' => ':count hari', // less reliable 'week' => ':count alzuma', // less reliable 'w' => ':count alzuma', // less reliable 'a_week' => ':count alzuma', // less reliable 'second' => ':count atinni', // less reliable 's' => ':count atinni', // less reliable 'a_second' => ':count atinni', // less reliable ]); ================================================ FILE: src/Carbon/Lang/doi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/doi_IN.php'; ================================================ FILE: src/Carbon/Lang/doi_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat Pune libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'एप्रैल', 'मेई', 'जून', 'जूलै', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर'], 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'एप्रैल', 'मेई', 'जून', 'जूलै', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर'], 'weekdays' => ['ऐतबार', 'सोमबार', 'मंगलबर', 'बुधबार', 'बीरबार', 'शुक्करबार', 'श्नीचरबार'], 'weekdays_short' => ['ऐत', 'सोम', 'मंगल', 'बुध', 'बीर', 'शुक्कर', 'श्नीचर'], 'weekdays_min' => ['ऐत', 'सोम', 'मंगल', 'बुध', 'बीर', 'शुक्कर', 'श्नीचर'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['सञं', 'सबेर'], 'second' => ':count सङार', // less reliable 's' => ':count सङार', // less reliable 'a_second' => ':count सङार', // less reliable ]); ================================================ FILE: src/Carbon/Lang/dsb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/dsb_DE.php'; ================================================ FILE: src/Carbon/Lang/dsb_DE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Information from Michael Wolf bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'DD. MMMM YYYY', 'LLL' => 'DD. MMMM, HH:mm [góź.]', 'LLLL' => 'dddd, DD. MMMM YYYY, HH:mm [góź.]', ], 'months' => ['januara', 'februara', 'měrca', 'apryla', 'maja', 'junija', 'julija', 'awgusta', 'septembra', 'oktobra', 'nowembra', 'decembra'], 'months_short' => ['Jan', 'Feb', 'Měr', 'Apr', 'Maj', 'Jun', 'Jul', 'Awg', 'Sep', 'Okt', 'Now', 'Dec'], 'weekdays' => ['Njeźela', 'Pónjeźele', 'Wałtora', 'Srjoda', 'Stwórtk', 'Pětk', 'Sobota'], 'weekdays_short' => ['Nj', 'Pó', 'Wa', 'Sr', 'St', 'Pě', 'So'], 'weekdays_min' => ['Nj', 'Pó', 'Wa', 'Sr', 'St', 'Pě', 'So'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count lěto', 'y' => ':count lěto', 'a_year' => ':count lěto', 'month' => ':count mjasec', 'm' => ':count mjasec', 'a_month' => ':count mjasec', 'week' => ':count tyźeń', 'w' => ':count tyźeń', 'a_week' => ':count tyźeń', 'day' => ':count źeń', 'd' => ':count źeń', 'a_day' => ':count źeń', 'hour' => ':count góźina', 'h' => ':count góźina', 'a_hour' => ':count góźina', 'minute' => ':count minuta', 'min' => ':count minuta', 'a_minute' => ':count minuta', 'second' => ':count drugi', 's' => ':count drugi', 'a_second' => ':count drugi', ]); ================================================ FILE: src/Carbon/Lang/dua.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['idiɓa', 'ebyámu'], 'weekdays' => ['éti', 'mɔ́sú', 'kwasú', 'mukɔ́sú', 'ŋgisú', 'ɗónɛsú', 'esaɓasú'], 'weekdays_short' => ['ét', 'mɔ́s', 'kwa', 'muk', 'ŋgi', 'ɗón', 'esa'], 'weekdays_min' => ['ét', 'mɔ́s', 'kwa', 'muk', 'ŋgi', 'ɗón', 'esa'], 'months' => ['dimɔ́di', 'ŋgɔndɛ', 'sɔŋɛ', 'diɓáɓá', 'emiasele', 'esɔpɛsɔpɛ', 'madiɓɛ́díɓɛ́', 'diŋgindi', 'nyɛtɛki', 'mayésɛ́', 'tiníní', 'eláŋgɛ́'], 'months_short' => ['di', 'ŋgɔn', 'sɔŋ', 'diɓ', 'emi', 'esɔ', 'mad', 'diŋ', 'nyɛt', 'may', 'tin', 'elá'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'year' => ':count ma mbu', // less reliable 'y' => ':count ma mbu', // less reliable 'a_year' => ':count ma mbu', // less reliable 'month' => ':count myo̱di', // less reliable 'm' => ':count myo̱di', // less reliable 'a_month' => ':count myo̱di', // less reliable 'week' => ':count woki', // less reliable 'w' => ':count woki', // less reliable 'a_week' => ':count woki', // less reliable 'day' => ':count buńa', // less reliable 'd' => ':count buńa', // less reliable 'a_day' => ':count buńa', // less reliable 'hour' => ':count ma awa', // less reliable 'h' => ':count ma awa', // less reliable 'a_hour' => ':count ma awa', // less reliable 'minute' => ':count minuti', // less reliable 'min' => ':count minuti', // less reliable 'a_minute' => ':count minuti', // less reliable 'second' => ':count maba', // less reliable 's' => ':count maba', // less reliable 'a_second' => ':count maba', // less reliable ]); ================================================ FILE: src/Carbon/Lang/dv.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $months = [ 'ޖަނަވަރީ', 'ފެބުރުވަރީ', 'މާރިޗު', 'އެޕްރީލް', 'މޭ', 'ޖޫން', 'ޖުލައި', 'އޮގަސްޓު', 'ސެޕްޓެންބަރު', 'އޮކްޓޫބަރު', 'ނޮވެންބަރު', 'ޑިސެންބަރު', ]; $weekdays = [ 'އާދިއްތަ', 'ހޯމަ', 'އަންގާރަ', 'ބުދަ', 'ބުރާސްފަތި', 'ހުކުރު', 'ހޮނިހިރު', ]; /* * Authors: * - Josh Soref * - Jawish Hameed * - Saiph Muhammad */ return [ 'year' => ':count '.'އަހަރު', 'a_year' => '{1}'.'އަހަރެއް'.'|:count '.'އަހަރު', 'month' => ':count '.'މަސް', 'a_month' => '{1}'.'މަހެއް'.'|:count '.'މަސް', 'week' => ':count '.'ހަފްތާ', 'a_week' => '{1}'.'ސިކުންތުކޮޅެއް'.'|:count '.'ހަފްތާ', 'day' => ':count '.'ދުވަސް', 'a_day' => '{1}'.'ދުވަހެއް'.'|:count '.'ދުވަސް', 'hour' => ':count '.'ގަޑިއިރު', 'a_hour' => '{1}'.'ގަޑިއިރެއް'.'|:count '.'ގަޑިއިރު', 'minute' => ':count '.'މިނިޓު', 'a_minute' => '{1}'.'މިނިޓެއް'.'|:count '.'މިނިޓު', 'second' => ':count '.'ސިކުންތު', 'a_second' => '{1}'.'ސިކުންތުކޮޅެއް'.'|:count '.'ސިކުންތު', 'ago' => 'ކުރިން :time', 'from_now' => 'ތެރޭގައި :time', 'after' => ':time ފަހުން', 'before' => ':time ކުރި', 'diff_yesterday' => 'އިއްޔެ', 'diff_today' => 'މިއަދު', 'diff_tomorrow' => 'މާދަމާ', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[މިއަދު] LT', 'nextDay' => '[މާދަމާ] LT', 'nextWeek' => 'dddd LT', 'lastDay' => '[އިއްޔެ] LT', 'lastWeek' => '[ފާއިތުވި] dddd LT', 'sameElse' => 'L', ], 'meridiem' => ['މކ', 'މފ'], 'months' => $months, 'months_short' => $months, 'weekdays' => $weekdays, 'weekdays_short' => $weekdays, 'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'], 'list' => [', ', ' އަދި '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]; ================================================ FILE: src/Carbon/Lang/dv_MV.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ahmed Ali */ $months = [ 'ޖެނުއަރީ', 'ފެބްރުއަރީ', 'މާރިޗު', 'އޭޕްރީލު', 'މޭ', 'ޖޫން', 'ޖުލައި', 'އޯގަސްޓު', 'ސެޕްޓެމްބަރު', 'އޮކްޓޯބަރު', 'ނޮވެމްބަރު', 'ޑިސެމްބަރު', ]; $weekdays = [ 'އާދިއްތަ', 'ހޯމަ', 'އަންގާރަ', 'ބުދަ', 'ބުރާސްފަތި', 'ހުކުރު', 'ހޮނިހިރު', ]; return [ 'year' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', 'y' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', 'month' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', 'm' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', 'week' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', 'w' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', 'day' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', 'd' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', 'hour' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', 'h' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', 'minute' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', 'min' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', 'second' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', 's' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', 'ago' => ':time ކުރިން', 'from_now' => ':time ފަހުން', 'after' => ':time ފަހުން', 'before' => ':time ކުރި', 'diff_yesterday' => 'އިއްޔެ', 'diff_today' => 'މިއަދު', 'diff_tomorrow' => 'މާދަމާ', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[މިއަދު] LT', 'nextDay' => '[މާދަމާ] LT', 'nextWeek' => 'dddd LT', 'lastDay' => '[އިއްޔެ] LT', 'lastWeek' => '[ފާއިތުވި] dddd LT', 'sameElse' => 'L', ], 'meridiem' => ['މކ', 'މފ'], 'months' => $months, 'months_short' => $months, 'weekdays' => $weekdays, 'weekdays_short' => $weekdays, 'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'], 'list' => [', ', ' އަދި '], ]; ================================================ FILE: src/Carbon/Lang/dyo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimas', 'Teneŋ', 'Talata', 'Alarbay', 'Aramisay', 'Arjuma', 'Sibiti'], 'weekdays_short' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], 'weekdays_min' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], 'months' => ['Sanvie', 'Fébirie', 'Mars', 'Aburil', 'Mee', 'Sueŋ', 'Súuyee', 'Ut', 'Settembar', 'Oktobar', 'Novembar', 'Disambar'], 'months_short' => ['Sa', 'Fe', 'Ma', 'Ab', 'Me', 'Su', 'Sú', 'Ut', 'Se', 'Ok', 'No', 'De'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/dz.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/dz_BT.php'; ================================================ FILE: src/Carbon/Lang/dz_BT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Sherubtse College bug-glibc@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'པསྱི་ལོYYཟལMMཚེསDD', ], 'months' => ['ཟླ་བ་དང་པ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་ཕ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུནཔ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], 'months_short' => ['ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥', 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠', 'ཟླ་༡༡', 'ཟླ་༡༢'], 'weekdays' => ['གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་ཕ་', 'གཟའ་པུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་ཕ་', 'གཟའ་ཉི་མ་'], 'weekdays_short' => ['ཟླ་', 'མིར་', 'ལྷག་', 'པུར་', 'སངས་', 'སྤེན་', 'ཉི་'], 'weekdays_min' => ['ཟླ་', 'མིར་', 'ལྷག་', 'པུར་', 'སངས་', 'སྤེན་', 'ཉི་'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ངས་ཆ', 'ཕྱི་ཆ'], 'year' => ':count ཆརཔ', // less reliable 'y' => ':count ཆརཔ', // less reliable 'a_year' => ':count ཆརཔ', // less reliable 'month' => ':count ཟླ་བ', // less reliable 'm' => ':count ཟླ་བ', // less reliable 'a_month' => ':count ཟླ་བ', // less reliable 'day' => ':count ཉི', // less reliable 'd' => ':count ཉི', // less reliable 'a_day' => ':count ཉི', // less reliable 'second' => ':count ཆ', // less reliable 's' => ':count ཆ', // less reliable 'a_second' => ':count ཆ', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ebu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['KI', 'UT'], 'weekdays' => ['Kiumia', 'Njumatatu', 'Njumaine', 'Njumatano', 'Aramithi', 'Njumaa', 'NJumamothii'], 'weekdays_short' => ['Kma', 'Tat', 'Ine', 'Tan', 'Arm', 'Maa', 'NMM'], 'weekdays_min' => ['Kma', 'Tat', 'Ine', 'Tan', 'Arm', 'Maa', 'NMM'], 'months' => ['Mweri wa mbere', 'Mweri wa kaĩri', 'Mweri wa kathatũ', 'Mweri wa kana', 'Mweri wa gatano', 'Mweri wa gatantatũ', 'Mweri wa mũgwanja', 'Mweri wa kanana', 'Mweri wa kenda', 'Mweri wa ikũmi', 'Mweri wa ikũmi na ũmwe', 'Mweri wa ikũmi na Kaĩrĩ'], 'months_short' => ['Mbe', 'Kai', 'Kat', 'Kan', 'Gat', 'Gan', 'Mug', 'Knn', 'Ken', 'Iku', 'Imw', 'Igi'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ee.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ŋ', 'ɣ'], 'weekdays' => ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'], 'weekdays_short' => ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'], 'weekdays_min' => ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'], 'months' => ['dzove', 'dzodze', 'tedoxe', 'afɔfĩe', 'dama', 'masa', 'siamlɔm', 'deasiamime', 'anyɔnyɔ', 'kele', 'adeɛmekpɔxe', 'dzome'], 'months_short' => ['dzv', 'dzd', 'ted', 'afɔ', 'dam', 'mas', 'sia', 'dea', 'any', 'kel', 'ade', 'dzm'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'a [ga] h:mm', 'LTS' => 'a [ga] h:mm:ss', 'L' => 'M/D/YYYY', 'LL' => 'MMM D [lia], YYYY', 'LLL' => 'a [ga] h:mm MMMM D [lia] YYYY', 'LLLL' => 'a [ga] h:mm dddd, MMMM D [lia] YYYY', ], 'year' => 'ƒe :count', 'y' => 'ƒe :count', 'a_year' => 'ƒe :count', 'month' => 'ɣleti :count', 'm' => 'ɣleti :count', 'a_month' => 'ɣleti :count', 'week' => 'kwasiɖa :count', 'w' => 'kwasiɖa :count', 'a_week' => 'kwasiɖa :count', 'day' => 'ŋkeke :count', 'd' => 'ŋkeke :count', 'a_day' => 'ŋkeke :count', 'hour' => 'gaƒoƒo :count', 'h' => 'gaƒoƒo :count', 'a_hour' => 'gaƒoƒo :count', 'minute' => 'miniti :count', // less reliable 'min' => 'miniti :count', // less reliable 'a_minute' => 'miniti :count', // less reliable 'second' => 'sɛkɛnd :count', // less reliable 's' => 'sɛkɛnd :count', // less reliable 'a_second' => 'sɛkɛnd :count', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ee_TG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ee.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'LLL' => 'HH:mm MMMM D [lia] YYYY', 'LLLL' => 'HH:mm dddd, MMMM D [lia] YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/el.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Alessandro Di Felice * - François B * - Tim Fish * - Gabriel Monteagudo * - JD Isaacks * - yiannisdesp * - Ilias Kasmeridis (iliaskasm) */ use Carbon\CarbonInterface; return [ 'year' => ':count χρόνος|:count χρόνια', 'a_year' => 'ένας χρόνος|:count χρόνια', 'y' => ':count χρ.', 'month' => ':count μήνας|:count μήνες', 'a_month' => 'ένας μήνας|:count μήνες', 'm' => ':count μήν.', 'week' => ':count εβδομάδα|:count εβδομάδες', 'a_week' => 'μια εβδομάδα|:count εβδομάδες', 'w' => ':count εβδ.', 'day' => ':count μέρα|:count μέρες', 'a_day' => 'μία μέρα|:count μέρες', 'd' => ':count μέρ.', 'hour' => ':count ώρα|:count ώρες', 'a_hour' => 'μία ώρα|:count ώρες', 'h' => ':count ώρα|:count ώρες', 'minute' => ':count λεπτό|:count λεπτά', 'a_minute' => 'ένα λεπτό|:count λεπτά', 'min' => ':count λεπ.', 'second' => ':count δευτερόλεπτο|:count δευτερόλεπτα', 'a_second' => 'λίγα δευτερόλεπτα|:count δευτερόλεπτα', 's' => ':count δευ.', 'ago' => 'πριν :time', 'from_now' => 'σε :time', 'after' => ':time μετά', 'before' => ':time πριν', 'year_ago' => ':count χρόνο|:count χρόνια', 'year_from_now' => ':count χρόνο|:count χρόνια', 'month_ago' => ':count μήνα|:count μήνες', 'month_from_now' => ':count μήνα|:count μήνες', 'diff_now' => 'τώρα', 'diff_today' => 'Σήμερα', 'diff_today_regexp' => 'Σήμερα(?:\\s+{})?', 'diff_yesterday' => 'χθες', 'diff_yesterday_regexp' => 'Χθες(?:\\s+{})?', 'diff_tomorrow' => 'αύριο', 'diff_tomorrow_regexp' => 'Αύριο(?:\\s+{})?', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY h:mm A', 'LLLL' => 'dddd, D MMMM YYYY h:mm A', ], 'calendar' => [ 'sameDay' => '[Σήμερα {}] LT', 'nextDay' => '[Αύριο {}] LT', 'nextWeek' => 'dddd [{}] LT', 'lastDay' => '[Χθες {}] LT', 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { 6 => '[το προηγούμενο] dddd [{}] LT', default => '[την προηγούμενη] dddd [{}] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':numberη', 'meridiem' => ['ΠΜ', 'ΜΜ', 'πμ', 'μμ'], 'months' => ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'], 'months_standalone' => ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], 'months_regexp' => '/(D[oD]?[\s,]+MMMM|L{2,4}|l{2,4})/', 'months_short' => ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], 'weekdays' => ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], 'weekdays_short' => ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], 'weekdays_min' => ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' και '], ]; ================================================ FILE: src/Carbon/Lang/el_CY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Greek Debian Translation Team bug-glibc@gnu.org */ return array_replace_recursive(require __DIR__.'/el.php', [ 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/el_GR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/el.php', [ 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Milos Sakovic * - Paul * - Pete Scopes (pdscopes) */ return [ /* * {1}, {0} and [-Inf,Inf] are not needed as it's the default for English pluralization. * But as some languages are using en.php as a fallback, it's better to specify it * explicitly so those languages also fallback to English pluralization when a unit * is missing. */ 'year' => '{1}:count year|{0}:count years|[-Inf,Inf]:count years', 'a_year' => '{1}a year|{0}:count years|[-Inf,Inf]:count years', 'y' => '{1}:countyr|{0}:countyrs|[-Inf,Inf]:countyrs', 'month' => '{1}:count month|{0}:count months|[-Inf,Inf]:count months', 'a_month' => '{1}a month|{0}:count months|[-Inf,Inf]:count months', 'm' => '{1}:countmo|{0}:countmos|[-Inf,Inf]:countmos', 'week' => '{1}:count week|{0}:count weeks|[-Inf,Inf]:count weeks', 'a_week' => '{1}a week|{0}:count weeks|[-Inf,Inf]:count weeks', 'w' => ':countw', 'day' => '{1}:count day|{0}:count days|[-Inf,Inf]:count days', 'a_day' => '{1}a day|{0}:count days|[-Inf,Inf]:count days', 'd' => ':countd', 'hour' => '{1}:count hour|{0}:count hours|[-Inf,Inf]:count hours', 'a_hour' => '{1}an hour|{0}:count hours|[-Inf,Inf]:count hours', 'h' => ':counth', 'minute' => '{1}:count minute|{0}:count minutes|[-Inf,Inf]:count minutes', 'a_minute' => '{1}a minute|{0}:count minutes|[-Inf,Inf]:count minutes', 'min' => ':countm', 'second' => '{1}:count second|{0}:count seconds|[-Inf,Inf]:count seconds', 'a_second' => '{0,1}a few seconds|[-Inf,Inf]:count seconds', 's' => ':counts', 'millisecond' => '{1}:count millisecond|{0}:count milliseconds|[-Inf,Inf]:count milliseconds', 'a_millisecond' => '{1}a millisecond|{0}:count milliseconds|[-Inf,Inf]:count milliseconds', 'ms' => ':countms', 'microsecond' => '{1}:count microsecond|{0}:count microseconds|[-Inf,Inf]:count microseconds', 'a_microsecond' => '{1}a microsecond|{0}:count microseconds|[-Inf,Inf]:count microseconds', 'µs' => ':countµs', 'ago' => ':time ago', 'from_now' => ':time from now', 'after' => ':time after', 'before' => ':time before', 'diff_now' => 'just now', 'diff_today' => 'today', 'diff_yesterday' => 'yesterday', 'diff_tomorrow' => 'tomorrow', 'diff_before_yesterday' => 'before yesterday', 'diff_after_tomorrow' => 'after tomorrow', 'period_recurrences' => '{1}once|{0}:count times|[-Inf,Inf]:count times', 'period_interval' => 'every :interval', 'period_start_date' => 'from :date', 'period_end_date' => 'to :date', 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 'ordinal' => static function ($number) { $lastDigit = $number % 10; return $number.( ((int) ($number % 100 / 10) === 1) ? 'th' : ( ($lastDigit === 1) ? 'st' : ( ($lastDigit === 2) ? 'nd' : ( ($lastDigit === 3) ? 'rd' : 'th' ) ) ) ); }, 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'MM/DD/YYYY', 'LL' => 'MMMM D, YYYY', 'LLL' => 'MMMM D, YYYY h:mm A', 'LLLL' => 'dddd, MMMM D, YYYY h:mm A', ], 'list' => [', ', ' and '], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['AM', 'PM'], ]; ================================================ FILE: src/Carbon/Lang/en_001.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_150.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_AG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], ]); ================================================ FILE: src/Carbon/Lang/en_AI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_AS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_AT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_AU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kunal Marwaha * - François B * - Mayank Badola * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY h:mm A', 'LLLL' => 'dddd, D MMMM YYYY h:mm A', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_BB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_BE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_BI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_BM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_BS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_BW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_BZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_CA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Zhan Tong Zhang * - Mayank Badola * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'YYYY-MM-DD', 'LL' => 'MMMM D, YYYY', 'LLL' => 'MMMM D, YYYY h:mm A', 'LLLL' => 'dddd, MMMM D, YYYY h:mm A', ], 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_CC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/en_CK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_CM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_CX.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_CY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - NehaGautam */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD-MM-YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_DE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_DG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_DK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Danish Standards Association bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_DM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_FI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_FJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_FK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_FM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_GB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Mayank Badola * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_GD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_GG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_GH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_GI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_GM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_GU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_GY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_HK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_IE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Martin McWhorter * - François B * - Chris Cartlidge * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD-MM-YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_IL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Yoav Amit * - François B * - Mayank Badola * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_IM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YY', 'LL' => 'MMMM DD, YYYY', 'LLL' => 'DD MMM HH:mm', 'LLLL' => 'MMMM DD, YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/en_IO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_ISO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'dddd, YYYY MMMM DD HH:mm', ], 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_JE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_JM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_KE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_KI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_KN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_KY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_LC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_LR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_LS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_MG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_MH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_MO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_MP.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_MS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_MT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_MU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_MW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_MY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_NA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_NF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_NG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/en_NL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_NR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_NU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_NZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Mayank Badola * - Luke McGregor * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY h:mm A', 'LLLL' => 'dddd, D MMMM YYYY h:mm A', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_PG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_PH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_PK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_PN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_PR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_PW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_RW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], ]); ================================================ FILE: src/Carbon/Lang/en_SE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/en_SH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SX.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_SZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_TC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_TK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_TO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_TT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_TV.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_TZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_UG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_UM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_US.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_US_Posix.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en_US.php'; ================================================ FILE: src/Carbon/Lang/en_VC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_VG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_VI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_VU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/en.php'; ================================================ FILE: src/Carbon/Lang/en_WS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/en_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YY', 'LL' => 'MMMM DD, YYYY', 'LLL' => 'DD MMM HH:mm', 'LLLL' => 'MMMM DD, YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/en_ZM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - ANLoc Martin Benjamin locales@africanlocalization.net */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], ]); ================================================ FILE: src/Carbon/Lang/en_ZW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/eo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - Mia Nordentoft * - JD Isaacks */ return [ 'year' => ':count jaro|:count jaroj', 'a_year' => 'jaro|:count jaroj', 'y' => ':count j.', 'month' => ':count monato|:count monatoj', 'a_month' => 'monato|:count monatoj', 'm' => ':count mo.', 'week' => ':count semajno|:count semajnoj', 'a_week' => 'semajno|:count semajnoj', 'w' => ':count sem.', 'day' => ':count tago|:count tagoj', 'a_day' => 'tago|:count tagoj', 'd' => ':count t.', 'hour' => ':count horo|:count horoj', 'a_hour' => 'horo|:count horoj', 'h' => ':count h.', 'minute' => ':count minuto|:count minutoj', 'a_minute' => 'minuto|:count minutoj', 'min' => ':count min.', 'second' => ':count sekundo|:count sekundoj', 'a_second' => 'sekundoj|:count sekundoj', 's' => ':count sek.', 'ago' => 'antaŭ :time', 'from_now' => 'post :time', 'after' => ':time poste', 'before' => ':time antaŭe', 'diff_yesterday' => 'Hieraŭ', 'diff_yesterday_regexp' => 'Hieraŭ(?:\\s+je)?', 'diff_today' => 'Hodiaŭ', 'diff_today_regexp' => 'Hodiaŭ(?:\\s+je)?', 'diff_tomorrow' => 'Morgaŭ', 'diff_tomorrow_regexp' => 'Morgaŭ(?:\\s+je)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'D[-a de] MMMM, YYYY', 'LLL' => 'D[-a de] MMMM, YYYY HH:mm', 'LLLL' => 'dddd, [la] D[-a de] MMMM, YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Hodiaŭ je] LT', 'nextDay' => '[Morgaŭ je] LT', 'nextWeek' => 'dddd [je] LT', 'lastDay' => '[Hieraŭ je] LT', 'lastWeek' => '[pasinta] dddd [je] LT', 'sameElse' => 'L', ], 'ordinal' => ':numbera', 'meridiem' => ['a.t.m.', 'p.t.m.'], 'months' => ['januaro', 'februaro', 'marto', 'aprilo', 'majo', 'junio', 'julio', 'aŭgusto', 'septembro', 'oktobro', 'novembro', 'decembro'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aŭg', 'sep', 'okt', 'nov', 'dec'], 'weekdays' => ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato'], 'weekdays_short' => ['dim', 'lun', 'mard', 'merk', 'ĵaŭ', 'ven', 'sab'], 'weekdays_min' => ['di', 'lu', 'ma', 'me', 'ĵa', 've', 'sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' kaj '], ]; ================================================ FILE: src/Carbon/Lang/es.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kunal Marwaha * - kostas * - François B * - Tim Fish * - Claire Coloma * - Steven Heinrich * - JD Isaacks * - Raphael Amorim * - Jorge Y. Castillo * - Víctor Díaz * - Diego * - Sebastian Thierer * - quinterocesar * - Daniel Commesse Liévanos (danielcommesse) * - Pete Scopes (pdscopes) * - gam04 */ use Carbon\CarbonInterface; return [ 'year' => ':count año|:count años', 'a_year' => 'un año|:count años', 'y' => ':count año|:count años', 'month' => ':count mes|:count meses', 'a_month' => 'un mes|:count meses', 'm' => ':count mes|:count meses', 'week' => ':count semana|:count semanas', 'a_week' => 'una semana|:count semanas', 'w' => ':countsem', 'day' => ':count día|:count días', 'a_day' => 'un día|:count días', 'd' => ':countd', 'hour' => ':count hora|:count horas', 'a_hour' => 'una hora|:count horas', 'h' => ':counth', 'minute' => ':count minuto|:count minutos', 'a_minute' => 'un minuto|:count minutos', 'min' => ':countm', 'second' => ':count segundo|:count segundos', 'a_second' => 'unos segundos|:count segundos', 's' => ':counts', 'millisecond' => ':count milisegundo|:count milisegundos', 'a_millisecond' => 'un milisegundo|:count milisegundos', 'ms' => ':countms', 'microsecond' => ':count microsegundo|:count microsegundos', 'a_microsecond' => 'un microsegundo|:count microsegundos', 'µs' => ':countµs', 'ago' => 'hace :time', 'from_now' => 'en :time', 'after' => ':time después', 'before' => ':time antes', 'diff_now' => 'ahora mismo', 'diff_today' => 'hoy', 'diff_today_regexp' => 'hoy(?:\\s+a)?(?:\\s+las)?', 'diff_yesterday' => 'ayer', 'diff_yesterday_regexp' => 'ayer(?:\\s+a)?(?:\\s+las)?', 'diff_tomorrow' => 'mañana', 'diff_tomorrow_regexp' => 'mañana(?:\\s+a)?(?:\\s+las)?', 'diff_before_yesterday' => 'anteayer', 'diff_after_tomorrow' => 'pasado mañana', 'period_recurrences' => 'una vez|:count veces', 'period_interval' => 'cada :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'a :date', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D [de] MMMM [de] YYYY', 'LLL' => 'D [de] MMMM [de] YYYY H:mm', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ 'sameDay' => static function (CarbonInterface $current) { return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'nextDay' => static function (CarbonInterface $current) { return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'nextWeek' => static function (CarbonInterface $current) { return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'lastDay' => static function (CarbonInterface $current) { return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'lastWeek' => static function (CarbonInterface $current) { return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'sameElse' => 'L', ], 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], 'mmm_suffix' => '.', 'ordinal' => ':numberº', 'weekdays' => ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], 'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], 'weekdays_min' => ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' y '], 'meridiem' => ['a. m.', 'p. m.'], 'ordinal_words' => [ 'of' => 'de', 'first' => 'primer', 'second' => 'segundo', 'third' => 'tercer', 'fourth' => 'cuarto', 'fifth' => 'quinto', 'last' => 'último', ], ]; ================================================ FILE: src/Carbon/Lang/es_419.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_AR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_BO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_BR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/es_BZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/es_CL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_CO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_CR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_CU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_DO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - kostas * - François B * - Tim Fish * - Chiel Robben * - Claire Coloma * - Steven Heinrich * - JD Isaacks * - Raphael Amorim */ return array_replace_recursive(require __DIR__.'/es.php', [ 'diff_before_yesterday' => 'anteayer', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'LLL' => 'D [de] MMMM [de] YYYY h:mm A', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm A', ], ]); ================================================ FILE: src/Carbon/Lang/es_EA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_EC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_ES.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return require __DIR__.'/es.php'; ================================================ FILE: src/Carbon/Lang/es_GQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_GT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_HN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_IC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_MX.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'diff_before_yesterday' => 'antier', 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_NI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_PA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_PE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_PH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/M/yy', 'LL' => 'D MMM YYYY', 'LLL' => 'D [de] MMMM [de] YYYY h:mm a', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/es_PR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_PY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_SV.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_US.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kunal Marwaha * - Josh Soref * - Jørn Ølmheim * - Craig Patik * - bustta * - François B * - Tim Fish * - Claire Coloma * - Steven Heinrich * - JD Isaacks * - Raphael Amorim */ return array_replace_recursive(require __DIR__.'/es.php', [ 'diff_before_yesterday' => 'anteayer', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'MM/DD/YYYY', 'LL' => 'MMMM [de] D [de] YYYY', 'LLL' => 'MMMM [de] D [de] YYYY h:mm A', 'LLLL' => 'dddd, MMMM [de] D [de] YYYY h:mm A', ], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_UY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'setiembre', 'octubre', 'noviembre', 'diciembre'], 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'set', 'oct', 'nov', 'dic'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/es_VE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/et.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Andres Ivanov * - Tsutomu Kuroda * - tjku * - Max Melentiev * - Juanito Fatas * - RM87 * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Esko Lehtme * - Mart Karu * - Nicolás Hock Isaza * - Kevin Valdek * - Zahhar Kirillov * - João Magalhães * - Ingmar * - Illimar Tambek * - Mihkel */ return [ 'year' => ':count aasta|:count aastat', 'y' => ':count a', 'month' => ':count kuu|:count kuud', 'm' => ':count k', 'week' => ':count nädal|:count nädalat', 'w' => ':count näd', 'day' => ':count päev|:count päeva', 'd' => ':count p', 'hour' => ':count tund|:count tundi', 'h' => ':count t', 'minute' => ':count minut|:count minutit', 'min' => ':count min', 'second' => ':count sekund|:count sekundit', 's' => ':count s', 'ago' => ':time tagasi', 'from_now' => ':time pärast', 'after' => ':time pärast', 'before' => ':time enne', 'year_from_now' => ':count aasta', 'month_from_now' => ':count kuu', 'week_from_now' => ':count nädala', 'day_from_now' => ':count päeva', 'hour_from_now' => ':count tunni', 'minute_from_now' => ':count minuti', 'second_from_now' => ':count sekundi', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'diff_now' => 'nüüd', 'diff_today' => 'täna', 'diff_yesterday' => 'eile', 'diff_tomorrow' => 'homme', 'diff_before_yesterday' => 'üleeile', 'diff_after_tomorrow' => 'ülehomme', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[täna] LT', 'nextDay' => '[homme] LT', 'lastDay' => '[eile] LT', 'nextWeek' => 'dddd LT', 'lastWeek' => '[eelmine] dddd LT', 'sameElse' => 'L', ], 'months' => ['jaanuar', 'veebruar', 'märts', 'aprill', 'mai', 'juuni', 'juuli', 'august', 'september', 'oktoober', 'november', 'detsember'], 'months_short' => ['jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets'], 'weekdays' => ['pühapäev', 'esmaspäev', 'teisipäev', 'kolmapäev', 'neljapäev', 'reede', 'laupäev'], 'weekdays_short' => ['P', 'E', 'T', 'K', 'N', 'R', 'L'], 'weekdays_min' => ['P', 'E', 'T', 'K', 'N', 'R', 'L'], 'list' => [', ', ' ja '], 'meridiem' => ['enne lõunat', 'pärast lõunat'], ]; ================================================ FILE: src/Carbon/Lang/et_EE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/et.php'; ================================================ FILE: src/Carbon/Lang/eu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - JD Isaacks */ return [ 'year' => 'urte bat|:count urte', 'y' => 'Urte 1|:count urte', 'month' => 'hilabete bat|:count hilabete', 'm' => 'Hile 1|:count hile', 'week' => 'Aste 1|:count aste', 'w' => 'Aste 1|:count aste', 'day' => 'egun bat|:count egun', 'd' => 'Egun 1|:count egun', 'hour' => 'ordu bat|:count ordu', 'h' => 'Ordu 1|:count ordu', 'minute' => 'minutu bat|:count minutu', 'min' => 'Minutu 1|:count minutu', 'second' => 'segundo batzuk|:count segundo', 's' => 'Segundu 1|:count segundu', 'ago' => 'duela :time', 'from_now' => ':time barru', 'after' => ':time geroago', 'before' => ':time lehenago', 'diff_now' => 'orain', 'diff_today' => 'gaur', 'diff_yesterday' => 'atzo', 'diff_tomorrow' => 'bihar', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'YYYY[ko] MMMM[ren] D[a]', 'LLL' => 'YYYY[ko] MMMM[ren] D[a] HH:mm', 'LLLL' => 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', ], 'calendar' => [ 'sameDay' => '[gaur] LT[etan]', 'nextDay' => '[bihar] LT[etan]', 'nextWeek' => 'dddd LT[etan]', 'lastDay' => '[atzo] LT[etan]', 'lastWeek' => '[aurreko] dddd LT[etan]', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['urtarrila', 'otsaila', 'martxoa', 'apirila', 'maiatza', 'ekaina', 'uztaila', 'abuztua', 'iraila', 'urria', 'azaroa', 'abendua'], 'months_short' => ['urt.', 'ots.', 'mar.', 'api.', 'mai.', 'eka.', 'uzt.', 'abu.', 'ira.', 'urr.', 'aza.', 'abe.'], 'weekdays' => ['igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata'], 'weekdays_short' => ['ig.', 'al.', 'ar.', 'az.', 'og.', 'ol.', 'lr.'], 'weekdays_min' => ['ig', 'al', 'ar', 'az', 'og', 'ol', 'lr'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' eta '], 'meridiem' => ['g', 'a'], ]; ================================================ FILE: src/Carbon/Lang/eu_ES.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/eu.php'; ================================================ FILE: src/Carbon/Lang/ewo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kíkíríg', 'ngəgógəle'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndi', 'sɔ́ndɔ məlú mə́bɛ̌', 'sɔ́ndɔ məlú mə́lɛ́', 'sɔ́ndɔ məlú mə́nyi', 'fúladé', 'séradé'], 'weekdays_short' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'fúl', 'sér'], 'weekdays_min' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'fúl', 'sér'], 'months' => ['ngɔn osú', 'ngɔn bɛ̌', 'ngɔn lála', 'ngɔn nyina', 'ngɔn tána', 'ngɔn saməna', 'ngɔn zamgbála', 'ngɔn mwom', 'ngɔn ebulú', 'ngɔn awóm', 'ngɔn awóm ai dziá', 'ngɔn awóm ai bɛ̌'], 'months_short' => ['ngo', 'ngb', 'ngl', 'ngn', 'ngt', 'ngs', 'ngz', 'ngm', 'nge', 'nga', 'ngad', 'ngab'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], // Too unreliable /* 'year' => ':count mbu', // less reliable 'y' => ':count mbu', // less reliable 'a_year' => ':count mbu', // less reliable 'month' => ':count ngòn', // less reliable 'm' => ':count ngòn', // less reliable 'a_month' => ':count ngòn', // less reliable 'week' => ':count mësë', // less reliable 'w' => ':count mësë', // less reliable 'a_week' => ':count mësë', // less reliable 'day' => ':count mësë', // less reliable 'd' => ':count mësë', // less reliable 'a_day' => ':count mësë', // less reliable 'hour' => ':count awola', // less reliable 'h' => ':count awola', // less reliable 'a_hour' => ':count awola', // less reliable 'minute' => ':count awola', // less reliable 'min' => ':count awola', // less reliable 'a_minute' => ':count awola', // less reliable */ ]); ================================================ FILE: src/Carbon/Lang/fa.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - Nasser Ghiasi * - JD Isaacks * - Hossein Jabbari * - nimamo * - hafezdivandari * - Hassan Pezeshk (hpez) */ return [ 'year' => ':count سال', 'a_year' => 'یک سال'.'|:count '.'سال', 'y' => ':count سال', 'month' => ':count ماه', 'a_month' => 'یک ماه'.'|:count '.'ماه', 'm' => ':count ماه', 'week' => ':count هفته', 'a_week' => 'یک هفته'.'|:count '.'هفته', 'w' => ':count هفته', 'day' => ':count روز', 'a_day' => 'یک روز'.'|:count '.'روز', 'd' => ':count روز', 'hour' => ':count ساعت', 'a_hour' => 'یک ساعت'.'|:count '.'ساعت', 'h' => ':count ساعت', 'minute' => ':count دقیقه', 'a_minute' => 'یک دقیقه'.'|:count '.'دقیقه', 'min' => ':count دقیقه', 'second' => ':count ثانیه', 's' => ':count ثانیه', 'ago' => ':time پیش', 'from_now' => ':time دیگر', 'after' => ':time پس از', 'before' => ':time پیش از', 'diff_now' => 'اکنون', 'diff_today' => 'امروز', 'diff_today_regexp' => 'امروز(?:\\s+ساعت)?', 'diff_yesterday' => 'دیروز', 'diff_yesterday_regexp' => 'دیروز(?:\\s+ساعت)?', 'diff_tomorrow' => 'فردا', 'diff_tomorrow_regexp' => 'فردا(?:\\s+ساعت)?', 'formats' => [ 'LT' => 'OH:Om', 'LTS' => 'OH:Om:Os', 'L' => 'OD/OM/OY', 'LL' => 'OD MMMM OY', 'LLL' => 'OD MMMM OY OH:Om', 'LLLL' => 'dddd, OD MMMM OY OH:Om', ], 'calendar' => [ 'sameDay' => '[امروز ساعت] LT', 'nextDay' => '[فردا ساعت] LT', 'nextWeek' => 'dddd [ساعت] LT', 'lastDay' => '[دیروز ساعت] LT', 'lastWeek' => 'dddd [پیش] [ساعت] LT', 'sameElse' => 'L', ], 'ordinal' => ':timeم', 'meridiem' => ['قبل از ظهر', 'بعد از ظهر'], 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], 'weekdays_min' => ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'list' => ['، ', ' و '], 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], 'months_short_standalone' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'weekend' => [5, 5], ]; ================================================ FILE: src/Carbon/Lang/fa_AF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fa.php', [ 'meridiem' => ['ق', 'ب'], 'weekend' => [4, 5], 'formats' => [ 'L' => 'OY/OM/OD', 'LL' => 'OD MMM OY', 'LLL' => 'OD MMMM OY،‏ H:mm', 'LLLL' => 'dddd OD MMMM OY،‏ H:mm', ], ]); ================================================ FILE: src/Carbon/Lang/fa_IR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fa.php'; ================================================ FILE: src/Carbon/Lang/ff.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'months' => ['siilo', 'colte', 'mbooy', 'seeɗto', 'duujal', 'korse', 'morso', 'juko', 'siilto', 'yarkomaa', 'jolal', 'bowte'], 'months_short' => ['sii', 'col', 'mbo', 'see', 'duu', 'kor', 'mor', 'juk', 'slt', 'yar', 'jol', 'bow'], 'weekdays' => ['dewo', 'aaɓnde', 'mawbaare', 'njeslaare', 'naasaande', 'mawnde', 'hoore-biir'], 'weekdays_short' => ['dew', 'aaɓ', 'maw', 'nje', 'naa', 'mwd', 'hbi'], 'weekdays_min' => ['dew', 'aaɓ', 'maw', 'nje', 'naa', 'mwd', 'hbi'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['subaka', 'kikiiɗe'], 'year' => ':count baret', // less reliable 'y' => ':count baret', // less reliable 'a_year' => ':count baret', // less reliable 'month' => ':count lewru', // less reliable 'm' => ':count lewru', // less reliable 'a_month' => ':count lewru', // less reliable 'week' => ':count naange', // less reliable 'w' => ':count naange', // less reliable 'a_week' => ':count naange', // less reliable 'day' => ':count dian', // less reliable 'd' => ':count dian', // less reliable 'a_day' => ':count dian', // less reliable 'hour' => ':count montor', // less reliable 'h' => ':count montor', // less reliable 'a_hour' => ':count montor', // less reliable 'minute' => ':count tokossuoum', // less reliable 'min' => ':count tokossuoum', // less reliable 'a_minute' => ':count tokossuoum', // less reliable 'second' => ':count tenen', // less reliable 's' => ':count tenen', // less reliable 'a_second' => ':count tenen', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ff_CM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ff.php'; ================================================ FILE: src/Carbon/Lang/ff_GN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ff.php'; ================================================ FILE: src/Carbon/Lang/ff_MR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ff.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/ff_SN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Pular-Fulfulde.org Ibrahima Sarr admin@pulaar-fulfulde.org */ return require __DIR__.'/ff.php'; ================================================ FILE: src/Carbon/Lang/fi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Janne Warén * - digitalfrost * - Tsutomu Kuroda * - Roope Salmi * - tjku * - Max Melentiev * - Sami Haahtinen * - Teemu Leisti * - Artem Ignatyev * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Robert Bjarnason * - Aaron Patterson * - Nicolás Hock Isaza * - Tom Hughes * - Sven Fuchs * - Petri Kivikangas * - Nizar Jouini * - Marko Seppae * - Tomi Mynttinen (Pikseli) * - Petteri (powergrip) */ return [ 'year' => ':count vuosi|:count vuotta', 'y' => ':count v', 'month' => ':count kuukausi|:count kuukautta', 'm' => ':count kk', 'week' => ':count viikko|:count viikkoa', 'w' => ':count vk', 'day' => ':count päivä|:count päivää', 'd' => ':count pv', 'hour' => ':count tunti|:count tuntia', 'h' => ':count t', 'minute' => ':count minuutti|:count minuuttia', 'min' => ':count min', 'second' => ':count sekunti|:count sekuntia', 'a_second' => 'muutama sekunti|:count sekuntia', 's' => ':count s', 'ago' => ':time sitten', 'from_now' => ':time päästä', 'year_from_now' => ':count vuoden', 'month_from_now' => ':count kuukauden', 'week_from_now' => ':count viikon', 'day_from_now' => ':count päivän', 'hour_from_now' => ':count tunnin', 'minute_from_now' => ':count minuutin', 'second_from_now' => ':count sekunnin', 'after' => ':time sen jälkeen', 'before' => ':time ennen', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' ja '], 'diff_now' => 'nyt', 'diff_yesterday' => 'eilen', 'diff_tomorrow' => 'huomenna', 'formats' => [ 'LT' => 'HH.mm', 'LTS' => 'HH.mm:ss', 'L' => 'D.M.YYYY', 'LL' => 'dddd D. MMMM[ta] YYYY', 'll' => 'ddd D. MMM YYYY', 'LLL' => 'D.MM. HH.mm', 'LLLL' => 'D. MMMM[ta] YYYY HH.mm', 'llll' => 'D. MMM YY HH.mm', ], 'weekdays' => ['sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai'], 'weekdays_short' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'], 'weekdays_min' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'], 'months' => ['tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu'], 'months_short' => ['tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu'], 'meridiem' => ['aamupäivä', 'iltapäivä'], ]; ================================================ FILE: src/Carbon/Lang/fi_FI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fi.php'; ================================================ FILE: src/Carbon/Lang/fil.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/fil_PH.php'; ================================================ FILE: src/Carbon/Lang/fil_PH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Rene Torres Rene Torres, Pablo Saratxaga rgtorre@rocketmail.com, pablo@mandrakesoft.com * - Jaycee Mariano (alohajaycee) */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'MM/DD/YY', ], 'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'], 'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'], 'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkoles', 'Huwebes', 'Biyernes', 'Sabado'], 'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], 'weekdays_min' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['N.U.', 'N.H.'], 'before' => ':time bago', 'after' => ':time pagkatapos', 'year' => ':count taon', 'y' => ':count taon', 'a_year' => ':count taon', 'month' => ':count buwan', 'm' => ':count buwan', 'a_month' => ':count buwan', 'week' => ':count linggo', 'w' => ':count linggo', 'a_week' => ':count linggo', 'day' => ':count araw', 'd' => ':count araw', 'a_day' => ':count araw', 'hour' => ':count oras', 'h' => ':count oras', 'a_hour' => ':count oras', 'minute' => ':count minuto', 'min' => ':count minuto', 'a_minute' => ':count minuto', 'second' => ':count segundo', 's' => ':count segundo', 'a_second' => ':count segundo', 'ago' => ':time ang nakalipas', 'from_now' => 'sa :time', ]); ================================================ FILE: src/Carbon/Lang/fo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kristian Sakarisson * - François B * - JD Isaacks * - Sverri Mohr Olsen */ return [ 'year' => 'eitt ár|:count ár', 'y' => ':count ár|:count ár', 'month' => 'ein mánaði|:count mánaðir', 'm' => ':count mánaður|:count mánaðir', 'week' => ':count vika|:count vikur', 'w' => ':count vika|:count vikur', 'day' => 'ein dagur|:count dagar', 'd' => ':count dag|:count dagar', 'hour' => 'ein tími|:count tímar', 'h' => ':count tími|:count tímar', 'minute' => 'ein minutt|:count minuttir', 'min' => ':count minutt|:count minuttir', 'second' => 'fá sekund|:count sekundir', 's' => ':count sekund|:count sekundir', 'ago' => ':time síðani', 'from_now' => 'um :time', 'after' => ':time aftaná', 'before' => ':time áðrenn', 'diff_today' => 'Í', 'diff_yesterday' => 'Í', 'diff_yesterday_regexp' => 'Í(?:\\s+gjár)?(?:\\s+kl.)?', 'diff_tomorrow' => 'Í', 'diff_tomorrow_regexp' => 'Í(?:\\s+morgin)?(?:\\s+kl.)?', 'diff_today_regexp' => 'Í(?:\\s+dag)?(?:\\s+kl.)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D. MMMM, YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Í dag kl.] LT', 'nextDay' => '[Í morgin kl.] LT', 'nextWeek' => 'dddd [kl.] LT', 'lastDay' => '[Í gjár kl.] LT', 'lastWeek' => '[síðstu] dddd [kl] LT', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['januar', 'februar', 'mars', 'apríl', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], 'weekdays' => ['sunnudagur', 'mánadagur', 'týsdagur', 'mikudagur', 'hósdagur', 'fríggjadagur', 'leygardagur'], 'weekdays_short' => ['sun', 'mán', 'týs', 'mik', 'hós', 'frí', 'ley'], 'weekdays_min' => ['su', 'má', 'tý', 'mi', 'hó', 'fr', 'le'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' og '], ]; ================================================ FILE: src/Carbon/Lang/fo_DK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fo.php', [ 'formats' => [ 'L' => 'DD.MM.yy', 'LL' => 'DD.MM.YYYY', 'LLL' => 'D. MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY, HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/fo_FO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fo.php'; ================================================ FILE: src/Carbon/Lang/fr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Dieter Sting * - François B * - Maxime VALY * - JD Isaacks * - Dieter Sting * - François B * - JD Isaacks * - Sebastian Thierer * - Fastfuel * - Pete Scopes (pdscopes) */ return [ 'millennium' => ':count millénaire|:count millénaires', 'a_millennium' => 'un millénaire|:count millénaires', 'century' => ':count siècle|:count siècles', 'a_century' => 'un siècle|:count siècles', 'decade' => ':count décennie|:count décennies', 'a_decade' => 'une décennie|:count décennies', 'year' => ':count an|:count ans', 'a_year' => 'un an|:count ans', 'y' => ':count an|:count ans', 'month' => ':count mois|:count mois', 'a_month' => 'un mois|:count mois', 'm' => ':count mois', 'week' => ':count semaine|:count semaines', 'a_week' => 'une semaine|:count semaines', 'w' => ':count sem.', 'day' => ':count jour|:count jours', 'a_day' => 'un jour|:count jours', 'd' => ':count j', 'hour' => ':count heure|:count heures', 'a_hour' => 'une heure|:count heures', 'h' => ':count h', 'minute' => ':count minute|:count minutes', 'a_minute' => 'une minute|:count minutes', 'min' => ':count min', 'second' => ':count seconde|:count secondes', 'a_second' => 'quelques secondes|:count secondes', 's' => ':count s', 'millisecond' => ':count milliseconde|:count millisecondes', 'a_millisecond' => 'une milliseconde|:count millisecondes', 'ms' => ':countms', 'microsecond' => ':count microseconde|:count microsecondes', 'a_microsecond' => 'une microseconde|:count microsecondes', 'µs' => ':countµs', 'ago' => 'il y a :time', 'from_now' => 'dans :time', 'after' => ':time après', 'before' => ':time avant', 'diff_now' => "à l'instant", 'diff_today' => "aujourd'hui", 'diff_today_regexp' => "aujourd'hui(?:\s+à)?", 'diff_yesterday' => 'hier', 'diff_yesterday_regexp' => 'hier(?:\s+à)?', 'diff_tomorrow' => 'demain', 'diff_tomorrow_regexp' => 'demain(?:\s+à)?', 'diff_before_yesterday' => 'avant-hier', 'diff_after_tomorrow' => 'après-demain', 'period_recurrences' => ':count fois', 'period_interval' => 'tous les :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'à :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Aujourd’hui à] LT', 'nextDay' => '[Demain à] LT', 'nextWeek' => 'dddd [à] LT', 'lastDay' => '[Hier à] LT', 'lastWeek' => 'dddd [dernier à] LT', 'sameElse' => 'L', ], 'months' => ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], 'months_short' => ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], 'weekdays' => ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], 'weekdays_short' => ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], 'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'], 'ordinal' => static function ($number, $period) { return match ($period) { // In French, only the first has to be ordinal, other number remains cardinal // @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais 'D' => $number.($number === 1 ? 'er' : ''), default => $number.($number === 1 ? 'er' : 'e'), 'w', 'W' => $number.($number === 1 ? 're' : 'e'), }; }, 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' et '], 'ordinal_words' => [ 'of' => 'de', 'first' => 'premier', 'second' => 'deuxième', 'third' => 'troisième', 'fourth' => 'quatrième', 'fifth' => 'cinquième', 'last' => 'dernier', ], ]; ================================================ FILE: src/Carbon/Lang/fr_BE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_BF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_BI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_BJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_BL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_CA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Dieter Sting * - François B * - Maxime VALY * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/fr_CD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_CF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_CG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Dieter Sting * - François B * - Gaspard Bucher * - Maxime VALY * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/fr_CI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_CM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'meridiem' => ['mat.', 'soir'], ]); ================================================ FILE: src/Carbon/Lang/fr_DJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_DZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_FR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_GA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_GF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_GN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_GP.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_GQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_HT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_KM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_LU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/fr_MA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], ]); ================================================ FILE: src/Carbon/Lang/fr_MC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_MF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_MG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_ML.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_MQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_MR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_MU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_NC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_NE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_PF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_PM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_RE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_RW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_SC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_SN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_SY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_TD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_TG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_TN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'weekend' => [5, 6], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_VU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/fr_WF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fr_YT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/fr.php'; ================================================ FILE: src/Carbon/Lang/fur.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/fur_IT.php'; ================================================ FILE: src/Carbon/Lang/fur_IT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Pablo Saratxaga pablo@mandrakesoft.com */ return [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD. MM. YY', 'LL' => 'DD di MMMM dal YYYY', 'LLL' => 'DD di MMM HH:mm', 'LLLL' => 'DD di MMMM dal YYYY HH:mm', ], 'months' => ['zenâr', 'fevrâr', 'març', 'avrîl', 'mai', 'jugn', 'lui', 'avost', 'setembar', 'otubar', 'novembar', 'dicembar'], 'months_short' => ['zen', 'fev', 'mar', 'avr', 'mai', 'jug', 'lui', 'avo', 'set', 'otu', 'nov', 'dic'], 'weekdays' => ['domenie', 'lunis', 'martars', 'miercus', 'joibe', 'vinars', 'sabide'], 'weekdays_short' => ['dom', 'lun', 'mar', 'mie', 'joi', 'vin', 'sab'], 'weekdays_min' => ['dom', 'lun', 'mar', 'mie', 'joi', 'vin', 'sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count an', 'month' => ':count mês', 'week' => ':count setemane', 'day' => ':count zornade', 'hour' => ':count ore', 'minute' => ':count minût', 'second' => ':count secont', ]; ================================================ FILE: src/Carbon/Lang/fy.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Tim Fish * - JD Isaacks */ return [ 'year' => ':count jier|:count jierren', 'a_year' => 'ien jier|:count jierren', 'y' => ':count j', 'month' => ':count moanne|:count moannen', 'a_month' => 'ien moanne|:count moannen', 'm' => ':count moa.', 'week' => ':count wike|:count wiken', 'a_week' => 'in wike|:count wiken', 'a' => ':count w.', 'day' => ':count dei|:count dagen', 'a_day' => 'ien dei|:count dagen', 'd' => ':count d.', 'hour' => ':count oere|:count oeren', 'a_hour' => 'ien oere|:count oeren', 'h' => ':count o.', 'minute' => ':count minút|:count minuten', 'a_minute' => 'ien minút|:count minuten', 'min' => ':count min.', 'second' => ':count sekonde|:count sekonden', 'a_second' => 'in pear sekonden|:count sekonden', 's' => ':count s.', 'ago' => ':time lyn', 'from_now' => 'oer :time', 'diff_yesterday' => 'juster', 'diff_yesterday_regexp' => 'juster(?:\\s+om)?', 'diff_today' => 'hjoed', 'diff_today_regexp' => 'hjoed(?:\\s+om)?', 'diff_tomorrow' => 'moarn', 'diff_tomorrow_regexp' => 'moarn(?:\\s+om)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD-MM-YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[hjoed om] LT', 'nextDay' => '[moarn om] LT', 'nextWeek' => 'dddd [om] LT', 'lastDay' => '[juster om] LT', 'lastWeek' => '[ôfrûne] dddd [om] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); }, 'months' => ['jannewaris', 'febrewaris', 'maart', 'april', 'maaie', 'juny', 'july', 'augustus', 'septimber', 'oktober', 'novimber', 'desimber'], 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], 'mmm_suffix' => '.', 'weekdays' => ['snein', 'moandei', 'tiisdei', 'woansdei', 'tongersdei', 'freed', 'sneon'], 'weekdays_short' => ['si.', 'mo.', 'ti.', 'wo.', 'to.', 'fr.', 'so.'], 'weekdays_min' => ['Si', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'So'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' en '], ]; ================================================ FILE: src/Carbon/Lang/fy_DE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com */ return array_replace_recursive(require __DIR__.'/fy.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Jaunuwoa', 'Februwoa', 'Moaz', 'Aprell', 'Mai', 'Juni', 'Juli', 'August', 'Septamba', 'Oktoba', 'Nowamba', 'Dezamba'], 'months_short' => ['Jan', 'Feb', 'Moz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Now', 'Dez'], 'weekdays' => ['Sinndag', 'Mondag', 'Dingsdag', 'Meddwäakj', 'Donnadag', 'Friedag', 'Sinnowend'], 'weekdays_short' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], 'weekdays_min' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/fy_NL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/fy.php', [ 'formats' => [ 'L' => 'DD-MM-YY', ], 'months' => ['Jannewaris', 'Febrewaris', 'Maart', 'April', 'Maaie', 'Juny', 'July', 'Augustus', 'Septimber', 'Oktober', 'Novimber', 'Desimber'], 'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Snein', 'Moandei', 'Tiisdei', 'Woansdei', 'Tongersdei', 'Freed', 'Sneon'], 'weekdays_short' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'], 'weekdays_min' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'], ]); ================================================ FILE: src/Carbon/Lang/ga.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Thanks to André Silva : https://github.com/askpt */ return [ 'year' => ':count bliain', 'a_year' => '{1}bliain|:count bliain', 'y' => ':countb', 'month' => ':count mí', 'a_month' => '{1}mí|:count mí', 'm' => ':countm', 'week' => ':count sheachtain', 'a_week' => '{1}sheachtain|:count sheachtain', 'w' => ':countsh', 'day' => ':count lá', 'a_day' => '{1}lá|:count lá', 'd' => ':countl', 'hour' => ':count uair an chloig', 'a_hour' => '{1}uair an chloig|:count uair an chloig', 'h' => ':countu', 'minute' => ':count nóiméad', 'a_minute' => '{1}nóiméad|:count nóiméad', 'min' => ':countn', 'second' => ':count soicind', 'a_second' => '{1}cúpla soicind|:count soicind', 's' => ':countso', 'ago' => ':time ó shin', 'from_now' => 'i :time', 'after' => ':time tar éis', 'before' => ':time roimh', 'diff_now' => 'anois', 'diff_today' => 'Inniu', 'diff_today_regexp' => 'Inniu(?:\\s+ag)?', 'diff_yesterday' => 'inné', 'diff_yesterday_regexp' => 'Inné(?:\\s+aig)?', 'diff_tomorrow' => 'amárach', 'diff_tomorrow_regexp' => 'Amárach(?:\\s+ag)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Inniu ag] LT', 'nextDay' => '[Amárach ag] LT', 'nextWeek' => 'dddd [ag] LT', 'lastDay' => '[Inné aig] LT', 'lastWeek' => 'dddd [seo caite] [ag] LT', 'sameElse' => 'L', ], 'months' => ['Eanáir', 'Feabhra', 'Márta', 'Aibreán', 'Bealtaine', 'Méitheamh', 'Iúil', 'Lúnasa', 'Meán Fómhair', 'Deaireadh Fómhair', 'Samhain', 'Nollaig'], 'months_short' => ['Eaná', 'Feab', 'Márt', 'Aibr', 'Beal', 'Méit', 'Iúil', 'Lúna', 'Meán', 'Deai', 'Samh', 'Noll'], 'weekdays' => ['Dé Domhnaigh', 'Dé Luain', 'Dé Máirt', 'Dé Céadaoin', 'Déardaoin', 'Dé hAoine', 'Dé Satharn'], 'weekdays_short' => ['Dom', 'Lua', 'Mái', 'Céa', 'Déa', 'hAo', 'Sat'], 'weekdays_min' => ['Do', 'Lu', 'Má', 'Ce', 'Dé', 'hA', 'Sa'], 'ordinal' => static fn ($number) => $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh')), 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' agus '], 'meridiem' => ['r.n.', 'i.n.'], ]; ================================================ FILE: src/Carbon/Lang/ga_IE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ga.php'; ================================================ FILE: src/Carbon/Lang/gd.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Jon Ashdown */ return [ 'year' => ':count bliadhna', 'a_year' => '{1}bliadhna|:count bliadhna', 'y' => ':count b.', 'month' => ':count mìosan', 'a_month' => '{1}mìos|:count mìosan', 'm' => ':count ms.', 'week' => ':count seachdainean', 'a_week' => '{1}seachdain|:count seachdainean', 'w' => ':count s.', 'day' => ':count latha', 'a_day' => '{1}latha|:count latha', 'd' => ':count l.', 'hour' => ':count uairean', 'a_hour' => '{1}uair|:count uairean', 'h' => ':count u.', 'minute' => ':count mionaidean', 'a_minute' => '{1}mionaid|:count mionaidean', 'min' => ':count md.', 'second' => ':count diogan', 'a_second' => '{1}beagan diogan|:count diogan', 's' => ':count d.', 'ago' => 'bho chionn :time', 'from_now' => 'ann an :time', 'diff_yesterday' => 'An-dè', 'diff_yesterday_regexp' => 'An-dè(?:\\s+aig)?', 'diff_today' => 'An-diugh', 'diff_today_regexp' => 'An-diugh(?:\\s+aig)?', 'diff_tomorrow' => 'A-màireach', 'diff_tomorrow_regexp' => 'A-màireach(?:\\s+aig)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[An-diugh aig] LT', 'nextDay' => '[A-màireach aig] LT', 'nextWeek' => 'dddd [aig] LT', 'lastDay' => '[An-dè aig] LT', 'lastWeek' => 'dddd [seo chaidh] [aig] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { return $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh')); }, 'months' => ['Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'], 'months_short' => ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'], 'weekdays' => ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'], 'weekdays_short' => ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'], 'weekdays_min' => ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' agus '], 'meridiem' => ['m', 'f'], ]; ================================================ FILE: src/Carbon/Lang/gd_GB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/gd.php'; ================================================ FILE: src/Carbon/Lang/gez.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/gez_ER.php'; ================================================ FILE: src/Carbon/Lang/gez_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጠሐረ', 'ከተተ', 'መገበ', 'አኀዘ', 'ግንባት', 'ሠንየ', 'ሐመለ', 'ነሐሰ', 'ከረመ', 'ጠቀመ', 'ኀደረ', 'ኀሠሠ'], 'months_short' => ['ጠሐረ', 'ከተተ', 'መገበ', 'አኀዘ', 'ግንባ', 'ሠንየ', 'ሐመለ', 'ነሐሰ', 'ከረመ', 'ጠቀመ', 'ኀደረ', 'ኀሠሠ'], 'weekdays' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚት'], 'weekdays_short' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], 'weekdays_min' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ጽባሕ', 'ምሴት'], 'month' => ':count ወርሕ', // less reliable 'm' => ':count ወርሕ', // less reliable 'a_month' => ':count ወርሕ', // less reliable 'week' => ':count ሰብዑ', // less reliable 'w' => ':count ሰብዑ', // less reliable 'a_week' => ':count ሰብዑ', // less reliable 'hour' => ':count አንትሙ', // less reliable 'h' => ':count አንትሙ', // less reliable 'a_hour' => ':count አንትሙ', // less reliable 'minute' => ':count ንኡስ', // less reliable 'min' => ':count ንኡስ', // less reliable 'a_minute' => ':count ንኡስ', // less reliable 'year' => ':count ዓመት', 'y' => ':count ዓመት', 'a_year' => ':count ዓመት', 'day' => ':count ዕለት', 'd' => ':count ዕለት', 'a_day' => ':count ዕለት', 'second' => ':count ካልእ', 's' => ':count ካልእ', 'a_second' => ':count ካልእ', ]); ================================================ FILE: src/Carbon/Lang/gez_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], 'weekdays' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚት'], 'weekdays_short' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], 'weekdays_min' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ጽባሕ', 'ምሴት'], ]); ================================================ FILE: src/Carbon/Lang/gl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Fidel Pita * - JD Isaacks * - Diego Vilariño * - Sebastian Thierer */ use Carbon\CarbonInterface; return [ 'year' => ':count ano|:count anos', 'a_year' => 'un ano|:count anos', 'y' => ':count a.', 'month' => ':count mes|:count meses', 'a_month' => 'un mes|:count meses', 'm' => ':count mes.', 'week' => ':count semana|:count semanas', 'a_week' => 'unha semana|:count semanas', 'w' => ':count sem.', 'day' => ':count día|:count días', 'a_day' => 'un día|:count días', 'd' => ':count d.', 'hour' => ':count hora|:count horas', 'a_hour' => 'unha hora|:count horas', 'h' => ':count h.', 'minute' => ':count minuto|:count minutos', 'a_minute' => 'un minuto|:count minutos', 'min' => ':count min.', 'second' => ':count segundo|:count segundos', 'a_second' => 'uns segundos|:count segundos', 's' => ':count seg.', 'ago' => 'hai :time', 'from_now' => static function ($time) { if (str_starts_with($time, 'un')) { return "n$time"; } return "en $time"; }, 'diff_now' => 'agora', 'diff_today' => 'hoxe', 'diff_today_regexp' => 'hoxe(?:\\s+ás)?', 'diff_yesterday' => 'onte', 'diff_yesterday_regexp' => 'onte(?:\\s+á)?', 'diff_tomorrow' => 'mañá', 'diff_tomorrow_regexp' => 'mañá(?:\\s+ás)?', 'after' => ':time despois', 'before' => ':time antes', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D [de] MMMM [de] YYYY', 'LLL' => 'D [de] MMMM [de] YYYY H:mm', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ 'sameDay' => static function (CarbonInterface $current) { return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'nextDay' => static function (CarbonInterface $current) { return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'nextWeek' => static function (CarbonInterface $current) { return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'lastDay' => static function (CarbonInterface $current) { return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT'; }, 'lastWeek' => static function (CarbonInterface $current) { return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'sameElse' => 'L', ], 'ordinal' => ':numberº', 'months' => ['xaneiro', 'febreiro', 'marzo', 'abril', 'maio', 'xuño', 'xullo', 'agosto', 'setembro', 'outubro', 'novembro', 'decembro'], 'months_short' => ['xan.', 'feb.', 'mar.', 'abr.', 'mai.', 'xuñ.', 'xul.', 'ago.', 'set.', 'out.', 'nov.', 'dec.'], 'weekdays' => ['domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado'], 'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mér.', 'xov.', 'ven.', 'sáb.'], 'weekdays_min' => ['do', 'lu', 'ma', 'mé', 'xo', 've', 'sá'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' e '], 'meridiem' => ['a.m.', 'p.m.'], ]; ================================================ FILE: src/Carbon/Lang/gl_ES.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/gl.php'; ================================================ FILE: src/Carbon/Lang/gom.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/gom_Latn.php'; ================================================ FILE: src/Carbon/Lang/gom_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ 'year' => ':count voros|:count vorsam', 'y' => ':countv', 'month' => ':count mhoino|:count mhoine', 'm' => ':countmh', 'week' => ':count satolleacho|:count satolleache', 'w' => ':countsa|:countsa', 'day' => ':count dis', 'd' => ':countd', 'hour' => ':count hor|:count horam', 'h' => ':counth', 'minute' => ':count minute|:count mintam', 'min' => ':countm', 'second' => ':count second', 's' => ':counts', 'diff_today' => 'Aiz', 'diff_yesterday' => 'Kal', 'diff_tomorrow' => 'Faleam', 'formats' => [ 'LT' => 'A h:mm [vazta]', 'LTS' => 'A h:mm:ss [vazta]', 'L' => 'DD-MM-YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY A h:mm [vazta]', 'LLLL' => 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]', 'llll' => 'ddd, D MMM YYYY, A h:mm [vazta]', ], 'calendar' => [ 'sameDay' => '[Aiz] LT', 'nextDay' => '[Faleam] LT', 'nextWeek' => '[Ieta to] dddd[,] LT', 'lastDay' => '[Kal] LT', 'lastWeek' => '[Fatlo] dddd[,] LT', 'sameElse' => 'L', ], 'months' => ['Janer', 'Febrer', 'Mars', 'Abril', 'Mai', 'Jun', 'Julai', 'Agost', 'Setembr', 'Otubr', 'Novembr', 'Dezembr'], 'months_short' => ['Jan.', 'Feb.', 'Mars', 'Abr.', 'Mai', 'Jun', 'Jul.', 'Ago.', 'Set.', 'Otu.', 'Nov.', 'Dez.'], 'weekdays' => ['Aitar', 'Somar', 'Mongllar', 'Budvar', 'Brestar', 'Sukrar', 'Son\'var'], 'weekdays_short' => ['Ait.', 'Som.', 'Mon.', 'Bud.', 'Bre.', 'Suk.', 'Son.'], 'weekdays_min' => ['Ai', 'Sm', 'Mo', 'Bu', 'Br', 'Su', 'Sn'], 'ordinal' => static fn ($number, $period) => $number.($period === 'D' ? 'er' : ''), 'meridiem' => static function ($hour) { if ($hour < 4) { return 'rati'; } if ($hour < 12) { return 'sokalli'; } if ($hour < 16) { return 'donparam'; } if ($hour < 20) { return 'sanje'; } return 'rati'; }, 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' ani '], ]; ================================================ FILE: src/Carbon/Lang/gsw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Christopher Dell * - Akira Matsuda * - Enrique Vidal * - Simone Carletti * - Henning Kiel * - Aaron Patterson * - Florian Hanke */ return [ 'year' => ':count Johr', 'month' => ':count Monet', 'week' => ':count Woche', 'day' => ':count Tag', 'hour' => ':count Schtund', 'minute' => ':count Minute', 'second' => ':count Sekunde', 'weekdays' => ['Sunntig', 'Mäntig', 'Ziischtig', 'Mittwuch', 'Dunschtig', 'Friitig', 'Samschtig'], 'weekdays_short' => ['Su', 'Mä', 'Zi', 'Mi', 'Du', 'Fr', 'Sa'], 'weekdays_min' => ['Su', 'Mä', 'Zi', 'Mi', 'Du', 'Fr', 'Sa'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'September', 'Oktober', 'November', 'Dezember'], 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], 'meridiem' => ['am Vormittag', 'am Namittag'], 'ordinal' => ':number.', 'list' => [', ', ' und '], 'diff_now' => 'now', 'diff_yesterday' => 'geschter', 'diff_tomorrow' => 'moorn', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'Do MMMM YYYY', 'LLL' => 'Do MMMM, HH:mm [Uhr]', 'LLLL' => 'dddd, Do MMMM YYYY, HH:mm [Uhr]', ], ]; ================================================ FILE: src/Carbon/Lang/gsw_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/gsw.php'; ================================================ FILE: src/Carbon/Lang/gsw_FR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], 'first_day_of_week' => 1, 'formats' => [ 'LLL' => 'Do MMMM YYYY HH:mm', 'LLLL' => 'dddd, Do MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/gsw_LI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], 'first_day_of_week' => 1, 'formats' => [ 'LLL' => 'Do MMMM YYYY HH:mm', 'LLLL' => 'dddd, Do MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/gu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - Kaushik Thanki * - Josh Soref */ return [ 'year' => 'એક વર્ષ|:count વર્ષ', 'y' => ':countવર્ષ|:countવર્ષો', 'month' => 'એક મહિનો|:count મહિના', 'm' => ':countમહિનો|:countમહિના', 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', 'w' => ':countઅઠ.|:countઅઠ.', 'day' => 'એક દિવસ|:count દિવસ', 'd' => ':countદિ.|:countદિ.', 'hour' => 'એક કલાક|:count કલાક', 'h' => ':countક.|:countક.', 'minute' => 'એક મિનિટ|:count મિનિટ', 'min' => ':countમિ.|:countમિ.', 'second' => 'અમુક પળો|:count સેકંડ', 's' => ':countસે.|:countસે.', 'ago' => ':time પેહલા', 'from_now' => ':time મા', 'after' => ':time પછી', 'before' => ':time પહેલા', 'diff_now' => 'હમણાં', 'diff_today' => 'આજ', 'diff_yesterday' => 'ગઇકાલે', 'diff_tomorrow' => 'કાલે', 'formats' => [ 'LT' => 'A h:mm વાગ્યે', 'LTS' => 'A h:mm:ss વાગ્યે', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm વાગ્યે', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm વાગ્યે', ], 'calendar' => [ 'sameDay' => '[આજ] LT', 'nextDay' => '[કાલે] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[ગઇકાલે] LT', 'lastWeek' => '[પાછલા] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'રાત'; } if ($hour < 10) { return 'સવાર'; } if ($hour < 17) { return 'બપોર'; } if ($hour < 20) { return 'સાંજ'; } return 'રાત'; }, 'months' => ['જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટ્બર', 'નવેમ્બર', 'ડિસેમ્બર'], 'months_short' => ['જાન્યુ.', 'ફેબ્રુ.', 'માર્ચ', 'એપ્રિ.', 'મે', 'જૂન', 'જુલા.', 'ઑગ.', 'સપ્ટે.', 'ઑક્ટ્.', 'નવે.', 'ડિસે.'], 'weekdays' => ['રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધ્વાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર'], 'weekdays_short' => ['રવિ', 'સોમ', 'મંગળ', 'બુધ્', 'ગુરુ', 'શુક્ર', 'શનિ'], 'weekdays_min' => ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'], 'list' => [', ', ' અને '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/gu_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/gu.php'; ================================================ FILE: src/Carbon/Lang/guz.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['Ma', 'Mo'], 'weekdays' => ['Chumapiri', 'Chumatato', 'Chumaine', 'Chumatano', 'Aramisi', 'Ichuma', 'Esabato'], 'weekdays_short' => ['Cpr', 'Ctt', 'Cmn', 'Cmt', 'Ars', 'Icm', 'Est'], 'weekdays_min' => ['Cpr', 'Ctt', 'Cmn', 'Cmt', 'Ars', 'Icm', 'Est'], 'months' => ['Chanuari', 'Feburari', 'Machi', 'Apiriri', 'Mei', 'Juni', 'Chulai', 'Agosti', 'Septemba', 'Okitoba', 'Nobemba', 'Disemba'], 'months_short' => ['Can', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Cul', 'Agt', 'Sep', 'Okt', 'Nob', 'Dis'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'month' => ':count omotunyi', // less reliable 'm' => ':count omotunyi', // less reliable 'a_month' => ':count omotunyi', // less reliable 'week' => ':count isano naibere', // less reliable 'w' => ':count isano naibere', // less reliable 'a_week' => ':count isano naibere', // less reliable 'second' => ':count ibere', // less reliable 's' => ':count ibere', // less reliable 'a_second' => ':count ibere', // less reliable 'year' => ':count omwaka', 'y' => ':count omwaka', 'a_year' => ':count omwaka', 'day' => ':count rituko', 'd' => ':count rituko', 'a_day' => ':count rituko', ]); ================================================ FILE: src/Carbon/Lang/gv.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/gv_GB.php'; ================================================ FILE: src/Carbon/Lang/gv_GB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Alastair McKinstry bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Jerrey-geuree', 'Toshiaght-arree', 'Mayrnt', 'Averil', 'Boaldyn', 'Mean-souree', 'Jerrey-souree', 'Luanistyn', 'Mean-fouyir', 'Jerrey-fouyir', 'Mee Houney', 'Mee ny Nollick'], 'months_short' => ['J-guer', 'T-arree', 'Mayrnt', 'Avrril', 'Boaldyn', 'M-souree', 'J-souree', 'Luanistyn', 'M-fouyir', 'J-fouyir', 'M.Houney', 'M.Nollick'], 'weekdays' => ['Jedoonee', 'Jelhein', 'Jemayrt', 'Jercean', 'Jerdein', 'Jeheiney', 'Jesarn'], 'weekdays_short' => ['Jed', 'Jel', 'Jem', 'Jerc', 'Jerd', 'Jeh', 'Jes'], 'weekdays_min' => ['Jed', 'Jel', 'Jem', 'Jerc', 'Jerd', 'Jeh', 'Jes'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count blein', 'y' => ':count blein', 'a_year' => ':count blein', 'month' => ':count mee', 'm' => ':count mee', 'a_month' => ':count mee', 'week' => ':count shiaghtin', 'w' => ':count shiaghtin', 'a_week' => ':count shiaghtin', 'day' => ':count laa', 'd' => ':count laa', 'a_day' => ':count laa', 'hour' => ':count oor', 'h' => ':count oor', 'a_hour' => ':count oor', 'minute' => ':count feer veg', 'min' => ':count feer veg', 'a_minute' => ':count feer veg', 'second' => ':count derrey', 's' => ':count derrey', 'a_second' => ':count derrey', ]); ================================================ FILE: src/Carbon/Lang/ha.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - pablo@mandriva.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY HH:mm', 'LLLL' => 'dddd, D MMMM, YYYY HH:mm', ], 'months' => ['Janairu', 'Faburairu', 'Maris', 'Afirilu', 'Mayu', 'Yuni', 'Yuli', 'Agusta', 'Satumba', 'Oktoba', 'Nuwamba', 'Disamba'], 'months_short' => ['Jan', 'Fab', 'Mar', 'Afi', 'May', 'Yun', 'Yul', 'Agu', 'Sat', 'Okt', 'Nuw', 'Dis'], 'weekdays' => ['Lahadi', 'Litini', 'Talata', 'Laraba', 'Alhamis', 'Jumaʼa', 'Asabar'], 'weekdays_short' => ['Lah', 'Lit', 'Tal', 'Lar', 'Alh', 'Jum', 'Asa'], 'weekdays_min' => ['Lh', 'Li', 'Ta', 'Lr', 'Al', 'Ju', 'As'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => 'shekara :count', 'y' => 'shekara :count', 'a_year' => 'shekara :count', 'month' => ':count wátàa', 'm' => ':count wátàa', 'a_month' => ':count wátàa', 'week' => ':count mako', 'w' => ':count mako', 'a_week' => ':count mako', 'day' => ':count rana', 'd' => ':count rana', 'a_day' => ':count rana', 'hour' => ':count áwàa', 'h' => ':count áwàa', 'a_hour' => ':count áwàa', 'minute' => 'minti :count', 'min' => 'minti :count', 'a_minute' => 'minti :count', 'second' => ':count ná bíyú', 's' => ':count ná bíyú', 'a_second' => ':count ná bíyú', ]); ================================================ FILE: src/Carbon/Lang/ha_GH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ha.php'; ================================================ FILE: src/Carbon/Lang/ha_NE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ha.php'; ================================================ FILE: src/Carbon/Lang/ha_NG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ha.php'; ================================================ FILE: src/Carbon/Lang/hak.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/hak_TW.php'; ================================================ FILE: src/Carbon/Lang/hak_TW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY年MM月DD日', ], 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], 'weekdays' => ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六'], 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['上晝', '下晝'], 'year' => ':count ngien11', 'y' => ':count ngien11', 'a_year' => ':count ngien11', 'month' => ':count ngie̍t', 'm' => ':count ngie̍t', 'a_month' => ':count ngie̍t', 'week' => ':count lî-pai', 'w' => ':count lî-pai', 'a_week' => ':count lî-pai', 'day' => ':count ngit', 'd' => ':count ngit', 'a_day' => ':count ngit', 'hour' => ':count sṳ̀', 'h' => ':count sṳ̀', 'a_hour' => ':count sṳ̀', 'minute' => ':count fûn', 'min' => ':count fûn', 'a_minute' => ':count fûn', 'second' => ':count miéu', 's' => ':count miéu', 'a_second' => ':count miéu', ]); ================================================ FILE: src/Carbon/Lang/haw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'months' => ['Ianuali', 'Pepeluali', 'Malaki', 'ʻApelila', 'Mei', 'Iune', 'Iulai', 'ʻAukake', 'Kepakemapa', 'ʻOkakopa', 'Nowemapa', 'Kekemapa'], 'months_short' => ['Ian.', 'Pep.', 'Mal.', 'ʻAp.', 'Mei', 'Iun.', 'Iul.', 'ʻAu.', 'Kep.', 'ʻOk.', 'Now.', 'Kek.'], 'weekdays' => ['Lāpule', 'Poʻakahi', 'Poʻalua', 'Poʻakolu', 'Poʻahā', 'Poʻalima', 'Poʻaono'], 'weekdays_short' => ['LP', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6'], 'weekdays_min' => ['S', 'M', 'T', 'W', 'T', 'F', 'S'], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd, D MMMM YYYY h:mm a', ], 'year' => ':count makahiki', 'y' => ':count makahiki', 'a_year' => ':count makahiki', 'month' => ':count mahina', 'm' => ':count mahina', 'a_month' => ':count mahina', 'week' => ':count pule', 'w' => ':count pule', 'a_week' => ':count pule', 'day' => ':count lā', 'd' => ':count lā', 'a_day' => ':count lā', 'hour' => ':count hola', 'h' => ':count hola', 'a_hour' => ':count hola', 'minute' => ':count minuke', 'min' => ':count minuke', 'a_minute' => ':count minuke', 'second' => ':count lua', 's' => ':count lua', 'a_second' => ':count lua', ]); ================================================ FILE: src/Carbon/Lang/he.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Daniel Cohen Gindi * - JD Isaacks * - Itai Nathaniel * - GabMic * - Yaakov Dahan (yakidahan) */ return [ 'year' => 'שנה|{2}שנתיים|:count שנים', 'y' => 'שנה|:count שנ׳', 'month' => 'חודש|{2}חודשיים|:count חודשים', 'm' => 'חודש|:count חו׳', 'week' => 'שבוע|{2}שבועיים|:count שבועות', 'w' => 'שבוע|:count שב׳', 'day' => 'יום|{2}יומיים|:count ימים', 'd' => 'יום|:count ימ׳', 'hour' => 'שעה|{2}שעתיים|:count שעות', 'h' => 'שעה|:count שע׳', 'minute' => 'דקה|{2}שתי דקות|:count דקות', 'min' => 'דקה|:count דק׳', 'second' => 'שנייה|:count שניות', 'a_second' => 'כמה שניות|:count שניות', 's' => 'שניה|:count שנ׳', 'ago' => 'לפני :time', 'from_now' => 'בעוד :time מעכשיו', 'after' => 'אחרי :time', 'before' => 'לפני :time', 'diff_now' => 'עכשיו', 'diff_today' => 'היום', 'diff_today_regexp' => 'היום(?:\\s+ב־)?', 'diff_yesterday' => 'אתמול', 'diff_yesterday_regexp' => 'אתמול(?:\\s+ב־)?', 'diff_tomorrow' => 'מחר', 'diff_tomorrow_regexp' => 'מחר(?:\\s+ב־)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D [ב]MMMM YYYY', 'LLL' => 'D [ב]MMMM YYYY HH:mm', 'LLLL' => 'dddd, D [ב]MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[היום ב־]LT', 'nextDay' => '[מחר ב־]LT', 'nextWeek' => 'dddd [בשעה] LT', 'lastDay' => '[אתמול ב־]LT', 'lastWeek' => '[ביום] dddd [האחרון בשעה] LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour, $minute, $isLower) { if ($hour < 5) { return 'לפנות בוקר'; } if ($hour < 10) { return 'בבוקר'; } if ($hour < 12) { return $isLower ? 'לפנה"צ' : 'לפני הצהריים'; } if ($hour < 18) { return $isLower ? 'אחה"צ' : 'אחרי הצהריים'; } return 'בערב'; }, 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], 'weekdays' => ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], 'weekdays_short' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'], 'weekdays_min' => ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'], 'list' => [', ', ' ו -'], 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/he_IL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/he.php'; ================================================ FILE: src/Carbon/Lang/hi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - abhimanyu003 * - Josh Soref * - JD Isaacks */ return [ 'year' => 'एक वर्ष|:count वर्ष', 'y' => '1 वर्ष|:count वर्षों', 'month' => 'एक महीने|:count महीने', 'm' => '1 माह|:count महीने', 'week' => '1 सप्ताह|:count सप्ताह', 'w' => '1 सप्ताह|:count सप्ताह', 'day' => 'एक दिन|:count दिन', 'd' => '1 दिन|:count दिनों', 'hour' => 'एक घंटा|:count घंटे', 'h' => '1 घंटा|:count घंटे', 'minute' => 'एक मिनट|:count मिनट', 'min' => '1 मिनट|:count मिनटों', 'second' => 'कुछ ही क्षण|:count सेकंड', 's' => '1 सेकंड|:count सेकंड', 'ago' => ':time पहले', 'from_now' => ':time में', 'after' => ':time के बाद', 'before' => ':time के पहले', 'diff_now' => 'अब', 'diff_today' => 'आज', 'diff_yesterday' => 'कल', 'diff_tomorrow' => 'कल', 'formats' => [ 'LT' => 'A h:mm बजे', 'LTS' => 'A h:mm:ss बजे', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm बजे', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm बजे', ], 'calendar' => [ 'sameDay' => '[आज] LT', 'nextDay' => '[कल] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[कल] LT', 'lastWeek' => '[पिछले] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'रात'; } if ($hour < 10) { return 'सुबह'; } if ($hour < 17) { return 'दोपहर'; } if ($hour < 20) { return 'शाम'; } return 'रात'; }, 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'months_short' => ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], 'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], 'list' => [', ', ' और '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/hi_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/hi.php'; ================================================ FILE: src/Carbon/Lang/hif.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/hif_FJ.php'; ================================================ FILE: src/Carbon/Lang/hif_FJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'dddd DD MMM YYYY', ], 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 'weekdays' => ['Ravivar', 'Somvar', 'Mangalvar', 'Budhvar', 'Guruvar', 'Shukravar', 'Shanivar'], 'weekdays_short' => ['Ravi', 'Som', 'Mangal', 'Budh', 'Guru', 'Shukra', 'Shani'], 'weekdays_min' => ['Ravi', 'Som', 'Mangal', 'Budh', 'Guru', 'Shukra', 'Shani'], 'meridiem' => ['Purvahan', 'Aparaahna'], 'hour' => ':count minit', // less reliable 'h' => ':count minit', // less reliable 'a_hour' => ':count minit', // less reliable 'year' => ':count saal', 'y' => ':count saal', 'a_year' => ':count saal', 'month' => ':count Mahina', 'm' => ':count Mahina', 'a_month' => ':count Mahina', 'week' => ':count Hafta', 'w' => ':count Hafta', 'a_week' => ':count Hafta', 'day' => ':count Din', 'd' => ':count Din', 'a_day' => ':count Din', 'minute' => ':count Minit', 'min' => ':count Minit', 'a_minute' => ':count Minit', 'second' => ':count Second', 's' => ':count Second', 'a_second' => ':count Second', ]); ================================================ FILE: src/Carbon/Lang/hne.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/hne_IN.php'; ================================================ FILE: src/Carbon/Lang/hne_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat, Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अपरेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितमबर', 'अकटूबर', 'नवमबर', 'दिसमबर'], 'months_short' => ['जन', 'फर', 'मार्च', 'अप', 'मई', 'जून', 'जुला', 'अग', 'सित', 'अकटू', 'नव', 'दिस'], 'weekdays' => ['इतवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'बिरसपत', 'सुकरवार', 'सनिवार'], 'weekdays_short' => ['इत', 'सोम', 'मंग', 'बुध', 'बिर', 'सुक', 'सनि'], 'weekdays_min' => ['इत', 'सोम', 'मंग', 'बुध', 'बिर', 'सुक', 'सनि'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['बिहिनियाँ', 'मंझनियाँ'], ]); ================================================ FILE: src/Carbon/Lang/hr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - Tim Fish * - shaishavgandhi05 * - Serhan Apaydın * - JD Isaacks * - tomhorvat * - Josh Soref * - François B * - shaishavgandhi05 * - Serhan Apaydın * - JD Isaacks * - tomhorvat * - Stjepan Majdak * - Vanja Retkovac (vr00) */ use Carbon\CarbonInterface; return [ 'year' => ':count godinu|:count godine|:count godina', 'y' => ':count god.|:count god.|:count god.', 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'm' => ':count mj.|:count mj.|:count mj.', 'week' => ':count tjedan|:count tjedna|:count tjedana', 'w' => ':count tj.|:count tj.|:count tj.', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count d.|:count d.|:count d.', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count sat|:count sata|:count sati', 'minute' => ':count minutu|:count minute|:count minuta', 'min' => ':count min.|:count min.|:count min.', 'second' => ':count sekundu|:count sekunde|:count sekundi', 'a_second' => 'nekoliko sekundi|:count sekunde|:count sekundi', 's' => ':count sek.|:count sek.|:count sek.', 'ago' => 'prije :time', 'from_now' => 'za :time', 'after' => ':time poslije', 'before' => ':time prije', 'diff_now' => 'sad', 'diff_today' => 'danas', 'diff_today_regexp' => 'danas(?:\\s+u)?', 'diff_yesterday' => 'jučer', 'diff_yesterday_regexp' => 'jučer(?:\\s+u)?', 'diff_tomorrow' => 'sutra', 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', 'diff_before_yesterday' => 'prekjučer', 'diff_after_tomorrow' => 'prekosutra', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'D. M. YYYY.', 'LL' => 'D. MMMM YYYY.', 'LLL' => 'D. MMMM YYYY. H:mm', 'LLLL' => 'dddd, D. MMMM YYYY. H:mm', ], 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[u] [nedjelju] [u] LT', 3 => '[u] [srijedu] [u] LT', 6 => '[u] [subotu] [u] LT', default => '[u] dddd [u] LT', }, 'lastDay' => '[jučer u] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0, 3 => '[prošlu] dddd [u] LT', 6 => '[prošle] [subote] [u] LT', default => '[prošli] dddd [u] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'], 'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], 'months_short' => ['sij.', 'velj.', 'ožu.', 'tra.', 'svi.', 'lip.', 'srp.', 'kol.', 'ruj.', 'lis.', 'stu.', 'pro.'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['nedjelju', 'ponedjeljak', 'utorak', 'srijedu', 'četvrtak', 'petak', 'subotu'], 'weekdays_standalone' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' i '], ]; ================================================ FILE: src/Carbon/Lang/hr_BA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - DarkoDevelop */ return array_replace_recursive(require __DIR__.'/hr.php', [ 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], 'weekdays_short' => ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'], 'weekdays_min' => ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'], 'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'], 'months_short' => ['sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro'], 'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D. M. yy.', 'LL' => 'D. MMM YYYY.', 'LLL' => 'D. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY. HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/hr_HR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/hr.php'; ================================================ FILE: src/Carbon/Lang/hsb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/hsb_DE.php'; ================================================ FILE: src/Carbon/Lang/hsb_DE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Information from Michael Wolf Andrzej Krzysztofowicz ankry@mif.pg.gda.pl */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'DD. MMMM YYYY', 'LLL' => 'DD. MMMM, HH:mm [hodź.]', 'LLLL' => 'dddd, DD. MMMM YYYY, HH:mm [hodź.]', ], 'months' => ['januara', 'februara', 'měrca', 'apryla', 'meje', 'junija', 'julija', 'awgusta', 'septembra', 'oktobra', 'nowembra', 'decembra'], 'months_short' => ['Jan', 'Feb', 'Měr', 'Apr', 'Mej', 'Jun', 'Jul', 'Awg', 'Sep', 'Okt', 'Now', 'Dec'], 'weekdays' => ['Njedźela', 'Póndźela', 'Wutora', 'Srjeda', 'Štvórtk', 'Pjatk', 'Sobota'], 'weekdays_short' => ['Nj', 'Pó', 'Wu', 'Sr', 'Št', 'Pj', 'So'], 'weekdays_min' => ['Nj', 'Pó', 'Wu', 'Sr', 'Št', 'Pj', 'So'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count lěto', 'y' => ':count lěto', 'a_year' => ':count lěto', 'month' => ':count měsac', 'm' => ':count měsac', 'a_month' => ':count měsac', 'week' => ':count tydźeń', 'w' => ':count tydźeń', 'a_week' => ':count tydźeń', 'day' => ':count dźeń', 'd' => ':count dźeń', 'a_day' => ':count dźeń', 'hour' => ':count hodźina', 'h' => ':count hodźina', 'a_hour' => ':count hodźina', 'minute' => ':count chwila', 'min' => ':count chwila', 'a_minute' => ':count chwila', 'second' => ':count druhi', 's' => ':count druhi', 'a_second' => ':count druhi', ]); ================================================ FILE: src/Carbon/Lang/ht.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ht_HT.php'; ================================================ FILE: src/Carbon/Lang/ht_HT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['janvye', 'fevriye', 'mas', 'avril', 'me', 'jen', 'jiyè', 'out', 'septanm', 'oktòb', 'novanm', 'desanm'], 'months_short' => ['jan', 'fev', 'mas', 'avr', 'me', 'jen', 'jiy', 'out', 'sep', 'okt', 'nov', 'des'], 'weekdays' => ['dimanch', 'lendi', 'madi', 'mèkredi', 'jedi', 'vandredi', 'samdi'], 'weekdays_short' => ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'], 'weekdays_min' => ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count lane', 'y' => ':count lane', 'a_year' => ':count lane', 'month' => 'mwa :count', 'm' => 'mwa :count', 'a_month' => 'mwa :count', 'week' => 'semèn :count', 'w' => 'semèn :count', 'a_week' => 'semèn :count', 'day' => ':count jou', 'd' => ':count jou', 'a_day' => ':count jou', 'hour' => ':count lè', 'h' => ':count lè', 'a_hour' => ':count lè', 'minute' => ':count minit', 'min' => ':count minit', 'a_minute' => ':count minit', 'second' => ':count segonn', 's' => ':count segonn', 'a_second' => ':count segonn', ]); ================================================ FILE: src/Carbon/Lang/hu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Adam Brunner * - Brett Johnson * - balping */ use Carbon\CarbonInterface; $huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton']; return [ 'year' => ':count év', 'y' => ':count év', 'month' => ':count hónap', 'm' => ':count hónap', 'week' => ':count hét', 'w' => ':count hét', 'day' => ':count nap', 'd' => ':count nap', 'hour' => ':count óra', 'h' => ':count óra', 'minute' => ':count perc', 'min' => ':count perc', 'second' => ':count másodperc', 's' => ':count másodperc', 'ago' => ':time', 'from_now' => ':time múlva', 'after' => ':time később', 'before' => ':time korábban', 'year_ago' => ':count éve', 'y_ago' => ':count éve', 'month_ago' => ':count hónapja', 'm_ago' => ':count hónapja', 'week_ago' => ':count hete', 'w_ago' => ':count hete', 'day_ago' => ':count napja', 'd_ago' => ':count napja', 'hour_ago' => ':count órája', 'h_ago' => ':count órája', 'minute_ago' => ':count perce', 'min_ago' => ':count perce', 'second_ago' => ':count másodperce', 's_ago' => ':count másodperce', 'year_after' => ':count évvel', 'y_after' => ':count évvel', 'month_after' => ':count hónappal', 'm_after' => ':count hónappal', 'week_after' => ':count héttel', 'w_after' => ':count héttel', 'day_after' => ':count nappal', 'd_after' => ':count nappal', 'hour_after' => ':count órával', 'h_after' => ':count órával', 'minute_after' => ':count perccel', 'min_after' => ':count perccel', 'second_after' => ':count másodperccel', 's_after' => ':count másodperccel', 'year_before' => ':count évvel', 'y_before' => ':count évvel', 'month_before' => ':count hónappal', 'm_before' => ':count hónappal', 'week_before' => ':count héttel', 'w_before' => ':count héttel', 'day_before' => ':count nappal', 'd_before' => ':count nappal', 'hour_before' => ':count órával', 'h_before' => ':count órával', 'minute_before' => ':count perccel', 'min_before' => ':count perccel', 'second_before' => ':count másodperccel', 's_before' => ':count másodperccel', 'months' => ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], 'months_short' => ['jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'], 'weekdays' => ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], 'weekdays_short' => ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], 'weekdays_min' => ['v', 'h', 'k', 'sze', 'cs', 'p', 'sz'], 'ordinal' => ':number.', 'diff_now' => 'most', 'diff_today' => 'ma', 'diff_yesterday' => 'tegnap', 'diff_tomorrow' => 'holnap', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'YYYY.MM.DD.', 'LL' => 'YYYY. MMMM D.', 'LLL' => 'YYYY. MMMM D. H:mm', 'LLLL' => 'YYYY. MMMM D., dddd H:mm', ], 'calendar' => [ 'sameDay' => '[ma] LT[-kor]', 'nextDay' => '[holnap] LT[-kor]', 'nextWeek' => static function (CarbonInterface $date) use ($huWeekEndings) { return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'lastDay' => '[tegnap] LT[-kor]', 'lastWeek' => static function (CarbonInterface $date) use ($huWeekEndings) { return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'sameElse' => 'L', ], 'meridiem' => ['DE', 'DU'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' és '], ]; ================================================ FILE: src/Carbon/Lang/hu_HU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/hu.php'; ================================================ FILE: src/Carbon/Lang/hy.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - mhamlet */ return [ 'year' => ':count տարի', 'a_year' => 'տարի|:count տարի', 'y' => ':countտ', 'month' => ':count ամիս', 'a_month' => 'ամիս|:count ամիս', 'm' => ':countամ', 'week' => ':count շաբաթ', 'a_week' => 'շաբաթ|:count շաբաթ', 'w' => ':countշ', 'day' => ':count օր', 'a_day' => 'օր|:count օր', 'd' => ':countօր', 'hour' => ':count ժամ', 'a_hour' => 'ժամ|:count ժամ', 'h' => ':countժ', 'minute' => ':count րոպե', 'a_minute' => 'րոպե|:count րոպե', 'min' => ':countր', 'second' => ':count վայրկյան', 'a_second' => 'մի քանի վայրկյան|:count վայրկյան', 's' => ':countվրկ', 'ago' => ':time առաջ', 'from_now' => ':timeից', 'after' => ':time հետո', 'before' => ':time առաջ', 'diff_now' => 'հիմա', 'diff_today' => 'այսօր', 'diff_yesterday' => 'երեկ', 'diff_tomorrow' => 'վաղը', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY թ.', 'LLL' => 'D MMMM YYYY թ., HH:mm', 'LLLL' => 'dddd, D MMMM YYYY թ., HH:mm', ], 'calendar' => [ 'sameDay' => '[այսօր] LT', 'nextDay' => '[վաղը] LT', 'nextWeek' => 'dddd [օրը ժամը] LT', 'lastDay' => '[երեկ] LT', 'lastWeek' => '[անցած] dddd [օրը ժամը] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'DDD', 'w', 'W', 'DDDo' => $number.($number === 1 ? '-ին' : '-րդ'), default => $number, }; }, 'meridiem' => static function ($hour) { if ($hour < 4) { return 'գիշերվա'; } if ($hour < 12) { return 'առավոտվա'; } if ($hour < 17) { return 'ցերեկվա'; } return 'երեկոյան'; }, 'months' => ['հունվարի', 'փետրվարի', 'մարտի', 'ապրիլի', 'մայիսի', 'հունիսի', 'հուլիսի', 'օգոստոսի', 'սեպտեմբերի', 'հոկտեմբերի', 'նոյեմբերի', 'դեկտեմբերի'], 'months_standalone' => ['հունվար', 'փետրվար', 'մարտ', 'ապրիլ', 'մայիս', 'հունիս', 'հուլիս', 'օգոստոս', 'սեպտեմբեր', 'հոկտեմբեր', 'նոյեմբեր', 'դեկտեմբեր'], 'months_short' => ['հնվ', 'փտր', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սպտ', 'հկտ', 'նմբ', 'դկտ'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ'], 'weekdays_short' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'], 'weekdays_min' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'], 'list' => [', ', ' եւ '], 'first_day_of_week' => 1, ]; ================================================ FILE: src/Carbon/Lang/hy_AM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - Tim Fish * - Serhan Apaydın * - JD Isaacks */ return array_replace_recursive(require __DIR__.'/hy.php', [ 'from_now' => ':time հետո', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/i18n.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], 'months' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 'months_short' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 'weekdays' => ['1', '2', '3', '4', '5', '6', '7'], 'weekdays_short' => ['1', '2', '3', '4', '5', '6', '7'], 'weekdays_min' => ['1', '2', '3', '4', '5', '6', '7'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/ia.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ia_FR.php'; ================================================ FILE: src/Carbon/Lang/ia_FR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Fedora Project Nik Kalach nikka@fedoraproject.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['januario', 'februario', 'martio', 'april', 'maio', 'junio', 'julio', 'augusto', 'septembre', 'octobre', 'novembre', 'decembre'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'], 'weekdays' => ['dominica', 'lunedi', 'martedi', 'mercuridi', 'jovedi', 'venerdi', 'sabbato'], 'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'jov', 'ven', 'sab'], 'weekdays_min' => ['dom', 'lun', 'mar', 'mer', 'jov', 'ven', 'sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => 'anno :count', 'y' => 'anno :count', 'a_year' => 'anno :count', 'month' => ':count mense', 'm' => ':count mense', 'a_month' => ':count mense', 'week' => ':count septimana', 'w' => ':count septimana', 'a_week' => ':count septimana', 'day' => ':count die', 'd' => ':count die', 'a_day' => ':count die', 'hour' => ':count hora', 'h' => ':count hora', 'a_hour' => ':count hora', 'minute' => ':count minuscule', 'min' => ':count minuscule', 'a_minute' => ':count minuscule', 'second' => ':count secunda', 's' => ':count secunda', 'a_second' => ':count secunda', ]); ================================================ FILE: src/Carbon/Lang/id.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - du * - JD Isaacks * - Nafies Luthfi * - Raymundus Jati Primanda (mundusjp) * - diankur313 * - a-wip0 */ return [ 'year' => ':count tahun', 'a_year' => '{1}setahun|[-Inf,Inf]:count tahun', 'y' => ':countthn', 'month' => ':count bulan', 'a_month' => '{1}sebulan|[-Inf,Inf]:count bulan', 'm' => ':countbln', 'week' => ':count minggu', 'a_week' => '{1}seminggu|[-Inf,Inf]:count minggu', 'w' => ':countmgg', 'day' => ':count hari', 'a_day' => '{1}sehari|[-Inf,Inf]:count hari', 'd' => ':counthr', 'hour' => ':count jam', 'a_hour' => '{1}sejam|[-Inf,Inf]:count jam', 'h' => ':countj', 'minute' => ':count menit', 'a_minute' => '{1}semenit|[-Inf,Inf]:count menit', 'min' => ':countmnt', 'second' => ':count detik', 'a_second' => '{1}beberapa detik|[-Inf,Inf]:count detik', 's' => ':countdt', 'ago' => ':time yang lalu', 'from_now' => ':time dari sekarang', 'after' => ':time setelahnya', 'before' => ':time sebelumnya', 'diff_now' => 'sekarang', 'diff_today' => 'Hari', 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', 'diff_yesterday' => 'kemarin', 'diff_yesterday_regexp' => 'Kemarin(?:\\s+pukul)?', 'diff_tomorrow' => 'besok', 'diff_tomorrow_regexp' => 'Besok(?:\\s+pukul)?', 'formats' => [ 'LT' => 'HH.mm', 'LTS' => 'HH.mm.ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY [pukul] HH.mm', 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', ], 'calendar' => [ 'sameDay' => '[Hari ini pukul] LT', 'nextDay' => '[Besok pukul] LT', 'nextWeek' => 'dddd [pukul] LT', 'lastDay' => '[Kemarin pukul] LT', 'lastWeek' => 'dddd [lalu pukul] LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 11) { return 'pagi'; } if ($hour < 15) { return 'siang'; } if ($hour < 19) { return 'sore'; } return 'malam'; }, 'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agt', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], 'weekdays_short' => ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], 'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' dan '], ]; ================================================ FILE: src/Carbon/Lang/id_ID.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/id.php'; ================================================ FILE: src/Carbon/Lang/ig.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ig_NG.php'; ================================================ FILE: src/Carbon/Lang/ig_NG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - pablo@mandriva.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Jenụwarị', 'Febrụwarị', 'Maachị', 'Eprel', 'Mee', 'Juun', 'Julaị', 'Ọgọọst', 'Septemba', 'Ọktoba', 'Novemba', 'Disemba'], 'months_short' => ['Jen', 'Feb', 'Maa', 'Epr', 'Mee', 'Juu', 'Jul', 'Ọgọ', 'Sep', 'Ọkt', 'Nov', 'Dis'], 'weekdays' => ['sọnde', 'mọnde', 'tuzde', 'wenzde', 'tọsde', 'fraịde', 'satọde'], 'weekdays_short' => ['sọn', 'mọn', 'tuz', 'wen', 'tọs', 'fra', 'sat'], 'weekdays_min' => ['sọn', 'mọn', 'tuz', 'wen', 'tọs', 'fra', 'sat'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => 'afo :count', 'y' => 'afo :count', 'a_year' => 'afo :count', 'month' => 'önwa :count', 'm' => 'önwa :count', 'a_month' => 'önwa :count', 'week' => 'izu :count', 'w' => 'izu :count', 'a_week' => 'izu :count', 'day' => 'ụbọchị :count', 'd' => 'ụbọchị :count', 'a_day' => 'ụbọchị :count', 'hour' => 'awa :count', 'h' => 'awa :count', 'a_hour' => 'awa :count', 'minute' => 'minit :count', 'min' => 'minit :count', 'a_minute' => 'minit :count', 'second' => 'sekọnd :count', 's' => 'sekọnd :count', 'a_second' => 'sekọnd :count', ]); ================================================ FILE: src/Carbon/Lang/ii.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['ꎸꄑ', 'ꁯꋒ'], 'weekdays' => ['ꑭꆏꑍ', 'ꆏꊂꋍ', 'ꆏꊂꑍ', 'ꆏꊂꌕ', 'ꆏꊂꇖ', 'ꆏꊂꉬ', 'ꆏꊂꃘ'], 'weekdays_short' => ['ꑭꆏ', 'ꆏꋍ', 'ꆏꑍ', 'ꆏꌕ', 'ꆏꇖ', 'ꆏꉬ', 'ꆏꃘ'], 'weekdays_min' => ['ꑭꆏ', 'ꆏꋍ', 'ꆏꑍ', 'ꆏꌕ', 'ꆏꇖ', 'ꆏꉬ', 'ꆏꃘ'], 'months' => null, 'months_short' => ['ꋍꆪ', 'ꑍꆪ', 'ꌕꆪ', 'ꇖꆪ', 'ꉬꆪ', 'ꃘꆪ', 'ꏃꆪ', 'ꉆꆪ', 'ꈬꆪ', 'ꊰꆪ', 'ꊰꊪꆪ', 'ꊰꑋꆪ'], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D h:mm a', 'LLLL' => 'YYYY MMMM D, dddd h:mm a', ], 'year' => ':count ꒉ', // less reliable 'y' => ':count ꒉ', // less reliable 'a_year' => ':count ꒉ', // less reliable 'month' => ':count ꆪ', 'm' => ':count ꆪ', 'a_month' => ':count ꆪ', 'week' => ':count ꏃ', // less reliable 'w' => ':count ꏃ', // less reliable 'a_week' => ':count ꏃ', // less reliable 'day' => ':count ꏜ', // less reliable 'd' => ':count ꏜ', // less reliable 'a_day' => ':count ꏜ', // less reliable 'hour' => ':count ꄮꈉ', 'h' => ':count ꄮꈉ', 'a_hour' => ':count ꄮꈉ', 'minute' => ':count ꀄꊭ', // less reliable 'min' => ':count ꀄꊭ', // less reliable 'a_minute' => ':count ꀄꊭ', // less reliable 'second' => ':count ꇅ', // less reliable 's' => ':count ꇅ', // less reliable 'a_second' => ':count ꇅ', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ik.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ik_CA.php'; ================================================ FILE: src/Carbon/Lang/ik_CA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - pablo@mandriva.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Siqiññaatchiaq', 'Siqiññaasrugruk', 'Paniqsiqsiivik', 'Qilġich Tatqiat', 'Suppivik', 'Iġñivik', 'Itchavik', 'Tiññivik', 'Amiġaiqsivik', 'Sikkuvik', 'Nippivik', 'Siqiñġiḷaq'], 'months_short' => ['Sñt', 'Sñs', 'Pan', 'Qil', 'Sup', 'Iġñ', 'Itc', 'Tiñ', 'Ami', 'Sik', 'Nip', 'Siq'], 'weekdays' => ['Minġuiqsioiq', 'Savałłiq', 'Ilaqtchiioiq', 'Qitchiioiq', 'Sisamiioiq', 'Tallimmiioiq', 'Maqinġuoiq'], 'weekdays_short' => ['Min', 'Sav', 'Ila', 'Qit', 'Sis', 'Tal', 'Maq'], 'weekdays_min' => ['Min', 'Sav', 'Ila', 'Qit', 'Sis', 'Tal', 'Maq'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => ':count ukiuq', 'y' => ':count ukiuq', 'a_year' => ':count ukiuq', 'month' => ':count Tatqiat', 'm' => ':count Tatqiat', 'a_month' => ':count Tatqiat', 'week' => ':count tatqiat', // less reliable 'w' => ':count tatqiat', // less reliable 'a_week' => ':count tatqiat', // less reliable 'day' => ':count siqiñiq', // less reliable 'd' => ':count siqiñiq', // less reliable 'a_day' => ':count siqiñiq', // less reliable 'hour' => ':count Siḷa', // less reliable 'h' => ':count Siḷa', // less reliable 'a_hour' => ':count Siḷa', // less reliable 'second' => ':count iġñiq', // less reliable 's' => ':count iġñiq', // less reliable 'a_second' => ':count iġñiq', // less reliable ]); ================================================ FILE: src/Carbon/Lang/in.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/id.php'; ================================================ FILE: src/Carbon/Lang/is.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kristján Ingi Geirsson */ return [ 'year' => '1 ár|:count ár', 'y' => '1 ár|:count ár', 'month' => '1 mánuður|:count mánuðir', 'm' => '1 mánuður|:count mánuðir', 'week' => '1 vika|:count vikur', 'w' => '1 vika|:count vikur', 'day' => '1 dagur|:count dagar', 'd' => '1 dagur|:count dagar', 'hour' => '1 klukkutími|:count klukkutímar', 'h' => '1 klukkutími|:count klukkutímar', 'minute' => '1 mínúta|:count mínútur', 'min' => '1 mínúta|:count mínútur', 'second' => '1 sekúnda|:count sekúndur', 's' => '1 sekúnda|:count sekúndur', 'ago' => ':time síðan', 'from_now' => ':time síðan', 'after' => ':time eftir', 'before' => ':time fyrir', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' og '], 'meridiem' => ['fh', 'eh'], 'diff_now' => 'núna', 'diff_yesterday' => 'í gær', 'diff_tomorrow' => 'á morgun', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM [kl.] HH:mm', 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', ], 'weekdays' => ['sunnudaginn', 'mánudaginn', 'þriðjudaginn', 'miðvikudaginn', 'fimmtudaginn', 'föstudaginn', 'laugardaginn'], 'weekdays_short' => ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'], 'weekdays_min' => ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'], 'months' => ['janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maí', 'jún', 'júl', 'ágú', 'sep', 'okt', 'nóv', 'des'], ]; ================================================ FILE: src/Carbon/Lang/is_IS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/is.php'; ================================================ FILE: src/Carbon/Lang/it.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ash * - François B * - Marco Perrando * - Massimiliano Caniparoli * - JD Isaacks * - Andrea Martini * - Francesco Marasco * - Tizianoz93 * - Davide Casiraghi (davide-casiraghi) * - Pete Scopes (pdscopes) */ use Carbon\CarbonInterface; return [ 'year' => ':count anno|:count anni', 'a_year' => 'un anno|:count anni', 'y' => ':count anno|:count anni', 'month' => ':count mese|:count mesi', 'a_month' => 'un mese|:count mesi', 'm' => ':count mese|:count mesi', 'week' => ':count settimana|:count settimane', 'a_week' => 'una settimana|:count settimane', 'w' => ':count set.', 'day' => ':count giorno|:count giorni', 'a_day' => 'un giorno|:count giorni', 'd' => ':count g|:count gg', 'hour' => ':count ora|:count ore', 'a_hour' => 'un\'ora|:count ore', 'h' => ':count h', 'minute' => ':count minuto|:count minuti', 'a_minute' => 'un minuto|:count minuti', 'min' => ':count min.', 'second' => ':count secondo|:count secondi', 'a_second' => 'alcuni secondi|:count secondi', 's' => ':count sec.', 'millisecond' => ':count millisecondo|:count millisecondi', 'a_millisecond' => 'un millisecondo|:count millisecondi', 'ms' => ':countms', 'microsecond' => ':count microsecondo|:count microsecondi', 'a_microsecond' => 'un microsecondo|:count microsecondi', 'µs' => ':countµs', 'ago' => ':time fa', 'from_now' => static function ($time) { return (preg_match('/^\d.+$/', $time) ? 'tra' : 'in')." $time"; }, 'after' => ':time dopo', 'before' => ':time prima', 'diff_now' => 'proprio ora', 'diff_today' => 'Oggi', 'diff_today_regexp' => 'Oggi(?:\\s+alle)?', 'diff_yesterday' => 'ieri', 'diff_yesterday_regexp' => 'Ieri(?:\\s+alle)?', 'diff_tomorrow' => 'domani', 'diff_tomorrow_regexp' => 'Domani(?:\\s+alle)?', 'diff_before_yesterday' => 'l\'altro ieri', 'diff_after_tomorrow' => 'dopodomani', 'period_interval' => 'ogni :interval', 'period_start_date' => 'dal :date', 'period_end_date' => 'al :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Oggi alle] LT', 'nextDay' => '[Domani alle] LT', 'nextWeek' => 'dddd [alle] LT', 'lastDay' => '[Ieri alle] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[la scorsa] dddd [alle] LT', default => '[lo scorso] dddd [alle] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':numberº', 'months' => ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], 'months_short' => ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], 'weekdays' => ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'], 'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'], 'weekdays_min' => ['do', 'lu', 'ma', 'me', 'gi', 've', 'sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' e '], 'ordinal_words' => [ 'of' => 'di', 'first' => 'primo', 'second' => 'secondo', 'third' => 'terzo', 'fourth' => 'quarto', 'fifth' => 'quinto', 'last' => 'ultimo', ], ]; ================================================ FILE: src/Carbon/Lang/it_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Propaganistas */ return array_replace_recursive(require __DIR__.'/it.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/it_IT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return require __DIR__.'/it.php'; ================================================ FILE: src/Carbon/Lang/it_SM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/it.php'; ================================================ FILE: src/Carbon/Lang/it_VA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/it.php'; ================================================ FILE: src/Carbon/Lang/iu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/iu_CA.php'; ================================================ FILE: src/Carbon/Lang/iu_CA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Pablo Saratxaga pablo@mandriva.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'MM/DD/YY', ], 'months' => ['ᔮᓄᐊᓕ', 'ᕕᕗᐊᓕ', 'ᒪᔅᓯ', 'ᐃᐳᓗ', 'ᒪᐃ', 'ᔪᓂ', 'ᔪᓚᐃ', 'ᐊᒋᓯ', 'ᓯᑎᕙ', 'ᐊᑦᑐᕙ', 'ᓄᕕᕙ', 'ᑎᓯᕝᕙ'], 'months_short' => ['ᔮᓄ', 'ᕕᕗ', 'ᒪᔅ', 'ᐃᐳ', 'ᒪᐃ', 'ᔪᓂ', 'ᔪᓚ', 'ᐊᒋ', 'ᓯᑎ', 'ᐊᑦ', 'ᓄᕕ', 'ᑎᓯ'], 'weekdays' => ['ᓈᑦᑎᖑᔭᕐᕕᒃ', 'ᓇᒡᒐᔾᔭᐅ', 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ', 'ᐱᖓᓲᓕᖅᓯᐅᑦ', 'ᕿᑎᖅᑰᑦ', 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ', 'ᓯᕙᑖᕕᒃ'], 'weekdays_short' => ['ᓈ', 'ᓇ', 'ᓕ', 'ᐱ', 'ᕿ', 'ᐅ', 'ᓯ'], 'weekdays_min' => ['ᓈ', 'ᓇ', 'ᓕ', 'ᐱ', 'ᕿ', 'ᐅ', 'ᓯ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => ':count ᐅᑭᐅᖅ', 'y' => ':count ᐅᑭᐅᖅ', 'a_year' => ':count ᐅᑭᐅᖅ', 'month' => ':count qaammat', 'm' => ':count qaammat', 'a_month' => ':count qaammat', 'week' => ':count sapaatip akunnera', 'w' => ':count sapaatip akunnera', 'a_week' => ':count sapaatip akunnera', 'day' => ':count ulloq', 'd' => ':count ulloq', 'a_day' => ':count ulloq', 'hour' => ':count ikarraq', 'h' => ':count ikarraq', 'a_hour' => ':count ikarraq', 'minute' => ':count titiqqaralaaq', // less reliable 'min' => ':count titiqqaralaaq', // less reliable 'a_minute' => ':count titiqqaralaaq', // less reliable 'second' => ':count marluk', // less reliable 's' => ':count marluk', // less reliable 'a_second' => ':count marluk', // less reliable ]); ================================================ FILE: src/Carbon/Lang/iw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], 'weekdays' => ['יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום שישי', 'יום שבת'], 'weekdays_short' => ['יום א׳', 'יום ב׳', 'יום ג׳', 'יום ד׳', 'יום ה׳', 'יום ו׳', 'שבת'], 'weekdays_min' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'], 'meridiem' => ['לפנה״צ', 'אחה״צ'], 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'D.M.YYYY', 'LL' => 'D בMMM YYYY', 'LLL' => 'D בMMMM YYYY H:mm', 'LLLL' => 'dddd, D בMMMM YYYY H:mm', ], 'year' => ':count שנה', 'y' => ':count שנה', 'a_year' => ':count שנה', 'month' => ':count חודש', 'm' => ':count חודש', 'a_month' => ':count חודש', 'week' => ':count שבוע', 'w' => ':count שבוע', 'a_week' => ':count שבוע', 'day' => ':count יום', 'd' => ':count יום', 'a_day' => ':count יום', 'hour' => ':count שעה', 'h' => ':count שעה', 'a_hour' => ':count שעה', 'minute' => ':count דקה', 'min' => ':count דקה', 'a_minute' => ':count דקה', 'second' => ':count שניה', 's' => ':count שניה', 'a_second' => ':count שניה', 'ago' => 'לפני :time', 'from_now' => 'בעוד :time', ]); ================================================ FILE: src/Carbon/Lang/ja.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Takuya Sawada * - Atsushi Tanaka * - François B * - Jason Katz-Brown * - Serhan Apaydın * - XueWei * - JD Isaacks * - toyama satoshi * - atakigawa */ use Carbon\CarbonInterface; return [ 'year' => ':count年', 'y' => ':count年', 'month' => ':countヶ月', 'm' => ':countヶ月', 'week' => ':count週間', 'w' => ':count週間', 'day' => ':count日', 'd' => ':count日', 'hour' => ':count時間', 'h' => ':count時間', 'minute' => ':count分', 'min' => ':count分', 'second' => ':count秒', 'a_second' => '{1}数秒|[-Inf,Inf]:count秒', 's' => ':count秒', 'ago' => ':time前', 'from_now' => ':time後', 'after' => ':time後', 'before' => ':time前', 'diff_now' => '今', 'diff_today' => '今日', 'diff_yesterday' => '昨日', 'diff_tomorrow' => '明日', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY/MM/DD', 'LL' => 'YYYY年M月D日', 'LLL' => 'YYYY年M月D日 HH:mm', 'LLLL' => 'YYYY年M月D日 dddd HH:mm', ], 'calendar' => [ 'sameDay' => '[今日] LT', 'nextDay' => '[明日] LT', 'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { if ($other->week !== $current->week) { return '[来週]dddd LT'; } return 'dddd LT'; }, 'lastDay' => '[昨日] LT', 'lastWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { if ($other->week !== $current->week) { return '[先週]dddd LT'; } return 'dddd LT'; }, 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'd', 'D', 'DDD' => $number.'日', default => $number, }; }, 'meridiem' => ['午前', '午後'], 'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 'weekdays' => ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], 'weekdays_short' => ['日', '月', '火', '水', '木', '金', '土'], 'weekdays_min' => ['日', '月', '火', '水', '木', '金', '土'], 'list' => '、', 'alt_numbers' => ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十', '二十一', '二十二', '二十三', '二十四', '二十五', '二十六', '二十七', '二十八', '二十九', '三十', '三十一', '三十二', '三十三', '三十四', '三十五', '三十六', '三十七', '三十八', '三十九', '四十', '四十一', '四十二', '四十三', '四十四', '四十五', '四十六', '四十七', '四十八', '四十九', '五十', '五十一', '五十二', '五十三', '五十四', '五十五', '五十六', '五十七', '五十八', '五十九', '六十', '六十一', '六十二', '六十三', '六十四', '六十五', '六十六', '六十七', '六十八', '六十九', '七十', '七十一', '七十二', '七十三', '七十四', '七十五', '七十六', '七十七', '七十八', '七十九', '八十', '八十一', '八十二', '八十三', '八十四', '八十五', '八十六', '八十七', '八十八', '八十九', '九十', '九十一', '九十二', '九十三', '九十四', '九十五', '九十六', '九十七', '九十八', '九十九'], 'alt_numbers_pow' => [ 10000 => '万', 1000 => '千', 100 => '百', ], ]; ================================================ FILE: src/Carbon/Lang/ja_JP.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ja.php'; ================================================ FILE: src/Carbon/Lang/jgo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/jmc.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/jv.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - tgfjt * - JD Isaacks */ return [ 'year' => ':count taun', 'a_year' => '{1}setaun|[-Inf,Inf]:count taun', 'month' => ':count wulan', 'a_month' => '{1}sewulan|[-Inf,Inf]:count wulan', 'week' => ':count minggu', 'a_week' => '{1}sakminggu|[-Inf,Inf]:count minggu', 'day' => ':count dina', 'a_day' => '{1}sedina|[-Inf,Inf]:count dina', 'hour' => ':count jam', 'a_hour' => '{1}setunggal jam|[-Inf,Inf]:count jam', 'minute' => ':count menit', 'a_minute' => '{1}setunggal menit|[-Inf,Inf]:count menit', 'second' => ':count detik', 'a_second' => '{0,1}sawetawis detik|[-Inf,Inf]:count detik', 'ago' => ':time ingkang kepengker', 'from_now' => 'wonten ing :time', 'diff_today' => 'Dinten', 'diff_yesterday' => 'Kala', 'diff_yesterday_regexp' => 'Kala(?:\\s+wingi)?(?:\\s+pukul)?', 'diff_tomorrow' => 'Mbenjang', 'diff_tomorrow_regexp' => 'Mbenjang(?:\\s+pukul)?', 'diff_today_regexp' => 'Dinten(?:\\s+puniko)?(?:\\s+pukul)?', 'formats' => [ 'LT' => 'HH.mm', 'LTS' => 'HH.mm.ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY [pukul] HH.mm', 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', ], 'calendar' => [ 'sameDay' => '[Dinten puniko pukul] LT', 'nextDay' => '[Mbenjang pukul] LT', 'nextWeek' => 'dddd [pukul] LT', 'lastDay' => '[Kala wingi pukul] LT', 'lastWeek' => 'dddd [kepengker pukul] LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 11) { return 'enjing'; } if ($hour < 15) { return 'siyang'; } if ($hour < 19) { return 'sonten'; } return 'ndalu'; }, 'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], 'weekdays' => ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], 'weekdays_short' => ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], 'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' lan '], ]; ================================================ FILE: src/Carbon/Lang/ka.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Tornike Razmadze * - François B * - Lasha Dolidze * - Tim Fish * - JD Isaacks * - Tornike Razmadze * - François B * - Lasha Dolidze * - JD Isaacks * - LONGMAN * - Avtandil Kikabidze (akalongman) * - Levan Velijanashvili (Stichoza) */ use Carbon\CarbonInterface; return [ 'year' => ':count წელი', 'y' => ':count წელი', 'a_year' => '{1}წელი|[-Inf,Inf]:count წელი', 'month' => ':count თვე', 'm' => ':count თვე', 'a_month' => '{1}თვე|[-Inf,Inf]:count თვე', 'week' => ':count კვირა', 'w' => ':count კვირა', 'a_week' => '{1}კვირა|[-Inf,Inf]:count კვირა', 'day' => ':count დღე', 'd' => ':count დღე', 'a_day' => '{1}დღე|[-Inf,Inf]:count დღე', 'hour' => ':count საათი', 'h' => ':count საათი', 'a_hour' => '{1}საათი|[-Inf,Inf]:count საათი', 'minute' => ':count წუთი', 'min' => ':count წუთი', 'a_minute' => '{1}წუთი|[-Inf,Inf]:count წუთი', 'second' => ':count წამი', 's' => ':count წამი', 'a_second' => '{1}რამდენიმე წამი|[-Inf,Inf]:count წამი', 'ago' => static function ($time) { $replacements = [ // year 'წელი' => 'წლის', // month 'თვე' => 'თვის', // week 'კვირა' => 'კვირის', // day 'დღე' => 'დღის', // hour 'საათი' => 'საათის', // minute 'წუთი' => 'წუთის', // second 'წამი' => 'წამის', ]; $time = strtr($time, array_flip($replacements)); $time = strtr($time, $replacements); return "$time წინ"; }, 'from_now' => static function ($time) { $replacements = [ // year 'წელი' => 'წელიწადში', // week 'კვირა' => 'კვირაში', // day 'დღე' => 'დღეში', // month 'თვე' => 'თვეში', // hour 'საათი' => 'საათში', // minute 'წუთი' => 'წუთში', // second 'წამი' => 'წამში', ]; $time = strtr($time, array_flip($replacements)); $time = strtr($time, $replacements); return $time; }, 'after' => static function ($time) { $replacements = [ // year 'წელი' => 'წლის', // month 'თვე' => 'თვის', // week 'კვირა' => 'კვირის', // day 'დღე' => 'დღის', // hour 'საათი' => 'საათის', // minute 'წუთი' => 'წუთის', // second 'წამი' => 'წამის', ]; $time = strtr($time, array_flip($replacements)); $time = strtr($time, $replacements); return "$time შემდეგ"; }, 'before' => static function ($time) { $replacements = [ // year 'წელი' => 'წლით', // month 'თვე' => 'თვით', // week 'კვირა' => 'კვირით', // day 'დღე' => 'დღით', // hour 'საათი' => 'საათით', // minute 'წუთი' => 'წუთით', // second 'წამი' => 'წამით', ]; $time = strtr($time, array_flip($replacements)); $time = strtr($time, $replacements); return "$time ადრე"; }, 'diff_now' => 'ახლა', 'diff_today' => 'დღეს', 'diff_yesterday' => 'გუშინ', 'diff_tomorrow' => 'ხვალ', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[დღეს], LT[-ზე]', 'nextDay' => '[ხვალ], LT[-ზე]', 'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]'; }, 'lastDay' => '[გუშინ], LT[-ზე]', 'lastWeek' => '[წინა] dddd, LT-ზე', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { if ($number === 0) { return $number; } if ($number === 1) { return $number.'-ლი'; } if (($number < 20) || ($number <= 100 && ($number % 20 === 0)) || ($number % 100 === 0)) { return 'მე-'.$number; } return $number.'-ე'; }, 'months' => ['იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'], 'months_standalone' => ['იანვარს', 'თებერვალს', 'მარტს', 'აპრილს', 'მაისს', 'ივნისს', 'ივლისს', 'აგვისტოს', 'სექტემბერს', 'ოქტომბერს', 'ნოემბერს', 'დეკემბერს'], 'months_short' => ['იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['კვირას', 'ორშაბათს', 'სამშაბათს', 'ოთხშაბათს', 'ხუთშაბათს', 'პარასკევს', 'შაბათს'], 'weekdays_standalone' => ['კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი'], 'weekdays_short' => ['კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'], 'weekdays_min' => ['კვ', 'ორ', 'სა', 'ოთ', 'ხუ', 'პა', 'შა'], 'weekdays_regexp' => '/^([^d].*|.*[^d])$/', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' და '], 'meridiem' => static function ($hour) { if ($hour >= 4) { if ($hour < 11) { return 'დილის'; } if ($hour < 16) { return 'შუადღის'; } if ($hour < 22) { return 'საღამოს'; } } return 'ღამის'; }, ]; ================================================ FILE: src/Carbon/Lang/ka_GE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ka.php'; ================================================ FILE: src/Carbon/Lang/kab.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/kab_DZ.php'; ================================================ FILE: src/Carbon/Lang/kab_DZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - belkacem77@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Yennayer', 'Fuṛar', 'Meɣres', 'Yebrir', 'Mayyu', 'Yunyu', 'Yulyu', 'ɣuct', 'Ctembeṛ', 'Tubeṛ', 'Wambeṛ', 'Dujembeṛ'], 'months_short' => ['Yen', 'Fur', 'Meɣ', 'Yeb', 'May', 'Yun', 'Yul', 'ɣuc', 'Cte', 'Tub', 'Wam', 'Duj'], 'weekdays' => ['Acer', 'Arim', 'Aram', 'Ahad', 'Amhad', 'Sem', 'Sed'], 'weekdays_short' => ['Ace', 'Ari', 'Ara', 'Aha', 'Amh', 'Sem', 'Sed'], 'weekdays_min' => ['Ace', 'Ari', 'Ara', 'Aha', 'Amh', 'Sem', 'Sed'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'meridiem' => ['FT', 'MD'], 'year' => ':count n yiseggasen', 'y' => ':count n yiseggasen', 'a_year' => ':count n yiseggasen', 'month' => ':count n wayyuren', 'm' => ':count n wayyuren', 'a_month' => ':count n wayyuren', 'week' => ':count n ledwaṛ', // less reliable 'w' => ':count n ledwaṛ', // less reliable 'a_week' => ':count n ledwaṛ', // less reliable 'day' => ':count n wussan', 'd' => ':count n wussan', 'a_day' => ':count n wussan', 'hour' => ':count n tsaɛtin', 'h' => ':count n tsaɛtin', 'a_hour' => ':count n tsaɛtin', 'minute' => ':count n tedqiqin', 'min' => ':count n tedqiqin', 'a_minute' => ':count n tedqiqin', 'second' => ':count tasdidt', // less reliable 's' => ':count tasdidt', // less reliable 'a_second' => ':count tasdidt', // less reliable ]); ================================================ FILE: src/Carbon/Lang/kam.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['Ĩyakwakya', 'Ĩyawĩoo'], 'weekdays' => ['Wa kyumwa', 'Wa kwambĩlĩlya', 'Wa kelĩ', 'Wa katatũ', 'Wa kana', 'Wa katano', 'Wa thanthatũ'], 'weekdays_short' => ['Wky', 'Wkw', 'Wkl', 'Wtũ', 'Wkn', 'Wtn', 'Wth'], 'weekdays_min' => ['Wky', 'Wkw', 'Wkl', 'Wtũ', 'Wkn', 'Wtn', 'Wth'], 'months' => ['Mwai wa mbee', 'Mwai wa kelĩ', 'Mwai wa katatũ', 'Mwai wa kana', 'Mwai wa katano', 'Mwai wa thanthatũ', 'Mwai wa muonza', 'Mwai wa nyaanya', 'Mwai wa kenda', 'Mwai wa ĩkumi', 'Mwai wa ĩkumi na ĩmwe', 'Mwai wa ĩkumi na ilĩ'], 'months_short' => ['Mbe', 'Kel', 'Ktũ', 'Kan', 'Ktn', 'Tha', 'Moo', 'Nya', 'Knd', 'Ĩku', 'Ĩkm', 'Ĩkl'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], // Too unreliable /* 'year' => ':count mbua', // less reliable 'y' => ':count mbua', // less reliable 'a_year' => ':count mbua', // less reliable 'month' => ':count ndakitali', // less reliable 'm' => ':count ndakitali', // less reliable 'a_month' => ':count ndakitali', // less reliable 'day' => ':count wia', // less reliable 'd' => ':count wia', // less reliable 'a_day' => ':count wia', // less reliable 'hour' => ':count orasan', // less reliable 'h' => ':count orasan', // less reliable 'a_hour' => ':count orasan', // less reliable 'minute' => ':count orasan', // less reliable 'min' => ':count orasan', // less reliable 'a_minute' => ':count orasan', // less reliable */ ]); ================================================ FILE: src/Carbon/Lang/kde.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Muhi', 'Chilo'], 'weekdays' => ['Liduva lyapili', 'Liduva lyatatu', 'Liduva lyanchechi', 'Liduva lyannyano', 'Liduva lyannyano na linji', 'Liduva lyannyano na mavili', 'Liduva litandi'], 'weekdays_short' => ['Ll2', 'Ll3', 'Ll4', 'Ll5', 'Ll6', 'Ll7', 'Ll1'], 'weekdays_min' => ['Ll2', 'Ll3', 'Ll4', 'Ll5', 'Ll6', 'Ll7', 'Ll1'], 'months' => ['Mwedi Ntandi', 'Mwedi wa Pili', 'Mwedi wa Tatu', 'Mwedi wa Nchechi', 'Mwedi wa Nnyano', 'Mwedi wa Nnyano na Umo', 'Mwedi wa Nnyano na Mivili', 'Mwedi wa Nnyano na Mitatu', 'Mwedi wa Nnyano na Nchechi', 'Mwedi wa Nnyano na Nnyano', 'Mwedi wa Nnyano na Nnyano na U', 'Mwedi wa Nnyano na Nnyano na M'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/kea.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sabadu'], 'weekdays_short' => ['dum', 'sig', 'ter', 'kua', 'kin', 'ses', 'sab'], 'weekdays_min' => ['du', 'si', 'te', 'ku', 'ki', 'se', 'sa'], 'weekdays_standalone' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sábadu'], 'months' => ['Janeru', 'Febreru', 'Marsu', 'Abril', 'Maiu', 'Junhu', 'Julhu', 'Agostu', 'Setenbru', 'Otubru', 'Nuvenbru', 'Dizenbru'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Otu', 'Nuv', 'Diz'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D [di] MMMM [di] YYYY HH:mm', 'LLLL' => 'dddd, D [di] MMMM [di] YYYY HH:mm', ], 'year' => ':count otunu', // less reliable 'y' => ':count otunu', // less reliable 'a_year' => ':count otunu', // less reliable 'week' => ':count día dumingu', // less reliable 'w' => ':count día dumingu', // less reliable 'a_week' => ':count día dumingu', // less reliable 'day' => ':count diâ', // less reliable 'd' => ':count diâ', // less reliable 'a_day' => ':count diâ', // less reliable 'minute' => ':count sugundu', // less reliable 'min' => ':count sugundu', // less reliable 'a_minute' => ':count sugundu', // less reliable 'second' => ':count dós', // less reliable 's' => ':count dós', // less reliable 'a_second' => ':count dós', // less reliable ]); ================================================ FILE: src/Carbon/Lang/khq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atini', 'Atalata', 'Alarba', 'Alhamiisa', 'Aljuma', 'Assabdu'], 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alj', 'Ass'], 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alj', 'Ass'], 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ki.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['Kiroko', 'Hwaĩ-inĩ'], 'weekdays' => ['Kiumia', 'Njumatatũ', 'Njumaine', 'Njumatana', 'Aramithi', 'Njumaa', 'Njumamothi'], 'weekdays_short' => ['KMA', 'NTT', 'NMN', 'NMT', 'ART', 'NMA', 'NMM'], 'weekdays_min' => ['KMA', 'NTT', 'NMN', 'NMT', 'ART', 'NMA', 'NMM'], 'months' => ['Njenuarĩ', 'Mwere wa kerĩ', 'Mwere wa gatatũ', 'Mwere wa kana', 'Mwere wa gatano', 'Mwere wa gatandatũ', 'Mwere wa mũgwanja', 'Mwere wa kanana', 'Mwere wa kenda', 'Mwere wa ikũmi', 'Mwere wa ikũmi na ũmwe', 'Ndithemba'], 'months_short' => ['JEN', 'WKR', 'WGT', 'WKN', 'WTN', 'WTD', 'WMJ', 'WNN', 'WKD', 'WIK', 'WMW', 'DIT'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'year' => ':count mĩaka', // less reliable 'y' => ':count mĩaka', // less reliable 'a_year' => ':count mĩaka', // less reliable 'month' => ':count mweri', // less reliable 'm' => ':count mweri', // less reliable 'a_month' => ':count mweri', // less reliable 'week' => ':count kiumia', // less reliable 'w' => ':count kiumia', // less reliable 'a_week' => ':count kiumia', // less reliable 'day' => ':count mũthenya', // less reliable 'd' => ':count mũthenya', // less reliable 'a_day' => ':count mũthenya', // less reliable 'hour' => ':count thaa', // less reliable 'h' => ':count thaa', // less reliable 'a_hour' => ':count thaa', // less reliable 'minute' => ':count mundu', // less reliable 'min' => ':count mundu', // less reliable 'a_minute' => ':count mundu', // less reliable 'second' => ':count igego', // less reliable 's' => ':count igego', // less reliable 'a_second' => ':count igego', // less reliable ]); ================================================ FILE: src/Carbon/Lang/kk.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - Talat Uspanov * - Нурлан Рахимжанов * - Toleugazy Kali */ return [ 'year' => ':count жыл', 'a_year' => '{1}бір жыл|:count жыл', 'y' => ':count ж.', 'month' => ':count ай', 'a_month' => '{1}бір ай|:count ай', 'm' => ':count ай', 'week' => ':count апта', 'a_week' => '{1}бір апта', 'w' => ':count ап.', 'day' => ':count күн', 'a_day' => '{1}бір күн|:count күн', 'd' => ':count к.', 'hour' => ':count сағат', 'a_hour' => '{1}бір сағат|:count сағат', 'h' => ':count са.', 'minute' => ':count минут', 'a_minute' => '{1}бір минут|:count минут', 'min' => ':count м.', 'second' => ':count секунд', 'a_second' => '{1}бірнеше секунд|:count секунд', 's' => ':count се.', 'ago' => ':time бұрын', 'from_now' => ':time ішінде', 'after' => ':time кейін', 'before' => ':time бұрын', 'diff_now' => 'қазір', 'diff_today' => 'Бүгін', 'diff_today_regexp' => 'Бүгін(?:\\s+сағат)?', 'diff_yesterday' => 'кеше', 'diff_yesterday_regexp' => 'Кеше(?:\\s+сағат)?', 'diff_tomorrow' => 'ертең', 'diff_tomorrow_regexp' => 'Ертең(?:\\s+сағат)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Бүгін сағат] LT', 'nextDay' => '[Ертең сағат] LT', 'nextWeek' => 'dddd [сағат] LT', 'lastDay' => '[Кеше сағат] LT', 'lastWeek' => '[Өткен аптаның] dddd [сағат] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { static $suffixes = [ 0 => '-ші', 1 => '-ші', 2 => '-ші', 3 => '-ші', 4 => '-ші', 5 => '-ші', 6 => '-шы', 7 => '-ші', 8 => '-ші', 9 => '-шы', 10 => '-шы', 20 => '-шы', 30 => '-шы', 40 => '-шы', 50 => '-ші', 60 => '-шы', 70 => '-ші', 80 => '-ші', 90 => '-шы', 100 => '-ші', ]; return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); }, 'months' => ['қаңтар', 'ақпан', 'наурыз', 'сәуір', 'мамыр', 'маусым', 'шілде', 'тамыз', 'қыркүйек', 'қазан', 'қараша', 'желтоқсан'], 'months_short' => ['қаң', 'ақп', 'нау', 'сәу', 'мам', 'мау', 'шіл', 'там', 'қыр', 'қаз', 'қар', 'жел'], 'weekdays' => ['жексенбі', 'дүйсенбі', 'сейсенбі', 'сәрсенбі', 'бейсенбі', 'жұма', 'сенбі'], 'weekdays_short' => ['жек', 'дүй', 'сей', 'сәр', 'бей', 'жұм', 'сен'], 'weekdays_min' => ['жк', 'дй', 'сй', 'ср', 'бй', 'жм', 'сн'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' және '], ]; ================================================ FILE: src/Carbon/Lang/kk_KZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/kk.php'; ================================================ FILE: src/Carbon/Lang/kkj.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/kl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/kl_GL.php'; ================================================ FILE: src/Carbon/Lang/kl_GL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Danish Standards Association bug-glibc-locales@gnu.org * - John Eyðstein Johannesen (mashema) */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', ], 'months' => ['januaarip', 'februaarip', 'marsip', 'apriilip', 'maajip', 'juunip', 'juulip', 'aggustip', 'septembarip', 'oktobarip', 'novembarip', 'decembarip'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 'weekdays' => ['sapaat', 'ataasinngorneq', 'marlunngorneq', 'pingasunngorneq', 'sisamanngorneq', 'tallimanngorneq', 'arfininngorneq'], 'weekdays_short' => ['sap', 'ata', 'mar', 'pin', 'sis', 'tal', 'arf'], 'weekdays_min' => ['sap', 'ata', 'mar', 'pin', 'sis', 'tal', 'arf'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => '{1}ukioq :count|{0}:count ukiut|[-Inf,Inf]ukiut :count', 'a_year' => '{1}ukioq|{0}:count ukiut|[-Inf,Inf]ukiut :count', 'y' => '{1}:countyr|{0}:countyrs|[-Inf,Inf]:countyrs', 'month' => '{1}qaammat :count|{0}:count qaammatit|[-Inf,Inf]qaammatit :count', 'a_month' => '{1}qaammat|{0}:count qaammatit|[-Inf,Inf]qaammatit :count', 'm' => '{1}:countmo|{0}:countmos|[-Inf,Inf]:countmos', 'week' => '{1}:count sap. ak.|{0}:count sap. ak.|[-Inf,Inf]:count sap. ak.', 'a_week' => '{1}a sap. ak.|{0}:count sap. ak.|[-Inf,Inf]:count sap. ak.', 'w' => ':countw', 'day' => '{1}:count ulloq|{0}:count ullut|[-Inf,Inf]:count ullut', 'a_day' => '{1}a ulloq|{0}:count ullut|[-Inf,Inf]:count ullut', 'd' => ':countd', 'hour' => '{1}:count tiimi|{0}:count tiimit|[-Inf,Inf]:count tiimit', 'a_hour' => '{1}tiimi|{0}:count tiimit|[-Inf,Inf]:count tiimit', 'h' => ':counth', 'minute' => '{1}:count minutsi|{0}:count minutsit|[-Inf,Inf]:count minutsit', 'a_minute' => '{1}a minutsi|{0}:count minutsit|[-Inf,Inf]:count minutsit', 'min' => ':countm', 'second' => '{1}:count sikunti|{0}:count sikuntit|[-Inf,Inf]:count sikuntit', 'a_second' => '{1}sikunti|{0}:count sikuntit|[-Inf,Inf]:count sikuntit', 's' => ':counts', 'ago' => ':time matuma siorna', ]); ================================================ FILE: src/Carbon/Lang/kln.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['krn', 'koosk'], 'weekdays' => ['Kotisap', 'Kotaai', 'Koaeng’', 'Kosomok', 'Koang’wan', 'Komuut', 'Kolo'], 'weekdays_short' => ['Kts', 'Kot', 'Koo', 'Kos', 'Koa', 'Kom', 'Kol'], 'weekdays_min' => ['Kts', 'Kot', 'Koo', 'Kos', 'Koa', 'Kom', 'Kol'], 'months' => ['Mulgul', 'Ng’atyaato', 'Kiptaamo', 'Iwootkuut', 'Mamuut', 'Paagi', 'Ng’eiyeet', 'Rooptui', 'Bureet', 'Epeeso', 'Kipsuunde ne taai', 'Kipsuunde nebo aeng’'], 'months_short' => ['Mul', 'Ngat', 'Taa', 'Iwo', 'Mam', 'Paa', 'Nge', 'Roo', 'Bur', 'Epe', 'Kpt', 'Kpa'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'year' => ':count maghatiat', // less reliable 'y' => ':count maghatiat', // less reliable 'a_year' => ':count maghatiat', // less reliable ]); ================================================ FILE: src/Carbon/Lang/km.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kruy Vanna * - Sereysethy Touch * - JD Isaacks * - Sovichet Tep */ return [ 'year' => ':count ឆ្នាំ', 'a_year' => '{1}មួយឆ្នាំ|[-Inf,Inf]:count ឆ្នាំ', 'y' => ':count ឆ្នាំ', 'month' => ':count ខែ', 'a_month' => '{1}មួយខែ|[-Inf,Inf]:count ខែ', 'm' => ':count ខែ', 'week' => ':count សប្តាហ៍', 'w' => ':count សប្តាហ៍', 'day' => ':count ថ្ងៃ', 'a_day' => '{1}មួយថ្ងៃ|[-Inf,Inf]:count ថ្ងៃ', 'd' => ':count ថ្ងៃ', 'hour' => ':count ម៉ោង', 'a_hour' => '{1}មួយម៉ោង|[-Inf,Inf]:count ម៉ោង', 'h' => ':count ម៉ោង', 'minute' => ':count នាទី', 'a_minute' => '{1}មួយនាទី|[-Inf,Inf]:count នាទី', 'min' => ':count នាទី', 'second' => ':count វិនាទី', 'a_second' => '{0,1}ប៉ុន្មានវិនាទី|[-Inf,Inf]:count វិនាទី', 's' => ':count វិនាទី', 'ago' => ':timeមុន', 'from_now' => ':timeទៀត', 'after' => 'នៅ​ក្រោយ :time', 'before' => 'នៅ​មុន :time', 'diff_now' => 'ឥឡូវ', 'diff_today' => 'ថ្ងៃនេះ', 'diff_today_regexp' => 'ថ្ងៃនេះ(?:\\s+ម៉ោង)?', 'diff_yesterday' => 'ម្សិលមិញ', 'diff_yesterday_regexp' => 'ម្សិលមិញ(?:\\s+ម៉ោង)?', 'diff_tomorrow' => 'ថ្ងៃ​ស្អែក', 'diff_tomorrow_regexp' => 'ស្អែក(?:\\s+ម៉ោង)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[ថ្ងៃនេះ ម៉ោង] LT', 'nextDay' => '[ស្អែក ម៉ោង] LT', 'nextWeek' => 'dddd [ម៉ោង] LT', 'lastDay' => '[ម្សិលមិញ ម៉ោង] LT', 'lastWeek' => 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', 'sameElse' => 'L', ], 'ordinal' => 'ទី:number', 'meridiem' => ['ព្រឹក', 'ល្ងាច'], 'months' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'], 'months_short' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'], 'weekdays' => ['អាទិត្យ', 'ច័ន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'], 'weekdays_short' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'], 'weekdays_min' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', 'និង '], ]; ================================================ FILE: src/Carbon/Lang/km_KH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/km.php'; ================================================ FILE: src/Carbon/Lang/kn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - MOHAN M U * - François B * - rajeevnaikte */ return [ 'year' => '{1}:count ವರ್ಷ|[-Inf,Inf]:count ವರ್ಷಗಳು', 'a_year' => '{1}ಒಂದು ವರ್ಷ|[-Inf,Inf]:count ವರ್ಷಗಳು', 'month' => ':count ತಿಂಗಳು', 'a_month' => '{1}ಒಂದು ತಿಂಗಳು|[-Inf,Inf]:count ತಿಂಗಳು', 'week' => '{1}:count ವಾರ|[-Inf,Inf]:count ವಾರಗಳು', 'a_week' => '{1}ಒಂದು ವಾರ|[-Inf,Inf]:count ವಾರಗಳು', 'day' => '{1}:count ದಿನ|[-Inf,Inf]:count ದಿನಗಳು', 'a_day' => '{1}ಒಂದು ದಿನ|[-Inf,Inf]:count ದಿನಗಳು', 'hour' => '{1}:count ಗಂಟೆ|[-Inf,Inf]:count ಗಂಟೆಗಳು', 'a_hour' => '{1}ಒಂದು ಗಂಟೆ|[-Inf,Inf]:count ಗಂಟೆಗಳು', 'minute' => '{1}:count ನಿಮಿಷ|[-Inf,Inf]:count ನಿಮಿಷಗಳು', 'a_minute' => '{1}ಒಂದು ನಿಮಿಷ|[-Inf,Inf]:count ನಿಮಿಷಗಳು', 'second' => '{0,1}:count ಸೆಕೆಂಡ್|[-Inf,Inf]:count ಸೆಕೆಂಡುಗಳು', 'a_second' => '{0,1}ಕೆಲವು ಕ್ಷಣಗಳು|[-Inf,Inf]:count ಸೆಕೆಂಡುಗಳು', 'ago' => ':time ಹಿಂದೆ', 'from_now' => ':time ನಂತರ', 'diff_now' => 'ಈಗ', 'diff_today' => 'ಇಂದು', 'diff_yesterday' => 'ನಿನ್ನೆ', 'diff_tomorrow' => 'ನಾಳೆ', 'formats' => [ 'LT' => 'A h:mm', 'LTS' => 'A h:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', ], 'calendar' => [ 'sameDay' => '[ಇಂದು] LT', 'nextDay' => '[ನಾಳೆ] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[ನಿನ್ನೆ] LT', 'lastWeek' => '[ಕೊನೆಯ] dddd, LT', 'sameElse' => 'L', ], 'ordinal' => ':numberನೇ', 'meridiem' => static function ($hour) { if ($hour < 4) { return 'ರಾತ್ರಿ'; } if ($hour < 10) { return 'ಬೆಳಿಗ್ಗೆ'; } if ($hour < 17) { return 'ಮಧ್ಯಾಹ್ನ'; } if ($hour < 20) { return 'ಸಂಜೆ'; } return 'ರಾತ್ರಿ'; }, 'months' => ['ಜನವರಿ', 'ಫೆಬ್ರವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'], 'months_short' => ['ಜನ', 'ಫೆಬ್ರ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂ', 'ಅಕ್ಟೋ', 'ನವೆಂ', 'ಡಿಸೆಂ'], 'weekdays' => ['ಭಾನುವಾರ', 'ಸೋಮವಾರ', 'ಮಂಗಳವಾರ', 'ಬುಧವಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರವಾರ', 'ಶನಿವಾರ'], 'weekdays_short' => ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'], 'weekdays_min' => ['ಭಾ', 'ಸೋ', 'ಮಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], 'list' => ', ', 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/kn_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/kn.php'; ================================================ FILE: src/Carbon/Lang/ko.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kunal Marwaha * - FourwingsY * - François B * - Jason Katz-Brown * - Seokjun Kim * - Junho Kim * - JD Isaacks * - Juwon Kim */ return [ 'year' => ':count년', 'a_year' => '{1}일년|[-Inf,Inf]:count년', 'y' => ':count년', 'month' => ':count개월', 'a_month' => '{1}한달|[-Inf,Inf]:count개월', 'm' => ':count개월', 'week' => ':count주', 'a_week' => '{1}일주일|[-Inf,Inf]:count 주', 'w' => ':count주일', 'day' => ':count일', 'a_day' => '{1}하루|[-Inf,Inf]:count일', 'd' => ':count일', 'hour' => ':count시간', 'a_hour' => '{1}한시간|[-Inf,Inf]:count시간', 'h' => ':count시간', 'minute' => ':count분', 'a_minute' => '{1}일분|[-Inf,Inf]:count분', 'min' => ':count분', 'second' => ':count초', 'a_second' => '{1}몇초|[-Inf,Inf]:count초', 's' => ':count초', 'ago' => ':time 전', 'from_now' => ':time 후', 'after' => ':time 후', 'before' => ':time 전', 'diff_now' => '지금', 'diff_today' => '오늘', 'diff_yesterday' => '어제', 'diff_tomorrow' => '내일', 'formats' => [ 'LT' => 'A h:mm', 'LTS' => 'A h:mm:ss', 'L' => 'YYYY.MM.DD.', 'LL' => 'YYYY년 MMMM D일', 'LLL' => 'YYYY년 MMMM D일 A h:mm', 'LLLL' => 'YYYY년 MMMM D일 dddd A h:mm', ], 'calendar' => [ 'sameDay' => '오늘 LT', 'nextDay' => '내일 LT', 'nextWeek' => 'dddd LT', 'lastDay' => '어제 LT', 'lastWeek' => '지난주 dddd LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'd', 'D', 'DDD' => $number.'일', 'M' => $number.'월', 'w', 'W' => $number.'주', default => $number, }; }, 'meridiem' => ['오전', '오후'], 'months' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 'months_short' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 'weekdays' => ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], 'weekdays_short' => ['일', '월', '화', '수', '목', '금', '토'], 'weekdays_min' => ['일', '월', '화', '수', '목', '금', '토'], 'list' => ' ', ]; ================================================ FILE: src/Carbon/Lang/ko_KP.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ko.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/ko_KR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ko.php'; ================================================ FILE: src/Carbon/Lang/kok.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/kok_IN.php'; ================================================ FILE: src/Carbon/Lang/kok_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat, Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D-M-YY', ], 'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ओगस्ट', 'सेप्टेंबर', 'ओक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], 'months_short' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ओगस्ट', 'सेप्टेंबर', 'ओक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], 'weekdays' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], 'weekdays_short' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], 'weekdays_min' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['म.पू.', 'म.नं.'], 'year' => ':count वैशाकु', // less reliable 'y' => ':count वैशाकु', // less reliable 'a_year' => ':count वैशाकु', // less reliable 'week' => ':count आदित्यवार', // less reliable 'w' => ':count आदित्यवार', // less reliable 'a_week' => ':count आदित्यवार', // less reliable 'minute' => ':count नोंद', // less reliable 'min' => ':count नोंद', // less reliable 'a_minute' => ':count नोंद', // less reliable 'second' => ':count तेंको', // less reliable 's' => ':count तेंको', // less reliable 'a_second' => ':count तेंको', // less reliable 'month' => ':count मैनो', 'm' => ':count मैनो', 'a_month' => ':count मैनो', 'day' => ':count दिवसु', 'd' => ':count दिवसु', 'a_day' => ':count दिवसु', 'hour' => ':count घंते', 'h' => ':count घंते', 'a_hour' => ':count घंते', ]); ================================================ FILE: src/Carbon/Lang/ks.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ks_IN.php'; ================================================ FILE: src/Carbon/Lang/ks_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat, Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'M/D/YY', ], 'months' => ['جنؤری', 'فرؤری', 'مارٕچ', 'اپریل', 'میٔ', 'جوٗن', 'جوٗلایی', 'اگست', 'ستمبر', 'اکتوٗبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنؤری', 'فرؤری', 'مارٕچ', 'اپریل', 'میٔ', 'جوٗن', 'جوٗلایی', 'اگست', 'ستمبر', 'اکتوٗبر', 'نومبر', 'دسمبر'], 'weekdays' => ['آتهوار', 'ژءندروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], 'weekdays_short' => ['آتهوار', 'ژءنتروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], 'weekdays_min' => ['آتهوار', 'ژءنتروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['دوپھربرونھ', 'دوپھرپتھ'], 'year' => ':count آب', // less reliable 'y' => ':count آب', // less reliable 'a_year' => ':count آب', // less reliable 'month' => ':count रान्', // less reliable 'm' => ':count रान्', // less reliable 'a_month' => ':count रान्', // less reliable 'week' => ':count آتھٕوار', // less reliable 'w' => ':count آتھٕوار', // less reliable 'a_week' => ':count آتھٕوار', // less reliable 'hour' => ':count سۄن', // less reliable 'h' => ':count سۄن', // less reliable 'a_hour' => ':count سۄن', // less reliable 'minute' => ':count فَن', // less reliable 'min' => ':count فَن', // less reliable 'a_minute' => ':count فَن', // less reliable 'second' => ':count दोʼयुम', // less reliable 's' => ':count दोʼयुम', // less reliable 'a_second' => ':count दोʼयुम', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ks_IN@devanagari.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - ks-gnome-trans-commits@lists.code.indlinux.net */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'M/D/YY', ], 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'weekdays' => ['आथवार', 'चॅ़दुरवार', 'बोमवार', 'ब्वदवार', 'ब्रसवार', 'शोकुरवार', 'बटुवार'], 'weekdays_short' => ['आथ ', 'चॅ़दुर', 'बोम', 'ब्वद', 'ब्रस', 'शोकुर', 'बटु'], 'weekdays_min' => ['आथ ', 'चॅ़दुर', 'बोम', 'ब्वद', 'ब्रस', 'शोकुर', 'बटु'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], ]); ================================================ FILE: src/Carbon/Lang/ksb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['makeo', 'nyiaghuo'], 'weekdays' => ['Jumaapii', 'Jumaatatu', 'Jumaane', 'Jumaatano', 'Alhamisi', 'Ijumaa', 'Jumaamosi'], 'weekdays_short' => ['Jpi', 'Jtt', 'Jmn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'weekdays_min' => ['Jpi', 'Jtt', 'Jmn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'months' => ['Januali', 'Febluali', 'Machi', 'Aplili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ksf.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['sárúwá', 'cɛɛ́nko'], 'weekdays' => ['sɔ́ndǝ', 'lǝndí', 'maadí', 'mɛkrɛdí', 'jǝǝdí', 'júmbá', 'samdí'], 'weekdays_short' => ['sɔ́n', 'lǝn', 'maa', 'mɛk', 'jǝǝ', 'júm', 'sam'], 'weekdays_min' => ['sɔ́n', 'lǝn', 'maa', 'mɛk', 'jǝǝ', 'júm', 'sam'], 'months' => ['ŋwíí a ntɔ́ntɔ', 'ŋwíí akǝ bɛ́ɛ', 'ŋwíí akǝ ráá', 'ŋwíí akǝ nin', 'ŋwíí akǝ táan', 'ŋwíí akǝ táafɔk', 'ŋwíí akǝ táabɛɛ', 'ŋwíí akǝ táaraa', 'ŋwíí akǝ táanin', 'ŋwíí akǝ ntɛk', 'ŋwíí akǝ ntɛk di bɔ́k', 'ŋwíí akǝ ntɛk di bɛ́ɛ'], 'months_short' => ['ŋ1', 'ŋ2', 'ŋ3', 'ŋ4', 'ŋ5', 'ŋ6', 'ŋ7', 'ŋ8', 'ŋ9', 'ŋ10', 'ŋ11', 'ŋ12'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ksh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['v.M.', 'n.M.'], 'weekdays' => ['Sunndaach', 'Mohndaach', 'Dinnsdaach', 'Metwoch', 'Dunnersdaach', 'Friidaach', 'Samsdaach'], 'weekdays_short' => ['Su.', 'Mo.', 'Di.', 'Me.', 'Du.', 'Fr.', 'Sa.'], 'weekdays_min' => ['Su', 'Mo', 'Di', 'Me', 'Du', 'Fr', 'Sa'], 'months' => ['Jannewa', 'Fäbrowa', 'Määz', 'Aprell', 'Mai', 'Juuni', 'Juuli', 'Oujoß', 'Septämber', 'Oktohber', 'Novämber', 'Dezämber'], 'months_short' => ['Jan', 'Fäb', 'Mäz', 'Apr', 'Mai', 'Jun', 'Jul', 'Ouj', 'Säp', 'Okt', 'Nov', 'Dez'], 'months_short_standalone' => ['Jan.', 'Fäb.', 'Mäz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Ouj.', 'Säp.', 'Okt.', 'Nov.', 'Dez.'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D. M. YYYY', 'LL' => 'D. MMM. YYYY', 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd, [dä] D. MMMM YYYY HH:mm', ], 'year' => ':count Johr', 'y' => ':count Johr', 'a_year' => ':count Johr', 'month' => ':count Moohnd', 'm' => ':count Moohnd', 'a_month' => ':count Moohnd', 'week' => ':count woch', 'w' => ':count woch', 'a_week' => ':count woch', 'day' => ':count Daach', 'd' => ':count Daach', 'a_day' => ':count Daach', 'hour' => ':count Uhr', 'h' => ':count Uhr', 'a_hour' => ':count Uhr', 'minute' => ':count Menutt', 'min' => ':count Menutt', 'a_minute' => ':count Menutt', 'second' => ':count Sekůndt', 's' => ':count Sekůndt', 'a_second' => ':count Sekůndt', ]); ================================================ FILE: src/Carbon/Lang/ku.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Unicode, Inc. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'ago' => 'berî :time', 'from_now' => 'di :time de', 'after' => ':time piştî', 'before' => ':time berê', 'year' => ':count sal', 'a_year' => ':count sal', 'y' => ':count sal', 'year_ago' => ':count salê|:count salan', 'y_ago' => ':count salê|:count salan', 'year_from_now' => 'salekê|:count salan', 'y_from_now' => 'salekê|:count salan', 'month' => ':count meh', 'a_month' => ':count meh', 'm' => ':count meh', 'week' => ':count hefte', 'a_week' => ':count hefte', 'w' => ':count hefte', 'day' => ':count roj', 'a_day' => ':count roj', 'd' => ':count roj', 'hour' => ':count saet', 'a_hour' => ':count saet', 'h' => ':count saet', 'minute' => ':count deqîqe', 'a_minute' => ':count deqîqe', 'min' => ':count deqîqe', 'second' => ':count saniye', 'a_second' => ':count saniye', 's' => ':count saniye', 'months' => ['rêbendanê', 'reşemiyê', 'adarê', 'avrêlê', 'gulanê', 'pûşperê', 'tîrmehê', 'gelawêjê', 'rezberê', 'kewçêrê', 'sermawezê', 'berfanbarê'], 'months_standalone' => ['rêbendan', 'reşemî', 'adar', 'avrêl', 'gulan', 'pûşper', 'tîrmeh', 'gelawêj', 'rezber', 'kewçêr', 'sermawez', 'berfanbar'], 'months_short' => ['rêb', 'reş', 'ada', 'avr', 'gul', 'pûş', 'tîr', 'gel', 'rez', 'kew', 'ser', 'ber'], 'weekdays' => ['yekşem', 'duşem', 'sêşem', 'çarşem', 'pêncşem', 'în', 'şemî'], 'weekdays_short' => ['yş', 'dş', 'sş', 'çş', 'pş', 'în', 'ş'], 'weekdays_min' => ['Y', 'D', 'S', 'Ç', 'P', 'Î', 'Ş'], 'list' => [', ', ' û '], 'ordinal' => ':number', 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/ku_TR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ku.php'; ================================================ FILE: src/Carbon/Lang/kw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/kw_GB.php'; ================================================ FILE: src/Carbon/Lang/kw_GB.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Alastair McKinstry bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['mis Genver', 'mis Hwevrer', 'mis Meurth', 'mis Ebrel', 'mis Me', 'mis Metheven', 'mis Gortheren', 'mis Est', 'mis Gwynngala', 'mis Hedra', 'mis Du', 'mis Kevardhu'], 'months_short' => ['Gen', 'Hwe', 'Meu', 'Ebr', 'Me', 'Met', 'Gor', 'Est', 'Gwn', 'Hed', 'Du', 'Kev'], 'weekdays' => ['De Sul', 'De Lun', 'De Merth', 'De Merher', 'De Yow', 'De Gwener', 'De Sadorn'], 'weekdays_short' => ['Sul', 'Lun', 'Mth', 'Mhr', 'Yow', 'Gwe', 'Sad'], 'weekdays_min' => ['Sul', 'Lun', 'Mth', 'Mhr', 'Yow', 'Gwe', 'Sad'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count bledhen', 'y' => ':count bledhen', 'a_year' => ':count bledhen', 'month' => ':count mis', 'm' => ':count mis', 'a_month' => ':count mis', 'week' => ':count seythen', 'w' => ':count seythen', 'a_week' => ':count seythen', 'day' => ':count dydh', 'd' => ':count dydh', 'a_day' => ':count dydh', 'hour' => ':count eur', 'h' => ':count eur', 'a_hour' => ':count eur', 'minute' => ':count mynysen', 'min' => ':count mynysen', 'a_minute' => ':count mynysen', 'second' => ':count pryjwyth', 's' => ':count pryjwyth', 'a_second' => ':count pryjwyth', ]); ================================================ FILE: src/Carbon/Lang/ky.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - acutexyz * - Josh Soref * - François B * - Chyngyz Arystan uulu * - Chyngyz * - acutexyz * - Josh Soref * - François B * - Chyngyz Arystan uulu */ return [ 'year' => ':count жыл', 'a_year' => '{1}бир жыл|:count жыл', 'y' => ':count жыл', 'month' => ':count ай', 'a_month' => '{1}бир ай|:count ай', 'm' => ':count ай', 'week' => ':count апта', 'a_week' => '{1}бир апта|:count апта', 'w' => ':count апт.', 'day' => ':count күн', 'a_day' => '{1}бир күн|:count күн', 'd' => ':count күн', 'hour' => ':count саат', 'a_hour' => '{1}бир саат|:count саат', 'h' => ':count саат.', 'minute' => ':count мүнөт', 'a_minute' => '{1}бир мүнөт|:count мүнөт', 'min' => ':count мүн.', 'second' => ':count секунд', 'a_second' => '{1}бирнече секунд|:count секунд', 's' => ':count сек.', 'ago' => ':time мурун', 'from_now' => ':time ичинде', 'diff_now' => 'азыр', 'diff_today' => 'Бүгүн', 'diff_today_regexp' => 'Бүгүн(?:\\s+саат)?', 'diff_yesterday' => 'кечээ', 'diff_yesterday_regexp' => 'Кече(?:\\s+саат)?', 'diff_tomorrow' => 'эртең', 'diff_tomorrow_regexp' => 'Эртең(?:\\s+саат)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Бүгүн саат] LT', 'nextDay' => '[Эртең саат] LT', 'nextWeek' => 'dddd [саат] LT', 'lastDay' => '[Кече саат] LT', 'lastWeek' => '[Өткен аптанын] dddd [күнү] [саат] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { static $suffixes = [ 0 => '-чү', 1 => '-чи', 2 => '-чи', 3 => '-чү', 4 => '-чү', 5 => '-чи', 6 => '-чы', 7 => '-чи', 8 => '-чи', 9 => '-чу', 10 => '-чу', 20 => '-чы', 30 => '-чу', 40 => '-чы', 50 => '-чү', 60 => '-чы', 70 => '-чи', 80 => '-чи', 90 => '-чу', 100 => '-чү', ]; return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); }, 'months' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'], 'months_short' => ['янв', 'фев', 'март', 'апр', 'май', 'июнь', 'июль', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'weekdays' => ['Жекшемби', 'Дүйшөмбү', 'Шейшемби', 'Шаршемби', 'Бейшемби', 'Жума', 'Ишемби'], 'weekdays_short' => ['Жек', 'Дүй', 'Шей', 'Шар', 'Бей', 'Жум', 'Ише'], 'weekdays_min' => ['Жк', 'Дй', 'Шй', 'Шр', 'Бй', 'Жм', 'Иш'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => ' ', 'meridiem' => ['таңкы', 'түштөн кийинки'], ]; ================================================ FILE: src/Carbon/Lang/ky_KG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ky.php'; ================================================ FILE: src/Carbon/Lang/lag.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['TOO', 'MUU'], 'weekdays' => ['Jumapíiri', 'Jumatátu', 'Jumaíne', 'Jumatáano', 'Alamíisi', 'Ijumáa', 'Jumamóosi'], 'weekdays_short' => ['Píili', 'Táatu', 'Íne', 'Táano', 'Alh', 'Ijm', 'Móosi'], 'weekdays_min' => ['Píili', 'Táatu', 'Íne', 'Táano', 'Alh', 'Ijm', 'Móosi'], 'months' => ['Kʉfúngatɨ', 'Kʉnaanɨ', 'Kʉkeenda', 'Kwiikumi', 'Kwiinyambála', 'Kwiidwaata', 'Kʉmʉʉnchɨ', 'Kʉvɨɨrɨ', 'Kʉsaatʉ', 'Kwiinyi', 'Kʉsaano', 'Kʉsasatʉ'], 'months_short' => ['Fúngatɨ', 'Naanɨ', 'Keenda', 'Ikúmi', 'Inyambala', 'Idwaata', 'Mʉʉnchɨ', 'Vɨɨrɨ', 'Saatʉ', 'Inyi', 'Saano', 'Sasatʉ'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/lb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - dan-nl * - Simon Lelorrain (slelorrain) */ use Carbon\CarbonInterface; return [ 'year' => ':count Joer', 'y' => ':countJ', 'month' => ':count Mount|:count Méint', 'm' => ':countMo', 'week' => ':count Woch|:count Wochen', 'w' => ':countWo|:countWo', 'day' => ':count Dag|:count Deeg', 'd' => ':countD', 'hour' => ':count Stonn|:count Stonnen', 'h' => ':countSto', 'minute' => ':count Minutt|:count Minutten', 'min' => ':countM', 'second' => ':count Sekonn|:count Sekonnen', 's' => ':countSek', 'ago' => 'virun :time', 'from_now' => 'an :time', 'before' => ':time virdrun', 'after' => ':time duerno', 'diff_today' => 'Haut', 'diff_yesterday' => 'Gëschter', 'diff_yesterday_regexp' => 'Gëschter(?:\\s+um)?', 'diff_tomorrow' => 'Muer', 'diff_tomorrow_regexp' => 'Muer(?:\\s+um)?', 'diff_today_regexp' => 'Haut(?:\\s+um)?', 'formats' => [ 'LT' => 'H:mm [Auer]', 'LTS' => 'H:mm:ss [Auer]', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY H:mm [Auer]', 'LLLL' => 'dddd, D. MMMM YYYY H:mm [Auer]', ], 'calendar' => [ 'sameDay' => '[Haut um] LT', 'nextDay' => '[Muer um] LT', 'nextWeek' => 'dddd [um] LT', 'lastDay' => '[Gëschter um] LT', 'lastWeek' => static function (CarbonInterface $date) { // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule return match ($date->dayOfWeek) { 2, 4 => '[Leschten] dddd [um] LT', default => '[Leschte] dddd [um] LT', }; }, 'sameElse' => 'L', ], 'months' => ['Januar', 'Februar', 'Mäerz', 'Abrëll', 'Mee', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 'months_short' => ['Jan.', 'Febr.', 'Mrz.', 'Abr.', 'Mee', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], 'weekdays' => ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'], 'weekdays_short' => ['So.', 'Mé.', 'Dë.', 'Më.', 'Do.', 'Fr.', 'Sa.'], 'weekdays_min' => ['So', 'Mé', 'Dë', 'Më', 'Do', 'Fr', 'Sa'], 'ordinal' => ':number.', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' an '], 'meridiem' => ['moies', 'mëttes'], 'weekdays_short_standalone' => ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'], 'months_short_standalone' => ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], ]; ================================================ FILE: src/Carbon/Lang/lb_LU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/lb.php'; ================================================ FILE: src/Carbon/Lang/lg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/lg_UG.php'; ================================================ FILE: src/Carbon/Lang/lg_UG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Akademe ya Luganda Kizito Birabwa kompyuta@kizito.uklinux.net */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'], 'weekdays' => ['Sabiiti', 'Balaza', 'Lwakubiri', 'Lwakusatu', 'Lwakuna', 'Lwakutaano', 'Lwamukaaga'], 'weekdays_short' => ['Sab', 'Bal', 'Lw2', 'Lw3', 'Lw4', 'Lw5', 'Lw6'], 'weekdays_min' => ['Sab', 'Bal', 'Lw2', 'Lw3', 'Lw4', 'Lw5', 'Lw6'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'month' => ':count njuba', // less reliable 'm' => ':count njuba', // less reliable 'a_month' => ':count njuba', // less reliable 'year' => ':count mwaaka', 'y' => ':count mwaaka', 'a_year' => ':count mwaaka', 'week' => ':count sabbiiti', 'w' => ':count sabbiiti', 'a_week' => ':count sabbiiti', 'day' => ':count lunaku', 'd' => ':count lunaku', 'a_day' => ':count lunaku', 'hour' => 'saawa :count', 'h' => 'saawa :count', 'a_hour' => 'saawa :count', 'minute' => 'ddakiika :count', 'min' => 'ddakiika :count', 'a_minute' => 'ddakiika :count', 'second' => ':count kyʼokubiri', 's' => ':count kyʼokubiri', 'a_second' => ':count kyʼokubiri', ]); ================================================ FILE: src/Carbon/Lang/li.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/li_NL.php'; ================================================ FILE: src/Carbon/Lang/li_NL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['jannewarie', 'fibberwarie', 'miert', 'eprèl', 'meij', 'junie', 'julie', 'augustus', 'september', 'oktober', 'november', 'desember'], 'months_short' => ['jan', 'fib', 'mie', 'epr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], 'weekdays' => ['zóndig', 'maondig', 'daensdig', 'goonsdig', 'dónderdig', 'vriedig', 'zaoterdig'], 'weekdays_short' => ['zón', 'mao', 'dae', 'goo', 'dón', 'vri', 'zao'], 'weekdays_min' => ['zón', 'mao', 'dae', 'goo', 'dón', 'vri', 'zao'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'minute' => ':count momênt', // less reliable 'min' => ':count momênt', // less reliable 'a_minute' => ':count momênt', // less reliable 'year' => ':count jaor', 'y' => ':count jaor', 'a_year' => ':count jaor', 'month' => ':count maond', 'm' => ':count maond', 'a_month' => ':count maond', 'week' => ':count waek', 'w' => ':count waek', 'a_week' => ':count waek', 'day' => ':count daag', 'd' => ':count daag', 'a_day' => ':count daag', 'hour' => ':count oer', 'h' => ':count oer', 'a_hour' => ':count oer', 'second' => ':count Secónd', 's' => ':count Secónd', 'a_second' => ':count Secónd', ]); ================================================ FILE: src/Carbon/Lang/lij.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/lij_IT.php'; ================================================ FILE: src/Carbon/Lang/lij_IT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Gastaldi alessio.gastaldi@libero.it */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['zenâ', 'fevrâ', 'marzo', 'avrî', 'mazzo', 'zûgno', 'lûggio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dixembre'], 'months_short' => ['zen', 'fev', 'mar', 'arv', 'maz', 'zûg', 'lûg', 'ago', 'set', 'ött', 'nov', 'dix'], 'weekdays' => ['domenega', 'lûnedì', 'martedì', 'mercUrdì', 'zêggia', 'venardì', 'sabbo'], 'weekdays_short' => ['dom', 'lûn', 'mar', 'mer', 'zêu', 'ven', 'sab'], 'weekdays_min' => ['dom', 'lûn', 'mar', 'mer', 'zêu', 'ven', 'sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count etæ', // less reliable 'y' => ':count etæ', // less reliable 'a_year' => ':count etæ', // less reliable 'month' => ':count meize', 'm' => ':count meize', 'a_month' => ':count meize', 'week' => ':count settemannha', 'w' => ':count settemannha', 'a_week' => ':count settemannha', 'day' => ':count giorno', 'd' => ':count giorno', 'a_day' => ':count giorno', 'hour' => ':count reléuio', // less reliable 'h' => ':count reléuio', // less reliable 'a_hour' => ':count reléuio', // less reliable 'minute' => ':count menûo', 'min' => ':count menûo', 'a_minute' => ':count menûo', 'second' => ':count segondo', 's' => ':count segondo', 'a_second' => ':count segondo', ]); ================================================ FILE: src/Carbon/Lang/lkt.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'month' => ':count haŋwí', // less reliable 'm' => ':count haŋwí', // less reliable 'a_month' => ':count haŋwí', // less reliable 'week' => ':count šakówiŋ', // less reliable 'w' => ':count šakówiŋ', // less reliable 'a_week' => ':count šakówiŋ', // less reliable 'hour' => ':count maza škaŋškaŋ', // less reliable 'h' => ':count maza škaŋškaŋ', // less reliable 'a_hour' => ':count maza škaŋškaŋ', // less reliable 'minute' => ':count číkʼala', // less reliable 'min' => ':count číkʼala', // less reliable 'a_minute' => ':count číkʼala', // less reliable 'year' => ':count waníyetu', 'y' => ':count waníyetu', 'a_year' => ':count waníyetu', 'day' => ':count aŋpétu', 'd' => ':count aŋpétu', 'a_day' => ':count aŋpétu', 'second' => ':count icinuŋpa', 's' => ':count icinuŋpa', 'a_second' => ':count icinuŋpa', ]); ================================================ FILE: src/Carbon/Lang/ln.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ubuntu René Manassé GALEKWA renemanasse@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'months' => ['sánzá ya yambo', 'sánzá ya míbalé', 'sánzá ya mísáto', 'sánzá ya mínei', 'sánzá ya mítáno', 'sánzá ya motóbá', 'sánzá ya nsambo', 'sánzá ya mwambe', 'sánzá ya libwa', 'sánzá ya zómi', 'sánzá ya zómi na mɔ̌kɔ́', 'sánzá ya zómi na míbalé'], 'months_short' => ['yan', 'fbl', 'msi', 'apl', 'mai', 'yun', 'yul', 'agt', 'stb', 'ɔtb', 'nvb', 'dsb'], 'weekdays' => ['Lomíngo', 'Mosálá mɔ̌kɔ́', 'Misálá míbalé', 'Misálá mísáto', 'Misálá mínei', 'Misálá mítáno', 'Mpɔ́sɔ'], 'weekdays_short' => ['m1.', 'm2.', 'm3.', 'm4.', 'm5.', 'm6.', 'm7.'], 'weekdays_min' => ['m1.', 'm2.', 'm3.', 'm4.', 'm5.', 'm6.', 'm7.'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => 'mbula :count', 'y' => 'mbula :count', 'a_year' => 'mbula :count', 'month' => 'sánzá :count', 'm' => 'sánzá :count', 'a_month' => 'sánzá :count', 'week' => 'mpɔ́sɔ :count', 'w' => 'mpɔ́sɔ :count', 'a_week' => 'mpɔ́sɔ :count', 'day' => 'mokɔlɔ :count', 'd' => 'mokɔlɔ :count', 'a_day' => 'mokɔlɔ :count', 'hour' => 'ngonga :count', 'h' => 'ngonga :count', 'a_hour' => 'ngonga :count', 'minute' => 'miniti :count', 'min' => 'miniti :count', 'a_minute' => 'miniti :count', 'second' => 'segɔnde :count', 's' => 'segɔnde :count', 'a_second' => 'segɔnde :count', ]); ================================================ FILE: src/Carbon/Lang/ln_AO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], ]); ================================================ FILE: src/Carbon/Lang/ln_CD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ubuntu René Manassé GALEKWA renemanasse@gmail.com */ return require __DIR__.'/ln.php'; ================================================ FILE: src/Carbon/Lang/ln_CF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], ]); ================================================ FILE: src/Carbon/Lang/ln_CG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], ]); ================================================ FILE: src/Carbon/Lang/lo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - ryanhart2 */ return [ 'year' => ':count ປີ', 'y' => ':count ປີ', 'month' => ':count ເດືອນ', 'm' => ':count ດ. ', 'week' => ':count ອາທິດ', 'w' => ':count ອທ. ', 'day' => ':count ມື້', 'd' => ':count ມື້', 'hour' => ':count ຊົ່ວໂມງ', 'h' => ':count ຊມ. ', 'minute' => ':count ນາທີ', 'min' => ':count ນທ. ', 'second' => ':count ວິນາທີ', 'a_second' => '{0,1}ບໍ່ເທົ່າໃດວິນາທີ|[-Inf,Inf]:count ວິນາທີ', 's' => ':count ວິ. ', 'ago' => ':timeຜ່ານມາ', 'from_now' => 'ອີກ :time', 'diff_now' => 'ຕອນນີ້', 'diff_today' => 'ມື້ນີ້ເວລາ', 'diff_yesterday' => 'ມື້ວານນີ້ເວລາ', 'diff_tomorrow' => 'ມື້ອື່ນເວລາ', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'ວັນdddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[ມື້ນີ້ເວລາ] LT', 'nextDay' => '[ມື້ອື່ນເວລາ] LT', 'nextWeek' => '[ວັນ]dddd[ໜ້າເວລາ] LT', 'lastDay' => '[ມື້ວານນີ້ເວລາ] LT', 'lastWeek' => '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', 'sameElse' => 'L', ], 'ordinal' => 'ທີ່:number', 'meridiem' => ['ຕອນເຊົ້າ', 'ຕອນແລງ'], 'months' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'], 'months_short' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'], 'weekdays' => ['ອາທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'], 'weekdays_short' => ['ທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'], 'weekdays_min' => ['ທ', 'ຈ', 'ອຄ', 'ພ', 'ພຫ', 'ສກ', 'ສ'], 'list' => [', ', 'ແລະ '], ]; ================================================ FILE: src/Carbon/Lang/lo_LA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/lo.php'; ================================================ FILE: src/Carbon/Lang/lrc.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'minute' => ':count هنر', // less reliable 'min' => ':count هنر', // less reliable 'a_minute' => ':count هنر', // less reliable ]); ================================================ FILE: src/Carbon/Lang/lrc_IQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/lrc.php'; ================================================ FILE: src/Carbon/Lang/lt.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - tjku * - valdas406 * - Justas Palumickas * - Max Melentiev * - Andrius Janauskas * - Juanito Fatas * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Nicolás Hock Isaza * - Laurynas Butkus * - Sven Fuchs * - Dominykas Tijūnaitis * - Justinas Bolys * - Ričardas * - Kirill Chalkin * - Rolandas * - Justinas (Gamesh) * - Sam Axe */ return [ 'year' => ':count metai|:count metai|:count metų', 'y' => ':count m.', 'month' => ':count mėnuo|:count mėnesiai|:count mėnesį', 'm' => ':count mėn.', 'week' => ':count savaitė|:count savaitės|:count savaitę', 'w' => ':count sav.', 'day' => ':count diena|:count dienos|:count dienų', 'd' => ':count d.', 'hour' => ':count valanda|:count valandos|:count valandų', 'h' => ':count val.', 'minute' => ':count minutė|:count minutės|:count minutę', 'min' => ':count min.', 'second' => ':count sekundė|:count sekundės|:count sekundžių', 's' => ':count sek.', 'year_ago' => ':count metus|:count metus|:count metų', 'month_ago' => ':count mėnesį|:count mėnesius|:count mėnesių', 'week_ago' => ':count savaitę|:count savaites|:count savaičių', 'day_ago' => ':count dieną|:count dienas|:count dienų', 'hour_ago' => ':count valandą|:count valandas|:count valandų', 'minute_ago' => ':count minutę|:count minutes|:count minučių', 'second_ago' => ':count sekundę|:count sekundes|:count sekundžių', 'year_from_now' => ':count metai|:count metai|:count metų', 'month_from_now' => ':count mėnuo|:count mėnesiai|:count mėnesių', 'week_from_now' => ':count savaitė|:count savaitės|:count savaičių', 'day_from_now' => ':count diena|:count dienos|:count dienų', 'hour_from_now' => ':count valanda|:count valandos|:count valandų', 'minute_from_now' => ':count minutė|:count minutės|:count minučių', 'second_from_now' => ':count sekundė|:count sekundės|:count sekundžių', 'year_after' => ':count metai|:count metai|:count metų', 'month_after' => ':count mėnuo|:count mėnesiai|:count mėnesių', 'week_after' => ':count savaitė|:count savaitės|:count savaičių', 'day_after' => ':count diena|:count dienos|:count dienų', 'hour_after' => ':count valanda|:count valandos|:count valandų', 'minute_after' => ':count minutė|:count minutės|:count minučių', 'second_after' => ':count sekundė|:count sekundės|:count sekundžių', 'year_before' => ':count metų', 'month_before' => ':count mėnesio|:count mėnesių|:count mėnesių', 'week_before' => ':count savaitės|:count savaičių|:count savaičių', 'day_before' => ':count dienos|:count dienų|:count dienų', 'hour_before' => ':count valandos|:count valandų|:count valandų', 'minute_before' => ':count minutės|:count minučių|:count minučių', 'second_before' => ':count sekundės|:count sekundžių|:count sekundžių', 'ago' => 'prieš :time', 'from_now' => ':time nuo dabar', 'after' => 'po :time', 'before' => 'už :time', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'diff_now' => 'ką tik', 'diff_today' => 'Šiandien', 'diff_yesterday' => 'vakar', 'diff_yesterday_regexp' => 'Vakar', 'diff_tomorrow' => 'rytoj', 'diff_tomorrow_regexp' => 'Rytoj', 'diff_before_yesterday' => 'užvakar', 'diff_after_tomorrow' => 'poryt', 'period_recurrences' => 'kartą|:count kartų', 'period_interval' => 'kiekvieną :interval', 'period_start_date' => 'nuo :date', 'period_end_date' => 'iki :date', 'months' => ['sausio', 'vasario', 'kovo', 'balandžio', 'gegužės', 'birželio', 'liepos', 'rugpjūčio', 'rugsėjo', 'spalio', 'lapkričio', 'gruodžio'], 'months_standalone' => ['sausis', 'vasaris', 'kovas', 'balandis', 'gegužė', 'birželis', 'liepa', 'rugpjūtis', 'rugsėjis', 'spalis', 'lapkritis', 'gruodis'], 'months_regexp' => '/(L{2,4}|D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?)/', 'months_short' => ['sau', 'vas', 'kov', 'bal', 'geg', 'bir', 'lie', 'rgp', 'rgs', 'spa', 'lap', 'gru'], 'weekdays' => ['sekmadienį', 'pirmadienį', 'antradienį', 'trečiadienį', 'ketvirtadienį', 'penktadienį', 'šeštadienį'], 'weekdays_standalone' => ['sekmadienis', 'pirmadienis', 'antradienis', 'trečiadienis', 'ketvirtadienis', 'penktadienis', 'šeštadienis'], 'weekdays_short' => ['sek', 'pir', 'ant', 'tre', 'ket', 'pen', 'šeš'], 'weekdays_min' => ['se', 'pi', 'an', 'tr', 'ke', 'pe', 'še'], 'list' => [', ', ' ir '], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'MMMM DD, YYYY', 'LLL' => 'DD MMM HH:mm', 'LLLL' => 'MMMM DD, YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Šiandien] LT', 'nextDay' => '[Rytoj] LT', 'nextWeek' => 'dddd LT', 'lastDay' => '[Vakar] LT', 'lastWeek' => '[Paskutinį] dddd LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { return match ($number) { 0 => '0-is', 3 => '3-ias', default => "$number-as", }; }, 'meridiem' => ['priešpiet', 'popiet'], ]; ================================================ FILE: src/Carbon/Lang/lt_LT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/lt.php'; ================================================ FILE: src/Carbon/Lang/lu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Dinda', 'Dilolo'], 'weekdays' => ['Lumingu', 'Nkodya', 'Ndàayà', 'Ndangù', 'Njòwa', 'Ngòvya', 'Lubingu'], 'weekdays_short' => ['Lum', 'Nko', 'Ndy', 'Ndg', 'Njw', 'Ngv', 'Lub'], 'weekdays_min' => ['Lum', 'Nko', 'Ndy', 'Ndg', 'Njw', 'Ngv', 'Lub'], 'months' => ['Ciongo', 'Lùishi', 'Lusòlo', 'Mùuyà', 'Lumùngùlù', 'Lufuimi', 'Kabàlàshìpù', 'Lùshìkà', 'Lutongolo', 'Lungùdi', 'Kaswèkèsè', 'Ciswà'], 'months_short' => ['Cio', 'Lui', 'Lus', 'Muu', 'Lum', 'Luf', 'Kab', 'Lush', 'Lut', 'Lun', 'Kas', 'Cis'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/luo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['OD', 'OT'], 'weekdays' => ['Jumapil', 'Wuok Tich', 'Tich Ariyo', 'Tich Adek', 'Tich Ang’wen', 'Tich Abich', 'Ngeso'], 'weekdays_short' => ['JMP', 'WUT', 'TAR', 'TAD', 'TAN', 'TAB', 'NGS'], 'weekdays_min' => ['JMP', 'WUT', 'TAR', 'TAD', 'TAN', 'TAB', 'NGS'], 'months' => ['Dwe mar Achiel', 'Dwe mar Ariyo', 'Dwe mar Adek', 'Dwe mar Ang’wen', 'Dwe mar Abich', 'Dwe mar Auchiel', 'Dwe mar Abiriyo', 'Dwe mar Aboro', 'Dwe mar Ochiko', 'Dwe mar Apar', 'Dwe mar gi achiel', 'Dwe mar Apar gi ariyo'], 'months_short' => ['DAC', 'DAR', 'DAD', 'DAN', 'DAH', 'DAU', 'DAO', 'DAB', 'DOC', 'DAP', 'DGI', 'DAG'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'year' => 'higni :count', 'y' => 'higni :count', 'a_year' => ':higni :count', 'month' => 'dweche :count', 'm' => 'dweche :count', 'a_month' => 'dweche :count', 'week' => 'jumbe :count', 'w' => 'jumbe :count', 'a_week' => 'jumbe :count', 'day' => 'ndalo :count', 'd' => 'ndalo :count', 'a_day' => 'ndalo :count', 'hour' => 'seche :count', 'h' => 'seche :count', 'a_hour' => 'seche :count', 'minute' => 'dakika :count', 'min' => 'dakika :count', 'a_minute' => 'dakika :count', 'second' => 'nus dakika :count', 's' => 'nus dakika :count', 'a_second' => 'nus dakika :count', ]); ================================================ FILE: src/Carbon/Lang/luy.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'weekdays' => ['Jumapiri', 'Jumatatu', 'Jumanne', 'Jumatano', 'Murwa wa Kanne', 'Murwa wa Katano', 'Jumamosi'], 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], // Too unreliable /* 'year' => ':count liliino', // less reliable 'y' => ':count liliino', // less reliable 'a_year' => ':count liliino', // less reliable 'month' => ':count kumwesi', // less reliable 'm' => ':count kumwesi', // less reliable 'a_month' => ':count kumwesi', // less reliable 'week' => ':count olutambi', // less reliable 'w' => ':count olutambi', // less reliable 'a_week' => ':count olutambi', // less reliable 'day' => ':count luno', // less reliable 'd' => ':count luno', // less reliable 'a_day' => ':count luno', // less reliable 'hour' => ':count ekengele', // less reliable 'h' => ':count ekengele', // less reliable 'a_hour' => ':count ekengele', // less reliable 'minute' => ':count omundu', // less reliable 'min' => ':count omundu', // less reliable 'a_minute' => ':count omundu', // less reliable 'second' => ':count liliino', // less reliable 's' => ':count liliino', // less reliable 'a_second' => ':count liliino', // less reliable */ ]); ================================================ FILE: src/Carbon/Lang/lv.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonInterface; /** * This file is part of the Carbon package. * * (c) Brian Nesbitt * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - pirminis * - Tsutomu Kuroda * - tjku * - Andris Zāģeris * - Max Melentiev * - Edgars Beigarts * - Juanito Fatas * - Vitauts Stočka * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Kaspars Bankovskis * - Nicolás Hock Isaza * - Viesturs Kavacs (Kavacky) * - zakse * - Janis Eglitis (janiseglitis) * - Guntars * - Juris Sudmalis */ $daysOfWeek = ['svētdiena', 'pirmdiena', 'otrdiena', 'trešdiena', 'ceturtdiena', 'piektdiena', 'sestdiena']; $daysOfWeekLocativum = ['svētdien', 'pirmdien', 'otrdien', 'trešdien', 'ceturtdien', 'piektdien', 'sestdien']; $transformDiff = static fn (string $input) => strtr($input, [ // Nominative => "pirms/pēc" Dative 'gads' => 'gada', 'gadi' => 'gadiem', 'gadu' => 'gadiem', 'mēnesis' => 'mēneša', 'mēneši' => 'mēnešiem', 'mēnešu' => 'mēnešiem', 'nedēļa' => 'nedēļas', 'nedēļas' => 'nedēļām', 'nedēļu' => 'nedēļām', 'diena' => 'dienas', 'dienas' => 'dienām', 'dienu' => 'dienām', 'stunda' => 'stundas', 'stundas' => 'stundām', 'stundu' => 'stundām', 'minūte' => 'minūtes', 'minūtes' => 'minūtēm', 'minūšu' => 'minūtēm', 'sekunde' => 'sekundes', 'sekundes' => 'sekundēm', 'sekunžu' => 'sekundēm', ]); return [ 'ago' => static fn (string $time) => 'pirms '.$transformDiff($time), 'from_now' => static fn (string $time) => 'pēc '.$transformDiff($time), 'year' => '0 gadu|:count gads|:count gadi', 'y' => ':count g.', 'a_year' => '{1}gads|0 gadu|:count gads|:count gadi', 'month' => '0 mēnešu|:count mēnesis|:count mēneši', 'm' => ':count mēn.', 'a_month' => '{1}mēnesis|0 mēnešu|:count mēnesis|:count mēneši', 'week' => '0 nedēļu|:count nedēļa|:count nedēļas', 'w' => ':count ned.', 'a_week' => '{1}nedēļa|0 nedēļu|:count nedēļa|:count nedēļas', 'day' => '0 dienu|:count diena|:count dienas', 'd' => ':count d.', 'a_day' => '{1}diena|0 dienu|:count diena|:count dienas', 'hour' => '0 stundu|:count stunda|:count stundas', 'h' => ':count st.', 'a_hour' => '{1}stunda|0 stundu|:count stunda|:count stundas', 'minute' => '0 minūšu|:count minūte|:count minūtes', 'min' => ':count min.', 'a_minute' => '{1}minūte|0 minūšu|:count minūte|:count minūtes', 'second' => '0 sekunžu|:count sekunde|:count sekundes', 's' => ':count sek.', 'a_second' => '{1}sekunde|0 sekunžu|:count sekunde|:count sekundes', 'after' => ':time vēlāk', 'year_after' => '0 gadus|:count gadu|:count gadus', 'a_year_after' => '{1}gadu|0 gadus|:count gadu|:count gadus', 'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', 'a_month_after' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', 'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', 'a_week_after' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', 'day_after' => '0 dienas|:count dienu|:count dienas', 'a_day_after' => '{1}dienu|0 dienas|:count dienu|:count dienas', 'hour_after' => '0 stundas|:count stundu|:count stundas', 'a_hour_after' => '{1}stundu|0 stundas|:count stundu|:count stundas', 'minute_after' => '0 minūtes|:count minūti|:count minūtes', 'a_minute_after' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', 'second_after' => '0 sekundes|:count sekundi|:count sekundes', 'a_second_after' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', 'before' => ':time agrāk', 'year_before' => '0 gadus|:count gadu|:count gadus', 'a_year_before' => '{1}gadu|0 gadus|:count gadu|:count gadus', 'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', 'a_month_before' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', 'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', 'a_week_before' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', 'day_before' => '0 dienas|:count dienu|:count dienas', 'a_day_before' => '{1}dienu|0 dienas|:count dienu|:count dienas', 'hour_before' => '0 stundas|:count stundu|:count stundas', 'a_hour_before' => '{1}stundu|0 stundas|:count stundu|:count stundas', 'minute_before' => '0 minūtes|:count minūti|:count minūtes', 'a_minute_before' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', 'second_before' => '0 sekundes|:count sekundi|:count sekundes', 'a_second_before' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' un '], 'diff_now' => 'tagad', 'diff_today' => 'šodien', 'diff_yesterday' => 'vakar', 'diff_before_yesterday' => 'aizvakar', 'diff_tomorrow' => 'rīt', 'diff_after_tomorrow' => 'parīt', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY.', 'LL' => 'YYYY. [gada] D. MMMM', 'LLL' => 'DD.MM.YYYY., HH:mm', 'LLLL' => 'YYYY. [gada] D. MMMM, HH:mm', ], 'calendar' => [ 'sameDay' => '[šodien] [plkst.] LT', 'nextDay' => '[rīt] [plkst.] LT', 'nextWeek' => static function (CarbonInterface $current, CarbonInterface $other) use ($daysOfWeekLocativum) { if ($current->week !== $other->week) { return '[nākošo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; } return '['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; }, 'lastDay' => '[vakar] [plkst.] LT', 'lastWeek' => static function (CarbonInterface $current) use ($daysOfWeekLocativum) { return '[pagājušo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; }, 'sameElse' => 'L', ], 'weekdays' => $daysOfWeek, 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'months' => ['janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris'], 'months_standalone' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], ]; ================================================ FILE: src/Carbon/Lang/lv_LV.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/lv.php'; ================================================ FILE: src/Carbon/Lang/lzh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/lzh_TW.php'; ================================================ FILE: src/Carbon/Lang/lzh_TW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'OY[年]MMMMOD[日]', ], 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => [' 一 ', ' 二 ', ' 三 ', ' 四 ', ' 五 ', ' 六 ', ' 七 ', ' 八 ', ' 九 ', ' 十 ', '十一', '十二'], 'weekdays' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '廿', '廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '卅', '卅一'], 'meridiem' => ['朝', '暮'], 'year' => ':count 夏', // less reliable 'y' => ':count 夏', // less reliable 'a_year' => ':count 夏', // less reliable 'month' => ':count 月', // less reliable 'm' => ':count 月', // less reliable 'a_month' => ':count 月', // less reliable 'hour' => ':count 氧', // less reliable 'h' => ':count 氧', // less reliable 'a_hour' => ':count 氧', // less reliable 'minute' => ':count 點', // less reliable 'min' => ':count 點', // less reliable 'a_minute' => ':count 點', // less reliable 'second' => ':count 楚', // less reliable 's' => ':count 楚', // less reliable 'a_second' => ':count 楚', // less reliable 'week' => ':count 星期', 'w' => ':count 星期', 'a_week' => ':count 星期', 'day' => ':count 日(曆法)', 'd' => ':count 日(曆法)', 'a_day' => ':count 日(曆法)', ]); ================================================ FILE: src/Carbon/Lang/mag.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mag_IN.php'; ================================================ FILE: src/Carbon/Lang/mag_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bhashaghar@googlegroups.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'weekdays' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], 'weekdays_short' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], 'weekdays_min' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], ]); ================================================ FILE: src/Carbon/Lang/mai.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mai_IN.php'; ================================================ FILE: src/Carbon/Lang/mai_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Maithili Computing Research Center, Pune, India rajeshkajha@yahoo.com,akhilesh.k@samusng.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['बैसाख', 'जेठ', 'अषाढ़', 'सावोन', 'भादो', 'आसिन', 'कातिक', 'अगहन', 'पूस', 'माघ', 'फागुन', 'चैति'], 'months_short' => ['बैसाख', 'जेठ', 'अषाढ़', 'सावोन', 'भादो', 'आसिन', 'कातिक', 'अगहन', 'पूस', 'माघ', 'फागुन', 'चैति'], 'weekdays' => ['रविदिन', 'सोमदिन', 'मंगलदिन', 'बुधदिन', 'बृहस्पतीदिन', 'शुक्रदिन', 'शनीदिन'], 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पती', 'शुक्र', 'शनी'], 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पती', 'शुक्र', 'शनी'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], 'year' => ':count ऋतु', // less reliable 'y' => ':count ऋतु', // less reliable 'a_year' => ':count ऋतु', // less reliable 'month' => ':count महिना', 'm' => ':count महिना', 'a_month' => ':count महिना', 'week' => ':count श्रेणी:क्यालेन्डर', // less reliable 'w' => ':count श्रेणी:क्यालेन्डर', // less reliable 'a_week' => ':count श्रेणी:क्यालेन्डर', // less reliable 'day' => ':count दिन', 'd' => ':count दिन', 'a_day' => ':count दिन', 'hour' => ':count घण्टा', 'h' => ':count घण्टा', 'a_hour' => ':count घण्टा', 'minute' => ':count समय', // less reliable 'min' => ':count समय', // less reliable 'a_minute' => ':count समय', // less reliable ]); ================================================ FILE: src/Carbon/Lang/mas.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['Ɛnkakɛnyá', 'Ɛndámâ'], 'weekdays' => ['Jumapílí', 'Jumatátu', 'Jumane', 'Jumatánɔ', 'Alaámisi', 'Jumáa', 'Jumamósi'], 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'months' => ['Oladalʉ́', 'Arát', 'Ɔɛnɨ́ɔɨŋɔk', 'Olodoyíóríê inkókúâ', 'Oloilépūnyīē inkókúâ', 'Kújúɔrɔk', 'Mórusásin', 'Ɔlɔ́ɨ́bɔ́rárɛ', 'Kúshîn', 'Olgísan', 'Pʉshʉ́ka', 'Ntʉ́ŋʉ́s'], 'months_short' => ['Dal', 'Ará', 'Ɔɛn', 'Doy', 'Lép', 'Rok', 'Sás', 'Bɔ́r', 'Kús', 'Gís', 'Shʉ́', 'Ntʉ́'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'year' => ':count olameyu', // less reliable 'y' => ':count olameyu', // less reliable 'a_year' => ':count olameyu', // less reliable 'week' => ':count engolongeare orwiki', // less reliable 'w' => ':count engolongeare orwiki', // less reliable 'a_week' => ':count engolongeare orwiki', // less reliable 'hour' => ':count esahabu', // less reliable 'h' => ':count esahabu', // less reliable 'a_hour' => ':count esahabu', // less reliable 'second' => ':count are', // less reliable 's' => ':count are', // less reliable 'a_second' => ':count are', // less reliable 'month' => ':count olapa', 'm' => ':count olapa', 'a_month' => ':count olapa', 'day' => ':count enkolongʼ', 'd' => ':count enkolongʼ', 'a_day' => ':count enkolongʼ', ]); ================================================ FILE: src/Carbon/Lang/mas_TZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/mas.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/mer.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['RŨ', 'ŨG'], 'weekdays' => ['Kiumia', 'Muramuko', 'Wairi', 'Wethatu', 'Wena', 'Wetano', 'Jumamosi'], 'weekdays_short' => ['KIU', 'MRA', 'WAI', 'WET', 'WEN', 'WTN', 'JUM'], 'weekdays_min' => ['KIU', 'MRA', 'WAI', 'WET', 'WEN', 'WTN', 'JUM'], 'months' => ['Januarĩ', 'Feburuarĩ', 'Machi', 'Ĩpurũ', 'Mĩĩ', 'Njuni', 'Njuraĩ', 'Agasti', 'Septemba', 'Oktũba', 'Novemba', 'Dicemba'], 'months_short' => ['JAN', 'FEB', 'MAC', 'ĨPU', 'MĨĨ', 'NJU', 'NJR', 'AGA', 'SPT', 'OKT', 'NOV', 'DEC'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'year' => ':count murume', // less reliable 'y' => ':count murume', // less reliable 'a_year' => ':count murume', // less reliable 'month' => ':count muchaara', // less reliable 'm' => ':count muchaara', // less reliable 'a_month' => ':count muchaara', // less reliable 'minute' => ':count monto', // less reliable 'min' => ':count monto', // less reliable 'a_minute' => ':count monto', // less reliable 'second' => ':count gikeno', // less reliable 's' => ':count gikeno', // less reliable 'a_second' => ':count gikeno', // less reliable ]); ================================================ FILE: src/Carbon/Lang/mfe.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mfe_MU.php'; ================================================ FILE: src/Carbon/Lang/mfe_MU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['zanvie', 'fevriye', 'mars', 'avril', 'me', 'zin', 'zilye', 'out', 'septam', 'oktob', 'novam', 'desam'], 'months_short' => ['zan', 'fev', 'mar', 'avr', 'me', 'zin', 'zil', 'out', 'sep', 'okt', 'nov', 'des'], 'weekdays' => ['dimans', 'lindi', 'mardi', 'merkredi', 'zedi', 'vandredi', 'samdi'], 'weekdays_short' => ['dim', 'lin', 'mar', 'mer', 'ze', 'van', 'sam'], 'weekdays_min' => ['dim', 'lin', 'mar', 'mer', 'ze', 'van', 'sam'], 'year' => ':count banané', 'y' => ':count banané', 'a_year' => ':count banané', 'month' => ':count mwa', 'm' => ':count mwa', 'a_month' => ':count mwa', 'week' => ':count sémenn', 'w' => ':count sémenn', 'a_week' => ':count sémenn', 'day' => ':count zour', 'd' => ':count zour', 'a_day' => ':count zour', 'hour' => ':count -er-tan', 'h' => ':count -er-tan', 'a_hour' => ':count -er-tan', 'minute' => ':count minitt', 'min' => ':count minitt', 'a_minute' => ':count minitt', 'second' => ':count déziém', 's' => ':count déziém', 'a_second' => ':count déziém', ]); ================================================ FILE: src/Carbon/Lang/mg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mg_MG.php'; ================================================ FILE: src/Carbon/Lang/mg_MG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - The Debian Project modified by GNU//Linux Malagasy Rado Ramarotafika,Do-Risika RAFIEFERANTSIARONJY rado@linuxmg.org,dourix@free.fr */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Janoary', 'Febroary', 'Martsa', 'Aprily', 'Mey', 'Jona', 'Jolay', 'Aogositra', 'Septambra', 'Oktobra', 'Novambra', 'Desambra'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mey', 'Jon', 'Jol', 'Aog', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['alahady', 'alatsinainy', 'talata', 'alarobia', 'alakamisy', 'zoma', 'sabotsy'], 'weekdays_short' => ['lhd', 'lts', 'tlt', 'lrb', 'lkm', 'zom', 'sab'], 'weekdays_min' => ['lhd', 'lts', 'tlt', 'lrb', 'lkm', 'zom', 'sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'minute' => ':count minitra', // less reliable 'min' => ':count minitra', // less reliable 'a_minute' => ':count minitra', // less reliable 'year' => ':count taona', 'y' => ':count taona', 'a_year' => ':count taona', 'month' => ':count volana', 'm' => ':count volana', 'a_month' => ':count volana', 'week' => ':count herinandro', 'w' => ':count herinandro', 'a_week' => ':count herinandro', 'day' => ':count andro', 'd' => ':count andro', 'a_day' => ':count andro', 'hour' => ':count ora', 'h' => ':count ora', 'a_hour' => ':count ora', 'second' => ':count segondra', 's' => ':count segondra', 'a_second' => ':count segondra', ]); ================================================ FILE: src/Carbon/Lang/mgh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['wichishu', 'mchochil’l'], 'weekdays' => ['Sabato', 'Jumatatu', 'Jumanne', 'Jumatano', 'Arahamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Sab', 'Jtt', 'Jnn', 'Jtn', 'Ara', 'Iju', 'Jmo'], 'weekdays_min' => ['Sab', 'Jtt', 'Jnn', 'Jtn', 'Ara', 'Iju', 'Jmo'], 'months' => ['Mweri wo kwanza', 'Mweri wo unayeli', 'Mweri wo uneraru', 'Mweri wo unecheshe', 'Mweri wo unethanu', 'Mweri wo thanu na mocha', 'Mweri wo saba', 'Mweri wo nane', 'Mweri wo tisa', 'Mweri wo kumi', 'Mweri wo kumi na moja', 'Mweri wo kumi na yel’li'], 'months_short' => ['Kwa', 'Una', 'Rar', 'Che', 'Tha', 'Moc', 'Sab', 'Nan', 'Tis', 'Kum', 'Moj', 'Yel'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/mgo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], 'weekdays_short' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], 'weekdays_min' => ['1', '2', '3', '4', '5', '6', '7'], 'months' => ['iməg mbegtug', 'imeg àbùbì', 'imeg mbəŋchubi', 'iməg ngwə̀t', 'iməg fog', 'iməg ichiibɔd', 'iməg àdùmbə̀ŋ', 'iməg ichika', 'iməg kud', 'iməg tèsiʼe', 'iməg zò', 'iməg krizmed'], 'months_short' => ['mbegtug', 'imeg àbùbì', 'imeg mbəŋchubi', 'iməg ngwə̀t', 'iməg fog', 'iməg ichiibɔd', 'iməg àdùmbə̀ŋ', 'iməg ichika', 'iməg kud', 'iməg tèsiʼe', 'iməg zò', 'iməg krizmed'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'dddd, YYYY MMMM DD HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/mhr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mhr_RU.php'; ================================================ FILE: src/Carbon/Lang/mhr_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - PeshSajSoft Ltd. Vyacheslav Kileev slavakileev@yandex.ru */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY.MM.DD', ], 'months' => ['Шорыкйол', 'Пургыж', 'Ӱярня', 'Вӱдшор', 'Ага', 'Пеледыш', 'Сӱрем', 'Сорла', 'Идым', 'Шыжа', 'Кылме', 'Теле'], 'months_short' => ['Шрк', 'Пгж', 'Ӱрн', 'Вшр', 'Ага', 'Пдш', 'Срм', 'Срл', 'Идм', 'Шыж', 'Клм', 'Тел'], 'weekdays' => ['Рушарня', 'Шочмо', 'Кушкыжмо', 'Вӱргече', 'Изарня', 'Кугарня', 'Шуматкече'], 'weekdays_short' => ['Ршр', 'Шчм', 'Кжм', 'Вгч', 'Изр', 'Кгр', 'Шмт'], 'weekdays_min' => ['Ршр', 'Шчм', 'Кжм', 'Вгч', 'Изр', 'Кгр', 'Шмт'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count идалык', 'y' => ':count идалык', 'a_year' => ':count идалык', 'month' => ':count Тылзе', 'm' => ':count Тылзе', 'a_month' => ':count Тылзе', 'week' => ':count арня', 'w' => ':count арня', 'a_week' => ':count арня', 'day' => ':count кече', 'd' => ':count кече', 'a_day' => ':count кече', 'hour' => ':count час', 'h' => ':count час', 'a_hour' => ':count час', 'minute' => ':count минут', 'min' => ':count минут', 'a_minute' => ':count минут', 'second' => ':count кокымшан', 's' => ':count кокымшан', 'a_second' => ':count кокымшан', ]); ================================================ FILE: src/Carbon/Lang/mi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - John Corrigan * - François B */ return [ 'year' => ':count tau', 'a_year' => '{1}he tau|:count tau', 'month' => ':count marama', 'a_month' => '{1}he marama|:count marama', 'week' => ':count wiki', 'a_week' => '{1}he wiki|:count wiki', 'day' => ':count ra', 'a_day' => '{1}he ra|:count ra', 'hour' => ':count haora', 'a_hour' => '{1}te haora|:count haora', 'minute' => ':count meneti', 'a_minute' => '{1}he meneti|:count meneti', 'second' => ':count hēkona', 'a_second' => '{1}te hēkona ruarua|:count hēkona', 'ago' => ':time i mua', 'from_now' => 'i roto i :time', 'diff_yesterday' => 'inanahi', 'diff_yesterday_regexp' => 'inanahi(?:\\s+i)?', 'diff_today' => 'i teie', 'diff_today_regexp' => 'i teie(?:\\s+mahana,)?(?:\\s+i)?', 'diff_tomorrow' => 'apopo', 'diff_tomorrow_regexp' => 'apopo(?:\\s+i)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY [i] HH:mm', 'LLLL' => 'dddd, D MMMM YYYY [i] HH:mm', ], 'calendar' => [ 'sameDay' => '[i teie mahana, i] LT', 'nextDay' => '[apopo i] LT', 'nextWeek' => 'dddd [i] LT', 'lastDay' => '[inanahi i] LT', 'lastWeek' => 'dddd [whakamutunga i] LT', 'sameElse' => 'L', ], 'ordinal' => ':numberº', 'months' => ['Kohi-tāte', 'Hui-tanguru', 'Poutū-te-rangi', 'Paenga-whāwhā', 'Haratua', 'Pipiri', 'Hōngoingoi', 'Here-turi-kōkā', 'Mahuru', 'Whiringa-ā-nuku', 'Whiringa-ā-rangi', 'Hakihea'], 'months_short' => ['Kohi', 'Hui', 'Pou', 'Pae', 'Hara', 'Pipi', 'Hōngoi', 'Here', 'Mahu', 'Whi-nu', 'Whi-ra', 'Haki'], 'weekdays' => ['Rātapu', 'Mane', 'Tūrei', 'Wenerei', 'Tāite', 'Paraire', 'Hātarei'], 'weekdays_short' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'], 'weekdays_min' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' me te '], ]; ================================================ FILE: src/Carbon/Lang/mi_NZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/mi.php'; ================================================ FILE: src/Carbon/Lang/miq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/miq_NI.php'; ================================================ FILE: src/Carbon/Lang/miq_NI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['siakwa kati', 'kuswa kati', 'kakamuk kati', 'lî wainhka kati', 'lih mairin kati', 'lî kati', 'pastara kati', 'sikla kati', 'wîs kati', 'waupasa kati', 'yahbra kati', 'trisu kati'], 'months_short' => ['siakwa kati', 'kuswa kati', 'kakamuk kati', 'lî wainhka kati', 'lih mairin kati', 'lî kati', 'pastara kati', 'sikla kati', 'wîs kati', 'waupasa kati', 'yahbra kati', 'trisu kati'], 'weekdays' => ['sandi', 'mundi', 'tiusdi', 'wensde', 'tausde', 'praidi', 'satadi'], 'weekdays_short' => ['san', 'mun', 'tius', 'wens', 'taus', 'prai', 'sat'], 'weekdays_min' => ['san', 'mun', 'tius', 'wens', 'taus', 'prai', 'sat'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 7, 'meridiem' => ['VM', 'NM'], 'month' => ':count kati', // less reliable 'm' => ':count kati', // less reliable 'a_month' => ':count kati', // less reliable ]); ================================================ FILE: src/Carbon/Lang/mjw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mjw_IN.php'; ================================================ FILE: src/Carbon/Lang/mjw_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Jor Teron bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['Arkoi', 'Thangthang', 'There', 'Jangmi', 'Aru', 'Vosik', 'Jakhong', 'Paipai', 'Chiti', 'Phere', 'Phaikuni', 'Matijong'], 'months_short' => ['Ark', 'Thang', 'The', 'Jang', 'Aru', 'Vos', 'Jak', 'Pai', 'Chi', 'Phe', 'Phai', 'Mati'], 'weekdays' => ['Bhomkuru', 'Urmi', 'Durmi', 'Thelang', 'Theman', 'Bhomta', 'Bhomti'], 'weekdays_short' => ['Bhom', 'Ur', 'Dur', 'Tkel', 'Tkem', 'Bhta', 'Bhti'], 'weekdays_min' => ['Bhom', 'Ur', 'Dur', 'Tkel', 'Tkem', 'Bhta', 'Bhti'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/mk.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Sashko Todorov * - Josh Soref * - François B * - Serhan Apaydın * - Borislav Mickov * - JD Isaacks * - Tomi Atanasoski */ use Carbon\CarbonInterface; return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', 'y' => ':count год.', 'month' => ':count месец|:count месеци', 'a_month' => 'месец|:count месеци', 'm' => ':count месец|:count месеци', 'week' => ':count седмица|:count седмици', 'a_week' => 'седмица|:count седмици', 'w' => ':count седмица|:count седмици', 'day' => ':count ден|:count дена', 'a_day' => 'ден|:count дена', 'd' => ':count ден|:count дена', 'hour' => ':count час|:count часа', 'a_hour' => 'час|:count часа', 'h' => ':count час|:count часа', 'minute' => ':count минута|:count минути', 'a_minute' => 'минута|:count минути', 'min' => ':count мин.', 'second' => ':count секунда|:count секунди', 'a_second' => 'неколку секунди|:count секунди', 's' => ':count сек.', 'ago' => 'пред :time', 'from_now' => 'после :time', 'after' => 'по :time', 'before' => 'пред :time', 'diff_now' => 'сега', 'diff_today' => 'Денес', 'diff_today_regexp' => 'Денес(?:\\s+во)?', 'diff_yesterday' => 'вчера', 'diff_yesterday_regexp' => 'Вчера(?:\\s+во)?', 'diff_tomorrow' => 'утре', 'diff_tomorrow_regexp' => 'Утре(?:\\s+во)?', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'D.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY H:mm', 'LLLL' => 'dddd, D MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[Денес во] LT', 'nextDay' => '[Утре во] LT', 'nextWeek' => '[Во] dddd [во] LT', 'lastDay' => '[Вчера во] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0, 3, 6 => '[Изминатата] dddd [во] LT', default => '[Изминатиот] dddd [во] LT', }, 'sameElse' => 'L', ], 'ordinal' => static function ($number) { $lastDigit = $number % 10; $last2Digits = $number % 100; if ($number === 0) { return $number.'-ев'; } if ($last2Digits === 0) { return $number.'-ен'; } if ($last2Digits > 10 && $last2Digits < 20) { return $number.'-ти'; } if ($lastDigit === 1) { return $number.'-ви'; } if ($lastDigit === 2) { return $number.'-ри'; } if ($lastDigit === 7 || $lastDigit === 8) { return $number.'-ми'; } return $number.'-ти'; }, 'months' => ['јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември'], 'months_short' => ['јан', 'фев', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'ное', 'дек'], 'weekdays' => ['недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота'], 'weekdays_short' => ['нед', 'пон', 'вто', 'сре', 'чет', 'пет', 'саб'], 'weekdays_min' => ['нe', 'пo', 'вт', 'ср', 'че', 'пе', 'сa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' и '], 'meridiem' => ['АМ', 'ПМ'], ]; ================================================ FILE: src/Carbon/Lang/mk_MK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/mk.php'; ================================================ FILE: src/Carbon/Lang/ml.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - JD Isaacks */ return [ 'year' => ':count വർഷം', 'a_year' => 'ഒരു വർഷം|:count വർഷം', 'month' => ':count മാസം', 'a_month' => 'ഒരു മാസം|:count മാസം', 'week' => ':count ആഴ്ച', 'a_week' => 'ഒരാഴ്ച|:count ആഴ്ച', 'day' => ':count ദിവസം', 'a_day' => 'ഒരു ദിവസം|:count ദിവസം', 'hour' => ':count മണിക്കൂർ', 'a_hour' => 'ഒരു മണിക്കൂർ|:count മണിക്കൂർ', 'minute' => ':count മിനിറ്റ്', 'a_minute' => 'ഒരു മിനിറ്റ്|:count മിനിറ്റ്', 'second' => ':count സെക്കൻഡ്', 'a_second' => 'അൽപ നിമിഷങ്ങൾ|:count സെക്കൻഡ്', 'ago' => ':time മുൻപ്', 'from_now' => ':time കഴിഞ്ഞ്', 'diff_now' => 'ഇപ്പോൾ', 'diff_today' => 'ഇന്ന്', 'diff_yesterday' => 'ഇന്നലെ', 'diff_tomorrow' => 'നാളെ', 'formats' => [ 'LT' => 'A h:mm -നു', 'LTS' => 'A h:mm:ss -നു', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm -നു', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm -നു', ], 'calendar' => [ 'sameDay' => '[ഇന്ന്] LT', 'nextDay' => '[നാളെ] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[ഇന്നലെ] LT', 'lastWeek' => '[കഴിഞ്ഞ] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'രാത്രി'; } if ($hour < 12) { return 'രാവിലെ'; } if ($hour < 17) { return 'ഉച്ച കഴിഞ്ഞ്'; } if ($hour < 20) { return 'വൈകുന്നേരം'; } return 'രാത്രി'; }, 'months' => ['ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്', 'ഏപ്രിൽ', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗസ്റ്റ്', 'സെപ്റ്റംബർ', 'ഒക്ടോബർ', 'നവംബർ', 'ഡിസംബർ'], 'months_short' => ['ജനു.', 'ഫെബ്രു.', 'മാർ.', 'ഏപ്രി.', 'മേയ്', 'ജൂൺ', 'ജൂലൈ.', 'ഓഗ.', 'സെപ്റ്റ.', 'ഒക്ടോ.', 'നവം.', 'ഡിസം.'], 'weekdays' => ['ഞായറാഴ്ച', 'തിങ്കളാഴ്ച', 'ചൊവ്വാഴ്ച', 'ബുധനാഴ്ച', 'വ്യാഴാഴ്ച', 'വെള്ളിയാഴ്ച', 'ശനിയാഴ്ച'], 'weekdays_short' => ['ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], 'weekdays_min' => ['ഞാ', 'തി', 'ചൊ', 'ബു', 'വ്യാ', 'വെ', 'ശ'], 'list' => ', ', 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/ml_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ml.php'; ================================================ FILE: src/Carbon/Lang/mn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - tjku * - Max Melentiev * - Zolzaya Erdenebaatar * - Tom Hughes * - Akira Matsuda * - Christopher Dell * - Michael Kessler * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Nicolás Hock Isaza * - Ochirkhuyag * - Batmandakh * - lucifer-crybaby */ return [ 'year' => ':count жил', 'y' => ':count жил', 'month' => ':count сар', 'm' => ':count сар', 'week' => ':count долоо хоног', 'w' => ':count долоо хоног', 'day' => ':count өдөр', 'd' => ':count өдөр', 'hour' => ':count цаг', 'h' => ':countц', 'minute' => ':count минут', 'min' => ':countм', 'second' => ':count секунд', 's' => ':countс', 'ago_mode' => 'last', 'ago' => ':time өмнө', 'year_ago' => ':count жилийн', 'y_ago' => ':count жилийн', 'month_ago' => ':count сарын', 'm_ago' => ':count сарын', 'day_ago' => ':count хоногийн', 'd_ago' => ':count хоногийн', 'week_ago' => ':count долоо хоногийн', 'w_ago' => ':count долоо хоногийн', 'hour_ago' => ':count цагийн', 'minute_ago' => ':count минутын', 'second_ago' => ':count секундын', 'from_now_mode' => 'last', 'from_now' => 'одоогоос :time', 'year_from_now' => ':count жилийн дараа', 'y_from_now' => ':count жилийн дараа', 'month_from_now' => ':count сарын дараа', 'm_from_now' => ':count сарын дараа', 'day_from_now' => ':count хоногийн дараа', 'd_from_now' => ':count хоногийн дараа', 'hour_from_now' => ':count цагийн дараа', 'minute_from_now' => ':count минутын дараа', 'second_from_now' => ':count секундын дараа', 'after_mode' => 'last', 'after' => ':time дараа', 'year_after' => ':count жилийн', 'y_after' => ':count жилийн', 'month_after' => ':count сарын', 'm_after' => ':count сарын', 'day_after' => ':count хоногийн', 'd_after' => ':count хоногийн', 'hour_after' => ':count цагийн', 'minute_after' => ':count минутын', 'second_after' => ':count секундын', 'before_mode' => 'last', 'before' => ':time өмнө', 'year_before' => ':count жилийн', 'y_before' => ':count жилийн', 'month_before' => ':count сарын', 'm_before' => ':count сарын', 'day_before' => ':count хоногийн', 'd_before' => ':count хоногийн', 'hour_before' => ':count цагийн', 'minute_before' => ':count минутын', 'second_before' => ':count секундын', 'list' => ', ', 'diff_now' => 'одоо', 'diff_yesterday' => 'өчигдөр', 'diff_tomorrow' => 'маргааш', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'YYYY MMMM DD', 'LLL' => 'YY-MM-DD, HH:mm', 'LLLL' => 'YYYY MMMM DD, HH:mm', ], 'weekdays' => ['Ням', 'Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба'], 'weekdays_short' => ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'], 'weekdays_min' => ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'], 'months' => ['1 сар', '2 сар', '3 сар', '4 сар', '5 сар', '6 сар', '7 сар', '8 сар', '9 сар', '10 сар', '11 сар', '12 сар'], 'months_short' => ['1 сар', '2 сар', '3 сар', '4 сар', '5 сар', '6 сар', '7 сар', '8 сар', '9 сар', '10 сар', '11 сар', '12 сар'], 'meridiem' => ['өглөө', 'орой'], 'first_day_of_week' => 1, ]; ================================================ FILE: src/Carbon/Lang/mn_MN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/mn.php'; ================================================ FILE: src/Carbon/Lang/mni.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/mni_IN.php'; ================================================ FILE: src/Carbon/Lang/mni_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat Pune libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['জানুৱারি', 'ফেব্রুৱারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগষ্ট', 'সেপ্তেম্বর', 'ওক্তোবর', 'নবেম্বর', 'ডিসেম্বর'], 'months_short' => ['জান', 'ফেব', 'মার', 'এপ্রি', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ', 'ওক্ত', 'নবে', 'ডিস'], 'weekdays' => ['নোংমাইজিং', 'নিংথৌকাবা', 'লৈবাকপোকপা', 'য়ুমশকৈশা', 'শগোলশেন', 'ইরাই', 'থাংজ'], 'weekdays_short' => ['নোং', 'নিং', 'লৈবাক', 'য়ুম', 'শগোল', 'ইরা', 'থাং'], 'weekdays_min' => ['নোং', 'নিং', 'লৈবাক', 'য়ুম', 'শগোল', 'ইরা', 'থাং'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['এ.ম.', 'প.ম.'], 'year' => ':count ইসিং', // less reliable 'y' => ':count ইসিং', // less reliable 'a_year' => ':count ইসিং', // less reliable 'second' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable 's' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable 'a_second' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable ]); ================================================ FILE: src/Carbon/Lang/mo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ro.php'; ================================================ FILE: src/Carbon/Lang/mr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Vikram-enyota */ return [ 'year' => ':count वर्ष', 'y' => ':count वर्ष', 'month' => ':count महिना|:count महिने', 'm' => ':count महिना|:count महिने', 'week' => ':count आठवडा|:count आठवडे', 'w' => ':count आठवडा|:count आठवडे', 'day' => ':count दिवस', 'd' => ':count दिवस', 'hour' => ':count तास', 'h' => ':count तास', 'minute' => ':count मिनिटे', 'min' => ':count मिनिटे', 'second' => ':count सेकंद', 's' => ':count सेकंद', 'ago' => ':timeपूर्वी', 'from_now' => ':timeमध्ये', 'before' => ':timeपूर्वी', 'after' => ':timeनंतर', 'diff_now' => 'आत्ता', 'diff_today' => 'आज', 'diff_yesterday' => 'काल', 'diff_tomorrow' => 'उद्या', 'formats' => [ 'LT' => 'A h:mm वाजता', 'LTS' => 'A h:mm:ss वाजता', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm वाजता', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm वाजता', ], 'calendar' => [ 'sameDay' => '[आज] LT', 'nextDay' => '[उद्या] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[काल] LT', 'lastWeek' => '[मागील] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'रात्री'; } if ($hour < 10) { return 'सकाळी'; } if ($hour < 17) { return 'दुपारी'; } if ($hour < 20) { return 'सायंकाळी'; } return 'रात्री'; }, 'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ऑगस्ट', 'सप्टेंबर', 'ऑक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], 'months_short' => ['जाने.', 'फेब्रु.', 'मार्च.', 'एप्रि.', 'मे.', 'जून.', 'जुलै.', 'ऑग.', 'सप्टें.', 'ऑक्टो.', 'नोव्हें.', 'डिसें.'], 'weekdays' => ['रविवार', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], 'weekdays_short' => ['रवि', 'सोम', 'मंगळ', 'बुध', 'गुरू', 'शुक्र', 'शनि'], 'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], 'list' => [', ', ' आणि '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/mr_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/mr.php'; ================================================ FILE: src/Carbon/Lang/ms.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - Azri Jamil * - JD Isaacks * - Josh Soref * - Azri Jamil * - Hariadi Hinta * - Ashraf Kamarudin */ return [ 'year' => ':count tahun', 'a_year' => '{1}setahun|[-Inf,Inf]:count tahun', 'y' => ':count tahun', 'month' => ':count bulan', 'a_month' => '{1}sebulan|[-Inf,Inf]:count bulan', 'm' => ':count bulan', 'week' => ':count minggu', 'a_week' => '{1}seminggu|[-Inf,Inf]:count minggu', 'w' => ':count minggu', 'day' => ':count hari', 'a_day' => '{1}sehari|[-Inf,Inf]:count hari', 'd' => ':count hari', 'hour' => ':count jam', 'a_hour' => '{1}sejam|[-Inf,Inf]:count jam', 'h' => ':count jam', 'minute' => ':count minit', 'a_minute' => '{1}seminit|[-Inf,Inf]:count minit', 'min' => ':count minit', 'second' => ':count saat', 'a_second' => '{1}beberapa saat|[-Inf,Inf]:count saat', 'millisecond' => ':count milisaat', 'a_millisecond' => '{1}semilisaat|[-Inf,Inf]:count milliseconds', 'microsecond' => ':count mikrodetik', 'a_microsecond' => '{1}semikrodetik|[-Inf,Inf]:count mikrodetik', 's' => ':count saat', 'ago' => ':time yang lepas', 'from_now' => ':time dari sekarang', 'after' => ':time kemudian', 'before' => ':time sebelum', 'diff_now' => 'sekarang', 'diff_today' => 'Hari', 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', 'diff_yesterday' => 'semalam', 'diff_yesterday_regexp' => 'Semalam(?:\\s+pukul)?', 'diff_tomorrow' => 'esok', 'diff_tomorrow_regexp' => 'Esok(?:\\s+pukul)?', 'diff_before_yesterday' => 'kelmarin', 'diff_after_tomorrow' => 'lusa', 'formats' => [ 'LT' => 'HH.mm', 'LTS' => 'HH.mm.ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY [pukul] HH.mm', 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', ], 'calendar' => [ 'sameDay' => '[Hari ini pukul] LT', 'nextDay' => '[Esok pukul] LT', 'nextWeek' => 'dddd [pukul] LT', 'lastDay' => '[Kelmarin pukul] LT', 'lastWeek' => 'dddd [lepas pukul] LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 1) { return 'tengah malam'; } if ($hour < 12) { return 'pagi'; } if ($hour < 13) { return 'tengah hari'; } if ($hour < 19) { return 'petang'; } return 'malam'; }, 'months' => ['Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogs', 'Sep', 'Okt', 'Nov', 'Dis'], 'weekdays' => ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'], 'weekdays_short' => ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'], 'weekdays_min' => ['Ah', 'Is', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' dan '], ]; ================================================ FILE: src/Carbon/Lang/ms_BN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/MM/yy', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, h:mm a', 'LLLL' => 'dd MMMM YYYY, h:mm a', ], 'meridiem' => ['a', 'p'], ]); ================================================ FILE: src/Carbon/Lang/ms_MY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - Azri Jamil * - JD Isaacks */ return require __DIR__.'/ms.php'; ================================================ FILE: src/Carbon/Lang/ms_SG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/MM/yy', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, h:mm a', 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', ], 'meridiem' => ['a', 'p'], ]); ================================================ FILE: src/Carbon/Lang/mt.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Alessandro Maruccia */ return [ 'year' => 'sena|:count sni|:count sni|:count sni', 'y' => 'sa sena|:count snin|:count snin|:count snin', 'month' => 'xahar|:count xhur|:count xhur|:count xhur', 'm' => ':count xahar|:count xhur|:count xhur|:count xhur', 'week' => 'gimgħa|:count ġimgħat|:count ġimgħat|:count ġimgħat', 'w' => 'ġimgħa|:count ġimgħat|:count ġimgħat|:count ġimgħat', 'day' => 'ġurnata|:count ġranet|:count ġranet|:count ġranet', 'd' => 'ġurnata|:count ġranet|:count ġranet|:count ġranet', 'hour' => 'siegħa|:count siegħat|:count siegħat|:count siegħat', 'h' => 'siegħa|:count sigħat|:count sigħat|:count sigħat', 'minute' => 'minuta|:count minuti|:count minuti|:count minuti', 'min' => 'min.|:count min.|:count min.|:count min.', 'second' => 'ftit sekondi|:count sekondi|:count sekondi|:count sekondi', 's' => 'sek.|:count sek.|:count sek.|:count sek.', 'ago' => ':time ilu', 'from_now' => 'f’ :time', 'diff_now' => 'issa', 'diff_today' => 'Illum', 'diff_today_regexp' => 'Illum(?:\\s+fil-)?', 'diff_yesterday' => 'lbieraħ', 'diff_yesterday_regexp' => 'Il-bieraħ(?:\\s+fil-)?', 'diff_tomorrow' => 'għada', 'diff_tomorrow_regexp' => 'Għada(?:\\s+fil-)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Illum fil-]LT', 'nextDay' => '[Għada fil-]LT', 'nextWeek' => 'dddd [fil-]LT', 'lastDay' => '[Il-bieraħ fil-]LT', 'lastWeek' => 'dddd [li għadda] [fil-]LT', 'sameElse' => 'L', ], 'ordinal' => ':numberº', 'months' => ['Jannar', 'Frar', 'Marzu', 'April', 'Mejju', 'Ġunju', 'Lulju', 'Awwissu', 'Settembru', 'Ottubru', 'Novembru', 'Diċembru'], 'months_short' => ['Jan', 'Fra', 'Mar', 'Apr', 'Mej', 'Ġun', 'Lul', 'Aww', 'Set', 'Ott', 'Nov', 'Diċ'], 'weekdays' => ['Il-Ħadd', 'It-Tnejn', 'It-Tlieta', 'L-Erbgħa', 'Il-Ħamis', 'Il-Ġimgħa', 'Is-Sibt'], 'weekdays_short' => ['Ħad', 'Tne', 'Tli', 'Erb', 'Ħam', 'Ġim', 'Sib'], 'weekdays_min' => ['Ħa', 'Tn', 'Tl', 'Er', 'Ħa', 'Ġi', 'Si'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' u '], ]; ================================================ FILE: src/Carbon/Lang/mt_MT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/mt.php'; ================================================ FILE: src/Carbon/Lang/mua.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['comme', 'lilli'], 'weekdays' => ['Com’yakke', 'Comlaaɗii', 'Comzyiiɗii', 'Comkolle', 'Comkaldǝɓlii', 'Comgaisuu', 'Comzyeɓsuu'], 'weekdays_short' => ['Cya', 'Cla', 'Czi', 'Cko', 'Cka', 'Cga', 'Cze'], 'weekdays_min' => ['Cya', 'Cla', 'Czi', 'Cko', 'Cka', 'Cga', 'Cze'], 'months' => ['Fĩi Loo', 'Cokcwaklaŋne', 'Cokcwaklii', 'Fĩi Marfoo', 'Madǝǝuutǝbijaŋ', 'Mamǝŋgwãafahbii', 'Mamǝŋgwãalii', 'Madǝmbii', 'Fĩi Dǝɓlii', 'Fĩi Mundaŋ', 'Fĩi Gwahlle', 'Fĩi Yuru'], 'months_short' => ['FLO', 'CLA', 'CKI', 'FMF', 'MAD', 'MBI', 'MLI', 'MAM', 'FDE', 'FMU', 'FGW', 'FYU'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/my.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - JD Isaacks * - Nay Lin Aung */ return [ 'year' => ':count နှစ်', 'a_year' => '{1}တစ်နှစ်|[-Inf,Inf]:count နှစ်', 'y' => ':count နှစ်', 'month' => ':count လ', 'a_month' => '{1}တစ်လ|[-Inf,Inf]:count လ', 'm' => ':count လ', 'week' => ':count ပတ်', 'w' => ':count ပတ်', 'day' => ':count ရက်', 'a_day' => '{1}တစ်ရက်|[-Inf,Inf]:count ရက်', 'd' => ':count ရက်', 'hour' => ':count နာရီ', 'a_hour' => '{1}တစ်နာရီ|[-Inf,Inf]:count နာရီ', 'h' => ':count နာရီ', 'minute' => ':count မိနစ်', 'a_minute' => '{1}တစ်မိနစ်|[-Inf,Inf]:count မိနစ်', 'min' => ':count မိနစ်', 'second' => ':count စက္ကန့်', 'a_second' => '{0,1}စက္ကန်.အနည်းငယ်|[-Inf,Inf]:count စက္ကန့်', 's' => ':count စက္ကန့်', 'ago' => 'လွန်ခဲ့သော :time က', 'from_now' => 'လာမည့် :time မှာ', 'after' => ':time ကြာပြီးနောက်', 'before' => ':time မတိုင်ခင်', 'diff_now' => 'အခုလေးတင်', 'diff_today' => 'ယနေ.', 'diff_yesterday' => 'မနေ့က', 'diff_yesterday_regexp' => 'မနေ.က', 'diff_tomorrow' => 'မနက်ဖြန်', 'diff_before_yesterday' => 'တမြန်နေ့က', 'diff_after_tomorrow' => 'တဘက်ခါ', 'period_recurrences' => ':count ကြိမ်', 'formats' => [ 'LT' => 'Oh:Om A', 'LTS' => 'Oh:Om:Os A', 'L' => 'OD/OM/OY', 'LL' => 'OD MMMM OY', 'LLL' => 'OD MMMM OY Oh:Om A', 'LLLL' => 'dddd OD MMMM OY Oh:Om A', ], 'calendar' => [ 'sameDay' => '[ယနေ.] LT [မှာ]', 'nextDay' => '[မနက်ဖြန်] LT [မှာ]', 'nextWeek' => 'dddd LT [မှာ]', 'lastDay' => '[မနေ.က] LT [မှာ]', 'lastWeek' => '[ပြီးခဲ့သော] dddd LT [မှာ]', 'sameElse' => 'L', ], 'months' => ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], 'months_short' => ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], 'weekdays' => ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], 'weekdays_short' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], 'weekdays_min' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'alt_numbers' => ['၀၀', '၀၁', '၀၂', '၀၃', '၀၄', '၀၅', '၀၆', '၀၇', '၀၈', '၀၉', '၁၀', '၁၁', '၁၂', '၁၃', '၁၄', '၁၅', '၁၆', '၁၇', '၁၈', '၁၉', '၂၀', '၂၁', '၂၂', '၂၃', '၂၄', '၂၅', '၂၆', '၂၇', '၂၈', '၂၉', '၃၀', '၃၁', '၃၂', '၃၃', '၃၄', '၃၅', '၃၆', '၃၇', '၃၈', '၃၉', '၄၀', '၄၁', '၄၂', '၄၃', '၄၄', '၄၅', '၄၆', '၄၇', '၄၈', '၄၉', '၅၀', '၅၁', '၅၂', '၅၃', '၅၄', '၅၅', '၅၆', '၅၇', '၅၈', '၅၉', '၆၀', '၆၁', '၆၂', '၆၃', '၆၄', '၆၅', '၆၆', '၆၇', '၆၈', '၆၉', '၇၀', '၇၁', '၇၂', '၇၃', '၇၄', '၇၅', '၇၆', '၇၇', '၇၈', '၇၉', '၈၀', '၈၁', '၈၂', '၈၃', '၈၄', '၈၅', '၈၆', '၈၇', '၈၈', '၈၉', '၉၀', '၉၁', '၉၂', '၉၃', '၉၄', '၉၅', '၉၆', '၉၇', '၉၈', '၉၉'], 'meridiem' => ['နံနက်', 'ညနေ'], ]; ================================================ FILE: src/Carbon/Lang/my_MM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/my.php'; ================================================ FILE: src/Carbon/Lang/mzn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fa.php', [ 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'first_day_of_week' => 6, 'weekend' => [5, 5], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'YYYY MMMM D, dddd HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/nan.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/nan_TW.php'; ================================================ FILE: src/Carbon/Lang/nan_TW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY年MM月DD日', ], 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], 'weekdays' => ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六'], 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['頂晡', '下晡'], 'year' => ':count 年', 'y' => ':count 年', 'a_year' => ':count 年', 'month' => ':count goe̍h', 'm' => ':count goe̍h', 'a_month' => ':count goe̍h', 'week' => ':count lé-pài', 'w' => ':count lé-pài', 'a_week' => ':count lé-pài', 'day' => ':count 日', 'd' => ':count 日', 'a_day' => ':count 日', 'hour' => ':count tiám-cheng', 'h' => ':count tiám-cheng', 'a_hour' => ':count tiám-cheng', 'minute' => ':count Hun-cheng', 'min' => ':count Hun-cheng', 'a_minute' => ':count Hun-cheng', 'second' => ':count Bió', 's' => ':count Bió', 'a_second' => ':count Bió', ]); ================================================ FILE: src/Carbon/Lang/nan_TW@latin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Arne Goetje arne@canonical.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], 'months' => ['1goe̍h', '2goe̍h', '3goe̍h', '4goe̍h', '5goe̍h', '6goe̍h', '7goe̍h', '8goe̍h', '9goe̍h', '10goe̍h', '11goe̍h', '12goe̍h'], 'months_short' => ['1g', '2g', '3g', '4g', '5g', '6g', '7g', '8g', '9g', '10g', '11g', '12g'], 'weekdays' => ['lé-pài-ji̍t', 'pài-it', 'pài-jī', 'pài-saⁿ', 'pài-sì', 'pài-gō͘', 'pài-la̍k'], 'weekdays_short' => ['lp', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6'], 'weekdays_min' => ['lp', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['téng-po͘', 'ē-po͘'], ]); ================================================ FILE: src/Carbon/Lang/naq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ǁgoagas', 'ǃuias'], 'weekdays' => ['Sontaxtsees', 'Mantaxtsees', 'Denstaxtsees', 'Wunstaxtsees', 'Dondertaxtsees', 'Fraitaxtsees', 'Satertaxtsees'], 'weekdays_short' => ['Son', 'Ma', 'De', 'Wu', 'Do', 'Fr', 'Sat'], 'weekdays_min' => ['Son', 'Ma', 'De', 'Wu', 'Do', 'Fr', 'Sat'], 'months' => ['ǃKhanni', 'ǃKhanǀgôab', 'ǀKhuuǁkhâb', 'ǃHôaǂkhaib', 'ǃKhaitsâb', 'Gamaǀaeb', 'ǂKhoesaob', 'Aoǁkhuumûǁkhâb', 'Taraǀkhuumûǁkhâb', 'ǂNûǁnâiseb', 'ǀHooǂgaeb', 'Hôasoreǁkhâb'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd, D MMMM YYYY h:mm a', ], 'year' => ':count kurigu', 'y' => ':count kurigu', 'a_year' => ':count kurigu', 'month' => ':count ǁaub', // less reliable 'm' => ':count ǁaub', // less reliable 'a_month' => ':count ǁaub', // less reliable 'week' => ':count hû', // less reliable 'w' => ':count hû', // less reliable 'a_week' => ':count hû', // less reliable 'day' => ':count ǀhobas', // less reliable 'd' => ':count ǀhobas', // less reliable 'a_day' => ':count ǀhobas', // less reliable 'hour' => ':count ǂgaes', // less reliable 'h' => ':count ǂgaes', // less reliable 'a_hour' => ':count ǂgaes', // less reliable 'minute' => ':count minutga', // less reliable 'min' => ':count minutga', // less reliable 'a_minute' => ':count minutga', // less reliable ]); ================================================ FILE: src/Carbon/Lang/nb.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Alexander Tømmerås * - Sigurd Gartmann * - JD Isaacks */ return [ 'year' => ':count år|:count år', 'a_year' => 'ett år|:count år', 'y' => ':count år|:count år', 'month' => ':count måned|:count måneder', 'a_month' => 'en måned|:count måneder', 'm' => ':count md.', 'week' => ':count uke|:count uker', 'a_week' => 'en uke|:count uker', 'w' => ':count u.', 'day' => ':count dag|:count dager', 'a_day' => 'en dag|:count dager', 'd' => ':count d.', 'hour' => ':count time|:count timer', 'a_hour' => 'en time|:count timer', 'h' => ':count t', 'minute' => ':count minutt|:count minutter', 'a_minute' => 'ett minutt|:count minutter', 'min' => ':count min', 'second' => ':count sekund|:count sekunder', 'a_second' => 'noen sekunder|:count sekunder', 's' => ':count sek', 'ago' => ':time siden', 'from_now' => 'om :time', 'after' => ':time etter', 'before' => ':time før', 'diff_now' => 'akkurat nå', 'diff_today' => 'i dag', 'diff_today_regexp' => 'i dag(?:\\s+kl.)?', 'diff_yesterday' => 'i går', 'diff_yesterday_regexp' => 'i går(?:\\s+kl.)?', 'diff_tomorrow' => 'i morgen', 'diff_tomorrow_regexp' => 'i morgen(?:\\s+kl.)?', 'diff_before_yesterday' => 'i forgårs', 'diff_after_tomorrow' => 'i overmorgen', 'period_recurrences' => 'en gang|:count ganger', 'period_interval' => 'hver :interval', 'period_start_date' => 'fra :date', 'period_end_date' => 'til :date', 'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], 'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], 'weekdays_short' => ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'], 'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'], 'ordinal' => ':number.', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY [kl.] HH:mm', 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', ], 'calendar' => [ 'sameDay' => '[i dag kl.] LT', 'nextDay' => '[i morgen kl.] LT', 'nextWeek' => 'dddd [kl.] LT', 'lastDay' => '[i går kl.] LT', 'lastWeek' => '[forrige] dddd [kl.] LT', 'sameElse' => 'L', ], 'list' => [', ', ' og '], 'meridiem' => ['a.m.', 'p.m.'], ]; ================================================ FILE: src/Carbon/Lang/nb_NO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/nb.php'; ================================================ FILE: src/Carbon/Lang/nb_SJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/nb.php', [ 'formats' => [ 'LL' => 'D. MMM YYYY', 'LLL' => 'D. MMMM YYYY, HH:mm', 'LLLL' => 'dddd D. MMMM YYYY, HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/nd.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'weekdays' => ['Sonto', 'Mvulo', 'Sibili', 'Sithathu', 'Sine', 'Sihlanu', 'Mgqibelo'], 'weekdays_short' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], 'weekdays_min' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], 'months' => ['Zibandlela', 'Nhlolanja', 'Mbimbitho', 'Mabasa', 'Nkwenkwezi', 'Nhlangula', 'Ntulikazi', 'Ncwabakazi', 'Mpandula', 'Mfumfu', 'Lwezi', 'Mpalakazi'], 'months_short' => ['Zib', 'Nhlo', 'Mbi', 'Mab', 'Nkw', 'Nhla', 'Ntu', 'Ncw', 'Mpan', 'Mfu', 'Lwe', 'Mpal'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'year' => 'okweminyaka engu-:count', // less reliable 'y' => 'okweminyaka engu-:count', // less reliable 'a_year' => 'okweminyaka engu-:count', // less reliable 'month' => 'inyanga ezingu-:count', 'm' => 'inyanga ezingu-:count', 'a_month' => 'inyanga ezingu-:count', 'week' => 'amaviki angu-:count', 'w' => 'amaviki angu-:count', 'a_week' => 'amaviki angu-:count', 'day' => 'kwamalanga angu-:count', 'd' => 'kwamalanga angu-:count', 'a_day' => 'kwamalanga angu-:count', 'hour' => 'amahola angu-:count', 'h' => 'amahola angu-:count', 'a_hour' => 'amahola angu-:count', 'minute' => 'imizuzu engu-:count', 'min' => 'imizuzu engu-:count', 'a_minute' => 'imizuzu engu-:count', 'second' => 'imizuzwana engu-:count', 's' => 'imizuzwana engu-:count', 'a_second' => 'imizuzwana engu-:count', ]); ================================================ FILE: src/Carbon/Lang/nds.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/nds_DE.php'; ================================================ FILE: src/Carbon/Lang/nds_DE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Jannuaar', 'Feberwaar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], 'weekdays' => ['Sünndag', 'Maandag', 'Dingsdag', 'Middeweek', 'Dunnersdag', 'Freedag', 'Sünnavend'], 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Midd', 'Dunn', 'Free', 'Svd.'], 'weekdays_min' => ['Sd', 'Ma', 'Di', 'Mi', 'Du', 'Fr', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count Johr', 'y' => ':countJ', 'a_year' => '{1}een Johr|:count Johr', 'month' => ':count Maand', 'm' => ':countM', 'a_month' => '{1}een Maand|:count Maand', 'week' => ':count Week|:count Weken', 'w' => ':countW', 'a_week' => '{1}een Week|:count Week|:count Weken', 'day' => ':count Dag|:count Daag', 'd' => ':countD', 'a_day' => '{1}een Dag|:count Dag|:count Daag', 'hour' => ':count Stünn|:count Stünnen', 'h' => ':countSt', 'a_hour' => '{1}een Stünn|:count Stünn|:count Stünnen', 'minute' => ':count Minuut|:count Minuten', 'min' => ':countm', 'a_minute' => '{1}een Minuut|:count Minuut|:count Minuten', 'second' => ':count Sekunn|:count Sekunnen', 's' => ':counts', 'a_second' => 'en poor Sekunnen|:count Sekunn|:count Sekunnen', 'ago' => 'vör :time', 'from_now' => 'in :time', 'before' => ':time vörher', 'after' => ':time later', ]); ================================================ FILE: src/Carbon/Lang/nds_NL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Jaunuwoa', 'Februwoa', 'Moaz', 'Aprell', 'Mai', 'Juni', 'Juli', 'August', 'Septamba', 'Oktoba', 'Nowamba', 'Dezamba'], 'months_short' => ['Jan', 'Feb', 'Moz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Now', 'Dez'], 'weekdays' => ['Sinndag', 'Mondag', 'Dingsdag', 'Meddwäakj', 'Donnadag', 'Friedag', 'Sinnowend'], 'weekdays_short' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], 'weekdays_min' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/ne.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - nootanghimire * - Josh Soref * - Nj Subedi * - JD Isaacks */ return [ 'year' => 'एक बर्ष|:count बर्ष', 'y' => ':count वर्ष', 'month' => 'एक महिना|:count महिना', 'm' => ':count महिना', 'week' => ':count हप्ता', 'w' => ':count हप्ता', 'day' => 'एक दिन|:count दिन', 'd' => ':count दिन', 'hour' => 'एक घण्टा|:count घण्टा', 'h' => ':count घण्टा', 'minute' => 'एक मिनेट|:count मिनेट', 'min' => ':count मिनेट', 'second' => 'केही क्षण|:count सेकेण्ड', 's' => ':count सेकेण्ड', 'ago' => ':time अगाडि', 'from_now' => ':timeमा', 'after' => ':time पछि', 'before' => ':time अघि', 'diff_now' => 'अहिले', 'diff_today' => 'आज', 'diff_yesterday' => 'हिजो', 'diff_tomorrow' => 'भोलि', 'formats' => [ 'LT' => 'Aको h:mm बजे', 'LTS' => 'Aको h:mm:ss बजे', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, Aको h:mm बजे', 'LLLL' => 'dddd, D MMMM YYYY, Aको h:mm बजे', ], 'calendar' => [ 'sameDay' => '[आज] LT', 'nextDay' => '[भोलि] LT', 'nextWeek' => '[आउँदो] dddd[,] LT', 'lastDay' => '[हिजो] LT', 'lastWeek' => '[गएको] dddd[,] LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 3) { return 'राति'; } if ($hour < 12) { return 'बिहान'; } if ($hour < 16) { return 'दिउँसो'; } if ($hour < 20) { return 'साँझ'; } return 'राति'; }, 'months' => ['जनवरी', 'फेब्रुवरी', 'मार्च', 'अप्रिल', 'मई', 'जुन', 'जुलाई', 'अगष्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], 'months_short' => ['जन.', 'फेब्रु.', 'मार्च', 'अप्रि.', 'मई', 'जुन', 'जुलाई.', 'अग.', 'सेप्ट.', 'अक्टो.', 'नोभे.', 'डिसे.'], 'weekdays' => ['आइतबार', 'सोमबार', 'मङ्गलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'], 'weekdays_short' => ['आइत.', 'सोम.', 'मङ्गल.', 'बुध.', 'बिहि.', 'शुक्र.', 'शनि.'], 'weekdays_min' => ['आ.', 'सो.', 'मं.', 'बु.', 'बि.', 'शु.', 'श.'], 'list' => [', ', ' र '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]; ================================================ FILE: src/Carbon/Lang/ne_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ne.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'yy/M/d', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D, h:mm a', 'LLLL' => 'YYYY MMMM D, dddd, h:mm a', ], 'months' => ['जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], 'months_short' => ['जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], 'weekend' => [0, 0], 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], ]); ================================================ FILE: src/Carbon/Lang/ne_NP.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ne.php'; ================================================ FILE: src/Carbon/Lang/nhn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/nhn_MX.php'; ================================================ FILE: src/Carbon/Lang/nhn_MX.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], 'weekdays' => ['teoilhuitl', 'ceilhuitl', 'omeilhuitl', 'yeilhuitl', 'nahuilhuitl', 'macuililhuitl', 'chicuaceilhuitl'], 'weekdays_short' => ['teo', 'cei', 'ome', 'yei', 'nau', 'mac', 'chi'], 'weekdays_min' => ['teo', 'cei', 'ome', 'yei', 'nau', 'mac', 'chi'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'month' => ':count metztli', // less reliable 'm' => ':count metztli', // less reliable 'a_month' => ':count metztli', // less reliable 'week' => ':count tonalli', // less reliable 'w' => ':count tonalli', // less reliable 'a_week' => ':count tonalli', // less reliable 'day' => ':count tonatih', // less reliable 'd' => ':count tonatih', // less reliable 'a_day' => ':count tonatih', // less reliable 'minute' => ':count toltecayotl', // less reliable 'min' => ':count toltecayotl', // less reliable 'a_minute' => ':count toltecayotl', // less reliable 'second' => ':count ome', // less reliable 's' => ':count ome', // less reliable 'a_second' => ':count ome', // less reliable 'year' => ':count xihuitl', 'y' => ':count xihuitl', 'a_year' => ':count xihuitl', ]); ================================================ FILE: src/Carbon/Lang/niu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/niu_NU.php'; ================================================ FILE: src/Carbon/Lang/niu_NU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RockET Systems Emani Fakaotimanava-Lui emani@niue.nu */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Ianuali', 'Fepuali', 'Masi', 'Apelila', 'Me', 'Iuni', 'Iulai', 'Aokuso', 'Sepetema', 'Oketopa', 'Novema', 'Tesemo'], 'months_short' => ['Ian', 'Fep', 'Mas', 'Ape', 'Me', 'Iun', 'Iul', 'Aok', 'Sep', 'Oke', 'Nov', 'Tes'], 'weekdays' => ['Aho Tapu', 'Aho Gofua', 'Aho Ua', 'Aho Lotu', 'Aho Tuloto', 'Aho Falaile', 'Aho Faiumu'], 'weekdays_short' => ['Tapu', 'Gofua', 'Ua', 'Lotu', 'Tuloto', 'Falaile', 'Faiumu'], 'weekdays_min' => ['Tapu', 'Gofua', 'Ua', 'Lotu', 'Tuloto', 'Falaile', 'Faiumu'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count tau', 'y' => ':count tau', 'a_year' => ':count tau', 'month' => ':count mahina', 'm' => ':count mahina', 'a_month' => ':count mahina', 'week' => ':count faahi tapu', 'w' => ':count faahi tapu', 'a_week' => ':count faahi tapu', 'day' => ':count aho', 'd' => ':count aho', 'a_day' => ':count aho', 'hour' => ':count e tulā', 'h' => ':count e tulā', 'a_hour' => ':count e tulā', 'minute' => ':count minuti', 'min' => ':count minuti', 'a_minute' => ':count minuti', 'second' => ':count sekone', 's' => ':count sekone', 'a_second' => ':count sekone', ]); ================================================ FILE: src/Carbon/Lang/nl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Roy * - Stephan * - François B * - Tim Fish * - Kevin Huang * - Jacob Middag * - JD Isaacks * - Roy * - Stephan * - François B * - Tim Fish * - Jacob Middag * - JD Isaacks * - Propaganistas * - MegaXLR * - adriaanzon * - MonkeyPhysics * - JeroenG * - RikSomers * - proclame * - Rik de Groot (hwdegroot) */ return [ 'year' => ':count jaar|:count jaar', 'a_year' => 'een jaar|:count jaar', 'y' => ':countj', 'month' => ':count maand|:count maanden', 'a_month' => 'een maand|:count maanden', 'm' => ':countmnd', 'week' => ':count week|:count weken', 'a_week' => 'een week|:count weken', 'w' => ':countw', 'day' => ':count dag|:count dagen', 'a_day' => 'een dag|:count dagen', 'd' => ':countd', 'hour' => ':count uur|:count uur', 'a_hour' => 'een uur|:count uur', 'h' => ':countu', 'minute' => ':count minuut|:count minuten', 'a_minute' => 'een minuut|:count minuten', 'min' => ':countmin', 'second' => ':count seconde|:count seconden', 'a_second' => 'een paar seconden|:count seconden', 's' => ':counts', 'ago' => ':time geleden', 'from_now' => 'over :time', 'after' => ':time later', 'before' => ':time eerder', 'diff_now' => 'nu', 'diff_today' => 'vandaag', 'diff_today_regexp' => 'vandaag(?:\\s+om)?', 'diff_yesterday' => 'gisteren', 'diff_yesterday_regexp' => 'gisteren(?:\\s+om)?', 'diff_tomorrow' => 'morgen', 'diff_tomorrow_regexp' => 'morgen(?:\\s+om)?', 'diff_after_tomorrow' => 'overmorgen', 'diff_before_yesterday' => 'eergisteren', 'period_recurrences' => ':count keer', 'period_interval' => static function (string $interval = '') { /** @var string $output */ $output = preg_replace('/^(een|één|1)\s+/u', '', $interval); if (preg_match('/^(een|één|1)( jaar|j| uur|u)/u', $interval)) { return "elk $output"; } return "elke $output"; }, 'period_start_date' => 'van :date', 'period_end_date' => 'tot :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD-MM-YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[vandaag om] LT', 'nextDay' => '[morgen om] LT', 'nextWeek' => 'dddd [om] LT', 'lastDay' => '[gisteren om] LT', 'lastWeek' => '[afgelopen] dddd [om] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); }, 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 'mmm_suffix' => '.', 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 'weekdays_short' => ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' en '], 'meridiem' => ['\'s ochtends', '\'s middags'], ]; ================================================ FILE: src/Carbon/Lang/nl_AW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/nl.php', [ 'formats' => [ 'L' => 'DD-MM-YY', ], 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 'weekdays_short' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/nl_BE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Roy * - Stephan * - François B * - Tim Fish * - Kevin Huang * - Jacob Middag * - JD Isaacks * - Propaganistas */ return array_replace_recursive(require __DIR__.'/nl.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/nl_BQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/nl.php'; ================================================ FILE: src/Carbon/Lang/nl_CW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/nl.php'; ================================================ FILE: src/Carbon/Lang/nl_NL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/nl.php', [ 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 'weekdays_short' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/nl_SR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/nl.php'; ================================================ FILE: src/Carbon/Lang/nl_SX.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/nl.php'; ================================================ FILE: src/Carbon/Lang/nmg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['maná', 'kugú'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndɔ', 'sɔ́ndɔ mafú mába', 'sɔ́ndɔ mafú málal', 'sɔ́ndɔ mafú mána', 'mabágá má sukul', 'sásadi'], 'weekdays_short' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'mbs', 'sas'], 'weekdays_min' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'mbs', 'sas'], 'months' => ['ngwɛn matáhra', 'ngwɛn ńmba', 'ngwɛn ńlal', 'ngwɛn ńna', 'ngwɛn ńtan', 'ngwɛn ńtuó', 'ngwɛn hɛmbuɛrí', 'ngwɛn lɔmbi', 'ngwɛn rɛbvuâ', 'ngwɛn wum', 'ngwɛn wum navǔr', 'krísimin'], 'months_short' => ['ng1', 'ng2', 'ng3', 'ng4', 'ng5', 'ng6', 'ng7', 'ng8', 'ng9', 'ng10', 'ng11', 'kris'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/nn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Alexander Tømmerås * - Øystein * - JD Isaacks * - Gaute Hvoslef Kvalnes (gaute) */ return [ 'year' => ':count år', 'a_year' => 'eit år|:count år', 'y' => ':count år', 'month' => ':count månad|:count månader', 'a_month' => 'ein månad|:count månader', 'm' => ':count md', 'week' => ':count veke|:count veker', 'a_week' => 'ei veke|:count veker', 'w' => ':countv', 'day' => ':count dag|:count dagar', 'a_day' => 'ein dag|:count dagar', 'd' => ':countd', 'hour' => ':count time|:count timar', 'a_hour' => 'ein time|:count timar', 'h' => ':countt', 'minute' => ':count minutt', 'a_minute' => 'eit minutt|:count minutt', 'min' => ':countm', 'second' => ':count sekund', 'a_second' => 'nokre sekund|:count sekund', 's' => ':counts', 'ago' => ':time sidan', 'from_now' => 'om :time', 'after' => ':time etter', 'before' => ':time før', 'diff_today' => 'I dag', 'diff_yesterday' => 'I går', 'diff_yesterday_regexp' => 'I går(?:\\s+klokka)?', 'diff_tomorrow' => 'I morgon', 'diff_tomorrow_regexp' => 'I morgon(?:\\s+klokka)?', 'diff_today_regexp' => 'I dag(?:\\s+klokka)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY [kl.] H:mm', 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', ], 'calendar' => [ 'sameDay' => '[I dag klokka] LT', 'nextDay' => '[I morgon klokka] LT', 'nextWeek' => 'dddd [klokka] LT', 'lastDay' => '[I går klokka] LT', 'lastWeek' => '[Føregåande] dddd [klokka] LT', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], 'weekdays' => ['sundag', 'måndag', 'tysdag', 'onsdag', 'torsdag', 'fredag', 'laurdag'], 'weekdays_short' => ['sun', 'mån', 'tys', 'ons', 'tor', 'fre', 'lau'], 'weekdays_min' => ['su', 'må', 'ty', 'on', 'to', 'fr', 'la'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' og '], 'meridiem' => ['f.m.', 'e.m.'], ]; ================================================ FILE: src/Carbon/Lang/nn_NO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/nn.php'; ================================================ FILE: src/Carbon/Lang/nnh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['mbaʼámbaʼ', 'ncwònzém'], 'weekdays' => null, 'weekdays_short' => ['lyɛʼɛ́ sẅíŋtè', 'mvfò lyɛ̌ʼ', 'mbɔ́ɔntè mvfò lyɛ̌ʼ', 'tsètsɛ̀ɛ lyɛ̌ʼ', 'mbɔ́ɔntè tsetsɛ̀ɛ lyɛ̌ʼ', 'mvfò màga lyɛ̌ʼ', 'màga lyɛ̌ʼ'], 'weekdays_min' => null, 'months' => null, 'months_short' => ['saŋ tsetsɛ̀ɛ lùm', 'saŋ kàg ngwóŋ', 'saŋ lepyè shúm', 'saŋ cÿó', 'saŋ tsɛ̀ɛ cÿó', 'saŋ njÿoláʼ', 'saŋ tyɛ̀b tyɛ̀b mbʉ̀ŋ', 'saŋ mbʉ̀ŋ', 'saŋ ngwɔ̀ʼ mbÿɛ', 'saŋ tàŋa tsetsáʼ', 'saŋ mejwoŋó', 'saŋ lùm'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/yy', 'LL' => 'D MMM, YYYY', 'LLL' => '[lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', 'LLLL' => 'dddd , [lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/no.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Daniel S. Billing * - Paul * - Jimmie Johansson * - Jens Herlevsen */ return array_replace_recursive(require __DIR__.'/nb.php', [ 'formats' => [ 'LLL' => 'D. MMMM YYYY HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY [kl.] HH:mm', ], 'calendar' => [ 'nextWeek' => 'på dddd [kl.] LT', 'lastWeek' => '[i] dddd[s kl.] LT', ], ]); ================================================ FILE: src/Carbon/Lang/nr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/nr_ZA.php'; ================================================ FILE: src/Carbon/Lang/nr_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Janabari', 'uFeberbari', 'uMatjhi', 'u-Apreli', 'Meyi', 'Juni', 'Julayi', 'Arhostosi', 'Septemba', 'Oktoba', 'Usinyikhaba', 'Disemba'], 'months_short' => ['Jan', 'Feb', 'Mat', 'Apr', 'Mey', 'Jun', 'Jul', 'Arh', 'Sep', 'Okt', 'Usi', 'Dis'], 'weekdays' => ['uSonto', 'uMvulo', 'uLesibili', 'lesithathu', 'uLesine', 'ngoLesihlanu', 'umGqibelo'], 'weekdays_short' => ['Son', 'Mvu', 'Bil', 'Tha', 'Ne', 'Hla', 'Gqi'], 'weekdays_min' => ['Son', 'Mvu', 'Bil', 'Tha', 'Ne', 'Hla', 'Gqi'], 'day_of_first_week_of_year' => 1, 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/nso.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/nso_ZA.php'; ================================================ FILE: src/Carbon/Lang/nso_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Janaware', 'Febereware', 'Matšhe', 'Aprele', 'Mei', 'June', 'Julae', 'Agostose', 'Setemere', 'Oktobere', 'Nofemere', 'Disemere'], 'months_short' => ['Jan', 'Feb', 'Mat', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Set', 'Okt', 'Nof', 'Dis'], 'weekdays' => ['LaMorena', 'Mošupologo', 'Labobedi', 'Laboraro', 'Labone', 'Labohlano', 'Mokibelo'], 'weekdays_short' => ['Son', 'Moš', 'Bed', 'Rar', 'Ne', 'Hla', 'Mok'], 'weekdays_min' => ['Son', 'Moš', 'Bed', 'Rar', 'Ne', 'Hla', 'Mok'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => ':count ngwaga', 'y' => ':count ngwaga', 'a_year' => ':count ngwaga', 'month' => ':count Kgwedi', 'm' => ':count Kgwedi', 'a_month' => ':count Kgwedi', 'week' => ':count Beke', 'w' => ':count Beke', 'a_week' => ':count Beke', 'day' => ':count Letšatši', 'd' => ':count Letšatši', 'a_day' => ':count Letšatši', 'hour' => ':count Iri', 'h' => ':count Iri', 'a_hour' => ':count Iri', 'minute' => ':count Motsotso', 'min' => ':count Motsotso', 'a_minute' => ':count Motsotso', 'second' => ':count motsotswana', 's' => ':count motsotswana', 'a_second' => ':count motsotswana', ]); ================================================ FILE: src/Carbon/Lang/nus.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RW', 'TŊ'], 'weekdays' => ['Cäŋ kuɔth', 'Jiec la̱t', 'Rɛw lätni', 'Diɔ̱k lätni', 'Ŋuaan lätni', 'Dhieec lätni', 'Bäkɛl lätni'], 'weekdays_short' => ['Cäŋ', 'Jiec', 'Rɛw', 'Diɔ̱k', 'Ŋuaan', 'Dhieec', 'Bäkɛl'], 'weekdays_min' => ['Cäŋ', 'Jiec', 'Rɛw', 'Diɔ̱k', 'Ŋuaan', 'Dhieec', 'Bäkɛl'], 'months' => ['Tiop thar pɛt', 'Pɛt', 'Duɔ̱ɔ̱ŋ', 'Guak', 'Duät', 'Kornyoot', 'Pay yie̱tni', 'Tho̱o̱r', 'Tɛɛr', 'Laath', 'Kur', 'Tio̱p in di̱i̱t'], 'months_short' => ['Tiop', 'Pɛt', 'Duɔ̱ɔ̱', 'Guak', 'Duä', 'Kor', 'Pay', 'Thoo', 'Tɛɛ', 'Laa', 'Kur', 'Tid'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd D MMMM YYYY h:mm a', ], 'year' => ':count jiök', // less reliable 'y' => ':count jiök', // less reliable 'a_year' => ':count jiök', // less reliable 'month' => ':count pay', // less reliable 'm' => ':count pay', // less reliable 'a_month' => ':count pay', // less reliable ]); ================================================ FILE: src/Carbon/Lang/nyn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], 'weekdays_min' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], 'months' => ['Okwokubanza', 'Okwakabiri', 'Okwakashatu', 'Okwakana', 'Okwakataana', 'Okwamukaaga', 'Okwamushanju', 'Okwamunaana', 'Okwamwenda', 'Okwaikumi', 'Okwaikumi na kumwe', 'Okwaikumi na ibiri'], 'months_short' => ['KBZ', 'KBR', 'KST', 'KKN', 'KTN', 'KMK', 'KMS', 'KMN', 'KMW', 'KKM', 'KNK', 'KNB'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/oc.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Quentí * - Quentin PAGÈS */ // @codeCoverageIgnoreStart use Symfony\Component\Translation\PluralizationRules; if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { PluralizationRules::set(static function ($number) { return $number == 1 ? 0 : 1; }, 'oc'); } // @codeCoverageIgnoreEnd return [ 'year' => ':count an|:count ans', 'a_year' => 'un an|:count ans', 'y' => ':count an|:count ans', 'month' => ':count mes|:count meses', 'a_month' => 'un mes|:count meses', 'm' => ':count mes|:count meses', 'week' => ':count setmana|:count setmanas', 'a_week' => 'una setmana|:count setmanas', 'w' => ':count setmana|:count setmanas', 'day' => ':count jorn|:count jorns', 'a_day' => 'un jorn|:count jorns', 'd' => ':count jorn|:count jorns', 'hour' => ':count ora|:count oras', 'a_hour' => 'una ora|:count oras', 'h' => ':count ora|:count oras', 'minute' => ':count minuta|:count minutas', 'a_minute' => 'una minuta|:count minutas', 'min' => ':count minuta|:count minutas', 'second' => ':count segonda|:count segondas', 'a_second' => 'una segonda|:count segondas', 's' => ':count segonda|:count segondas', 'ago' => 'fa :time', 'from_now' => 'd\'aquí :time', 'after' => ':time aprèp', 'before' => ':time abans', 'diff_now' => 'ara meteis', 'diff_today' => 'Uèi', 'diff_today_regexp' => 'Uèi(?:\\s+a)?', 'diff_yesterday' => 'ièr', 'diff_yesterday_regexp' => 'Ièr(?:\\s+a)?', 'diff_tomorrow' => 'deman', 'diff_tomorrow_regexp' => 'Deman(?:\\s+a)?', 'diff_before_yesterday' => 'ièr delà', 'diff_after_tomorrow' => 'deman passat', 'period_recurrences' => ':count còp|:count còps', 'period_interval' => 'cada :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'fins a :date', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM [de] YYYY', 'LLL' => 'D MMMM [de] YYYY [a] H:mm', 'LLLL' => 'dddd D MMMM [de] YYYY [a] H:mm', ], 'calendar' => [ 'sameDay' => '[Uèi a] LT', 'nextDay' => '[Deman a] LT', 'nextWeek' => 'dddd [a] LT', 'lastDay' => '[Ièr a] LT', 'lastWeek' => 'dddd [passat a] LT', 'sameElse' => 'L', ], 'months' => ['de genièr', 'de febrièr', 'de març', 'd\'abrial', 'de mai', 'de junh', 'de julhet', 'd\'agost', 'de setembre', 'd’octòbre', 'de novembre', 'de decembre'], 'months_standalone' => ['genièr', 'febrièr', 'març', 'abrial', 'mai', 'junh', 'julh', 'agost', 'setembre', 'octòbre', 'novembre', 'decembre'], 'months_short' => ['gen.', 'feb.', 'març', 'abr.', 'mai', 'junh', 'julh', 'ago.', 'sep.', 'oct.', 'nov.', 'dec.'], 'weekdays' => ['dimenge', 'diluns', 'dimars', 'dimècres', 'dijòus', 'divendres', 'dissabte'], 'weekdays_short' => ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], 'weekdays_min' => ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], 'ordinal' => static function ($number, string $period = '') { $ordinal = [1 => 'èr', 2 => 'nd'][(int) $number] ?? 'en'; // feminine for week, hour, minute, second if (preg_match('/^[wWhHgGis]$/', $period)) { $ordinal .= 'a'; } return $number.$ordinal; }, 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' e '], ]; ================================================ FILE: src/Carbon/Lang/oc_FR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/oc.php'; ================================================ FILE: src/Carbon/Lang/om.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation & Sagalee Oromoo Publishing Co. Inc. locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'dd-MMM-YYYY', 'LLL' => 'dd MMMM YYYY HH:mm', 'LLLL' => 'dddd, MMMM D, YYYY HH:mm', ], 'months' => ['Amajjii', 'Guraandhala', 'Bitooteessa', 'Elba', 'Caamsa', 'Waxabajjii', 'Adooleessa', 'Hagayya', 'Fuulbana', 'Onkololeessa', 'Sadaasa', 'Muddee'], 'months_short' => ['Ama', 'Gur', 'Bit', 'Elb', 'Cam', 'Wax', 'Ado', 'Hag', 'Ful', 'Onk', 'Sad', 'Mud'], 'weekdays' => ['Dilbata', 'Wiixata', 'Qibxata', 'Roobii', 'Kamiisa', 'Jimaata', 'Sanbata'], 'weekdays_short' => ['Dil', 'Wix', 'Qib', 'Rob', 'Kam', 'Jim', 'San'], 'weekdays_min' => ['Dil', 'Wix', 'Qib', 'Rob', 'Kam', 'Jim', 'San'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['WD', 'WB'], 'year' => 'wggoota :count', 'y' => 'wggoota :count', 'a_year' => 'wggoota :count', 'month' => 'ji’a :count', 'm' => 'ji’a :count', 'a_month' => 'ji’a :count', 'week' => 'torban :count', 'w' => 'torban :count', 'a_week' => 'torban :count', 'day' => 'guyyaa :count', 'd' => 'guyyaa :count', 'a_day' => 'guyyaa :count', 'hour' => 'saʼaatii :count', 'h' => 'saʼaatii :count', 'a_hour' => 'saʼaatii :count', 'minute' => 'daqiiqaa :count', 'min' => 'daqiiqaa :count', 'a_minute' => 'daqiiqaa :count', 'second' => 'sekoondii :count', 's' => 'sekoondii :count', 'a_second' => 'sekoondii :count', ]); ================================================ FILE: src/Carbon/Lang/om_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/om.php'; ================================================ FILE: src/Carbon/Lang/om_KE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/om.php', [ 'day_of_first_week_of_year' => 0, ]); ================================================ FILE: src/Carbon/Lang/or.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/or_IN.php'; ================================================ FILE: src/Carbon/Lang/or_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM AP Linux Technology Center, Yamato Software Laboratory bug-glibc@gnu.org */ return [ 'diff_now' => 'ବର୍ତ୍ତମାନ', 'diff_yesterday' => 'ଗତକାଲି', 'diff_tomorrow' => 'ଆସନ୍ତାକାଲି', 'formats' => [ 'LT' => 'Oh:Om A', 'LTS' => 'Oh:Om:Os A', 'L' => 'OD-OM-OY', 'LL' => 'OD MMMM OY', 'LLL' => 'OD MMMM OY Oh:Om A', 'LLLL' => 'dddd OD MMMM OY Oh:Om A', ], 'months' => ['ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର'], 'months_short' => ['ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର'], 'weekdays' => ['ରବିବାର', 'ସୋମବାର', 'ମଙ୍ଗଳବାର', 'ବୁଧବାର', 'ଗୁରୁବାର', 'ଶୁକ୍ରବାର', 'ଶନିବାର'], 'weekdays_short' => ['ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି'], 'weekdays_min' => ['ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି'], 'day_of_first_week_of_year' => 1, 'alt_numbers' => ['୦', '୧', '୨', '୩', '୪', '୫', '୬', '୭', '୮', '୯', '୧୦', '୧୧', '୧୨', '୧୩', '୧୪', '୧୫', '୧୬', '୧୭', '୧୮', '୧୯', '୨୦', '୨୧', '୨୨', '୨୩', '୨୪', '୨୫', '୨୬', '୨୭', '୨୮', '୨୯', '୩୦', '୩୧', '୩୨', '୩୩', '୩୪', '୩୫', '୩୬', '୩୭', '୩୮', '୩୯', '୪୦', '୪୧', '୪୨', '୪୩', '୪୪', '୪୫', '୪୬', '୪୭', '୪୮', '୪୯', '୫୦', '୫୧', '୫୨', '୫୩', '୫୪', '୫୫', '୫୬', '୫୭', '୫୮', '୫୯', '୬୦', '୬୧', '୬୨', '୬୩', '୬୪', '୬୫', '୬୬', '୬୭', '୬୮', '୬୯', '୭୦', '୭୧', '୭୨', '୭୩', '୭୪', '୭୫', '୭୬', '୭୭', '୭୮', '୭୯', '୮୦', '୮୧', '୮୨', '୮୩', '୮୪', '୮୫', '୮୬', '୮୭', '୮୮', '୮୯', '୯୦', '୯୧', '୯୨', '୯୩', '୯୪', '୯୫', '୯୬', '୯୭', '୯୮', '୯୯'], 'year' => ':count ବର୍ଷ', 'y' => ':count ବ.', 'month' => ':count ମାସ', 'm' => ':count ମା.', 'week' => ':count ସପ୍ତାହ', 'w' => ':count ସପ୍ତା.', 'day' => ':count ଦିନ', 'd' => ':count ଦିନ', 'hour' => ':count ଘଣ୍ତ', 'h' => ':count ଘ.', 'minute' => ':count ମିନଟ', 'min' => ':count ମି.', 'second' => ':count ସେକଣ୍ଢ', 's' => ':count ସେ.', 'ago' => ':time ପୂର୍ବେ', 'from_now' => ':timeରେ', ]; ================================================ FILE: src/Carbon/Lang/os.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/os_RU.php'; ================================================ FILE: src/Carbon/Lang/os_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['январы', 'февралы', 'мартъийы', 'апрелы', 'майы', 'июны', 'июлы', 'августы', 'сентябры', 'октябры', 'ноябры', 'декабры'], 'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], 'weekdays' => ['Хуыцаубон', 'Къуырисæр', 'Дыццæг', 'Æртыццæг', 'Цыппæрæм', 'Майрæмбон', 'Сабат'], 'weekdays_short' => ['Хцб', 'Крс', 'Дцг', 'Æрт', 'Цпр', 'Мрб', 'Сбт'], 'weekdays_min' => ['Хцб', 'Крс', 'Дцг', 'Æрт', 'Цпр', 'Мрб', 'Сбт'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'minute' => ':count гыццыл', // less reliable 'min' => ':count гыццыл', // less reliable 'a_minute' => ':count гыццыл', // less reliable 'second' => ':count æндæр', // less reliable 's' => ':count æндæр', // less reliable 'a_second' => ':count æндæр', // less reliable 'year' => ':count аз', 'y' => ':count аз', 'a_year' => ':count аз', 'month' => ':count мӕй', 'm' => ':count мӕй', 'a_month' => ':count мӕй', 'week' => ':count къуыри', 'w' => ':count къуыри', 'a_week' => ':count къуыри', 'day' => ':count бон', 'd' => ':count бон', 'a_day' => ':count бон', 'hour' => ':count сахат', 'h' => ':count сахат', 'a_hour' => ':count сахат', ]); ================================================ FILE: src/Carbon/Lang/pa.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - Punjab */ return [ 'year' => 'ਇੱਕ ਸਾਲ|:count ਸਾਲ', 'month' => 'ਇੱਕ ਮਹੀਨਾ|:count ਮਹੀਨੇ', 'week' => 'ਹਫਤਾ|:count ਹਫ਼ਤੇ', 'day' => 'ਇੱਕ ਦਿਨ|:count ਦਿਨ', 'hour' => 'ਇੱਕ ਘੰਟਾ|:count ਘੰਟੇ', 'minute' => 'ਇਕ ਮਿੰਟ|:count ਮਿੰਟ', 'second' => 'ਕੁਝ ਸਕਿੰਟ|:count ਸਕਿੰਟ', 'ago' => ':time ਪਹਿਲਾਂ', 'from_now' => ':time ਵਿੱਚ', 'before' => ':time ਤੋਂ ਪਹਿਲਾਂ', 'after' => ':time ਤੋਂ ਬਾਅਦ', 'diff_now' => 'ਹੁਣ', 'diff_today' => 'ਅਜ', 'diff_yesterday' => 'ਕਲ', 'diff_tomorrow' => 'ਕਲ', 'formats' => [ 'LT' => 'A h:mm ਵਜੇ', 'LTS' => 'A h:mm:ss ਵਜੇ', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm ਵਜੇ', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm ਵਜੇ', ], 'calendar' => [ 'sameDay' => '[ਅਜ] LT', 'nextDay' => '[ਕਲ] LT', 'nextWeek' => '[ਅਗਲਾ] dddd, LT', 'lastDay' => '[ਕਲ] LT', 'lastWeek' => '[ਪਿਛਲੇ] dddd, LT', 'sameElse' => 'L', ], 'meridiem' => static function ($hour) { if ($hour < 4) { return 'ਰਾਤ'; } if ($hour < 10) { return 'ਸਵੇਰ'; } if ($hour < 17) { return 'ਦੁਪਹਿਰ'; } if ($hour < 20) { return 'ਸ਼ਾਮ'; } return 'ਰਾਤ'; }, 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], 'months_short' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'], 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' ਅਤੇ '], 'weekend' => [0, 0], 'alt_numbers' => ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'], ]; ================================================ FILE: src/Carbon/Lang/pa_Arab.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ur.php', [ 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], 'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئ', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئ', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd, DD MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/pa_Guru.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/pa.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D/M/yy', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, h:mm a', 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', ], 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], 'months_short' => ['ਜਨ', 'ਫ਼ਰ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾ', 'ਅਗ', 'ਸਤੰ', 'ਅਕਤੂ', 'ਨਵੰ', 'ਦਸੰ'], 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁੱਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨਿੱਚਰਵਾਰ'], 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕਰ', 'ਸ਼ਨਿੱਚਰ'], 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕ', 'ਸ਼ਨਿੱ'], 'weekend' => [0, 0], ]); ================================================ FILE: src/Carbon/Lang/pa_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Guo Xiang Tan * - Josh Soref * - Ash * - harpreetkhalsagtbit */ return require __DIR__.'/pa.php'; ================================================ FILE: src/Carbon/Lang/pa_PK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/pa_Arab.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['جنوري', 'فروري', 'مارچ', 'اپريل', 'مٓی', 'جون', 'جولاي', 'اگست', 'ستمبر', 'اكتوبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنوري', 'فروري', 'مارچ', 'اپريل', 'مٓی', 'جون', 'جولاي', 'اگست', 'ستمبر', 'اكتوبر', 'نومبر', 'دسمبر'], 'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], 'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], 'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ص', 'ش'], ]); ================================================ FILE: src/Carbon/Lang/pap.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return [ 'formats' => [ 'LT' => 'HH.mm', 'LTS' => 'HH.mm:ss', 'L' => 'DD-MM-YY', 'LL' => 'MMMM [di] DD, YYYY', 'LLL' => 'DD MMM HH.mm', 'LLLL' => 'MMMM DD, YYYY HH.mm', ], 'months' => ['yanüari', 'febrüari', 'mart', 'aprel', 'mei', 'yüni', 'yüli', 'ougùstùs', 'sèptèmber', 'oktober', 'novèmber', 'desèmber'], 'months_short' => ['yan', 'feb', 'mar', 'apr', 'mei', 'yün', 'yül', 'oug', 'sèp', 'okt', 'nov', 'des'], 'weekdays' => ['djadomingo', 'djaluna', 'djamars', 'djawebs', 'djarason', 'djabierne', 'djasabra'], 'weekdays_short' => ['do', 'lu', 'ma', 'we', 'ra', 'bi', 'sa'], 'weekdays_min' => ['do', 'lu', 'ma', 'we', 'ra', 'bi', 'sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count aña', 'month' => ':count luna', 'week' => ':count siman', 'day' => ':count dia', 'hour' => ':count ora', 'minute' => ':count minüt', 'second' => ':count sekònde', 'list' => [', ', ' i '], ]; ================================================ FILE: src/Carbon/Lang/pap_AW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - information from native speaker Pablo Saratxaga pablo@mandrakesoft.com */ return require __DIR__.'/pap.php'; ================================================ FILE: src/Carbon/Lang/pap_CW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - information from native speaker Pablo Saratxaga pablo@mandrakesoft.com */ return require __DIR__.'/pap.php'; ================================================ FILE: src/Carbon/Lang/pl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Wacław Jacek * - François B * - Tim Fish * - Serhan Apaydın * - Massimiliano Caniparoli * - JD Isaacks * - Jakub Szwacz * - Jan * - Paul * - damlys * - Marek (marast78) * - Peter (UnrulyNatives) * - Qrzysio * - Jan (aso824) * - diverpl */ use Carbon\CarbonInterface; return [ 'year' => ':count rok|:count lata|:count lat', 'a_year' => 'rok|:count lata|:count lat', 'y' => ':count r|:count l|:count l', 'month' => ':count miesiąc|:count miesiące|:count miesięcy', 'a_month' => 'miesiąc|:count miesiące|:count miesięcy', 'm' => ':count mies.', 'week' => ':count tydzień|:count tygodnie|:count tygodni', 'a_week' => 'tydzień|:count tygodnie|:count tygodni', 'w' => ':count tyg.', 'day' => ':count dzień|:count dni|:count dni', 'a_day' => 'dzień|:count dni|:count dni', 'd' => ':count d', 'hour' => ':count godzina|:count godziny|:count godzin', 'a_hour' => 'godzina|:count godziny|:count godzin', 'h' => ':count godz.', 'minute' => ':count minuta|:count minuty|:count minut', 'a_minute' => 'minuta|:count minuty|:count minut', 'min' => ':count min', 'second' => ':count sekunda|:count sekundy|:count sekund', 'a_second' => '{1}kilka sekund|:count sekunda|:count sekundy|:count sekund', 's' => ':count sek.', 'ago' => ':time temu', 'from_now' => static function ($time) { return 'za '.strtr($time, [ 'godzina' => 'godzinę', 'minuta' => 'minutę', 'sekunda' => 'sekundę', ]); }, 'after' => ':time po', 'before' => ':time przed', 'diff_now' => 'teraz', 'diff_today' => 'Dziś', 'diff_today_regexp' => 'Dziś(?:\\s+o)?', 'diff_yesterday' => 'wczoraj', 'diff_yesterday_regexp' => 'Wczoraj(?:\\s+o)?', 'diff_tomorrow' => 'jutro', 'diff_tomorrow_regexp' => 'Jutro(?:\\s+o)?', 'diff_before_yesterday' => 'przedwczoraj', 'diff_after_tomorrow' => 'pojutrze', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Dziś o] LT', 'nextDay' => '[Jutro o] LT', 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[W niedzielę o] LT', 2 => '[We wtorek o] LT', 3 => '[W środę o] LT', 6 => '[W sobotę o] LT', default => '[W] dddd [o] LT', }, 'lastDay' => '[Wczoraj o] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[W zeszłą niedzielę o] LT', 3 => '[W zeszłą środę o] LT', 6 => '[W zeszłą sobotę o] LT', default => '[W zeszły] dddd [o] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'], 'months_standalone' => ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], 'months_short' => ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], 'weekdays_short' => ['ndz', 'pon', 'wt', 'śr', 'czw', 'pt', 'sob'], 'weekdays_min' => ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' i '], 'meridiem' => ['przed południem', 'po południu'], ]; ================================================ FILE: src/Carbon/Lang/pl_PL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pl.php'; ================================================ FILE: src/Carbon/Lang/prg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'YYYY MMMM D, dddd HH:mm', ], 'year' => ':count meta', 'y' => ':count meta', 'a_year' => ':count meta', 'month' => ':count mēniks', // less reliable 'm' => ':count mēniks', // less reliable 'a_month' => ':count mēniks', // less reliable 'week' => ':count sawaītin', // less reliable 'w' => ':count sawaītin', // less reliable 'a_week' => ':count sawaītin', // less reliable 'day' => ':count di', 'd' => ':count di', 'a_day' => ':count di', 'hour' => ':count bruktēt', // less reliable 'h' => ':count bruktēt', // less reliable 'a_hour' => ':count bruktēt', // less reliable 'minute' => ':count līkuts', // less reliable 'min' => ':count līkuts', // less reliable 'a_minute' => ':count līkuts', // less reliable 'second' => ':count kitan', // less reliable 's' => ':count kitan', // less reliable 'a_second' => ':count kitan', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ps.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Muhammad Nasir Rahimi * - Nassim Nasibullah (spinzar) */ return [ 'year' => ':count کال|:count کاله', 'y' => ':countکال|:countکاله', 'month' => ':count مياشت|:count مياشتي', 'm' => ':countمياشت|:countمياشتي', 'week' => ':count اونۍ|:count اونۍ', 'w' => ':countاونۍ|:countاونۍ', 'day' => ':count ورځ|:count ورځي', 'd' => ':countورځ|:countورځي', 'hour' => ':count ساعت|:count ساعته', 'h' => ':countساعت|:countساعته', 'minute' => ':count دقيقه|:count دقيقې', 'min' => ':countدقيقه|:countدقيقې', 'second' => ':count ثانيه|:count ثانيې', 's' => ':countثانيه|:countثانيې', 'ago' => ':time دمخه', 'from_now' => ':time له اوس څخه', 'after' => ':time وروسته', 'before' => ':time دمخه', 'list' => ['، ', ' او '], 'meridiem' => ['غ.م.', 'غ.و.'], 'weekdays' => ['اتوار', 'ګل', 'نهه', 'شورو', 'زيارت', 'جمعه', 'خالي'], 'weekdays_short' => ['ا', 'ګ', 'ن', 'ش', 'ز', 'ج', 'خ'], 'weekdays_min' => ['ا', 'ګ', 'ن', 'ش', 'ز', 'ج', 'خ'], 'months' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_standalone' => ['جنوري', 'فېبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_short_standalone' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'first_day_of_week' => 6, 'weekend' => [4, 5], 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'YYYY/M/d', 'LL' => 'YYYY MMM D', 'LLL' => 'د YYYY د MMMM D H:mm', 'LLLL' => 'dddd د YYYY د MMMM D H:mm', ], ]; ================================================ FILE: src/Carbon/Lang/ps_AF.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ps.php'; ================================================ FILE: src/Carbon/Lang/pt.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Cassiano Montanari * - Matt Pope * - François B * - Prodis * - JD Isaacks * - Raphael Amorim * - João Magalhães * - victortobias * - Paulo Freitas * - Sebastian Thierer * - Claudson Martins (claudsonm) */ use Carbon\CarbonInterface; return [ 'year' => ':count ano|:count anos', 'a_year' => 'um ano|:count anos', 'y' => ':counta', 'month' => ':count mês|:count meses', 'a_month' => 'um mês|:count meses', 'm' => ':countm', 'week' => ':count semana|:count semanas', 'a_week' => 'uma semana|:count semanas', 'w' => ':countsem', 'day' => ':count dia|:count dias', 'a_day' => 'um dia|:count dias', 'd' => ':countd', 'hour' => ':count hora|:count horas', 'a_hour' => 'uma hora|:count horas', 'h' => ':counth', 'minute' => ':count minuto|:count minutos', 'a_minute' => 'um minuto|:count minutos', 'min' => ':countmin', 'second' => ':count segundo|:count segundos', 'a_second' => 'alguns segundos|:count segundos', 's' => ':counts', 'millisecond' => ':count milissegundo|:count milissegundos', 'a_millisecond' => 'um milissegundo|:count milissegundos', 'ms' => ':countms', 'microsecond' => ':count microssegundo|:count microssegundos', 'a_microsecond' => 'um microssegundo|:count microssegundos', 'µs' => ':countµs', 'ago' => 'há :time', 'from_now' => 'em :time', 'after' => ':time depois', 'before' => ':time antes', 'diff_now' => 'agora', 'diff_today' => 'Hoje', 'diff_today_regexp' => 'Hoje(?:\\s+às)?', 'diff_yesterday' => 'ontem', 'diff_yesterday_regexp' => 'Ontem(?:\\s+às)?', 'diff_tomorrow' => 'amanhã', 'diff_tomorrow_regexp' => 'Amanhã(?:\\s+às)?', 'diff_before_yesterday' => 'anteontem', 'diff_after_tomorrow' => 'depois de amanhã', 'period_recurrences' => 'uma vez|:count vezes', 'period_interval' => 'cada :interval', 'period_start_date' => 'de :date', 'period_end_date' => 'até :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D [de] MMMM [de] YYYY', 'LLL' => 'D [de] MMMM [de] YYYY HH:mm', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Hoje às] LT', 'nextDay' => '[Amanhã às] LT', 'nextWeek' => 'dddd [às] LT', 'lastDay' => '[Ontem às] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0, 6 => '[Último] dddd [às] LT', default => '[Última] dddd [às] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':numberº', 'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'], 'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'], 'weekdays' => ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado'], 'weekdays_short' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], 'weekdays_min' => ['Do', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sá'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' e '], 'ordinal_words' => [ 'of' => 'de', 'first' => 'primeira', 'second' => 'segunda', 'third' => 'terceira', 'fourth' => 'quarta', 'fifth' => 'quinta', 'last' => 'última', ], ]; ================================================ FILE: src/Carbon/Lang/pt_AO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_BR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Cassiano Montanari * - Eduardo Dalla Vecchia * - David Rodrigues * - Matt Pope * - François B * - Prodis * - Marlon Maxwel * - JD Isaacks * - Raphael Amorim * - Rafael Raupp * - felipeleite1 * - swalker * - Lucas Macedo * - Paulo Freitas * - Sebastian Thierer */ return array_replace_recursive(require __DIR__.'/pt.php', [ 'period_recurrences' => 'uma|:count vez', 'period_interval' => 'toda :interval', 'formats' => [ 'LLL' => 'D [de] MMMM [de] YYYY [às] HH:mm', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY [às] HH:mm', ], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/pt_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_CV.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_GQ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_GW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_LU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_MO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/pt.php', [ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'LLL' => 'D [de] MMMM [de] YYYY, h:mm a', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY, h:mm a', ], 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/pt_MZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/pt.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/pt_PT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RAP bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/pt.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'], 'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'], 'weekdays' => ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'], 'weekdays_short' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], 'weekdays_min' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]); ================================================ FILE: src/Carbon/Lang/pt_ST.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/pt_TL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/pt.php'; ================================================ FILE: src/Carbon/Lang/qu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/es_UY.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM, YYYY HH:mm', ], 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/qu_BO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/qu_EC.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/quz.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/quz_PE.php'; ================================================ FILE: src/Carbon/Lang/quz_PE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['iniru', 'phiwriru', 'marsu', 'awril', 'mayu', 'huniyu', 'huliyu', 'agustu', 'siptiyimri', 'uktuwri', 'nuwiyimri', 'tisiyimri'], 'months_short' => ['ini', 'phi', 'mar', 'awr', 'may', 'hun', 'hul', 'agu', 'sip', 'ukt', 'nuw', 'tis'], 'weekdays' => ['tuminku', 'lunis', 'martis', 'miyirkulis', 'juywis', 'wiyirnis', 'sawatu'], 'weekdays_short' => ['tum', 'lun', 'mar', 'miy', 'juy', 'wiy', 'saw'], 'weekdays_min' => ['tum', 'lun', 'mar', 'miy', 'juy', 'wiy', 'saw'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'minute' => ':count uchuy', // less reliable 'min' => ':count uchuy', // less reliable 'a_minute' => ':count uchuy', // less reliable 'year' => ':count wata', 'y' => ':count wata', 'a_year' => ':count wata', 'month' => ':count killa', 'm' => ':count killa', 'a_month' => ':count killa', 'week' => ':count simana', 'w' => ':count simana', 'a_week' => ':count simana', 'day' => ':count pʼunchaw', 'd' => ':count pʼunchaw', 'a_day' => ':count pʼunchaw', 'hour' => ':count ura', 'h' => ':count ura', 'a_hour' => ':count ura', 'second' => ':count iskay ñiqin', 's' => ':count iskay ñiqin', 'a_second' => ':count iskay ñiqin', ]); ================================================ FILE: src/Carbon/Lang/raj.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/raj_IN.php'; ================================================ FILE: src/Carbon/Lang/raj_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - meghrajsuthar03@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'], 'months_short' => ['जन', 'फर', 'मार्च', 'अप्रै', 'मई', 'जून', 'जुल', 'अग', 'सित', 'अक्टू', 'नव', 'दिस'], 'weekdays' => ['रविवार', 'सोमवार', 'मंगल्लवार', 'बुधवार', 'बृहस्पतिवार', 'शुक्रवार', 'शनिवार'], 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], 'year' => ':count आंहू', // less reliable 'y' => ':count आंहू', // less reliable 'a_year' => ':count आंहू', // less reliable 'month' => ':count सूरज', // less reliable 'm' => ':count सूरज', // less reliable 'a_month' => ':count सूरज', // less reliable 'week' => ':count निवाज', // less reliable 'w' => ':count निवाज', // less reliable 'a_week' => ':count निवाज', // less reliable 'day' => ':count अेक', // less reliable 'd' => ':count अेक', // less reliable 'a_day' => ':count अेक', // less reliable 'hour' => ':count दुनियांण', // less reliable 'h' => ':count दुनियांण', // less reliable 'a_hour' => ':count दुनियांण', // less reliable ]); ================================================ FILE: src/Carbon/Lang/rm.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - tjku * - Max Melentiev * - Juanito Fatas * - Tsutomu Kuroda * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Nicolás Hock Isaza * - sebastian de castelberg */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'Do MMMM YYYY', 'LLL' => 'Do MMMM, HH:mm [Uhr]', 'LLLL' => 'dddd, Do MMMM YYYY, HH:mm [Uhr]', ], 'year' => ':count onn|:count onns', 'month' => ':count mais', 'week' => ':count emna|:count emnas', 'day' => ':count di|:count dis', 'hour' => ':count oura|:count ouras', 'minute' => ':count minuta|:count minutas', 'second' => ':count secunda|:count secundas', 'weekdays' => ['dumengia', 'glindesdi', 'mardi', 'mesemna', 'gievgia', 'venderdi', 'sonda'], 'weekdays_short' => ['du', 'gli', 'ma', 'me', 'gie', 've', 'so'], 'weekdays_min' => ['du', 'gli', 'ma', 'me', 'gie', 've', 'so'], 'months' => ['schaner', 'favrer', 'mars', 'avrigl', 'matg', 'zercladur', 'fanadur', 'avust', 'settember', 'october', 'november', 'december'], 'months_short' => ['schan', 'favr', 'mars', 'avr', 'matg', 'zercl', 'fan', 'avust', 'sett', 'oct', 'nov', 'dec'], 'meridiem' => ['avantmezdi', 'suentermezdi'], 'list' => [', ', ' e '], 'first_day_of_week' => 1, ]); ================================================ FILE: src/Carbon/Lang/rn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Z.MU.', 'Z.MW.'], 'weekdays' => ['Ku w’indwi', 'Ku wa mbere', 'Ku wa kabiri', 'Ku wa gatatu', 'Ku wa kane', 'Ku wa gatanu', 'Ku wa gatandatu'], 'weekdays_short' => ['cu.', 'mbe.', 'kab.', 'gtu.', 'kan.', 'gnu.', 'gnd.'], 'weekdays_min' => ['cu.', 'mbe.', 'kab.', 'gtu.', 'kan.', 'gnu.', 'gnd.'], 'months' => ['Nzero', 'Ruhuhuma', 'Ntwarante', 'Ndamukiza', 'Rusama', 'Ruheshi', 'Mukakaro', 'Nyandagaro', 'Nyakanga', 'Gitugutu', 'Munyonyo', 'Kigarama'], 'months_short' => ['Mut.', 'Gas.', 'Wer.', 'Mat.', 'Gic.', 'Kam.', 'Nya.', 'Kan.', 'Nze.', 'Ukw.', 'Ugu.', 'Uku.'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'year' => 'imyaka :count', 'y' => 'imyaka :count', 'a_year' => 'imyaka :count', 'month' => 'amezi :count', 'm' => 'amezi :count', 'a_month' => 'amezi :count', 'week' => 'indwi :count', 'w' => 'indwi :count', 'a_week' => 'indwi :count', 'day' => 'imisi :count', 'd' => 'imisi :count', 'a_day' => 'imisi :count', 'hour' => 'amasaha :count', 'h' => 'amasaha :count', 'a_hour' => 'amasaha :count', 'minute' => 'iminuta :count', 'min' => 'iminuta :count', 'a_minute' => 'iminuta :count', 'second' => 'inguvu :count', // less reliable 's' => 'inguvu :count', // less reliable 'a_second' => 'inguvu :count', // less reliable ]); ================================================ FILE: src/Carbon/Lang/ro.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - JD Isaacks * - Cătălin Georgescu * - Valentin Ivaşcu (oriceon) */ return [ 'year' => ':count an|:count ani|:count ani', 'a_year' => 'un an|:count ani|:count ani', 'y' => ':count a.', 'month' => ':count lună|:count luni|:count luni', 'a_month' => 'o lună|:count luni|:count luni', 'm' => ':count l.', 'week' => ':count săptămână|:count săptămâni|:count săptămâni', 'a_week' => 'o săptămână|:count săptămâni|:count săptămâni', 'w' => ':count săp.', 'day' => ':count zi|:count zile|:count zile', 'a_day' => 'o zi|:count zile|:count zile', 'd' => ':count z.', 'hour' => ':count oră|:count ore|:count ore', 'a_hour' => 'o oră|:count ore|:count ore', 'h' => ':count o.', 'minute' => ':count minut|:count minute|:count minute', 'a_minute' => 'un minut|:count minute|:count minute', 'min' => ':count m.', 'second' => ':count secundă|:count secunde|:count secunde', 'a_second' => 'câteva secunde|:count secunde|:count secunde', 's' => ':count sec.', 'ago' => ':time în urmă', 'from_now' => 'peste :time', 'after' => 'peste :time', 'before' => 'acum :time', 'diff_now' => 'acum', 'diff_today' => 'azi', 'diff_today_regexp' => 'azi(?:\\s+la)?', 'diff_yesterday' => 'ieri', 'diff_yesterday_regexp' => 'ieri(?:\\s+la)?', 'diff_tomorrow' => 'mâine', 'diff_tomorrow_regexp' => 'mâine(?:\\s+la)?', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY H:mm', 'LLLL' => 'dddd, D MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[azi la] LT', 'nextDay' => '[mâine la] LT', 'nextWeek' => 'dddd [la] LT', 'lastDay' => '[ieri la] LT', 'lastWeek' => '[fosta] dddd [la] LT', 'sameElse' => 'L', ], 'months' => ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], 'months_short' => ['ian.', 'feb.', 'mar.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], 'weekdays' => ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], 'weekdays_short' => ['dum', 'lun', 'mar', 'mie', 'joi', 'vin', 'sâm'], 'weekdays_min' => ['du', 'lu', 'ma', 'mi', 'jo', 'vi', 'sâ'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' și '], 'meridiem' => ['a.m.', 'p.m.'], ]; ================================================ FILE: src/Carbon/Lang/ro_MD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ro.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ro_RO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ro.php'; ================================================ FILE: src/Carbon/Lang/rof.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kang’ama', 'kingoto'], 'weekdays' => ['Ijumapili', 'Ijumatatu', 'Ijumanne', 'Ijumatano', 'Alhamisi', 'Ijumaa', 'Ijumamosi'], 'weekdays_short' => ['Ijp', 'Ijt', 'Ijn', 'Ijtn', 'Alh', 'Iju', 'Ijm'], 'weekdays_min' => ['Ijp', 'Ijt', 'Ijn', 'Ijtn', 'Alh', 'Iju', 'Ijm'], 'months' => ['Mweri wa kwanza', 'Mweri wa kaili', 'Mweri wa katatu', 'Mweri wa kaana', 'Mweri wa tanu', 'Mweri wa sita', 'Mweri wa saba', 'Mweri wa nane', 'Mweri wa tisa', 'Mweri wa ikumi', 'Mweri wa ikumi na moja', 'Mweri wa ikumi na mbili'], 'months_short' => ['M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ru.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Bari Badamshin * - Jørn Ølmheim * - François B * - Tim Fish * - Коренберг Марк (imac) * - Serhan Apaydın * - RomeroMsk * - vsn4ik * - JD Isaacks * - Bari Badamshin * - Jørn Ølmheim * - François B * - Коренберг Марк (imac) * - Serhan Apaydın * - RomeroMsk * - vsn4ik * - JD Isaacks * - Fellzo * - andrey-helldar * - Pavel Skripkin (psxx) * - AlexWalkerson * - Vladislav UnsealedOne * - dima-bzz * - Sergey Danilchenko */ use Carbon\CarbonInterface; $transformDiff = static fn (string $input) => strtr($input, [ 'неделя' => 'неделю', 'секунда' => 'секунду', 'минута' => 'минуту', ]); return [ 'year' => ':count год|:count года|:count лет', 'y' => ':count г.|:count г.|:count л.', 'a_year' => '{1}год|:count год|:count года|:count лет', 'month' => ':count месяц|:count месяца|:count месяцев', 'm' => ':count мес.', 'a_month' => '{1}месяц|:count месяц|:count месяца|:count месяцев', 'week' => ':count неделя|:count недели|:count недель', 'w' => ':count нед.', 'a_week' => '{1}неделя|:count неделю|:count недели|:count недель', 'day' => ':count день|:count дня|:count дней', 'd' => ':count д.', 'a_day' => '{1}день|:count день|:count дня|:count дней', 'hour' => ':count час|:count часа|:count часов', 'h' => ':count ч.', 'a_hour' => '{1}час|:count час|:count часа|:count часов', 'minute' => ':count минута|:count минуты|:count минут', 'min' => ':count мин.', 'a_minute' => '{1}минута|:count минута|:count минуты|:count минут', 'second' => ':count секунда|:count секунды|:count секунд', 's' => ':count сек.', 'a_second' => '{1}несколько секунд|:count секунду|:count секунды|:count секунд', 'millisecond' => '{1}:count миллисекунда|:count миллисекунды|:count миллисекунд', 'a_millisecond' => '{1}миллисекунда|:count миллисекунда|:count миллисекунды|:count миллисекунд', 'ms' => ':count мс', 'microsecond' => '{1}:count микросекунда|:count микросекунды|:count микросекунд', 'a_microsecond' => '{1}микросекунда|:count микросекунда|:count микросекунды|:count микросекунд', 'ago' => static fn (string $time) => $transformDiff($time).' назад', 'from_now' => static fn (string $time) => 'через '.$transformDiff($time), 'after' => static fn (string $time) => $transformDiff($time).' после', 'before' => static fn (string $time) => $transformDiff($time).' до', 'diff_now' => 'только что', 'diff_today' => 'Сегодня,', 'diff_today_regexp' => 'Сегодня,?(?:\\s+в)?', 'diff_yesterday' => 'вчера', 'diff_yesterday_regexp' => 'Вчера,?(?:\\s+в)?', 'diff_tomorrow' => 'завтра', 'diff_tomorrow_regexp' => 'Завтра,?(?:\\s+в)?', 'diff_before_yesterday' => 'позавчера', 'diff_after_tomorrow' => 'послезавтра', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY г.', 'LLL' => 'D MMMM YYYY г., H:mm', 'LLLL' => 'dddd, D MMMM YYYY г., H:mm', ], 'calendar' => [ 'sameDay' => '[Сегодня, в] LT', 'nextDay' => '[Завтра, в] LT', 'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: return '[В следующее] dddd, [в] LT'; case 1: case 2: case 4: return '[В следующий] dddd, [в] LT'; case 3: case 5: case 6: return '[В следующую] dddd, [в] LT'; } } if ($current->dayOfWeek === 2) { return '[Во] dddd, [в] LT'; } return '[В] dddd, [в] LT'; }, 'lastDay' => '[Вчера, в] LT', 'lastWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: return '[В прошлое] dddd, [в] LT'; case 1: case 2: case 4: return '[В прошлый] dddd, [в] LT'; case 3: case 5: case 6: return '[В прошлую] dddd, [в] LT'; } } if ($current->dayOfWeek === 2) { return '[Во] dddd, [в] LT'; } return '[В] dddd, [в] LT'; }, 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'M', 'd', 'DDD' => $number.'-й', 'D' => $number.'-го', 'w', 'W' => $number.'-я', default => $number, }; }, 'meridiem' => static function ($hour) { if ($hour < 4) { return 'ночи'; } if ($hour < 12) { return 'утра'; } if ($hour < 17) { return 'дня'; } return 'вечера'; }, 'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], 'months_standalone' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'], 'months_short' => ['янв', 'фев', 'мар', 'апр', 'мая', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'months_short_standalone' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среду', 'четверг', 'пятницу', 'субботу'], 'weekdays_standalone' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'], 'weekdays_short' => ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт'], 'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], 'weekdays_regexp' => '/\[\s*(В|в)\s*((?:прошлую|следующую|эту)\s*)?\]\s*dddd/', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' и '], ]; ================================================ FILE: src/Carbon/Lang/ru_BY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ru.php'; ================================================ FILE: src/Carbon/Lang/ru_KG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ru.php'; ================================================ FILE: src/Carbon/Lang/ru_KZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ru.php'; ================================================ FILE: src/Carbon/Lang/ru_MD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ru.php'; ================================================ FILE: src/Carbon/Lang/ru_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ru.php'; ================================================ FILE: src/Carbon/Lang/ru_UA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - RFC 2319 bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/ru.php', [ 'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'], 'weekdays_short' => ['вск', 'пнд', 'вто', 'срд', 'чтв', 'птн', 'суб'], 'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'су'], ]); ================================================ FILE: src/Carbon/Lang/rw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/rw_RW.php'; ================================================ FILE: src/Carbon/Lang/rw_RW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Rwanda Steve Murphy murf@e-tools.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicuransi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeli', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], 'months_short' => ['Mut', 'Gas', 'Wer', 'Mat', 'Gic', 'Kam', 'Nya', 'Kan', 'Nze', 'Ukw', 'Ugu', 'Uku'], 'weekdays' => ['Ku cyumweru', 'Kuwa mbere', 'Kuwa kabiri', 'Kuwa gatatu', 'Kuwa kane', 'Kuwa gatanu', 'Kuwa gatandatu'], 'weekdays_short' => ['Mwe', 'Mbe', 'Kab', 'Gtu', 'Kan', 'Gnu', 'Gnd'], 'weekdays_min' => ['Mwe', 'Mbe', 'Kab', 'Gtu', 'Kan', 'Gnu', 'Gnd'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'second' => ':count vuna', // less reliable 's' => ':count vuna', // less reliable 'a_second' => ':count vuna', // less reliable 'year' => 'aka :count', 'y' => 'aka :count', 'a_year' => 'aka :count', 'month' => 'ezi :count', 'm' => 'ezi :count', 'a_month' => 'ezi :count', 'week' => ':count icyumweru', 'w' => ':count icyumweru', 'a_week' => ':count icyumweru', 'day' => ':count nsi', 'd' => ':count nsi', 'a_day' => ':count nsi', 'hour' => 'saha :count', 'h' => 'saha :count', 'a_hour' => 'saha :count', 'minute' => ':count -nzinya', 'min' => ':count -nzinya', 'a_minute' => ':count -nzinya', ]); ================================================ FILE: src/Carbon/Lang/rwk.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/sa.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sa_IN.php'; ================================================ FILE: src/Carbon/Lang/sa_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - The Debian project Christian Perrier bubulle@debian.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D-MM-YY', ], 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'weekdays' => ['रविवासर:', 'सोमवासर:', 'मंगलवासर:', 'बुधवासर:', 'बृहस्पतिवासरः', 'शुक्रवासर', 'शनिवासर:'], 'weekdays_short' => ['रविः', 'सोम:', 'मंगल:', 'बुध:', 'बृहस्पतिः', 'शुक्र', 'शनि:'], 'weekdays_min' => ['रविः', 'सोम:', 'मंगल:', 'बुध:', 'बृहस्पतिः', 'शुक्र', 'शनि:'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], 'minute' => ':count होरा', // less reliable 'min' => ':count होरा', // less reliable 'a_minute' => ':count होरा', // less reliable 'year' => ':count वर्ष', 'y' => ':count वर्ष', 'a_year' => ':count वर्ष', 'month' => ':count मास', 'm' => ':count मास', 'a_month' => ':count मास', 'week' => ':count सप्ताहः saptahaĥ', 'w' => ':count सप्ताहः saptahaĥ', 'a_week' => ':count सप्ताहः saptahaĥ', 'day' => ':count दिन', 'd' => ':count दिन', 'a_day' => ':count दिन', 'hour' => ':count घण्टा', 'h' => ':count घण्टा', 'a_hour' => ':count घण्टा', 'second' => ':count द्वितीयः', 's' => ':count द्वितीयः', 'a_second' => ':count द्वितीयः', ]); ================================================ FILE: src/Carbon/Lang/sah.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sah_RU.php'; ================================================ FILE: src/Carbon/Lang/sah_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Valery Timiriliyev Valery Timiriliyev timiriliyev@gmail.com */ return array_replace_recursive(require __DIR__.'/ru.php', [ 'formats' => [ 'L' => 'YYYY.MM.DD', ], 'months' => ['тохсунньу', 'олунньу', 'кулун тутар', 'муус устар', 'ыам ыйын', 'бэс ыйын', 'от ыйын', 'атырдьах ыйын', 'балаҕан ыйын', 'алтынньы', 'сэтинньи', 'ахсынньы'], 'months_short' => ['тохс', 'олун', 'кул', 'муус', 'ыам', 'бэс', 'от', 'атыр', 'бал', 'алт', 'сэт', 'ахс'], 'weekdays' => ['баскыһыанньа', 'бэнидиэнньик', 'оптуорунньук', 'сэрэдэ', 'чэппиэр', 'бээтинсэ', 'субуота'], 'weekdays_short' => ['бс', 'бн', 'оп', 'ср', 'чп', 'бт', 'сб'], 'weekdays_min' => ['бс', 'бн', 'оп', 'ср', 'чп', 'бт', 'сб'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/saq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['Tesiran', 'Teipa'], 'weekdays' => ['Mderot ee are', 'Mderot ee kuni', 'Mderot ee ong’wan', 'Mderot ee inet', 'Mderot ee ile', 'Mderot ee sapa', 'Mderot ee kwe'], 'weekdays_short' => ['Are', 'Kun', 'Ong', 'Ine', 'Ile', 'Sap', 'Kwe'], 'weekdays_min' => ['Are', 'Kun', 'Ong', 'Ine', 'Ile', 'Sap', 'Kwe'], 'months' => ['Lapa le obo', 'Lapa le waare', 'Lapa le okuni', 'Lapa le ong’wan', 'Lapa le imet', 'Lapa le ile', 'Lapa le sapa', 'Lapa le isiet', 'Lapa le saal', 'Lapa le tomon', 'Lapa le tomon obo', 'Lapa le tomon waare'], 'months_short' => ['Obo', 'Waa', 'Oku', 'Ong', 'Ime', 'Ile', 'Sap', 'Isi', 'Saa', 'Tom', 'Tob', 'Tow'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/sat.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sat_IN.php'; ================================================ FILE: src/Carbon/Lang/sat_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat Pune libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जुन', 'जुलाई', 'अगस्त', 'सितम्बर', 'अखथबर', 'नवम्बर', 'दिसम्बर'], 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जुन', 'जुलाई', 'अगस्त', 'सितम्बर', 'अखथबर', 'नवम्बर', 'दिसम्बर'], 'weekdays' => ['सिंगेमाँहाँ', 'ओतेमाँहाँ', 'बालेमाँहाँ', 'सागुनमाँहाँ', 'सारदीमाँहाँ', 'जारुममाँहाँ', 'ञुहुममाँहाँ'], 'weekdays_short' => ['सिंगे', 'ओते', 'बाले', 'सागुन', 'सारदी', 'जारुम', 'ञुहुम'], 'weekdays_min' => ['सिंगे', 'ओते', 'बाले', 'सागुन', 'सारदी', 'जारुम', 'ञुहुम'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'month' => ':count ńindạ cando', // less reliable 'm' => ':count ńindạ cando', // less reliable 'a_month' => ':count ńindạ cando', // less reliable 'week' => ':count mãhã', // less reliable 'w' => ':count mãhã', // less reliable 'a_week' => ':count mãhã', // less reliable 'hour' => ':count ᱥᱳᱱᱚ', // less reliable 'h' => ':count ᱥᱳᱱᱚ', // less reliable 'a_hour' => ':count ᱥᱳᱱᱚ', // less reliable 'minute' => ':count ᱯᱤᱞᱪᱩ', // less reliable 'min' => ':count ᱯᱤᱞᱪᱩ', // less reliable 'a_minute' => ':count ᱯᱤᱞᱪᱩ', // less reliable 'second' => ':count ar', // less reliable 's' => ':count ar', // less reliable 'a_second' => ':count ar', // less reliable 'year' => ':count ne̲s', 'y' => ':count ne̲s', 'a_year' => ':count ne̲s', 'day' => ':count ᱫᱤᱱ', 'd' => ':count ᱫᱤᱱ', 'a_day' => ':count ᱫᱤᱱ', ]); ================================================ FILE: src/Carbon/Lang/sbp.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Lwamilawu', 'Pashamihe'], 'weekdays' => ['Mulungu', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alahamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Mul', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'weekdays_min' => ['Mul', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'months' => ['Mupalangulwa', 'Mwitope', 'Mushende', 'Munyi', 'Mushende Magali', 'Mujimbi', 'Mushipepo', 'Mupuguto', 'Munyense', 'Mokhu', 'Musongandembwe', 'Muhaano'], 'months_short' => ['Mup', 'Mwi', 'Msh', 'Mun', 'Mag', 'Muj', 'Msp', 'Mpg', 'Mye', 'Mok', 'Mus', 'Muh'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/sc.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sc_IT.php'; ================================================ FILE: src/Carbon/Lang/sc_IT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Sardinian Translators Team Massimeddu Cireddu massimeddu@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD. MM. YY', ], 'months' => ['Ghennàrgiu', 'Freàrgiu', 'Martzu', 'Abrile', 'Maju', 'Làmpadas', 'Argiolas//Trìulas', 'Austu', 'Cabudanni', 'Santugaine//Ladàmine', 'Onniasantu//Santandria', 'Nadale//Idas'], 'months_short' => ['Ghe', 'Fre', 'Mar', 'Abr', 'Maj', 'Làm', 'Arg', 'Aus', 'Cab', 'Lad', 'Onn', 'Nad'], 'weekdays' => ['Domìnigu', 'Lunis', 'Martis', 'Mèrcuris', 'Giòbia', 'Chenàbura', 'Sàbadu'], 'weekdays_short' => ['Dom', 'Lun', 'Mar', 'Mèr', 'Giò', 'Che', 'Sàb'], 'weekdays_min' => ['Dom', 'Lun', 'Mar', 'Mèr', 'Giò', 'Che', 'Sàb'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'minute' => ':count mementu', // less reliable 'min' => ':count mementu', // less reliable 'a_minute' => ':count mementu', // less reliable 'year' => ':count annu', 'y' => ':count annu', 'a_year' => ':count annu', 'month' => ':count mese', 'm' => ':count mese', 'a_month' => ':count mese', 'week' => ':count chida', 'w' => ':count chida', 'a_week' => ':count chida', 'day' => ':count dí', 'd' => ':count dí', 'a_day' => ':count dí', 'hour' => ':count ora', 'h' => ':count ora', 'a_hour' => ':count ora', 'second' => ':count secundu', 's' => ':count secundu', 'a_second' => ':count secundu', ]); ================================================ FILE: src/Carbon/Lang/sd.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $months = [ 'جنوري', 'فيبروري', 'مارچ', 'اپريل', 'مئي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر', ]; $weekdays = [ 'آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر', ]; /* * Authors: * - Narain Sagar * - Sawood Alam */ return [ 'year' => ':count '.'سال', 'a_year' => '{1}'.'هڪ سال'.'|:count '.'سال', 'month' => ':count '.'مهينا', 'a_month' => '{1}'.'هڪ مهينو'.'|:count '.'مهينا', 'week' => ':count '.'هفتا', 'a_week' => '{1}'.'ھڪ ھفتو'.'|:count '.'هفتا', 'day' => ':count '.'ڏينهن', 'a_day' => '{1}'.'هڪ ڏينهن'.'|:count '.'ڏينهن', 'hour' => ':count '.'ڪلاڪ', 'a_hour' => '{1}'.'هڪ ڪلاڪ'.'|:count '.'ڪلاڪ', 'minute' => ':count '.'منٽ', 'a_minute' => '{1}'.'هڪ منٽ'.'|:count '.'منٽ', 'second' => ':count '.'سيڪنڊ', 'a_second' => '{1}'.'چند سيڪنڊ'.'|:count '.'سيڪنڊ', 'ago' => ':time اڳ', 'from_now' => ':time پوء', 'diff_yesterday' => 'ڪالهه', 'diff_today' => 'اڄ', 'diff_tomorrow' => 'سڀاڻي', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd، D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[اڄ] LT', 'nextDay' => '[سڀاڻي] LT', 'nextWeek' => 'dddd [اڳين هفتي تي] LT', 'lastDay' => '[ڪالهه] LT', 'lastWeek' => '[گزريل هفتي] dddd [تي] LT', 'sameElse' => 'L', ], 'meridiem' => ['صبح', 'شام'], 'months' => $months, 'months_short' => $months, 'weekdays' => $weekdays, 'weekdays_short' => $weekdays, 'weekdays_min' => $weekdays, 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => ['، ', ' ۽ '], ]; ================================================ FILE: src/Carbon/Lang/sd_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat, Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/sd.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['جنوري', 'فبروري', 'مارچ', 'اپريل', 'مي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽيمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'], 'months_short' => ['جنوري', 'فبروري', 'مارچ', 'اپريل', 'مي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽيمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'], 'weekdays' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], 'weekdays_short' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], 'weekdays_min' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/sd_IN@devanagari.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat, Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/sd.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['जनवरी', 'फबरवरी', 'मार्चि', 'अप्रेल', 'मे', 'जूनि', 'जूलाइ', 'आगस्टु', 'सेप्टेंबरू', 'आक्टूबरू', 'नवंबरू', 'ॾिसंबरू'], 'months_short' => ['जनवरी', 'फबरवरी', 'मार्चि', 'अप्रेल', 'मे', 'जूनि', 'जूलाइ', 'आगस्टु', 'सेप्टेंबरू', 'आक्टूबरू', 'नवंबरू', 'ॾिसंबरू'], 'weekdays' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], 'weekdays_short' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], 'weekdays_min' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], 'day_of_first_week_of_year' => 1, 'meridiem' => ['म.पू.', 'म.नं.'], ]); ================================================ FILE: src/Carbon/Lang/se.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Karamell */ return [ 'year' => '{1}:count jahki|:count jagit', 'a_year' => '{1}okta jahki|:count jagit', 'y' => ':count j.', 'month' => '{1}:count mánnu|:count mánut', 'a_month' => '{1}okta mánnu|:count mánut', 'm' => ':count mán.', 'week' => '{1}:count vahkku|:count vahkku', 'a_week' => '{1}okta vahkku|:count vahkku', 'w' => ':count v.', 'day' => '{1}:count beaivi|:count beaivvit', 'a_day' => '{1}okta beaivi|:count beaivvit', 'd' => ':count b.', 'hour' => '{1}:count diimmu|:count diimmut', 'a_hour' => '{1}okta diimmu|:count diimmut', 'h' => ':count d.', 'minute' => '{1}:count minuhta|:count minuhtat', 'a_minute' => '{1}okta minuhta|:count minuhtat', 'min' => ':count min.', 'second' => '{1}:count sekunddat|:count sekunddat', 'a_second' => '{1}moadde sekunddat|:count sekunddat', 's' => ':count s.', 'ago' => 'maŋit :time', 'from_now' => ':time geažes', 'diff_yesterday' => 'ikte', 'diff_yesterday_regexp' => 'ikte(?:\\s+ti)?', 'diff_today' => 'otne', 'diff_today_regexp' => 'otne(?:\\s+ti)?', 'diff_tomorrow' => 'ihttin', 'diff_tomorrow_regexp' => 'ihttin(?:\\s+ti)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'MMMM D. [b.] YYYY', 'LLL' => 'MMMM D. [b.] YYYY [ti.] HH:mm', 'LLLL' => 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm', ], 'calendar' => [ 'sameDay' => '[otne ti] LT', 'nextDay' => '[ihttin ti] LT', 'nextWeek' => 'dddd [ti] LT', 'lastDay' => '[ikte ti] LT', 'lastWeek' => '[ovddit] dddd [ti] LT', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'], 'months_short' => ['ođđj', 'guov', 'njuk', 'cuo', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'], 'weekdays' => ['sotnabeaivi', 'vuossárga', 'maŋŋebárga', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvardat'], 'weekdays_short' => ['sotn', 'vuos', 'maŋ', 'gask', 'duor', 'bear', 'láv'], 'weekdays_min' => ['s', 'v', 'm', 'g', 'd', 'b', 'L'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' ja '], 'meridiem' => ['i.b.', 'e.b.'], ]; ================================================ FILE: src/Carbon/Lang/se_FI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/se.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'], 'months_short' => ['ođđj', 'guov', 'njuk', 'cuoŋ', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'], 'weekdays' => ['sotnabeaivi', 'mánnodat', 'disdat', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvordat'], 'weekdays_short' => ['so', 'má', 'di', 'ga', 'du', 'be', 'lá'], 'weekdays_min' => ['so', 'má', 'di', 'ga', 'du', 'be', 'lá'], 'meridiem' => ['i', 'e'], ]); ================================================ FILE: src/Carbon/Lang/se_NO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/se.php'; ================================================ FILE: src/Carbon/Lang/se_SE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/se.php'; ================================================ FILE: src/Carbon/Lang/seh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'weekdays' => ['Dimingu', 'Chiposi', 'Chipiri', 'Chitatu', 'Chinai', 'Chishanu', 'Sabudu'], 'weekdays_short' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], 'weekdays_min' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], 'months' => ['Janeiro', 'Fevreiro', 'Marco', 'Abril', 'Maio', 'Junho', 'Julho', 'Augusto', 'Setembro', 'Otubro', 'Novembro', 'Decembro'], 'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Aug', 'Set', 'Otu', 'Nov', 'Dec'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'd [de] MMM [de] YYYY', 'LLL' => 'd [de] MMMM [de] YYYY HH:mm', 'LLLL' => 'dddd, d [de] MMMM [de] YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/ses.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamiisa', 'Alzuma', 'Asibti'], 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'month' => ':count alaada', // less reliable 'm' => ':count alaada', // less reliable 'a_month' => ':count alaada', // less reliable 'hour' => ':count ɲaajin', // less reliable 'h' => ':count ɲaajin', // less reliable 'a_hour' => ':count ɲaajin', // less reliable 'minute' => ':count zarbu', // less reliable 'min' => ':count zarbu', // less reliable 'a_minute' => ':count zarbu', // less reliable 'year' => ':count jiiri', 'y' => ':count jiiri', 'a_year' => ':count jiiri', 'week' => ':count jirbiiyye', 'w' => ':count jirbiiyye', 'a_week' => ':count jirbiiyye', 'day' => ':count zaari', 'd' => ':count zaari', 'a_day' => ':count zaari', 'second' => ':count ihinkante', 's' => ':count ihinkante', 'a_second' => ':count ihinkante', ]); ================================================ FILE: src/Carbon/Lang/sg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ND', 'LK'], 'weekdays' => ['Bikua-ôko', 'Bïkua-ûse', 'Bïkua-ptâ', 'Bïkua-usïö', 'Bïkua-okü', 'Lâpôsö', 'Lâyenga'], 'weekdays_short' => ['Bk1', 'Bk2', 'Bk3', 'Bk4', 'Bk5', 'Lâp', 'Lây'], 'weekdays_min' => ['Bk1', 'Bk2', 'Bk3', 'Bk4', 'Bk5', 'Lâp', 'Lây'], 'months' => ['Nyenye', 'Fulundïgi', 'Mbängü', 'Ngubùe', 'Bêläwü', 'Föndo', 'Lengua', 'Kükürü', 'Mvuka', 'Ngberere', 'Nabändüru', 'Kakauka'], 'months_short' => ['Nye', 'Ful', 'Mbä', 'Ngu', 'Bêl', 'Fön', 'Len', 'Kük', 'Mvu', 'Ngb', 'Nab', 'Kak'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'year' => ':count dā', // less reliable 'y' => ':count dā', // less reliable 'a_year' => ':count dā', // less reliable 'week' => ':count bïkua-okü', // less reliable 'w' => ':count bïkua-okü', // less reliable 'a_week' => ':count bïkua-okü', // less reliable 'day' => ':count ziggawâ', // less reliable 'd' => ':count ziggawâ', // less reliable 'a_day' => ':count ziggawâ', // less reliable 'hour' => ':count yângâködörö', // less reliable 'h' => ':count yângâködörö', // less reliable 'a_hour' => ':count yângâködörö', // less reliable 'second' => ':count bïkua-ôko', // less reliable 's' => ':count bïkua-ôko', // less reliable 'a_second' => ':count bïkua-ôko', // less reliable 'month' => ':count Nze tî ngu', 'm' => ':count Nze tî ngu', 'a_month' => ':count Nze tî ngu', ]); ================================================ FILE: src/Carbon/Lang/sgs.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sgs_LT.php'; ================================================ FILE: src/Carbon/Lang/sgs_LT.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Arnas Udovičius bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY.MM.DD', ], 'months' => ['sausė', 'vasarė', 'kuova', 'balondė', 'gegožės', 'bėrželė', 'lëpas', 'rogpjūtė', 'siejės', 'spalė', 'lapkrėstė', 'grůdė'], 'months_short' => ['Sau', 'Vas', 'Kuo', 'Bal', 'Geg', 'Bėr', 'Lëp', 'Rgp', 'Sie', 'Spa', 'Lap', 'Grd'], 'weekdays' => ['nedielės dëna', 'panedielis', 'oterninks', 'sereda', 'četvergs', 'petnīčė', 'sobata'], 'weekdays_short' => ['Nd', 'Pn', 'Ot', 'Sr', 'Čt', 'Pt', 'Sb'], 'weekdays_min' => ['Nd', 'Pn', 'Ot', 'Sr', 'Čt', 'Pt', 'Sb'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'minute' => ':count mažos', // less reliable 'min' => ':count mažos', // less reliable 'a_minute' => ':count mažos', // less reliable 'year' => ':count metā', 'y' => ':count metā', 'a_year' => ':count metā', 'month' => ':count mienou', 'm' => ':count mienou', 'a_month' => ':count mienou', 'week' => ':count nedielė', 'w' => ':count nedielė', 'a_week' => ':count nedielė', 'day' => ':count dīna', 'd' => ':count dīna', 'a_day' => ':count dīna', 'hour' => ':count adīna', 'h' => ':count adīna', 'a_hour' => ':count adīna', 'second' => ':count Sekondė', 's' => ':count Sekondė', 'a_second' => ':count Sekondė', ]); ================================================ FILE: src/Carbon/Lang/sh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Томица Кораћ * - Enrique Vidal * - Christopher Dell * - dmilisic * - danijel * - Miroslav Matkovic (mikki021) */ return [ 'diff_now' => 'sada', 'diff_yesterday' => 'juče', 'diff_tomorrow' => 'sutra', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'MMMM D, YYYY', 'LLL' => 'DD MMM HH:mm', 'LLLL' => 'MMMM DD, YYYY HH:mm', ], 'year' => ':count godina|:count godine|:count godina', 'y' => ':count g.', 'month' => ':count mesec|:count meseca|:count meseci', 'm' => ':count m.', 'week' => ':count nedelja|:count nedelje|:count nedelja', 'w' => ':count n.', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count d.', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count č.', 'minute' => ':count minut|:count minuta|:count minuta', 'min' => ':count min.', 'second' => ':count sekund|:count sekunde|:count sekundi', 's' => ':count s.', 'ago' => 'pre :time', 'from_now' => 'za :time', 'after' => 'nakon :time', 'before' => ':time raniјe', 'weekdays' => ['Nedelja', 'Ponedeljak', 'Utorak', 'Sreda', 'Četvrtak', 'Petak', 'Subota'], 'weekdays_short' => ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], 'weekdays_min' => ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], 'months' => ['Januar', 'Februar', 'Mart', 'April', 'Maj', 'Jun', 'Jul', 'Avgust', 'Septembar', 'Oktobar', 'Novembar', 'Decembar'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'], 'list' => [', ', ' i '], 'meridiem' => ['pre podne', 'po podne'], ]; ================================================ FILE: src/Carbon/Lang/shi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵕⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], 'weekdays_short' => ['ⴰⵙⴰ', 'ⴰⵢⵏ', 'ⴰⵙⵉ', 'ⴰⴽⵕ', 'ⴰⴽⵡ', 'ⴰⵙⵉⵎ', 'ⴰⵙⵉⴹ'], 'weekdays_min' => ['ⴰⵙⴰ', 'ⴰⵢⵏ', 'ⴰⵙⵉ', 'ⴰⴽⵕ', 'ⴰⴽⵡ', 'ⴰⵙⵉⵎ', 'ⴰⵙⵉⴹ'], 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵜⵓⴱⵔ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'], 'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵜⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'], 'first_day_of_week' => 6, 'weekend' => [5, 6], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'year' => ':count aseggwas', 'y' => ':count aseggwas', 'a_year' => ':count aseggwas', 'month' => ':count ayyur', 'm' => ':count ayyur', 'a_month' => ':count ayyur', 'week' => ':count imalass', 'w' => ':count imalass', 'a_week' => ':count imalass', 'day' => ':count ass', 'd' => ':count ass', 'a_day' => ':count ass', 'hour' => ':count urɣ', // less reliable 'h' => ':count urɣ', // less reliable 'a_hour' => ':count urɣ', // less reliable 'minute' => ':count ⴰⵎⵥⵉ', // less reliable 'min' => ':count ⴰⵎⵥⵉ', // less reliable 'a_minute' => ':count ⴰⵎⵥⵉ', // less reliable 'second' => ':count sin', // less reliable 's' => ':count sin', // less reliable 'a_second' => ':count sin', // less reliable ]); ================================================ FILE: src/Carbon/Lang/shi_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/shi.php', [ 'meridiem' => ['tifawt', 'tadggʷat'], 'weekdays' => ['asamas', 'aynas', 'asinas', 'akṛas', 'akwas', 'asimwas', 'asiḍyas'], 'weekdays_short' => ['asa', 'ayn', 'asi', 'akṛ', 'akw', 'asim', 'asiḍ'], 'weekdays_min' => ['asa', 'ayn', 'asi', 'akṛ', 'akw', 'asim', 'asiḍ'], 'months' => ['innayr', 'bṛayṛ', 'maṛṣ', 'ibrir', 'mayyu', 'yunyu', 'yulyuz', 'ɣuct', 'cutanbir', 'ktubr', 'nuwanbir', 'dujanbir'], 'months_short' => ['inn', 'bṛa', 'maṛ', 'ibr', 'may', 'yun', 'yul', 'ɣuc', 'cut', 'ktu', 'nuw', 'duj'], 'first_day_of_week' => 6, 'weekend' => [5, 6], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'minute' => ':count agur', // less reliable 'min' => ':count agur', // less reliable 'a_minute' => ':count agur', // less reliable ]); ================================================ FILE: src/Carbon/Lang/shi_Tfng.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/shi.php'; ================================================ FILE: src/Carbon/Lang/shn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/shn_MM.php'; ================================================ FILE: src/Carbon/Lang/shn_MM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - ubuntu Myanmar LoCo Team https://ubuntu-mm.net Bone Pyae Sone bone.burma@mail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'OY MMM OD dddd', ], 'months' => ['လိူၼ်ၵမ်', 'လိူၼ်သၢမ်', 'လိူၼ်သီ', 'လိူၼ်ႁႃႈ', 'လိူၼ်ႁူၵ်း', 'လိူၼ်ၸဵတ်း', 'လိူၼ်ပႅတ်ႇ', 'လိူၼ်ၵဝ်ႈ', 'လိူၼ်သိပ်း', 'လိူၼ်သိပ်းဢိတ်း', 'လိူၼ်သိပ်းဢိတ်းသွင်', 'လိူၼ်ၸဵင်'], 'months_short' => ['လိူၼ်ၵမ်', 'လိူၼ်သၢမ်', 'လိူၼ်သီ', 'လိူၼ်ႁႃႈ', 'လိူၼ်ႁူၵ်း', 'လိူၼ်ၸဵတ်း', 'လိူၼ်ပႅတ်ႇ', 'လိူၼ်ၵဝ်ႈ', 'လိူၼ်သိပ်း', 'လိူၼ်သိပ်းဢိတ်း', 'လိူၼ်သိပ်းဢိတ်းသွင်', 'လိူၼ်ၸဵင်'], 'weekdays' => ['ဝၼ်းဢႃးတိတ်ႉ', 'ဝၼ်းၸၼ်', 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း', 'ဝၼ်းပူတ်ႉ', 'ဝၼ်းၽတ်း', 'ဝၼ်းသုၵ်း', 'ဝၼ်းသဝ်'], 'weekdays_short' => ['တိတ့်', 'ၸၼ်', 'ၵၢၼ်း', 'ပုတ့်', 'ၽတ်း', 'သုၵ်း', 'သဝ်'], 'weekdays_min' => ['တိတ့်', 'ၸၼ်', 'ၵၢၼ်း', 'ပုတ့်', 'ၽတ်း', 'သုၵ်း', 'သဝ်'], 'alt_numbers' => ['႐႐', '႐႑', '႐႒', '႐႓', '႐႔', '႐႕', '႐႖', '႐႗', '႐႘', '႐႙', '႑႐', '႑႑', '႑႒', '႑႓', '႑႔', '႑႕', '႑႖', '႑႗', '႑႘', '႑႙', '႒႐', '႒႑', '႒႒', '႒႓', '႒႔', '႒႕', '႒႖', '႒႗', '႒႘', '႒႙', '႓႐', '႓႑', '႓႒', '႓႓', '႓႔', '႓႕', '႓႖', '႓႗', '႓႘', '႓႙', '႔႐', '႔႑', '႔႒', '႔႓', '႔႔', '႔႕', '႔႖', '႔႗', '႔႘', '႔႙', '႕႐', '႕႑', '႕႒', '႕႓', '႕႔', '႕႕', '႕႖', '႕႗', '႕႘', '႕႙', '႖႐', '႖႑', '႖႒', '႖႓', '႖႔', '႖႕', '႖႖', '႖႗', '႖႘', '႖႙', '႗႐', '႗႑', '႗႒', '႗႓', '႗႔', '႗႕', '႗႖', '႗႗', '႗႘', '႗႙', '႘႐', '႘႑', '႘႒', '႘႓', '႘႔', '႘႕', '႘႖', '႘႗', '႘႘', '႘႙', '႙႐', '႙႑', '႙႒', '႙႓', '႙႔', '႙႕', '႙႖', '႙႗', '႙႘', '႙႙'], 'meridiem' => ['ၵၢင်ၼႂ်', 'တၢမ်းၶမ်ႈ'], 'month' => ':count လိူၼ်', // less reliable 'm' => ':count လိူၼ်', // less reliable 'a_month' => ':count လိူၼ်', // less reliable 'week' => ':count ဝၼ်း', // less reliable 'w' => ':count ဝၼ်း', // less reliable 'a_week' => ':count ဝၼ်း', // less reliable 'hour' => ':count ຕີ', // less reliable 'h' => ':count ຕີ', // less reliable 'a_hour' => ':count ຕີ', // less reliable 'minute' => ':count ເດັກ', // less reliable 'min' => ':count ເດັກ', // less reliable 'a_minute' => ':count ເດັກ', // less reliable 'second' => ':count ဢိုၼ်ႇ', // less reliable 's' => ':count ဢိုၼ်ႇ', // less reliable 'a_second' => ':count ဢိုၼ်ႇ', // less reliable 'year' => ':count ပီ', 'y' => ':count ပီ', 'a_year' => ':count ပီ', 'day' => ':count ກາງວັນ', 'd' => ':count ກາງວັນ', 'a_day' => ':count ກາງວັນ', ]); ================================================ FILE: src/Carbon/Lang/shs.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/shs_CA.php'; ================================================ FILE: src/Carbon/Lang/shs_CA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Neskie Manuel bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Pellkwet̓min', 'Pelctsipwen̓ten', 'Pellsqépts', 'Peslléwten', 'Pell7ell7é7llqten', 'Pelltspéntsk', 'Pelltqwelq̓wél̓t', 'Pellct̓éxel̓cten', 'Pesqelqlélten', 'Pesllwélsten', 'Pellc7ell7é7llcwten̓', 'Pelltetétq̓em'], 'months_short' => ['Kwe', 'Tsi', 'Sqe', 'Éwt', 'Ell', 'Tsp', 'Tqw', 'Ct̓é', 'Qel', 'Wél', 'U7l', 'Tet'], 'weekdays' => ['Sxetspesq̓t', 'Spetkesq̓t', 'Selesq̓t', 'Skellesq̓t', 'Smesesq̓t', 'Stselkstesq̓t', 'Stqmekstesq̓t'], 'weekdays_short' => ['Sxe', 'Spe', 'Sel', 'Ske', 'Sme', 'Sts', 'Stq'], 'weekdays_min' => ['Sxe', 'Spe', 'Sel', 'Ske', 'Sme', 'Sts', 'Stq'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => ':count sqlélten', // less reliable 'y' => ':count sqlélten', // less reliable 'a_year' => ':count sqlélten', // less reliable 'month' => ':count swewll', // less reliable 'm' => ':count swewll', // less reliable 'a_month' => ':count swewll', // less reliable 'hour' => ':count seqwlút', // less reliable 'h' => ':count seqwlút', // less reliable 'a_hour' => ':count seqwlút', // less reliable ]); ================================================ FILE: src/Carbon/Lang/si.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Serhan Apaydın * - JD Isaacks * - Malinda Weerasinghe (MalindaWMD) */ return [ 'year' => '{1}වසර 1|වසර :count', 'a_year' => '{1}වසරක්|වසර :count', 'month' => '{1}මාස 1|මාස :count', 'a_month' => '{1}මාසය|මාස :count', 'week' => '{1}සති 1|සති :count', 'a_week' => '{1}සතියක්|සති :count', 'day' => '{1}දින 1|දින :count', 'a_day' => '{1}දිනක්|දින :count', 'hour' => '{1}පැය 1|පැය :count', 'a_hour' => '{1}පැයක්|පැය :count', 'minute' => '{1}මිනිත්තු 1|මිනිත්තු :count', 'a_minute' => '{1}මිනිත්තුවක්|මිනිත්තු :count', 'second' => '{1}තත්පර 1|තත්පර :count', 'a_second' => '{1}තත්පර කිහිපයකට|තත්පර :count', 'ago' => ':time කට පෙර', 'from_now' => static function ($time) { if (preg_match('/දින \d+/u', $time)) { return $time.' න්'; } return $time.' කින්'; }, 'before' => ':time කට පෙර', 'after' => static function ($time) { if (preg_match('/දින \d+/u', $time)) { return $time.' න්'; } return $time.' කින්'; }, 'diff_now' => 'දැන්', 'diff_today' => 'අද', 'diff_yesterday' => 'ඊයේ', 'diff_tomorrow' => 'හෙට', 'formats' => [ 'LT' => 'a h:mm', 'LTS' => 'a h:mm:ss', 'L' => 'YYYY/MM/DD', 'LL' => 'YYYY MMMM D', 'LLL' => 'YYYY MMMM D, a h:mm', 'LLLL' => 'YYYY MMMM D [වැනි] dddd, a h:mm:ss', ], 'calendar' => [ 'sameDay' => '[අද] LT[ට]', 'nextDay' => '[හෙට] LT[ට]', 'nextWeek' => 'dddd LT[ට]', 'lastDay' => '[ඊයේ] LT[ට]', 'lastWeek' => '[පසුගිය] dddd LT[ට]', 'sameElse' => 'L', ], 'ordinal' => ':number වැනි', 'meridiem' => ['පෙර වරු', 'පස් වරු', 'පෙ.ව.', 'ප.ව.'], 'months' => ['ජනවාරි', 'පෙබරවාරි', 'මාර්තු', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝස්තු', 'සැප්තැම්බර්', 'ඔක්තෝබර්', 'නොවැම්බර්', 'දෙසැම්බර්'], 'months_short' => ['ජන', 'පෙබ', 'මාර්', 'අප්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝ', 'සැප්', 'ඔක්', 'නොවැ', 'දෙසැ'], 'weekdays' => ['ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්‍රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා'], 'weekdays_short' => ['ඉරි', 'සඳු', 'අඟ', 'බදා', 'බ්‍රහ', 'සිකු', 'සෙන'], 'weekdays_min' => ['ඉ', 'ස', 'අ', 'බ', 'බ්‍ර', 'සි', 'සෙ'], 'first_day_of_week' => 1, ]; ================================================ FILE: src/Carbon/Lang/si_LK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/si.php'; ================================================ FILE: src/Carbon/Lang/sid.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sid_ET.php'; ================================================ FILE: src/Carbon/Lang/sid_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 'weekdays' => ['Sambata', 'Sanyo', 'Maakisanyo', 'Roowe', 'Hamuse', 'Arbe', 'Qidaame'], 'weekdays_short' => ['Sam', 'San', 'Mak', 'Row', 'Ham', 'Arb', 'Qid'], 'weekdays_min' => ['Sam', 'San', 'Mak', 'Row', 'Ham', 'Arb', 'Qid'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['soodo', 'hawwaro'], ]); ================================================ FILE: src/Carbon/Lang/sk.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Martin Suja * - Tsutomu Kuroda * - tjku * - Max Melentiev * - Juanito Fatas * - Ivan Stana * - Akira Matsuda * - Christopher Dell * - James McKinney * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Jozef Fulop * - Nicolás Hock Isaza * - Tom Hughes * - Simon Hürlimann (CyT) * - jofi * - Jakub ADAMEC * - Marek Adamický * - AlterwebStudio * - Peter Kundis */ use Carbon\CarbonInterface; $fromNow = function ($time) { return 'o '.strtr($time, [ 'hodina' => 'hodinu', 'minúta' => 'minútu', 'sekunda' => 'sekundu', ]); }; $ago = function ($time) { $replacements = [ '/\bhodina\b/' => 'hodinou', '/\bminúta\b/' => 'minútou', '/\bsekunda\b/' => 'sekundou', '/\bdeň\b/u' => 'dňom', '/\btýždeň\b/u' => 'týždňom', '/\bmesiac\b/' => 'mesiacom', '/\brok\b/' => 'rokom', ]; $replacementsPlural = [ '/\b(?:hodiny|hodín)\b/' => 'hodinami', '/\b(?:minúty|minút)\b/' => 'minútami', '/\b(?:sekundy|sekúnd)\b/' => 'sekundami', '/\bdeň\b/' => 'dňom', '/\bdni\b/' => 'dňami', '/\bdní\b/u' => 'dňami', '/\b(?:týždne|týždňov)\b/' => 'týždňami', '/\b(?:mesiace|mesiacov)\b/' => 'mesiacmi', '/\b(?:roky|rokov)\b/' => 'rokmi', ]; foreach ($replacements + $replacementsPlural as $pattern => $replacement) { $time = preg_replace($pattern, $replacement, $time); } return "pred $time"; }; return [ 'year' => ':count rok|:count roky|:count rokov', 'a_year' => 'rok|:count roky|:count rokov', 'y' => ':count r', 'month' => ':count mesiac|:count mesiace|:count mesiacov', 'a_month' => 'mesiac|:count mesiace|:count mesiacov', 'm' => ':count m', 'week' => ':count týždeň|:count týždne|:count týždňov', 'a_week' => 'týždeň|:count týždne|:count týždňov', 'w' => ':count t', 'day' => ':count deň|:count dni|:count dní', 'a_day' => 'deň|:count dni|:count dní', 'd' => ':count d', 'hour' => ':count hodina|:count hodiny|:count hodín', 'a_hour' => 'hodina|:count hodiny|:count hodín', 'h' => ':count h', 'minute' => ':count minúta|:count minúty|:count minút', 'a_minute' => 'minúta|:count minúty|:count minút', 'min' => ':count min', 'second' => ':count sekunda|:count sekundy|:count sekúnd', 'a_second' => 'sekunda|:count sekundy|:count sekúnd', 's' => ':count s', 'millisecond' => ':count milisekunda|:count milisekundy|:count milisekúnd', 'a_millisecond' => 'milisekunda|:count milisekundy|:count milisekúnd', 'ms' => ':count ms', 'microsecond' => ':count mikrosekunda|:count mikrosekundy|:count mikrosekúnd', 'a_microsecond' => 'mikrosekunda|:count mikrosekundy|:count mikrosekúnd', 'µs' => ':count µs', 'ago' => $ago, 'from_now' => $fromNow, 'before' => ':time pred', 'after' => ':time po', 'hour_after' => ':count hodinu|:count hodiny|:count hodín', 'minute_after' => ':count minútu|:count minúty|:count minút', 'second_after' => ':count sekundu|:count sekundy|:count sekúnd', 'hour_before' => ':count hodinu|:count hodiny|:count hodín', 'minute_before' => ':count minútu|:count minúty|:count minút', 'second_before' => ':count sekundu|:count sekundy|:count sekúnd', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' a '], 'diff_now' => 'teraz', 'diff_yesterday' => 'včera', 'diff_tomorrow' => 'zajtra', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'DD. MMMM YYYY', 'LLL' => 'D. M. HH:mm', 'LLLL' => 'dddd D. MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[dnes o] LT', 'nextDay' => '[zajtra o] LT', 'lastDay' => '[včera o] LT', 'nextWeek' => 'dddd [o] LT', 'lastWeek' => static function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 1: case 2: case 4: case 5: return '[minulý] dddd [o] LT'; //pondelok/utorok/štvrtok/piatok default: return '[minulá] dddd [o] LT'; } }, 'sameElse' => 'L', ], 'weekdays' => ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'], 'weekdays_short' => ['ned', 'pon', 'uto', 'str', 'štv', 'pia', 'sob'], 'weekdays_min' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'], 'months' => ['januára', 'februára', 'marca', 'apríla', 'mája', 'júna', 'júla', 'augusta', 'septembra', 'októbra', 'novembra', 'decembra'], 'months_standalone' => ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'], 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'meridiem' => ['dopoludnia', 'popoludní'], ]; ================================================ FILE: src/Carbon/Lang/sk_SK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sk.php'; ================================================ FILE: src/Carbon/Lang/sl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - tjku * - Max Melentiev * - Juanito Fatas * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Nicolás Hock Isaza * - Miha Rebernik * - Gal Jakič (morpheus7CS) * - Glavić * - Anže Časar * - Lovro Tramšek (Lovro1107) * - burut13 */ use Carbon\CarbonInterface; return [ 'year' => ':count leto|:count leti|:count leta|:count let', 'y' => ':count leto|:count leti|:count leta|:count let', 'month' => ':count mesec|:count meseca|:count mesece|:count mesecev', 'm' => ':count mes.', 'week' => ':count teden|:count tedna|:count tedne|:count tednov', 'w' => ':count ted.', 'day' => ':count dan|:count dni|:count dni|:count dni', 'd' => ':count dan|:count dni|:count dni|:count dni', 'hour' => ':count ura|:count uri|:count ure|:count ur', 'h' => ':count h', 'minute' => ':count minuta|:count minuti|:count minute|:count minut', 'min' => ':count min.', 'second' => ':count sekunda|:count sekundi|:count sekunde|:count sekund', 'a_second' => '{1}nekaj sekund|:count sekunda|:count sekundi|:count sekunde|:count sekund', 's' => ':count s', 'year_ago' => ':count letom|:count letoma|:count leti|:count leti', 'y_ago' => ':count letom|:count letoma|:count leti|:count leti', 'month_ago' => ':count mesecem|:count mesecema|:count meseci|:count meseci', 'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni', 'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', 'd_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', 'hour_ago' => ':count uro|:count urama|:count urami|:count urami', 'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami', 'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami', 'day_from_now' => ':count dan|:count dneva|:count dni|:count dni', 'd_from_now' => ':count dan|:count dneva|:count dni|:count dni', 'hour_from_now' => ':count uro|:count uri|:count ure|:count ur', 'minute_from_now' => ':count minuto|:count minuti|:count minute|:count minut', 'second_from_now' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', 'ago' => 'pred :time', 'from_now' => 'čez :time', 'after' => ':time kasneje', 'before' => ':time prej', 'diff_now' => 'ravnokar', 'diff_today' => 'danes', 'diff_today_regexp' => 'danes(?:\\s+ob)?', 'diff_yesterday' => 'včeraj', 'diff_yesterday_regexp' => 'včeraj(?:\\s+ob)?', 'diff_tomorrow' => 'jutri', 'diff_tomorrow_regexp' => 'jutri(?:\\s+ob)?', 'diff_before_yesterday' => 'predvčerajšnjim', 'diff_after_tomorrow' => 'pojutrišnjem', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'period_start_date' => 'od :date', 'period_end_date' => 'do :date', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY H:mm', 'LLLL' => 'dddd, D. MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[danes ob] LT', 'nextDay' => '[jutri ob] LT', 'nextWeek' => 'dddd [ob] LT', 'lastDay' => '[včeraj ob] LT', 'lastWeek' => static function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[preteklo] [nedeljo] [ob] LT'; case 1: return '[pretekli] [ponedeljek] [ob] LT'; case 2: return '[pretekli] [torek] [ob] LT'; case 3: return '[preteklo] [sredo] [ob] LT'; case 4: return '[pretekli] [četrtek] [ob] LT'; case 5: return '[pretekli] [petek] [ob] LT'; case 6: return '[preteklo] [soboto] [ob] LT'; } }, 'sameElse' => 'L', ], 'months' => ['januarja', 'februarja', 'marca', 'aprila', 'maja', 'junija', 'julija', 'avgusta', 'septembra', 'oktobra', 'novembra', 'decembra'], 'months_standalone' => ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec'], 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => ['nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota'], 'weekdays_short' => ['ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob'], 'weekdays_min' => ['ne', 'po', 'to', 'sr', 'če', 'pe', 'so'], 'list' => [', ', ' in '], 'meridiem' => ['dopoldan', 'popoldan'], ]; ================================================ FILE: src/Carbon/Lang/sl_SI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sl.php'; ================================================ FILE: src/Carbon/Lang/sm.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/sm_WS.php'; ================================================ FILE: src/Carbon/Lang/sm_WS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Ianuari', 'Fepuari', 'Mati', 'Aperila', 'Me', 'Iuni', 'Iulai', 'Auguso', 'Setema', 'Oketopa', 'Novema', 'Tesema'], 'months_short' => ['Ian', 'Fep', 'Mat', 'Ape', 'Me', 'Iun', 'Iul', 'Aug', 'Set', 'Oke', 'Nov', 'Tes'], 'weekdays' => ['Aso Sa', 'Aso Gafua', 'Aso Lua', 'Aso Lulu', 'Aso Tofi', 'Aso Farail', 'Aso To\'ana\'i'], 'weekdays_short' => ['Aso Sa', 'Aso Gaf', 'Aso Lua', 'Aso Lul', 'Aso Tof', 'Aso Far', 'Aso To\''], 'weekdays_min' => ['Aso Sa', 'Aso Gaf', 'Aso Lua', 'Aso Lul', 'Aso Tof', 'Aso Far', 'Aso To\''], 'hour' => ':count uati', // less reliable 'h' => ':count uati', // less reliable 'a_hour' => ':count uati', // less reliable 'minute' => ':count itiiti', // less reliable 'min' => ':count itiiti', // less reliable 'a_minute' => ':count itiiti', // less reliable 'second' => ':count lua', // less reliable 's' => ':count lua', // less reliable 'a_second' => ':count lua', // less reliable 'year' => ':count tausaga', 'y' => ':count tausaga', 'a_year' => ':count tausaga', 'month' => ':count māsina', 'm' => ':count māsina', 'a_month' => ':count māsina', 'week' => ':count vaiaso', 'w' => ':count vaiaso', 'a_week' => ':count vaiaso', 'day' => ':count aso', 'd' => ':count aso', 'a_day' => ':count aso', ]); ================================================ FILE: src/Carbon/Lang/smn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ip.', 'ep.'], 'weekdays' => ['pasepeeivi', 'vuossaargâ', 'majebaargâ', 'koskoho', 'tuorâstuv', 'vástuppeeivi', 'lávurduv'], 'weekdays_short' => ['pas', 'vuo', 'maj', 'kos', 'tuo', 'vás', 'láv'], 'weekdays_min' => ['pa', 'vu', 'ma', 'ko', 'tu', 'vá', 'lá'], 'weekdays_standalone' => ['pasepeivi', 'vuossargâ', 'majebargâ', 'koskokko', 'tuorâstâh', 'vástuppeivi', 'lávurdâh'], 'months' => ['uđđâivemáánu', 'kuovâmáánu', 'njuhčâmáánu', 'cuáŋuimáánu', 'vyesimáánu', 'kesimáánu', 'syeinimáánu', 'porgemáánu', 'čohčâmáánu', 'roovvâdmáánu', 'skammâmáánu', 'juovlâmáánu'], 'months_short' => ['uđiv', 'kuovâ', 'njuhčâ', 'cuáŋui', 'vyesi', 'kesi', 'syeini', 'porge', 'čohčâ', 'roovvâd', 'skammâ', 'juovlâ'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'H.mm', 'LTS' => 'H.mm.ss', 'L' => 'D.M.YYYY', 'LL' => 'MMM D. YYYY', 'LLL' => 'MMMM D. YYYY H.mm', 'LLLL' => 'dddd, MMMM D. YYYY H.mm', ], 'hour' => ':count äigi', // less reliable 'h' => ':count äigi', // less reliable 'a_hour' => ':count äigi', // less reliable 'year' => ':count ihe', 'y' => ':count ihe', 'a_year' => ':count ihe', 'month' => ':count mánuppaje', 'm' => ':count mánuppaje', 'a_month' => ':count mánuppaje', 'week' => ':count okko', 'w' => ':count okko', 'a_week' => ':count okko', 'day' => ':count peivi', 'd' => ':count peivi', 'a_day' => ':count peivi', 'minute' => ':count miinut', 'min' => ':count miinut', 'a_minute' => ':count miinut', 'second' => ':count nubbe', 's' => ':count nubbe', 'a_second' => ':count nubbe', ]); ================================================ FILE: src/Carbon/Lang/sn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'meridiem' => ['a', 'p'], 'weekdays' => ['Svondo', 'Muvhuro', 'Chipiri', 'Chitatu', 'China', 'Chishanu', 'Mugovera'], 'weekdays_short' => ['Svo', 'Muv', 'Chp', 'Cht', 'Chn', 'Chs', 'Mug'], 'weekdays_min' => ['Sv', 'Mu', 'Cp', 'Ct', 'Cn', 'Cs', 'Mg'], 'months' => ['Ndira', 'Kukadzi', 'Kurume', 'Kubvumbi', 'Chivabvu', 'Chikumi', 'Chikunguru', 'Nyamavhuvhu', 'Gunyana', 'Gumiguru', 'Mbudzi', 'Zvita'], 'months_short' => ['Ndi', 'Kuk', 'Kur', 'Kub', 'Chv', 'Chk', 'Chg', 'Nya', 'Gun', 'Gum', 'Mbu', 'Zvi'], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'YYYY MMMM D, dddd HH:mm', ], 'year' => 'makore :count', 'y' => 'makore :count', 'a_year' => 'makore :count', 'month' => 'mwedzi :count', 'm' => 'mwedzi :count', 'a_month' => 'mwedzi :count', 'week' => 'vhiki :count', 'w' => 'vhiki :count', 'a_week' => 'vhiki :count', 'day' => 'mazuva :count', 'd' => 'mazuva :count', 'a_day' => 'mazuva :count', 'hour' => 'maawa :count', 'h' => 'maawa :count', 'a_hour' => 'maawa :count', 'minute' => 'minitsi :count', 'min' => 'minitsi :count', 'a_minute' => 'minitsi :count', 'second' => 'sekonzi :count', 's' => 'sekonzi :count', 'a_second' => 'sekonzi :count', ]); ================================================ FILE: src/Carbon/Lang/so.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Author: * - Abdifatah Abdilahi(@abdifatahz) */ return array_replace_recursive(require __DIR__.'/en.php', [ 'year' => ':count sanad|:count sanadood', 'a_year' => 'sanad|:count sanadood', 'y' => '{1}:countsn|{0}:countsns|[-Inf,Inf]:countsn', 'month' => ':count bil|:count bilood', 'a_month' => 'bil|:count bilood', 'm' => ':countbil', 'week' => ':count isbuuc', 'a_week' => 'isbuuc|:count isbuuc', 'w' => ':countis', 'day' => ':count maalin|:count maalmood', 'a_day' => 'maalin|:count maalmood', 'd' => ':countml', 'hour' => ':count saac', 'a_hour' => 'saacad|:count saac', 'h' => ':countsc', 'minute' => ':count daqiiqo', 'a_minute' => 'daqiiqo|:count daqiiqo', 'min' => ':countdq', 'second' => ':count ilbidhiqsi', 'a_second' => 'xooga ilbidhiqsiyo|:count ilbidhiqsi', 's' => ':countil', 'ago' => ':time kahor', 'from_now' => ':time gudahood', 'after' => ':time kedib', 'before' => ':time kahor', 'diff_now' => 'hada', 'diff_today' => 'maanta', 'diff_today_regexp' => 'maanta(?:\s+markay\s+(?:tahay|ahayd))?', 'diff_yesterday' => 'shalayto', 'diff_yesterday_regexp' => 'shalayto(?:\s+markay\s+ahayd)?', 'diff_tomorrow' => 'beri', 'diff_tomorrow_regexp' => 'beri(?:\s+markay\s+tahay)?', 'diff_before_yesterday' => 'doraato', 'diff_after_tomorrow' => 'saadanbe', 'period_recurrences' => 'mar|:count jeer', 'period_interval' => ':interval kasta', 'period_start_date' => 'laga bilaabo :date', 'period_end_date' => 'ilaa :date', 'months' => ['Janaayo', 'Febraayo', 'Abriil', 'Maajo', 'Juun', 'Luuliyo', 'Agoosto', 'Sebteembar', 'Oktoobar', 'Nofeembar', 'Diseembar'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Abr', 'Mjo', 'Jun', 'Lyo', 'Agt', 'Seb', 'Okt', 'Nof', 'Dis'], 'weekdays' => ['Axad', 'Isniin', 'Talaada', 'Arbaca', 'Khamiis', 'Jimce', 'Sabti'], 'weekdays_short' => ['Axd', 'Isn', 'Tal', 'Arb', 'Kha', 'Jim', 'Sbt'], 'weekdays_min' => ['Ax', 'Is', 'Ta', 'Ar', 'Kh', 'Ji', 'Sa'], 'list' => [', ', ' and '], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'calendar' => [ 'sameDay' => '[Maanta markay tahay] LT', 'nextDay' => '[Beri markay tahay] LT', 'nextWeek' => 'dddd [markay tahay] LT', 'lastDay' => '[Shalay markay ahayd] LT', 'lastWeek' => '[Hore] dddd [Markay ahayd] LT', 'sameElse' => 'L', ], ]); ================================================ FILE: src/Carbon/Lang/so_DJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/so.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/so_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return require __DIR__.'/so.php'; ================================================ FILE: src/Carbon/Lang/so_KE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return require __DIR__.'/so.php'; ================================================ FILE: src/Carbon/Lang/so_SO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return require __DIR__.'/so.php'; ================================================ FILE: src/Carbon/Lang/sq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - JD Isaacks * - Fadion Dashi */ return [ 'year' => ':count vit|:count vjet', 'a_year' => 'një vit|:count vite', 'y' => ':count v.', 'month' => ':count muaj', 'a_month' => 'një muaj|:count muaj', 'm' => ':count muaj', 'week' => ':count javë', 'a_week' => ':count javë|:count javë', 'w' => ':count j.', 'day' => ':count ditë', 'a_day' => 'një ditë|:count ditë', 'd' => ':count d.', 'hour' => ':count orë', 'a_hour' => 'një orë|:count orë', 'h' => ':count o.', 'minute' => ':count minutë|:count minuta', 'a_minute' => 'një minutë|:count minuta', 'min' => ':count min.', 'second' => ':count sekondë|:count sekonda', 'a_second' => 'disa sekonda|:count sekonda', 's' => ':count s.', 'ago' => ':time më parë', 'from_now' => 'në :time', 'after' => ':time pas', 'before' => ':time para', 'diff_now' => 'tani', 'diff_today' => 'Sot', 'diff_today_regexp' => 'Sot(?:\\s+në)?', 'diff_yesterday' => 'dje', 'diff_yesterday_regexp' => 'Dje(?:\\s+në)?', 'diff_tomorrow' => 'nesër', 'diff_tomorrow_regexp' => 'Nesër(?:\\s+në)?', 'diff_before_yesterday' => 'pardje', 'diff_after_tomorrow' => 'pasnesër', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Sot në] LT', 'nextDay' => '[Nesër në] LT', 'nextWeek' => 'dddd [në] LT', 'lastDay' => '[Dje në] LT', 'lastWeek' => 'dddd [e kaluar në] LT', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'meridiem' => ['PD', 'MD'], 'months' => ['janar', 'shkurt', 'mars', 'prill', 'maj', 'qershor', 'korrik', 'gusht', 'shtator', 'tetor', 'nëntor', 'dhjetor'], 'months_short' => ['jan', 'shk', 'mar', 'pri', 'maj', 'qer', 'kor', 'gus', 'sht', 'tet', 'nën', 'dhj'], 'weekdays' => ['e diel', 'e hënë', 'e martë', 'e mërkurë', 'e enjte', 'e premte', 'e shtunë'], 'weekdays_short' => ['die', 'hën', 'mar', 'mër', 'enj', 'pre', 'sht'], 'weekdays_min' => ['d', 'h', 'ma', 'më', 'e', 'p', 'sh'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' dhe '], ]; ================================================ FILE: src/Carbon/Lang/sq_AL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sq.php'; ================================================ FILE: src/Carbon/Lang/sq_MK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/sq_XK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/sr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - shaishavgandhi05 * - Serhan Apaydın * - JD Isaacks * - Glavić * - Milos Sakovic */ use Carbon\CarbonInterface; return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count g.', 'month' => ':count mesec|:count meseca|:count meseci', 'm' => ':count mes.', 'week' => ':count nedelja|:count nedelje|:count nedelja', 'w' => ':count ned.', 'day' => ':count dan|:count dana|:count dana', 'd' => ':count d.', 'hour' => ':count sat|:count sata|:count sati', 'h' => ':count č.', 'minute' => ':count minut|:count minuta|:count minuta', 'min' => ':count min.', 'second' => ':count sekundu|:count sekunde|:count sekundi', 's' => ':count sek.', 'ago' => 'pre :time', 'from_now' => 'za :time', 'after' => 'nakon :time', 'before' => 'pre :time', 'year_ago' => ':count godinu|:count godine|:count godina', 'year_from_now' => ':count godinu|:count godine|:count godina', 'week_ago' => ':count nedelju|:count nedelje|:count nedelja', 'week_from_now' => ':count nedelju|:count nedelje|:count nedelja', 'diff_now' => 'upravo sada', 'diff_today' => 'danas', 'diff_today_regexp' => 'danas(?:\\s+u)?', 'diff_yesterday' => 'juče', 'diff_yesterday_regexp' => 'juče(?:\\s+u)?', 'diff_tomorrow' => 'sutra', 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', 'diff_before_yesterday' => 'prekjuče', 'diff_after_tomorrow' => 'preksutra', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY H:mm', 'LLLL' => 'dddd, D. MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[u nedelju u] LT', 3 => '[u sredu u] LT', 6 => '[u subotu u] LT', default => '[u] dddd [u] LT', }, 'lastDay' => '[juče u] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[prošle nedelje u] LT', 1 => '[prošlog ponedeljka u] LT', 2 => '[prošlog utorka u] LT', 3 => '[prošle srede u] LT', 4 => '[prošlog četvrtka u] LT', 5 => '[prošlog petka u] LT', default => '[prošle subote u] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' i '], ]; ================================================ FILE: src/Carbon/Lang/sr_Cyrl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - shaishavgandhi05 * - Serhan Apaydın * - JD Isaacks * - Glavić * - Nikola Zeravcic * - Milos Sakovic */ use Carbon\CarbonInterface; return [ 'year' => ':count година|:count године|:count година', 'y' => ':count г.', 'month' => ':count месец|:count месеца|:count месеци', 'm' => ':count м.', 'week' => ':count недеља|:count недеље|:count недеља', 'w' => ':count нед.', 'day' => ':count дан|:count дана|:count дана', 'd' => ':count д.', 'hour' => ':count сат|:count сата|:count сати', 'h' => ':count ч.', 'minute' => ':count минут|:count минута|:count минута', 'min' => ':count мин.', 'second' => ':count секунд|:count секунде|:count секунди', 's' => ':count сек.', 'ago' => 'пре :time', 'from_now' => 'за :time', 'after' => ':time након', 'before' => ':time пре', 'year_from_now' => ':count годину|:count године|:count година', 'year_ago' => ':count годину|:count године|:count година', 'week_from_now' => ':count недељу|:count недеље|:count недеља', 'week_ago' => ':count недељу|:count недеље|:count недеља', 'diff_now' => 'управо сада', 'diff_today' => 'данас', 'diff_today_regexp' => 'данас(?:\\s+у)?', 'diff_yesterday' => 'јуче', 'diff_yesterday_regexp' => 'јуче(?:\\s+у)?', 'diff_tomorrow' => 'сутра', 'diff_tomorrow_regexp' => 'сутра(?:\\s+у)?', 'diff_before_yesterday' => 'прекјуче', 'diff_after_tomorrow' => 'прекосутра', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY H:mm', 'LLLL' => 'dddd, D. MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[у недељу у] LT', 3 => '[у среду у] LT', 6 => '[у суботу у] LT', default => '[у] dddd [у] LT', }, 'lastDay' => '[јуче у] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[прошле недеље у] LT', 1 => '[прошлог понедељка у] LT', 2 => '[прошлог уторка у] LT', 3 => '[прошле среде у] LT', 4 => '[прошлог четвртка у] LT', 5 => '[прошлог петка у] LT', default => '[прошле суботе у] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], 'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], 'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], 'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' и '], 'meridiem' => ['АМ', 'ПМ'], ]; ================================================ FILE: src/Carbon/Lang/sr_Cyrl_BA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'sr'); }, 'sr_Cyrl_BA'); } // @codeCoverageIgnoreEnd return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D.M.yy.', 'LL' => 'DD.MM.YYYY.', 'LLL' => 'DD. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', ], 'weekdays' => ['недјеља', 'понедељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], 'weekdays_short' => ['нед.', 'пон.', 'ут.', 'ср.', 'чет.', 'пет.', 'суб.'], ]); ================================================ FILE: src/Carbon/Lang/sr_Cyrl_ME.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Glavić * - Milos Sakovic */ use Carbon\CarbonInterface; use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'sr'); }, 'sr_Cyrl_ME'); } // @codeCoverageIgnoreEnd return [ 'year' => ':count година|:count године|:count година', 'y' => ':count г.', 'month' => ':count мјесец|:count мјесеца|:count мјесеци', 'm' => ':count мј.', 'week' => ':count недјеља|:count недјеље|:count недјеља', 'w' => ':count нед.', 'day' => ':count дан|:count дана|:count дана', 'd' => ':count д.', 'hour' => ':count сат|:count сата|:count сати', 'h' => ':count ч.', 'minute' => ':count минут|:count минута|:count минута', 'min' => ':count мин.', 'second' => ':count секунд|:count секунде|:count секунди', 's' => ':count сек.', 'ago' => 'прије :time', 'from_now' => 'за :time', 'after' => ':time након', 'before' => ':time прије', 'year_from_now' => ':count годину|:count године|:count година', 'year_ago' => ':count годину|:count године|:count година', 'week_from_now' => ':count недјељу|:count недјеље|:count недјеља', 'week_ago' => ':count недјељу|:count недјеље|:count недјеља', 'diff_now' => 'управо сада', 'diff_today' => 'данас', 'diff_today_regexp' => 'данас(?:\\s+у)?', 'diff_yesterday' => 'јуче', 'diff_yesterday_regexp' => 'јуче(?:\\s+у)?', 'diff_tomorrow' => 'сутра', 'diff_tomorrow_regexp' => 'сутра(?:\\s+у)?', 'diff_before_yesterday' => 'прекјуче', 'diff_after_tomorrow' => 'прекосјутра', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM YYYY', 'LLL' => 'D. MMMM YYYY H:mm', 'LLLL' => 'dddd, D. MMMM YYYY H:mm', ], 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[у недељу у] LT', 3 => '[у среду у] LT', 6 => '[у суботу у] LT', default => '[у] dddd [у] LT', }, 'lastDay' => '[јуче у] LT', 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[прошле недеље у] LT', 1 => '[прошлог понедељка у] LT', 2 => '[прошлог уторка у] LT', 3 => '[прошле среде у] LT', 4 => '[прошлог четвртка у] LT', 5 => '[прошлог петка у] LT', default => '[прошле суботе у] LT', }, 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], 'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], 'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], 'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' и '], 'meridiem' => ['АМ', 'ПМ'], ]; ================================================ FILE: src/Carbon/Lang/sr_Cyrl_XK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'sr'); }, 'sr_Cyrl_XK'); } // @codeCoverageIgnoreEnd return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [ 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], ]); ================================================ FILE: src/Carbon/Lang/sr_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sr.php'; ================================================ FILE: src/Carbon/Lang/sr_Latn_BA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'sr'); }, 'sr_Latn_BA'); } // @codeCoverageIgnoreEnd return array_replace_recursive(require __DIR__.'/sr_Latn.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D.M.yy.', 'LL' => 'DD.MM.YYYY.', 'LLL' => 'DD. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', ], 'weekdays' => ['nedjelja', 'ponedeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], 'weekdays_short' => ['ned.', 'pon.', 'ut.', 'sr.', 'čet.', 'pet.', 'sub.'], ]); ================================================ FILE: src/Carbon/Lang/sr_Latn_ME.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Glavić * - Milos Sakovic */ use Carbon\CarbonInterface; use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'sr'); }, 'sr_Latn_ME'); } // @codeCoverageIgnoreEnd return array_replace_recursive(require __DIR__.'/sr.php', [ 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', 'second' => ':count sekund|:count sekunde|:count sekundi', 'ago' => 'prije :time', 'from_now' => 'za :time', 'after' => ':time nakon', 'before' => ':time prije', 'week_from_now' => ':count nedjelju|:count nedjelje|:count nedjelja', 'week_ago' => ':count nedjelju|:count nedjelje|:count nedjelja', 'second_ago' => ':count sekund|:count sekunde|:count sekundi', 'diff_tomorrow' => 'sjutra', 'calendar' => [ 'nextDay' => '[sjutra u] LT', 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[u nedjelju u] LT', 3 => '[u srijedu u] LT', 6 => '[u subotu u] LT', default => '[u] dddd [u] LT', }, 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0 => '[prošle nedjelje u] LT', 1 => '[prošle nedjelje u] LT', 2 => '[prošlog utorka u] LT', 3 => '[prošle srijede u] LT', 4 => '[prošlog četvrtka u] LT', 5 => '[prošlog petka u] LT', default => '[prošle subote u] LT', }, ], 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], ]); ================================================ FILE: src/Carbon/Lang/sr_Latn_XK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Component\Translation\PluralizationRules; // @codeCoverageIgnoreStart if (class_exists(PluralizationRules::class)) { PluralizationRules::set(static function ($number) { return PluralizationRules::get($number, 'sr'); }, 'sr_Latn_XK'); } // @codeCoverageIgnoreEnd return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [ 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], ]); ================================================ FILE: src/Carbon/Lang/sr_ME.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sr_Latn_ME.php'; ================================================ FILE: src/Carbon/Lang/sr_RS.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - sr_YU, sr_CS locale Danilo Segan bug-glibc-locales@gnu.org */ return require __DIR__.'/sr_Cyrl.php'; ================================================ FILE: src/Carbon/Lang/sr_RS@latin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sr.php'; ================================================ FILE: src/Carbon/Lang/ss.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Nicolai Davies */ return [ 'year' => '{1}umnyaka|:count iminyaka', 'month' => '{1}inyanga|:count tinyanga', 'week' => '{1}:count liviki|:count emaviki', 'day' => '{1}lilanga|:count emalanga', 'hour' => '{1}lihora|:count emahora', 'minute' => '{1}umzuzu|:count emizuzu', 'second' => '{1}emizuzwana lomcane|:count mzuzwana', 'ago' => 'wenteka nga :time', 'from_now' => 'nga :time', 'diff_yesterday' => 'Itolo', 'diff_yesterday_regexp' => 'Itolo(?:\\s+nga)?', 'diff_today' => 'Namuhla', 'diff_today_regexp' => 'Namuhla(?:\\s+nga)?', 'diff_tomorrow' => 'Kusasa', 'diff_tomorrow_regexp' => 'Kusasa(?:\\s+nga)?', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY h:mm A', 'LLLL' => 'dddd, D MMMM YYYY h:mm A', ], 'calendar' => [ 'sameDay' => '[Namuhla nga] LT', 'nextDay' => '[Kusasa nga] LT', 'nextWeek' => 'dddd [nga] LT', 'lastDay' => '[Itolo nga] LT', 'lastWeek' => 'dddd [leliphelile] [nga] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { $lastDigit = $number % 10; return $number.( ((int) ($number % 100 / 10) === 1) ? 'e' : ( ($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e' ) ); }, 'meridiem' => static function ($hour) { if ($hour < 11) { return 'ekuseni'; } if ($hour < 15) { return 'emini'; } if ($hour < 19) { return 'entsambama'; } return 'ebusuku'; }, 'months' => ['Bhimbidvwane', 'Indlovana', 'Indlov\'lenkhulu', 'Mabasa', 'Inkhwekhweti', 'Inhlaba', 'Kholwane', 'Ingci', 'Inyoni', 'Imphala', 'Lweti', 'Ingongoni'], 'months_short' => ['Bhi', 'Ina', 'Inu', 'Mab', 'Ink', 'Inh', 'Kho', 'Igc', 'Iny', 'Imp', 'Lwe', 'Igo'], 'weekdays' => ['Lisontfo', 'Umsombuluko', 'Lesibili', 'Lesitsatfu', 'Lesine', 'Lesihlanu', 'Umgcibelo'], 'weekdays_short' => ['Lis', 'Umb', 'Lsb', 'Les', 'Lsi', 'Lsh', 'Umg'], 'weekdays_min' => ['Li', 'Us', 'Lb', 'Lt', 'Ls', 'Lh', 'Ug'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]; ================================================ FILE: src/Carbon/Lang/ss_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/ss.php'; ================================================ FILE: src/Carbon/Lang/st.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/st_ZA.php'; ================================================ FILE: src/Carbon/Lang/st_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Pherekgong', 'Hlakola', 'Tlhakubele', 'Mmese', 'Motsheanong', 'Phupjane', 'Phupu', 'Phato', 'Leotse', 'Mphalane', 'Pudungwana', 'Tshitwe'], 'months_short' => ['Phe', 'Hla', 'TlH', 'Mme', 'Mot', 'Jan', 'Upu', 'Pha', 'Leo', 'Mph', 'Pud', 'Tsh'], 'weekdays' => ['Sontaha', 'Mantaha', 'Labobedi', 'Laboraro', 'Labone', 'Labohlano', 'Moqebelo'], 'weekdays_short' => ['Son', 'Mma', 'Bed', 'Rar', 'Ne', 'Hla', 'Moq'], 'weekdays_min' => ['Son', 'Mma', 'Bed', 'Rar', 'Ne', 'Hla', 'Moq'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'week' => ':count Sontaha', // less reliable 'w' => ':count Sontaha', // less reliable 'a_week' => ':count Sontaha', // less reliable 'day' => ':count letsatsi', // less reliable 'd' => ':count letsatsi', // less reliable 'a_day' => ':count letsatsi', // less reliable 'hour' => ':count sešupanako', // less reliable 'h' => ':count sešupanako', // less reliable 'a_hour' => ':count sešupanako', // less reliable 'minute' => ':count menyane', // less reliable 'min' => ':count menyane', // less reliable 'a_minute' => ':count menyane', // less reliable 'second' => ':count thusa', // less reliable 's' => ':count thusa', // less reliable 'a_second' => ':count thusa', // less reliable 'year' => ':count selemo', 'y' => ':count selemo', 'a_year' => ':count selemo', 'month' => ':count kgwedi', 'm' => ':count kgwedi', 'a_month' => ':count kgwedi', ]); ================================================ FILE: src/Carbon/Lang/sv.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Kristoffer Snabb * - JD Isaacks * - Jens Herlevsen * - Nightpine * - Anders Nygren (litemerafrukt) */ return [ 'year' => ':count år', 'a_year' => 'ett år|:count år', 'y' => ':count år', 'month' => ':count månad|:count månader', 'a_month' => 'en månad|:count månader', 'm' => ':count mån', 'week' => ':count vecka|:count veckor', 'a_week' => 'en vecka|:count veckor', 'w' => ':count v', 'day' => ':count dag|:count dagar', 'a_day' => 'en dag|:count dagar', 'd' => ':count dgr', 'hour' => ':count timme|:count timmar', 'a_hour' => 'en timme|:count timmar', 'h' => ':count tim', 'minute' => ':count minut|:count minuter', 'a_minute' => 'en minut|:count minuter', 'min' => ':count min', 'second' => ':count sekund|:count sekunder', 'a_second' => 'några sekunder|:count sekunder', 's' => ':count s', 'ago' => 'för :time sedan', 'from_now' => 'om :time', 'after' => ':time efter', 'before' => ':time före', 'diff_now' => 'nu', 'diff_today' => 'I dag', 'diff_yesterday' => 'i går', 'diff_yesterday_regexp' => 'I går', 'diff_tomorrow' => 'i morgon', 'diff_tomorrow_regexp' => 'I morgon', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY [kl.] HH:mm', 'LLLL' => 'dddd D MMMM YYYY [kl.] HH:mm', ], 'calendar' => [ 'sameDay' => '[I dag] LT', 'nextDay' => '[I morgon] LT', 'nextWeek' => '[På] dddd LT', 'lastDay' => '[I går] LT', 'lastWeek' => '[I] dddd[s] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { $lastDigit = $number % 10; return $number.( ((int) ($number % 100 / 10) === 1) ? 'e' : ( ($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e' ) ); }, 'months' => ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 'weekdays' => ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], 'weekdays_short' => ['sön', 'mån', 'tis', 'ons', 'tors', 'fre', 'lör'], 'weekdays_min' => ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' och '], 'meridiem' => ['fm', 'em'], ]; ================================================ FILE: src/Carbon/Lang/sv_AX.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/sv.php', [ 'formats' => [ 'L' => 'YYYY-MM-dd', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/sv_FI.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sv.php'; ================================================ FILE: src/Carbon/Lang/sv_SE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/sv.php'; ================================================ FILE: src/Carbon/Lang/sw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - leyluj * - Josh Soref * - ryanhart2 */ return [ 'year' => 'mwaka :count|miaka :count', 'a_year' => 'mwaka mmoja|miaka :count', 'y' => 'mwaka :count|miaka :count', 'month' => 'mwezi :count|miezi :count', 'a_month' => 'mwezi mmoja|miezi :count', 'm' => 'mwezi :count|miezi :count', 'week' => 'wiki :count', 'a_week' => 'wiki mmoja|wiki :count', 'w' => 'w. :count', 'day' => 'siku :count', 'a_day' => 'siku moja|masiku :count', 'd' => 'si. :count', 'hour' => 'saa :count|masaa :count', 'a_hour' => 'saa limoja|masaa :count', 'h' => 'saa :count|masaa :count', 'minute' => 'dakika :count', 'a_minute' => 'dakika moja|dakika :count', 'min' => 'd. :count', 'second' => 'sekunde :count', 'a_second' => 'hivi punde|sekunde :count', 's' => 'se. :count', 'ago' => 'tokea :time', 'from_now' => ':time baadaye', 'after' => ':time baada', 'before' => ':time kabla', 'diff_now' => 'sasa hivi', 'diff_today' => 'leo', 'diff_today_regexp' => 'leo(?:\\s+saa)?', 'diff_yesterday' => 'jana', 'diff_tomorrow' => 'kesho', 'diff_tomorrow_regexp' => 'kesho(?:\\s+saa)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[leo saa] LT', 'nextDay' => '[kesho saa] LT', 'nextWeek' => '[wiki ijayo] dddd [saat] LT', 'lastDay' => '[jana] LT', 'lastWeek' => '[wiki iliyopita] dddd [saat] LT', 'sameElse' => 'L', ], 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Jpl', 'Jtat', 'Jnne', 'Jtan', 'Alh', 'Ijm', 'Jmos'], 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' na '], ]; ================================================ FILE: src/Carbon/Lang/sw_CD.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/sw_KE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kamusi Project Martin Benjamin locales@kamusi.org */ return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], 'day_of_first_week_of_year' => 1, 'meridiem' => ['asubuhi', 'alasiri'], ]); ================================================ FILE: src/Carbon/Lang/sw_TZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kamusi Project Martin Benjamin locales@kamusi.org */ return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['asubuhi', 'alasiri'], ]); ================================================ FILE: src/Carbon/Lang/sw_UG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', ], ]); ================================================ FILE: src/Carbon/Lang/szl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/szl_PL.php'; ================================================ FILE: src/Carbon/Lang/szl_PL.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - szl_PL locale Przemyslaw Buczkowski libc-alpha@sourceware.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['styczyń', 'luty', 'merc', 'kwjeciyń', 'moj', 'czyrwjyń', 'lipjyń', 'siyrpjyń', 'wrzesiyń', 'październik', 'listopad', 'grudziyń'], 'months_short' => ['sty', 'lut', 'mer', 'kwj', 'moj', 'czy', 'lip', 'siy', 'wrz', 'paź', 'lis', 'gru'], 'weekdays' => ['niydziela', 'pyńdziŏek', 'wtŏrek', 'strzŏda', 'sztwortek', 'pjōntek', 'sobŏta'], 'weekdays_short' => ['niy', 'pyń', 'wtŏ', 'str', 'szt', 'pjō', 'sob'], 'weekdays_min' => ['niy', 'pyń', 'wtŏ', 'str', 'szt', 'pjō', 'sob'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count rok', 'y' => ':count rok', 'a_year' => ':count rok', 'month' => ':count mjeśůnc', 'm' => ':count mjeśůnc', 'a_month' => ':count mjeśůnc', 'week' => ':count tydźyń', 'w' => ':count tydźyń', 'a_week' => ':count tydźyń', 'day' => ':count dźyń', 'd' => ':count dźyń', 'a_day' => ':count dźyń', 'hour' => ':count godzina', 'h' => ':count godzina', 'a_hour' => ':count godzina', 'minute' => ':count minuta', 'min' => ':count minuta', 'a_minute' => ':count minuta', 'second' => ':count sekůnda', 's' => ':count sekůnda', 'a_second' => ':count sekůnda', ]); ================================================ FILE: src/Carbon/Lang/ta.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - François B * - JD Isaacks * - Satheez */ return [ 'year' => ':count வருடம்|:count ஆண்டுகள்', 'a_year' => 'ஒரு வருடம்|:count ஆண்டுகள்', 'y' => ':count வருட.|:count ஆண்.', 'month' => ':count மாதம்|:count மாதங்கள்', 'a_month' => 'ஒரு மாதம்|:count மாதங்கள்', 'm' => ':count மாத.', 'week' => ':count வாரம்|:count வாரங்கள்', 'a_week' => 'ஒரு வாரம்|:count வாரங்கள்', 'w' => ':count வார.', 'day' => ':count நாள்|:count நாட்கள்', 'a_day' => 'ஒரு நாள்|:count நாட்கள்', 'd' => ':count நாள்|:count நாட்.', 'hour' => ':count மணி நேரம்|:count மணி நேரம்', 'a_hour' => 'ஒரு மணி நேரம்|:count மணி நேரம்', 'h' => ':count மணி.', 'minute' => ':count நிமிடம்|:count நிமிடங்கள்', 'a_minute' => 'ஒரு நிமிடம்|:count நிமிடங்கள்', 'min' => ':count நிமி.', 'second' => ':count சில விநாடிகள்|:count விநாடிகள்', 'a_second' => 'ஒரு சில விநாடிகள்|:count விநாடிகள்', 's' => ':count விநா.', 'ago' => ':time முன்', 'from_now' => ':time இல்', 'before' => ':time முன்', 'after' => ':time பின்', 'diff_now' => 'இப்போது', 'diff_today' => 'இன்று', 'diff_yesterday' => 'நேற்று', 'diff_tomorrow' => 'நாளை', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], 'calendar' => [ 'sameDay' => '[இன்று] LT', 'nextDay' => '[நாளை] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[நேற்று] LT', 'lastWeek' => '[கடந்த வாரம்] dddd, LT', 'sameElse' => 'L', ], 'ordinal' => ':numberவது', 'meridiem' => static function ($hour) { if ($hour < 2) { return ' யாமம்'; } if ($hour < 6) { return ' வைகறை'; } if ($hour < 10) { return ' காலை'; } if ($hour < 14) { return ' நண்பகல்'; } if ($hour < 18) { return ' எற்பாடு'; } if ($hour < 22) { return ' மாலை'; } return ' யாமம்'; }, 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], 'months_short' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], 'weekdays' => ['ஞாயிற்றுக்கிழமை', 'திங்கட்கிழமை', 'செவ்வாய்கிழமை', 'புதன்கிழமை', 'வியாழக்கிழமை', 'வெள்ளிக்கிழமை', 'சனிக்கிழமை'], 'weekdays_short' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' மற்றும் '], 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/ta_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], 'weekdays_short' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'day_of_first_week_of_year' => 1, 'meridiem' => ['காலை', 'மாலை'], ]); ================================================ FILE: src/Carbon/Lang/ta_LK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - J.Yogaraj 94-777-315206 yogaraj.ubuntu@gmail.com */ return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], 'months_short' => ['ஜன', 'பிப்', 'மார்', 'ஏப்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக', 'செப்', 'அக்', 'நவ', 'டிச'], 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], 'weekdays_short' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['காலை', 'மாலை'], ]); ================================================ FILE: src/Carbon/Lang/ta_MY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', 'LTS' => 'a h:mm:ss', 'L' => 'D/M/yy', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY, a h:mm', 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', ], 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], 'weekdays_short' => ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'], 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'first_day_of_week' => 1, 'meridiem' => ['மு.ப', 'பி.ப'], ]); ================================================ FILE: src/Carbon/Lang/ta_SG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', 'LTS' => 'a h:mm:ss', 'L' => 'D/M/yy', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY, a h:mm', 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', ], 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], 'weekdays_short' => ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'], 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], 'meridiem' => ['மு.ப', 'பி.ப'], ]); ================================================ FILE: src/Carbon/Lang/tcy.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/tcy_IN.php'; ================================================ FILE: src/Carbon/Lang/tcy_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IndLinux.org, Samsung Electronics Co., Ltd. alexey.merzlyakov@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['ಜನವರಿ', 'ಫೆಬ್ರುವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್‌‌', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್‌', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'], 'months_short' => ['ಜ', 'ಫೆ', 'ಮಾ', 'ಏ', 'ಮೇ', 'ಜೂ', 'ಜು', 'ಆ', 'ಸೆ', 'ಅ', 'ನ', 'ಡಿ'], 'weekdays' => ['ಐಥಾರ', 'ಸೋಮಾರ', 'ಅಂಗರೆ', 'ಬುಧಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರರ', 'ಶನಿವಾರ'], 'weekdays_short' => ['ಐ', 'ಸೋ', 'ಅಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], 'weekdays_min' => ['ಐ', 'ಸೋ', 'ಅಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ಕಾಂಡೆ', 'ಬಯ್ಯ'], 'year' => ':count ನೀರ್', // less reliable 'y' => ':count ನೀರ್', // less reliable 'a_year' => ':count ನೀರ್', // less reliable 'month' => ':count ಮೀನ್', // less reliable 'm' => ':count ಮೀನ್', // less reliable 'a_month' => ':count ಮೀನ್', // less reliable 'day' => ':count ಸುಗ್ಗಿ', // less reliable 'd' => ':count ಸುಗ್ಗಿ', // less reliable 'a_day' => ':count ಸುಗ್ಗಿ', // less reliable ]); ================================================ FILE: src/Carbon/Lang/te.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kunal Marwaha * - Josh Soref * - François B * - kc */ return [ 'year' => ':count సంవత్సరం|:count సంవత్సరాలు', 'a_year' => 'ఒక సంవత్సరం|:count సంవత్సరాలు', 'y' => ':count సం.', 'month' => ':count నెల|:count నెలలు', 'a_month' => 'ఒక నెల|:count నెలలు', 'm' => ':count నెల|:count నెల.', 'week' => ':count వారం|:count వారాలు', 'a_week' => 'ఒక వారం|:count వారాలు', 'w' => ':count వార.|:count వారా.', 'day' => ':count రోజు|:count రోజులు', 'a_day' => 'ఒక రోజు|:count రోజులు', 'd' => ':count రోజు|:count రోజు.', 'hour' => ':count గంట|:count గంటలు', 'a_hour' => 'ఒక గంట|:count గంటలు', 'h' => ':count గం.', 'minute' => ':count నిమిషం|:count నిమిషాలు', 'a_minute' => 'ఒక నిమిషం|:count నిమిషాలు', 'min' => ':count నిమి.', 'second' => ':count సెకను|:count సెకన్లు', 'a_second' => 'కొన్ని క్షణాలు|:count సెకన్లు', 's' => ':count సెక.', 'ago' => ':time క్రితం', 'from_now' => ':time లో', 'diff_now' => 'ప్రస్తుతం', 'diff_today' => 'నేడు', 'diff_yesterday' => 'నిన్న', 'diff_tomorrow' => 'రేపు', 'formats' => [ 'LT' => 'A h:mm', 'LTS' => 'A h:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, A h:mm', 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', ], 'calendar' => [ 'sameDay' => '[నేడు] LT', 'nextDay' => '[రేపు] LT', 'nextWeek' => 'dddd, LT', 'lastDay' => '[నిన్న] LT', 'lastWeek' => '[గత] dddd, LT', 'sameElse' => 'L', ], 'ordinal' => ':numberవ', 'meridiem' => static function ($hour) { if ($hour < 4) { return 'రాత్రి'; } if ($hour < 10) { return 'ఉదయం'; } if ($hour < 17) { return 'మధ్యాహ్నం'; } if ($hour < 20) { return 'సాయంత్రం'; } return ' రాత్రి'; }, 'months' => ['జనవరి', 'ఫిబ్రవరి', 'మార్చి', 'ఏప్రిల్', 'మే', 'జూన్', 'జూలై', 'ఆగస్టు', 'సెప్టెంబర్', 'అక్టోబర్', 'నవంబర్', 'డిసెంబర్'], 'months_short' => ['జన.', 'ఫిబ్ర.', 'మార్చి', 'ఏప్రి.', 'మే', 'జూన్', 'జూలై', 'ఆగ.', 'సెప్.', 'అక్టో.', 'నవ.', 'డిసె.'], 'weekdays' => ['ఆదివారం', 'సోమవారం', 'మంగళవారం', 'బుధవారం', 'గురువారం', 'శుక్రవారం', 'శనివారం'], 'weekdays_short' => ['ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని'], 'weekdays_min' => ['ఆ', 'సో', 'మం', 'బు', 'గు', 'శు', 'శ'], 'list' => ', ', 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'weekend' => [0, 0], ]; ================================================ FILE: src/Carbon/Lang/te_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/te.php'; ================================================ FILE: src/Carbon/Lang/teo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ta.php', [ 'meridiem' => ['Taparachu', 'Ebongi'], 'weekdays' => ['Nakaejuma', 'Nakaebarasa', 'Nakaare', 'Nakauni', 'Nakaung’on', 'Nakakany', 'Nakasabiti'], 'weekdays_short' => ['Jum', 'Bar', 'Aar', 'Uni', 'Ung', 'Kan', 'Sab'], 'weekdays_min' => ['Jum', 'Bar', 'Aar', 'Uni', 'Ung', 'Kan', 'Sab'], 'months' => ['Orara', 'Omuk', 'Okwamg’', 'Odung’el', 'Omaruk', 'Omodok’king’ol', 'Ojola', 'Opedel', 'Osokosokoma', 'Otibar', 'Olabor', 'Opoo'], 'months_short' => ['Rar', 'Muk', 'Kwa', 'Dun', 'Mar', 'Mod', 'Jol', 'Ped', 'Sok', 'Tib', 'Lab', 'Poo'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/teo_KE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/teo.php', [ 'first_day_of_week' => 0, ]); ================================================ FILE: src/Carbon/Lang/tet.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Joshua Brooks * - François B */ return [ 'year' => 'tinan :count', 'a_year' => '{1}tinan ida|tinan :count', 'month' => 'fulan :count', 'a_month' => '{1}fulan ida|fulan :count', 'week' => 'semana :count', 'a_week' => '{1}semana ida|semana :count', 'day' => 'loron :count', 'a_day' => '{1}loron ida|loron :count', 'hour' => 'oras :count', 'a_hour' => '{1}oras ida|oras :count', 'minute' => 'minutu :count', 'a_minute' => '{1}minutu ida|minutu :count', 'second' => 'segundu :count', 'a_second' => '{1}segundu balun|segundu :count', 'ago' => ':time liuba', 'from_now' => 'iha :time', 'diff_yesterday' => 'Horiseik', 'diff_yesterday_regexp' => 'Horiseik(?:\\s+iha)?', 'diff_today' => 'Ohin', 'diff_today_regexp' => 'Ohin(?:\\s+iha)?', 'diff_tomorrow' => 'Aban', 'diff_tomorrow_regexp' => 'Aban(?:\\s+iha)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Ohin iha] LT', 'nextDay' => '[Aban iha] LT', 'nextWeek' => 'dddd [iha] LT', 'lastDay' => '[Horiseik iha] LT', 'lastWeek' => 'dddd [semana kotuk] [iha] LT', 'sameElse' => 'L', ], 'ordinal' => ':numberº', 'months' => ['Janeiru', 'Fevereiru', 'Marsu', 'Abril', 'Maiu', 'Juñu', 'Jullu', 'Agustu', 'Setembru', 'Outubru', 'Novembru', 'Dezembru'], 'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], 'weekdays' => ['Domingu', 'Segunda', 'Tersa', 'Kuarta', 'Kinta', 'Sesta', 'Sabadu'], 'weekdays_short' => ['Dom', 'Seg', 'Ters', 'Kua', 'Kint', 'Sest', 'Sab'], 'weekdays_min' => ['Do', 'Seg', 'Te', 'Ku', 'Ki', 'Ses', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]; ================================================ FILE: src/Carbon/Lang/tg.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Orif N. Jr */ return [ 'year' => '{1}як сол|:count сол', 'month' => '{1}як моҳ|:count моҳ', 'week' => '{1}як ҳафта|:count ҳафта', 'day' => '{1}як рӯз|:count рӯз', 'hour' => '{1}як соат|:count соат', 'minute' => '{1}як дақиқа|:count дақиқа', 'second' => '{1}якчанд сония|:count сония', 'ago' => ':time пеш', 'from_now' => 'баъди :time', 'diff_today' => 'Имрӯз', 'diff_yesterday' => 'Дирӯз', 'diff_yesterday_regexp' => 'Дирӯз(?:\\s+соати)?', 'diff_tomorrow' => 'Пагоҳ', 'diff_tomorrow_regexp' => 'Пагоҳ(?:\\s+соати)?', 'diff_today_regexp' => 'Имрӯз(?:\\s+соати)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Имрӯз соати] LT', 'nextDay' => '[Пагоҳ соати] LT', 'nextWeek' => 'dddd[и] [ҳафтаи оянда соати] LT', 'lastDay' => '[Дирӯз соати] LT', 'lastWeek' => 'dddd[и] [ҳафтаи гузашта соати] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number) { if ($number === 0) { // special case for zero return "$number-ıncı"; } static $suffixes = [ 0 => '-ум', 1 => '-ум', 2 => '-юм', 3 => '-юм', 4 => '-ум', 5 => '-ум', 6 => '-ум', 7 => '-ум', 8 => '-ум', 9 => '-ум', 10 => '-ум', 12 => '-ум', 13 => '-ум', 20 => '-ум', 30 => '-юм', 40 => '-ум', 50 => '-ум', 60 => '-ум', 70 => '-ум', 80 => '-ум', 90 => '-ум', 100 => '-ум', ]; return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); }, 'meridiem' => static function ($hour) { if ($hour < 4) { return 'шаб'; } if ($hour < 11) { return 'субҳ'; } if ($hour < 16) { return 'рӯз'; } if ($hour < 19) { return 'бегоҳ'; } return 'шаб'; }, 'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'weekdays' => ['якшанбе', 'душанбе', 'сешанбе', 'чоршанбе', 'панҷшанбе', 'ҷумъа', 'шанбе'], 'weekdays_short' => ['яшб', 'дшб', 'сшб', 'чшб', 'пшб', 'ҷум', 'шнб'], 'weekdays_min' => ['яш', 'дш', 'сш', 'чш', 'пш', 'ҷм', 'шб'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' ва '], ]; ================================================ FILE: src/Carbon/Lang/tg_TJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/tg.php'; ================================================ FILE: src/Carbon/Lang/th.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Nate Whittaker * - John MacAslan * - Chanintorn Asavavichairoj * - JD Isaacks * - ROKAISAKKON * - RO'KAISAKKON * - Andreas Möller * - nithisa */ return [ 'year' => ':count ปี', 'y' => ':count ปี', 'month' => ':count เดือน', 'm' => ':count เดือน', 'week' => ':count สัปดาห์', 'w' => ':count สัปดาห์', 'day' => ':count วัน', 'd' => ':count วัน', 'hour' => ':count ชั่วโมง', 'h' => ':count ชั่วโมง', 'minute' => ':count นาที', 'min' => ':count นาที', 'second' => ':count วินาที', 'a_second' => '{1}ไม่กี่วินาที|[-Inf,Inf]:count วินาที', 's' => ':count วินาที', 'ago' => ':timeที่แล้ว', 'from_now' => 'อีก :time', 'after' => ':timeหลังจากนี้', 'before' => ':timeก่อน', 'diff_now' => 'ขณะนี้', 'diff_today' => 'วันนี้', 'diff_today_regexp' => 'วันนี้(?:\\s+เวลา)?', 'diff_yesterday' => 'เมื่อวาน', 'diff_yesterday_regexp' => 'เมื่อวานนี้(?:\\s+เวลา)?', 'diff_tomorrow' => 'พรุ่งนี้', 'diff_tomorrow_regexp' => 'พรุ่งนี้(?:\\s+เวลา)?', 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY เวลา H:mm', 'LLLL' => 'วันddddที่ D MMMM YYYY เวลา H:mm', ], 'calendar' => [ 'sameDay' => '[วันนี้ เวลา] LT', 'nextDay' => '[พรุ่งนี้ เวลา] LT', 'nextWeek' => 'dddd[หน้า เวลา] LT', 'lastDay' => '[เมื่อวานนี้ เวลา] LT', 'lastWeek' => '[วัน]dddd[ที่แล้ว เวลา] LT', 'sameElse' => 'L', ], 'meridiem' => ['ก่อนเที่ยง', 'หลังเที่ยง'], 'months' => ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], 'months_short' => ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], 'weekdays' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], 'weekdays_short' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], 'weekdays_min' => ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], 'list' => [', ', ' และ '], ]; ================================================ FILE: src/Carbon/Lang/th_TH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/th.php'; ================================================ FILE: src/Carbon/Lang/the.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/the_NP.php'; ================================================ FILE: src/Carbon/Lang/the_NP.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Chitwanix OS Development info@chitwanix.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'dddd DD MMM YYYY', ], 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 'weekdays' => ['आइतबार', 'सोमबार', 'मंगलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'], 'weekdays_short' => ['आइत', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि'], 'weekdays_min' => ['आइत', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], ]); ================================================ FILE: src/Carbon/Lang/ti.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ti_ER.php'; ================================================ FILE: src/Carbon/Lang/ti_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጥሪ', 'ለካቲት', 'መጋቢት', 'ሚያዝያ', 'ግንቦት', 'ሰነ', 'ሓምለ', 'ነሓሰ', 'መስከረም', 'ጥቅምቲ', 'ሕዳር', 'ታሕሳስ'], 'months_short' => ['ጥሪ ', 'ለካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰነ ', 'ሓምለ', 'ነሓሰ', 'መስከ', 'ጥቅም', 'ሕዳር', 'ታሕሳ'], 'weekdays' => ['ሰንበት', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], 'weekdays_short' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], 'weekdays_min' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ንጉሆ ሰዓተ', 'ድሕር ሰዓት'], 'year' => ':count ዓመት', 'y' => ':count ዓመት', 'a_year' => ':count ዓመት', 'month' => 'ወርሒ :count', 'm' => 'ወርሒ :count', 'a_month' => 'ወርሒ :count', 'week' => ':count ሰሙን', 'w' => ':count ሰሙን', 'a_week' => ':count ሰሙን', 'day' => ':count መዓልቲ', 'd' => ':count መዓልቲ', 'a_day' => ':count መዓልቲ', 'hour' => ':count ሰዓት', 'h' => ':count ሰዓት', 'a_hour' => ':count ሰዓት', 'minute' => ':count ደቒቕ', 'min' => ':count ደቒቕ', 'a_minute' => ':count ደቒቕ', 'second' => ':count ሰከንድ', 's' => ':count ሰከንድ', 'a_second' => ':count ሰከንድ', ]); ================================================ FILE: src/Carbon/Lang/ti_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], 'weekdays' => ['ሰንበት', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], 'weekdays_short' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], 'weekdays_min' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ንጉሆ ሰዓተ', 'ድሕር ሰዓት'], ]); ================================================ FILE: src/Carbon/Lang/tig.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/tig_ER.php'; ================================================ FILE: src/Carbon/Lang/tig_ER.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጥሪ', 'ለካቲት', 'መጋቢት', 'ሚያዝያ', 'ግንቦት', 'ሰነ', 'ሓምለ', 'ነሓሰ', 'መስከረም', 'ጥቅምቲ', 'ሕዳር', 'ታሕሳስ'], 'months_short' => ['ጥሪ ', 'ለካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰነ ', 'ሓምለ', 'ነሓሰ', 'መስከ', 'ጥቅም', 'ሕዳር', 'ታሕሳ'], 'weekdays' => ['ሰንበት ዓባይ', 'ሰኖ', 'ታላሸኖ', 'ኣረርባዓ', 'ከሚሽ', 'ጅምዓት', 'ሰንበት ንኢሽ'], 'weekdays_short' => ['ሰ//ዓ', 'ሰኖ ', 'ታላሸ', 'ኣረር', 'ከሚሽ', 'ጅምዓ', 'ሰ//ን'], 'weekdays_min' => ['ሰ//ዓ', 'ሰኖ ', 'ታላሸ', 'ኣረር', 'ከሚሽ', 'ጅምዓ', 'ሰ//ን'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ቀደም ሰር ምዕል', 'ሓቆ ሰር ምዕል'], 'year' => ':count ማይ', // less reliable 'y' => ':count ማይ', // less reliable 'a_year' => ':count ማይ', // less reliable 'month' => ':count ሸምሽ', // less reliable 'm' => ':count ሸምሽ', // less reliable 'a_month' => ':count ሸምሽ', // less reliable 'week' => ':count ሰቡዕ', // less reliable 'w' => ':count ሰቡዕ', // less reliable 'a_week' => ':count ሰቡዕ', // less reliable 'day' => ':count ዎሮ', // less reliable 'd' => ':count ዎሮ', // less reliable 'a_day' => ':count ዎሮ', // less reliable 'hour' => ':count ሰዓት', // less reliable 'h' => ':count ሰዓት', // less reliable 'a_hour' => ':count ሰዓት', // less reliable 'minute' => ':count ካልኣይት', // less reliable 'min' => ':count ካልኣይት', // less reliable 'a_minute' => ':count ካልኣይት', // less reliable 'second' => ':count ካልኣይ', 's' => ':count ካልኣይ', 'a_second' => ':count ካልኣይ', ]); ================================================ FILE: src/Carbon/Lang/tk.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/tk_TM.php'; ================================================ FILE: src/Carbon/Lang/tk_TM.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Authors: * - Ghorban M. Tavakoly Pablo Saratxaga & Ghorban M. Tavakoly pablo@walon.org & gmt314@yahoo.com * - SuperManPHP * - Maksat Meredow (isadma) */ $transformDiff = static fn (string $input) => strtr($input, [ 'sekunt' => 'sekunt', 'hepde' => 'hepde', ]); return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Ýanwar', 'Fewral', 'Mart', 'Aprel', 'Maý', 'Iýun', 'Iýul', 'Awgust', 'Sentýabr', 'Oktýabr', 'Noýabr', 'Dekabr'], 'months_short' => ['Ýan', 'Few', 'Mar', 'Apr', 'Maý', 'Iýn', 'Iýl', 'Awg', 'Sen', 'Okt', 'Noý', 'Dek'], 'weekdays' => ['Ýekşenbe', 'Duşenbe', 'Sişenbe', 'Çarşenbe', 'Penşenbe', 'Anna', 'Şenbe'], 'weekdays_short' => ['Ýek', 'Duş', 'Siş', 'Çar', 'Pen', 'Ann', 'Şen'], 'weekdays_min' => ['Ýe', 'Du', 'Si', 'Ça', 'Pe', 'An', 'Şe'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count ýyl', 'y' => ':count ýyl', 'a_year' => ':count ýyl', 'month' => ':count aý', 'm' => ':count aý', 'a_month' => ':count aý', 'week' => ':count hepde', 'w' => ':count hepde', 'a_week' => ':count hepde', 'day' => ':count gün', 'd' => ':count gün', 'a_day' => ':count gün', 'hour' => ':count sagat', 'h' => ':count sagat', 'a_hour' => ':count sagat', 'minute' => ':count minut', 'min' => ':count minut', 'a_minute' => ':count minut', 'second' => ':count sekunt', 's' => ':count sekunt', 'a_second' => ':count sekunt', 'ago' => static fn (string $time) => $transformDiff($time).' ozal', 'from_now' => static fn (string $time) => $transformDiff($time).' soňra', 'after' => static fn (string $time) => $transformDiff($time).' soň', 'before' => static fn (string $time) => $transformDiff($time).' öň', ]); ================================================ FILE: src/Carbon/Lang/tl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ 'year' => ':count taon', 'a_year' => '{1}isang taon|:count taon', 'month' => ':count buwan', 'a_month' => '{1}isang buwan|:count buwan', 'week' => ':count linggo', 'a_week' => '{1}isang linggo|:count linggo', 'day' => ':count araw', 'a_day' => '{1}isang araw|:count araw', 'hour' => ':count oras', 'a_hour' => '{1}isang oras|:count oras', 'minute' => ':count minuto', 'a_minute' => '{1}isang minuto|:count minuto', 'min' => ':count min.', 'second' => ':count segundo', 'a_second' => '{1}ilang segundo|:count segundo', 's' => ':count seg.', 'ago' => ':time ang nakalipas', 'from_now' => 'sa loob ng :time', 'diff_now' => 'ngayon', 'diff_today' => 'ngayong', 'diff_today_regexp' => 'ngayong(?:\\s+araw)?', 'diff_yesterday' => 'kahapon', 'diff_tomorrow' => 'bukas', 'diff_tomorrow_regexp' => 'Bukas(?:\\s+ng)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'MM/D/YYYY', 'LL' => 'MMMM D, YYYY', 'LLL' => 'MMMM D, YYYY HH:mm', 'LLLL' => 'dddd, MMMM DD, YYYY HH:mm', ], 'calendar' => [ 'sameDay' => 'LT [ngayong araw]', 'nextDay' => '[Bukas ng] LT', 'nextWeek' => 'LT [sa susunod na] dddd', 'lastDay' => 'LT [kahapon]', 'lastWeek' => 'LT [noong nakaraang] dddd', 'sameElse' => 'L', ], 'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'], 'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'], 'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado'], 'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], 'weekdays_min' => ['Li', 'Lu', 'Ma', 'Mi', 'Hu', 'Bi', 'Sab'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' at '], ]; ================================================ FILE: src/Carbon/Lang/tl_PH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Ian De La Cruz * - JD Isaacks */ return require __DIR__.'/tl.php'; ================================================ FILE: src/Carbon/Lang/tlh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Serhan Apaydın * - Dominika */ return [ 'year' => '{1}wa’ DIS|:count DIS', 'month' => '{1}wa’ jar|:count jar', 'week' => '{1}wa’ hogh|:count hogh', 'day' => '{1}wa’ jaj|:count jaj', 'hour' => '{1}wa’ rep|:count rep', 'minute' => '{1}wa’ tup|:count tup', 'second' => '{1}puS lup|:count lup', 'ago' => static function ($time) { $output = strtr($time, [ 'jaj' => 'Hu’', 'jar' => 'wen', 'DIS' => 'ben', ]); return $output === $time ? "$time ret" : $output; }, 'from_now' => static function ($time) { $output = strtr($time, [ 'jaj' => 'leS', 'jar' => 'waQ', 'DIS' => 'nem', ]); return $output === $time ? "$time pIq" : $output; }, 'diff_yesterday' => 'wa’Hu’', 'diff_today' => 'DaHjaj', 'diff_tomorrow' => 'wa’leS', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[DaHjaj] LT', 'nextDay' => '[wa’leS] LT', 'nextWeek' => 'LLL', 'lastDay' => '[wa’Hu’] LT', 'lastWeek' => 'LLL', 'sameElse' => 'L', ], 'ordinal' => ':number.', 'months' => ['tera’ jar wa’', 'tera’ jar cha’', 'tera’ jar wej', 'tera’ jar loS', 'tera’ jar vagh', 'tera’ jar jav', 'tera’ jar Soch', 'tera’ jar chorgh', 'tera’ jar Hut', 'tera’ jar wa’maH', 'tera’ jar wa’maH wa’', 'tera’ jar wa’maH cha’'], 'months_short' => ['jar wa’', 'jar cha’', 'jar wej', 'jar loS', 'jar vagh', 'jar jav', 'jar Soch', 'jar chorgh', 'jar Hut', 'jar wa’maH', 'jar wa’maH wa’', 'jar wa’maH cha’'], 'weekdays' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], 'weekdays_short' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], 'weekdays_min' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' ’ej '], ]; ================================================ FILE: src/Carbon/Lang/tn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/tn_ZA.php'; ================================================ FILE: src/Carbon/Lang/tn_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Ferikgong', 'Tlhakole', 'Mopitlwe', 'Moranang', 'Motsheganong', 'Seetebosigo', 'Phukwi', 'Phatwe', 'Lwetse', 'Diphalane', 'Ngwanatsele', 'Sedimonthole'], 'months_short' => ['Fer', 'Tlh', 'Mop', 'Mor', 'Mot', 'See', 'Phu', 'Pha', 'Lwe', 'Dip', 'Ngw', 'Sed'], 'weekdays' => ['laTshipi', 'Mosupologo', 'Labobedi', 'Laboraro', 'Labone', 'Labotlhano', 'Lamatlhatso'], 'weekdays_short' => ['Tsh', 'Mos', 'Bed', 'Rar', 'Ne', 'Tlh', 'Mat'], 'weekdays_min' => ['Tsh', 'Mos', 'Bed', 'Rar', 'Ne', 'Tlh', 'Mat'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => 'dingwaga di le :count', 'y' => 'dingwaga di le :count', 'a_year' => 'dingwaga di le :count', 'month' => 'dikgwedi di le :count', 'm' => 'dikgwedi di le :count', 'a_month' => 'dikgwedi di le :count', 'week' => 'dibeke di le :count', 'w' => 'dibeke di le :count', 'a_week' => 'dibeke di le :count', 'day' => 'malatsi :count', 'd' => 'malatsi :count', 'a_day' => 'malatsi :count', 'hour' => 'diura di le :count', 'h' => 'diura di le :count', 'a_hour' => 'diura di le :count', 'minute' => 'metsotso e le :count', 'min' => 'metsotso e le :count', 'a_minute' => 'metsotso e le :count', 'second' => 'metsotswana e le :count', 's' => 'metsotswana e le :count', 'a_second' => 'metsotswana e le :count', ]); ================================================ FILE: src/Carbon/Lang/to.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/to_TO.php'; ================================================ FILE: src/Carbon/Lang/to_TO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - International Components for Unicode akhilesh.k@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 0, 'formats' => [ 'L' => 'dddd DD MMM YYYY', ], 'months' => ['Sānuali', 'Fēpueli', 'Maʻasi', 'ʻEpeleli', 'Mē', 'Sune', 'Siulai', 'ʻAokosi', 'Sepitema', 'ʻOkatopa', 'Nōvema', 'Tīsema'], 'months_short' => ['Sān', 'Fēp', 'Maʻa', 'ʻEpe', 'Mē', 'Sun', 'Siu', 'ʻAok', 'Sep', 'ʻOka', 'Nōv', 'Tīs'], 'weekdays' => ['Sāpate', 'Mōnite', 'Tūsite', 'Pulelulu', 'Tuʻapulelulu', 'Falaite', 'Tokonaki'], 'weekdays_short' => ['Sāp', 'Mōn', 'Tūs', 'Pul', 'Tuʻa', 'Fal', 'Tok'], 'weekdays_min' => ['Sāp', 'Mōn', 'Tūs', 'Pul', 'Tuʻa', 'Fal', 'Tok'], 'meridiem' => ['hengihengi', 'efiafi'], 'year' => ':count fitu', // less reliable 'y' => ':count fitu', // less reliable 'a_year' => ':count fitu', // less reliable 'month' => ':count mahina', // less reliable 'm' => ':count mahina', // less reliable 'a_month' => ':count mahina', // less reliable 'week' => ':count Sapate', // less reliable 'w' => ':count Sapate', // less reliable 'a_week' => ':count Sapate', // less reliable 'day' => ':count ʻaho', // less reliable 'd' => ':count ʻaho', // less reliable 'a_day' => ':count ʻaho', // less reliable 'hour' => ':count houa', 'h' => ':count houa', 'a_hour' => ':count houa', 'minute' => ':count miniti', 'min' => ':count miniti', 'a_minute' => ':count miniti', 'second' => ':count sekoni', 's' => ':count sekoni', 'a_second' => ':count sekoni', ]); ================================================ FILE: src/Carbon/Lang/tpi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/tpi_PG.php'; ================================================ FILE: src/Carbon/Lang/tpi_PG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Janueri', 'Februeri', 'Mas', 'Epril', 'Me', 'Jun', 'Julai', 'Ogas', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mas', 'Epr', 'Me', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Des'], 'weekdays' => ['Sande', 'Mande', 'Tunde', 'Trinde', 'Fonde', 'Fraide', 'Sarere'], 'weekdays_short' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'], 'weekdays_min' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['biknait', 'apinun'], 'year' => 'yia :count', 'y' => 'yia :count', 'a_year' => 'yia :count', 'month' => ':count mun', 'm' => ':count mun', 'a_month' => ':count mun', 'week' => ':count wik', 'w' => ':count wik', 'a_week' => ':count wik', 'day' => ':count de', 'd' => ':count de', 'a_day' => ':count de', 'hour' => ':count aua', 'h' => ':count aua', 'a_hour' => ':count aua', 'minute' => ':count minit', 'min' => ':count minit', 'a_minute' => ':count minit', 'second' => ':count namba tu', 's' => ':count namba tu', 'a_second' => ':count namba tu', ]); ================================================ FILE: src/Carbon/Lang/tr.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - Alan Agius * - Erhan Gundogan * - François B * - JD Isaacks * - Murat Yüksel * - Baran Şengül * - Selami (selamialtin) * - TeomanBey */ return [ 'year' => ':count yıl', 'a_year' => '{1}bir yıl|[-Inf,Inf]:count yıl', 'y' => ':county', 'month' => ':count ay', 'a_month' => '{1}bir ay|[-Inf,Inf]:count ay', 'm' => ':countay', 'week' => ':count hafta', 'a_week' => '{1}bir hafta|[-Inf,Inf]:count hafta', 'w' => ':counth', 'day' => ':count gün', 'a_day' => '{1}bir gün|[-Inf,Inf]:count gün', 'd' => ':countg', 'hour' => ':count saat', 'a_hour' => '{1}bir saat|[-Inf,Inf]:count saat', 'h' => ':countsa', 'minute' => ':count dakika', 'a_minute' => '{1}bir dakika|[-Inf,Inf]:count dakika', 'min' => ':countdk', 'second' => ':count saniye', 'a_second' => '{1}birkaç saniye|[-Inf,Inf]:count saniye', 's' => ':countsn', 'ago' => ':time önce', 'from_now' => ':time sonra', 'after' => ':time sonra', 'before' => ':time önce', 'diff_now' => 'şimdi', 'diff_today' => 'bugün', 'diff_today_regexp' => 'bugün(?:\\s+saat)?', 'diff_yesterday' => 'dün', 'diff_tomorrow' => 'yarın', 'diff_tomorrow_regexp' => 'yarın(?:\\s+saat)?', 'diff_before_yesterday' => 'evvelsi gün', 'diff_after_tomorrow' => 'öbür gün', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[bugün saat] LT', 'nextDay' => '[yarın saat] LT', 'nextWeek' => '[gelecek] dddd [saat] LT', 'lastDay' => '[dün] LT', 'lastWeek' => '[geçen] dddd [saat] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { switch ($period) { case 'd': case 'D': case 'Do': case 'DD': return $number; default: if ($number === 0) { // special case for zero return "$number'ıncı"; } static $suffixes = [ 1 => '\'inci', 5 => '\'inci', 8 => '\'inci', 70 => '\'inci', 80 => '\'inci', 2 => '\'nci', 7 => '\'nci', 20 => '\'nci', 50 => '\'nci', 3 => '\'üncü', 4 => '\'üncü', 100 => '\'üncü', 6 => '\'ncı', 9 => '\'uncu', 10 => '\'uncu', 30 => '\'uncu', 60 => '\'ıncı', 90 => '\'ıncı', ]; $lastDigit = $number % 10; return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); } }, 'meridiem' => ['ÖÖ', 'ÖS', 'öö', 'ös'], 'months' => ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], 'months_short' => ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], 'weekdays' => ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], 'weekdays_short' => ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], 'weekdays_min' => ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' ve '], ]; ================================================ FILE: src/Carbon/Lang/tr_CY.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/tr.php', [ 'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], 'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'D.MM.YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'D MMMM YYYY dddd h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/tr_TR.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/tr.php'; ================================================ FILE: src/Carbon/Lang/ts.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ts_ZA.php'; ================================================ FILE: src/Carbon/Lang/ts_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Sunguti', 'Nyenyenyani', 'Nyenyankulu', 'Dzivamisoko', 'Mudyaxihi', 'Khotavuxika', 'Mawuwani', 'Mhawuri', 'Ndzhati', 'Nhlangula', 'Hukuri', 'N\'wendzamhala'], 'months_short' => ['Sun', 'Yan', 'Kul', 'Dzi', 'Mud', 'Kho', 'Maw', 'Mha', 'Ndz', 'Nhl', 'Huk', 'N\'w'], 'weekdays' => ['Sonto', 'Musumbhunuku', 'Ravumbirhi', 'Ravunharhu', 'Ravumune', 'Ravuntlhanu', 'Mugqivela'], 'weekdays_short' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'], 'weekdays_min' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => 'malembe ya :count', 'y' => 'malembe ya :count', 'a_year' => 'malembe ya :count', 'month' => 'tin’hweti ta :count', 'm' => 'tin’hweti ta :count', 'a_month' => 'tin’hweti ta :count', 'week' => 'mavhiki ya :count', 'w' => 'mavhiki ya :count', 'a_week' => 'mavhiki ya :count', 'day' => 'masiku :count', 'd' => 'masiku :count', 'a_day' => 'masiku :count', 'hour' => 'tiawara ta :count', 'h' => 'tiawara ta :count', 'a_hour' => 'tiawara ta :count', 'minute' => 'timinete ta :count', 'min' => 'timinete ta :count', 'a_minute' => 'timinete ta :count', 'second' => 'tisekoni ta :count', 's' => 'tisekoni ta :count', 'a_second' => 'tisekoni ta :count', ]); ================================================ FILE: src/Carbon/Lang/tt.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/tt_RU.php'; ================================================ FILE: src/Carbon/Lang/tt_RU.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Rinat Norkin Pablo Saratxaga, Rinat Norkin pablo@mandrakesoft.com, rinat@taif.ru */ return [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'DD MMM, HH:mm', 'LLLL' => 'DD MMMM YYYY, HH:mm', ], 'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'weekdays' => ['якшәмбе', 'дышәмбе', 'сишәмбе', 'чәршәәмбе', 'пәнҗешмбе', 'җомга', 'шимбә'], 'weekdays_short' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'], 'weekdays_min' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count ел', 'month' => ':count ай', 'week' => ':count атна', 'day' => ':count көн', 'hour' => ':count сәгать', 'minute' => ':count минут', 'second' => ':count секунд', ]; ================================================ FILE: src/Carbon/Lang/tt_RU@iqtelif.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Reshat Sabiq tatar.iqtelif.i18n@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD.MM.YYYY', ], 'months' => ['Ğınwar', 'Fiwral\'', 'Mart', 'April', 'May', 'Yün', 'Yül', 'Awgust', 'Sintebír', 'Üktebír', 'Noyebír', 'Dikebír'], 'months_short' => ['Ğın', 'Fiw', 'Mar', 'Apr', 'May', 'Yün', 'Yül', 'Awg', 'Sin', 'Ükt', 'Noy', 'Dik'], 'weekdays' => ['Yekşembí', 'Düşembí', 'Sişembí', 'Çerşembí', 'Pencíşembí', 'Comğa', 'Şimbe'], 'weekdays_short' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'], 'weekdays_min' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ÖA', 'ÖS'], ]); ================================================ FILE: src/Carbon/Lang/twq.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/ses.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], ]); ================================================ FILE: src/Carbon/Lang/tzl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ 'year' => '[0,1]:count ar|:count ars', 'y' => '[0,1]:count ar|:count ars', 'month' => '[0,1]:count mes|:count mesen', 'm' => '[0,1]:count mes|:count mesen', 'week' => '[0,1]:count seifetziua|:count seifetziuas', 'w' => '[0,1]:count seifetziua|:count seifetziuas', 'day' => '[0,1]:count ziua|:count ziuas', 'd' => '[0,1]:count ziua|:count ziuas', 'hour' => '[0,1]:count þora|:count þoras', 'h' => '[0,1]:count þora|:count þoras', 'minute' => '[0,1]:count míut|:count míuts', 'min' => '[0,1]:count míut|:count míuts', 'second' => ':count secunds', 's' => ':count secunds', 'ago' => 'ja :time', 'from_now' => 'osprei :time', 'diff_yesterday' => 'ieiri', 'diff_yesterday_regexp' => 'ieiri(?:\\s+à)?', 'diff_today' => 'oxhi', 'diff_today_regexp' => 'oxhi(?:\\s+à)?', 'diff_tomorrow' => 'demà', 'diff_tomorrow_regexp' => 'demà(?:\\s+à)?', 'formats' => [ 'LT' => 'HH.mm', 'LTS' => 'HH.mm.ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D. MMMM [dallas] YYYY', 'LLL' => 'D. MMMM [dallas] YYYY HH.mm', 'LLLL' => 'dddd, [li] D. MMMM [dallas] YYYY HH.mm', ], 'calendar' => [ 'sameDay' => '[oxhi à] LT', 'nextDay' => '[demà à] LT', 'nextWeek' => 'dddd [à] LT', 'lastDay' => '[ieiri à] LT', 'lastWeek' => '[sür el] dddd [lasteu à] LT', 'sameElse' => 'L', ], 'meridiem' => ["D'A", "D'O"], 'months' => ['Januar', 'Fevraglh', 'Març', 'Avrïu', 'Mai', 'Gün', 'Julia', 'Guscht', 'Setemvar', 'Listopäts', 'Noemvar', 'Zecemvar'], 'months_short' => ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Gün', 'Jul', 'Gus', 'Set', 'Lis', 'Noe', 'Zec'], 'weekdays' => ['Súladi', 'Lúneçi', 'Maitzi', 'Márcuri', 'Xhúadi', 'Viénerçi', 'Sáturi'], 'weekdays_short' => ['Súl', 'Lún', 'Mai', 'Már', 'Xhú', 'Vié', 'Sát'], 'weekdays_min' => ['Sú', 'Lú', 'Ma', 'Má', 'Xh', 'Vi', 'Sá'], 'ordinal' => ':number.', 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, ]; ================================================ FILE: src/Carbon/Lang/tzm.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - JD Isaacks */ return [ 'year' => '{1}ⴰⵙⴳⴰⵙ|:count ⵉⵙⴳⴰⵙⵏ', 'month' => '{1}ⴰⵢoⵓⵔ|:count ⵉⵢⵢⵉⵔⵏ', 'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ', 'day' => '{1}ⴰⵙⵙ|:count oⵙⵙⴰⵏ', 'hour' => '{1}ⵙⴰⵄⴰ|:count ⵜⴰⵙⵙⴰⵄⵉⵏ', 'minute' => '{1}ⵎⵉⵏⵓⴺ|:count ⵎⵉⵏⵓⴺ', 'second' => '{1}ⵉⵎⵉⴽ|:count ⵉⵎⵉⴽ', 'ago' => 'ⵢⴰⵏ :time', 'from_now' => 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ :time', 'diff_today' => 'ⴰⵙⴷⵅ', 'diff_yesterday' => 'ⴰⵚⴰⵏⵜ', 'diff_yesterday_regexp' => 'ⴰⵚⴰⵏⵜ(?:\\s+ⴴ)?', 'diff_tomorrow' => 'ⴰⵙⴽⴰ', 'diff_tomorrow_regexp' => 'ⴰⵙⴽⴰ(?:\\s+ⴴ)?', 'diff_today_regexp' => 'ⴰⵙⴷⵅ(?:\\s+ⴴ)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[ⴰⵙⴷⵅ ⴴ] LT', 'nextDay' => '[ⴰⵙⴽⴰ ⴴ] LT', 'nextWeek' => 'dddd [ⴴ] LT', 'lastDay' => '[ⴰⵚⴰⵏⵜ ⴴ] LT', 'lastWeek' => 'dddd [ⴴ] LT', 'sameElse' => 'L', ], 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'], 'months_short' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'], 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], 'weekdays_short' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], 'weekdays_min' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, 'weekend' => [5, 6], ]; ================================================ FILE: src/Carbon/Lang/tzm_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - JD Isaacks */ return [ 'year' => '{1}:count asgas|:count isgasn', 'a_year' => 'asgas|:count isgasn', 'month' => '{1}:count ayowr|:count iyyirn', 'a_month' => 'ayowr|:count iyyirn', 'week' => ':count imalass', 'a_week' => ':imalass', 'day' => '{1}:count ass|:count ossan', 'a_day' => 'ass|:count ossan', 'hour' => '{1}:count saɛa|:count tassaɛin', 'a_hour' => '{1}saɛa|:count tassaɛin', 'minute' => ':count minuḍ', 'a_minute' => '{1}minuḍ|:count minuḍ', 'second' => ':count imik', 'a_second' => '{1}imik|:count imik', 'ago' => 'yan :time', 'from_now' => 'dadkh s yan :time', 'diff_yesterday' => 'assant', 'diff_yesterday_regexp' => 'assant(?:\\s+g)?', 'diff_today' => 'asdkh', 'diff_today_regexp' => 'asdkh(?:\\s+g)?', 'diff_tomorrow' => 'aska', 'diff_tomorrow_regexp' => 'aska(?:\\s+g)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[asdkh g] LT', 'nextDay' => '[aska g] LT', 'nextWeek' => 'dddd [g] LT', 'lastDay' => '[assant g] LT', 'lastWeek' => 'dddd [g] LT', 'sameElse' => 'L', ], 'months' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'], 'months_short' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'], 'weekdays' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], 'weekdays_short' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], 'weekdays_min' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], 'meridiem' => ['Zdat azal', 'Ḍeffir aza'], 'first_day_of_week' => 6, 'day_of_first_week_of_year' => 1, ]; ================================================ FILE: src/Carbon/Lang/ug.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Philippe Vaucher * - Tsutomu Kuroda * - yasinn */ return [ 'year' => '{1}'.'بىر يىل'.'|:count '.'يىل', 'month' => '{1}'.'بىر ئاي'.'|:count '.'ئاي', 'week' => '{1}'.'بىر ھەپتە'.'|:count '.'ھەپتە', 'day' => '{1}'.'بىر كۈن'.'|:count '.'كۈن', 'hour' => '{1}'.'بىر سائەت'.'|:count '.'سائەت', 'minute' => '{1}'.'بىر مىنۇت'.'|:count '.'مىنۇت', 'second' => '{1}'.'نەچچە سېكونت'.'|:count '.'سېكونت', 'ago' => ':time بۇرۇن', 'from_now' => ':time كېيىن', 'diff_today' => 'بۈگۈن', 'diff_yesterday' => 'تۆنۈگۈن', 'diff_tomorrow' => 'ئەتە', 'diff_tomorrow_regexp' => 'ئەتە(?:\\s+سائەت)?', 'diff_today_regexp' => 'بۈگۈن(?:\\s+سائەت)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-DD', 'LL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى', 'LLL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', 'LLLL' => 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', ], 'calendar' => [ 'sameDay' => '[بۈگۈن سائەت] LT', 'nextDay' => '[ئەتە سائەت] LT', 'nextWeek' => '[كېلەركى] dddd [سائەت] LT', 'lastDay' => '[تۆنۈگۈن] LT', 'lastWeek' => '[ئالدىنقى] dddd [سائەت] LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'd', 'D', 'DDD' => $number.'-كۈنى', 'w', 'W' => $number.'-ھەپتە', default => $number, }; }, 'meridiem' => static function ($hour, $minute) { $time = $hour * 100 + $minute; if ($time < 600) { return 'يېرىم كېچە'; } if ($time < 900) { return 'سەھەر'; } if ($time < 1130) { return 'چۈشتىن بۇرۇن'; } if ($time < 1230) { return 'چۈش'; } if ($time < 1800) { return 'چۈشتىن كېيىن'; } return 'كەچ'; }, 'months' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'], 'months_short' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'], 'weekdays' => ['يەكشەنبە', 'دۈشەنبە', 'سەيشەنبە', 'چارشەنبە', 'پەيشەنبە', 'جۈمە', 'شەنبە'], 'weekdays_short' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'], 'weekdays_min' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' ۋە '], ]; ================================================ FILE: src/Carbon/Lang/ug_CN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Kunal Marwaha * - Alim Boyaq */ return require __DIR__.'/ug.php'; ================================================ FILE: src/Carbon/Lang/uk.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonInterface; $processHoursFunction = static function (CarbonInterface $date, string $format) { return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT'; }; /* * Authors: * - Kunal Marwaha * - Josh Soref * - François B * - Tim Fish * - Serhan Apaydın * - Max Mykhailenko * - JD Isaacks * - Max Kovpak * - AucT * - Philippe Vaucher * - Ilya Shaplyko * - Vadym Ievsieiev * - Denys Kurets * - Igor Kasyanchuk * - Tsutomu Kuroda * - tjku * - Max Melentiev * - Oleh * - epaminond * - Juanito Fatas * - Vitalii Khustochka * - Akira Matsuda * - Christopher Dell * - Enrique Vidal * - Simone Carletti * - Aaron Patterson * - Andriy Tyurnikov * - Nicolás Hock Isaza * - Iwakura Taro * - Andrii Ponomarov * - alecrabbit * - vystepanenko * - AlexWalkerson * - Andre Havryliuk (Andrend) * - Max Datsenko (datsenko-md) */ return [ 'year' => ':count рік|:count роки|:count років', 'y' => ':countр|:countрр|:countрр', 'a_year' => '{1}рік|:count рік|:count роки|:count років', 'month' => ':count місяць|:count місяці|:count місяців', 'm' => ':countм', 'a_month' => '{1}місяць|:count місяць|:count місяці|:count місяців', 'week' => ':count тиждень|:count тижні|:count тижнів', 'w' => ':countт', 'a_week' => '{1}тиждень|:count тиждень|:count тижні|:count тижнів', 'day' => ':count день|:count дні|:count днів', 'd' => ':countд', 'a_day' => '{1}день|:count день|:count дні|:count днів', 'hour' => ':count година|:count години|:count годин', 'h' => ':countг', 'a_hour' => '{1}година|:count година|:count години|:count годин', 'minute' => ':count хвилина|:count хвилини|:count хвилин', 'min' => ':countхв', 'a_minute' => '{1}хвилина|:count хвилина|:count хвилини|:count хвилин', 'second' => ':count секунда|:count секунди|:count секунд', 's' => ':countсек', 'a_second' => '{1}декілька секунд|:count секунда|:count секунди|:count секунд', 'hour_ago' => ':count годину|:count години|:count годин', 'a_hour_ago' => '{1}годину|:count годину|:count години|:count годин', 'minute_ago' => ':count хвилину|:count хвилини|:count хвилин', 'a_minute_ago' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', 'second_ago' => ':count секунду|:count секунди|:count секунд', 'a_second_ago' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', 'hour_from_now' => ':count годину|:count години|:count годин', 'a_hour_from_now' => '{1}годину|:count годину|:count години|:count годин', 'minute_from_now' => ':count хвилину|:count хвилини|:count хвилин', 'a_minute_from_now' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', 'second_from_now' => ':count секунду|:count секунди|:count секунд', 'a_second_from_now' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', 'hour_after' => ':count годину|:count години|:count годин', 'a_hour_after' => '{1}годину|:count годину|:count години|:count годин', 'minute_after' => ':count хвилину|:count хвилини|:count хвилин', 'a_minute_after' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', 'second_after' => ':count секунду|:count секунди|:count секунд', 'a_second_after' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', 'hour_before' => ':count годину|:count години|:count годин', 'a_hour_before' => '{1}годину|:count годину|:count години|:count годин', 'minute_before' => ':count хвилину|:count хвилини|:count хвилин', 'a_minute_before' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', 'second_before' => ':count секунду|:count секунди|:count секунд', 'a_second_before' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', 'ago' => ':time тому', 'from_now' => 'за :time', 'after' => ':time після', 'before' => ':time до', 'diff_now' => 'щойно', 'diff_today' => 'Сьогодні', 'diff_today_regexp' => 'Сьогодні(?:\\s+о)?', 'diff_yesterday' => 'вчора', 'diff_yesterday_regexp' => 'Вчора(?:\\s+о)?', 'diff_tomorrow' => 'завтра', 'diff_tomorrow_regexp' => 'Завтра(?:\\s+о)?', 'diff_before_yesterday' => 'позавчора', 'diff_after_tomorrow' => 'післязавтра', 'period_recurrences' => 'один раз|:count рази|:count разів', 'period_interval' => 'кожні :interval', 'period_start_date' => 'з :date', 'period_end_date' => 'до :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], 'calendar' => [ 'sameDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Сьогодні '), 'nextDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Завтра '), 'nextWeek' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[У] dddd ['), 'lastDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Вчора '), 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { 0, 3, 5, 6 => $processHoursFunction($date, '[Минулої] dddd ['), default => $processHoursFunction($date, '[Минулого] dddd ['), }, 'sameElse' => 'L', ], 'ordinal' => static fn ($number, $period) => match ($period) { 'M', 'd', 'DDD', 'w', 'W' => $number.'-й', 'D' => $number.'-го', default => $number, }, 'meridiem' => static function ($hour) { if ($hour < 4) { return 'ночі'; } if ($hour < 12) { return 'ранку'; } if ($hour < 17) { return 'дня'; } return 'вечора'; }, 'months' => ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'], 'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'], 'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', 'weekdays' => static function (CarbonInterface $date, $format, $index) { static $words = [ 'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], 'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], 'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'], ]; $format ??= ''; $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format) ? 'accusative' : ( preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/u', $format) ? 'genitive' : 'nominative' ); return $words[$nounCase][$index] ?? null; }, 'weekdays_short' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], 'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' i '], ]; ================================================ FILE: src/Carbon/Lang/uk_UA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/uk.php'; ================================================ FILE: src/Carbon/Lang/unm.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/unm_US.php'; ================================================ FILE: src/Carbon/Lang/unm_US.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['enikwsi', 'chkwali', 'xamokhwite', 'kwetayoxe', 'tainipen', 'kichinipen', 'lainipen', 'winaminke', 'kichitahkok', 'puksit', 'wini', 'muxkotae'], 'months_short' => ['eni', 'chk', 'xam', 'kwe', 'tai', 'nip', 'lai', 'win', 'tah', 'puk', 'kun', 'mux'], 'weekdays' => ['kentuwei', 'manteke', 'tusteke', 'lelai', 'tasteke', 'pelaiteke', 'sateteke'], 'weekdays_short' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'], 'weekdays_min' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, // Too unreliable /* 'year' => ':count kaxtëne', 'y' => ':count kaxtëne', 'a_year' => ':count kaxtëne', 'month' => ':count piskewëni kishux', // less reliable 'm' => ':count piskewëni kishux', // less reliable 'a_month' => ':count piskewëni kishux', // less reliable 'week' => ':count kishku', // less reliable 'w' => ':count kishku', // less reliable 'a_week' => ':count kishku', // less reliable 'day' => ':count kishku', 'd' => ':count kishku', 'a_day' => ':count kishku', 'hour' => ':count xkuk', // less reliable 'h' => ':count xkuk', // less reliable 'a_hour' => ':count xkuk', // less reliable 'minute' => ':count txituwàk', // less reliable 'min' => ':count txituwàk', // less reliable 'a_minute' => ':count txituwàk', // less reliable 'second' => ':count nisha', // less reliable 's' => ':count nisha', // less reliable 'a_second' => ':count nisha', // less reliable */ ]); ================================================ FILE: src/Carbon/Lang/ur.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $months = [ 'جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر', ]; $weekdays = [ 'اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ', ]; /* * Authors: * - Sawood Alam * - Mehshan * - Philippe Vaucher * - Tsutomu Kuroda * - tjku * - Zaid Akram * - Max Melentiev * - hafezdivandari * - Hossein Jabbari * - nimamo * - Usman Zahid */ return [ 'year' => ':count '.'سال', 'a_year' => 'ایک سال|:count سال', 'month' => ':count '.'ماہ', 'a_month' => 'ایک ماہ|:count ماہ', 'week' => ':count '.'ہفتے', 'day' => ':count '.'دن', 'a_day' => 'ایک دن|:count دن', 'hour' => ':count '.'گھنٹے', 'a_hour' => 'ایک گھنٹہ|:count گھنٹے', 'minute' => ':count '.'منٹ', 'a_minute' => 'ایک منٹ|:count منٹ', 'second' => ':count '.'سیکنڈ', 'a_second' => 'چند سیکنڈ|:count سیکنڈ', 'ago' => ':time قبل', 'from_now' => ':time بعد', 'after' => ':time بعد', 'before' => ':time پہلے', 'diff_now' => 'اب', 'diff_today' => 'آج', 'diff_today_regexp' => 'آج(?:\\s+بوقت)?', 'diff_yesterday' => 'گزشتہ کل', 'diff_yesterday_regexp' => 'گذشتہ(?:\\s+روز)?(?:\\s+بوقت)?', 'diff_tomorrow' => 'آئندہ کل', 'diff_tomorrow_regexp' => 'کل(?:\\s+بوقت)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd، D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[آج بوقت] LT', 'nextDay' => '[کل بوقت] LT', 'nextWeek' => 'dddd [بوقت] LT', 'lastDay' => '[گذشتہ روز بوقت] LT', 'lastWeek' => '[گذشتہ] dddd [بوقت] LT', 'sameElse' => 'L', ], 'meridiem' => ['صبح', 'شام'], 'months' => $months, 'months_short' => $months, 'weekdays' => $weekdays, 'weekdays_short' => $weekdays, 'weekdays_min' => $weekdays, 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => ['، ', ' اور '], ]; ================================================ FILE: src/Carbon/Lang/ur_IN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Red Hat, Pune bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/ur.php', [ 'formats' => [ 'L' => 'D/M/YY', ], 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], 'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/ur_PK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/ur.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], 'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], 'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], 'day_of_first_week_of_year' => 1, 'meridiem' => ['ص', 'ش'], ]); ================================================ FILE: src/Carbon/Lang/uz.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Dmitriy Shabanov * - JD Isaacks * - Inoyatulloh * - Jamshid * - aarkhipov * - Philippe Vaucher * - felixthemagnificent * - Tsutomu Kuroda * - tjku * - Max Melentiev * - Juanito Fatas * - Alisher Ulugbekov * - Ergashev Adizbek */ return [ 'year' => ':count йил', 'a_year' => '{1}бир йил|:count йил', 'y' => ':count й', 'month' => ':count ой', 'a_month' => '{1}бир ой|:count ой', 'm' => ':count о', 'week' => ':count ҳафта', 'a_week' => '{1}бир ҳафта|:count ҳафта', 'w' => ':count ҳ', 'day' => ':count кун', 'a_day' => '{1}бир кун|:count кун', 'd' => ':count к', 'hour' => ':count соат', 'a_hour' => '{1}бир соат|:count соат', 'h' => ':count с', 'minute' => ':count дақиқа', 'a_minute' => '{1}бир дақиқа|:count дақиқа', 'min' => ':count д', 'second' => ':count сония', 'a_second' => '{1}сония|:count сония', 's' => ':count с', 'ago' => ':time аввал', 'from_now' => 'Якин :time ичида', 'after' => ':timeдан кейин', 'before' => ':time олдин', 'diff_now' => 'ҳозир', 'diff_today' => 'Бугун', 'diff_today_regexp' => 'Бугун(?:\\s+соат)?', 'diff_yesterday' => 'Кеча', 'diff_yesterday_regexp' => 'Кеча(?:\\s+соат)?', 'diff_tomorrow' => 'Эртага', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'D MMMM YYYY, dddd HH:mm', ], 'calendar' => [ 'sameDay' => '[Бугун соат] LT [да]', 'nextDay' => '[Эртага] LT [да]', 'nextWeek' => 'dddd [куни соат] LT [да]', 'lastDay' => '[Кеча соат] LT [да]', 'lastWeek' => '[Утган] dddd [куни соат] LT [да]', 'sameElse' => 'L', ], 'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 'weekdays' => ['якшанба', 'душанба', 'сешанба', 'чоршанба', 'пайшанба', 'жума', 'шанба'], 'weekdays_short' => ['якш', 'душ', 'сеш', 'чор', 'пай', 'жум', 'шан'], 'weekdays_min' => ['як', 'ду', 'се', 'чо', 'па', 'жу', 'ша'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'meridiem' => ['эрталаб', 'кечаси'], 'list' => [', ', ' ва '], ]; ================================================ FILE: src/Carbon/Lang/uz_Arab.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/fa.php', [ 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], 'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], 'weekdays_min' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], 'months' => ['جنوری', 'فبروری', 'مارچ', 'اپریل', 'می', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], 'months_short' => ['جنو', 'فبر', 'مار', 'اپر', 'می', 'جون', 'جول', 'اگس', 'سپت', 'اکت', 'نوم', 'دسم'], 'first_day_of_week' => 6, 'weekend' => [4, 5], 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'YYYY MMMM D, dddd HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/uz_Cyrl.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/uz.php', [ 'formats' => [ 'L' => 'DD/MM/yy', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY HH:mm', 'LLLL' => 'dddd, DD MMMM, YYYY HH:mm', ], 'meridiem' => ['ТО', 'ТК'], ]); ================================================ FILE: src/Carbon/Lang/uz_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Josh Soref * - Rasulbek * - Ilyosjon Kamoldinov (ilyosjon09) */ return [ 'year' => ':count yil', 'a_year' => '{1}bir yil|:count yil', 'y' => ':count y', 'month' => ':count oy', 'a_month' => '{1}bir oy|:count oy', 'm' => ':count o', 'week' => ':count hafta', 'a_week' => '{1}bir hafta|:count hafta', 'w' => ':count h', 'day' => ':count kun', 'a_day' => '{1}bir kun|:count kun', 'd' => ':count k', 'hour' => ':count soat', 'a_hour' => '{1}bir soat|:count soat', 'h' => ':count soat', 'minute' => ':count daqiqa', 'a_minute' => '{1}bir daqiqa|:count daqiqa', 'min' => ':count d', 'second' => ':count soniya', 'a_second' => '{1}soniya|:count soniya', 's' => ':count son.', 'ago' => ':time avval', 'from_now' => 'Yaqin :time ichida', 'after' => ':timedan keyin', 'before' => ':time oldin', 'diff_yesterday' => 'Kecha', 'diff_yesterday_regexp' => 'Kecha(?:\\s+soat)?', 'diff_today' => 'Bugun', 'diff_today_regexp' => 'Bugun(?:\\s+soat)?', 'diff_tomorrow' => 'Ertaga', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'D MMMM YYYY, dddd HH:mm', ], 'calendar' => [ 'sameDay' => '[Bugun soat] LT [da]', 'nextDay' => '[Ertaga] LT [da]', 'nextWeek' => 'dddd [kuni soat] LT [da]', 'lastDay' => '[Kecha soat] LT [da]', 'lastWeek' => '[O\'tgan] dddd [kuni soat] LT [da]', 'sameElse' => 'L', ], 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'], 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyun', 'Iyul', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], 'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], 'weekdays_short' => ['Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan'], 'weekdays_min' => ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' va '], 'meridiem' => ['TO', 'TK'], ]; ================================================ FILE: src/Carbon/Lang/uz_UZ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Bobir Ismailov Bobir Ismailov, Pablo Saratxaga, Mashrab Kuvatov bobir_is@yahoo.com, pablo@mandrakesoft.com, kmashrab@uni-bremen.de */ return array_replace_recursive(require __DIR__.'/uz_Latn.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'], 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyn', 'Iyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], 'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], 'weekdays_short' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'], 'weekdays_min' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/uz_UZ@cyrillic.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Mashrab Kuvatov Mashrab Kuvatov, Pablo Saratxaga kmashrab@uni-bremen.de, pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/uz.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['Январ', 'Феврал', 'Март', 'Апрел', 'Май', 'Июн', 'Июл', 'Август', 'Сентябр', 'Октябр', 'Ноябр', 'Декабр'], 'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], 'weekdays' => ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], 'weekdays_short' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], 'weekdays_min' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/vai.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], 'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], 'weekdays_min' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], 'months' => ['ꖨꖕ ꕪꕴ ꔞꔀꕮꕊ', 'ꕒꕡꖝꖕ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞꔤ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋꕔꕿ ꕸꖃꗏ', 'ꖨꖕ ꕪꕴ ꗏꖺꕮꕊ'], 'months_short' => ['ꖨꖕꔞ', 'ꕒꕡ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋ', 'ꖨꖕꗏ'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd, D MMMM YYYY h:mm a', ], 'year' => ':count ꕀ', // less reliable 'y' => ':count ꕀ', // less reliable 'a_year' => ':count ꕀ', // less reliable 'second' => ':count ꗱꕞꕯꕊ', // less reliable 's' => ':count ꗱꕞꕯꕊ', // less reliable 'a_second' => ':count ꗱꕞꕯꕊ', // less reliable ]); ================================================ FILE: src/Carbon/Lang/vai_Latn.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_min' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'months' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], 'months_short' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd, D MMMM YYYY h:mm a', ], ]); ================================================ FILE: src/Carbon/Lang/vai_Vaii.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/vai.php'; ================================================ FILE: src/Carbon/Lang/ve.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/ve_ZA.php'; ================================================ FILE: src/Carbon/Lang/ve_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Phando', 'Luhuhi', 'Ṱhafamuhwe', 'Lambamai', 'Shundunthule', 'Fulwi', 'Fulwana', 'Ṱhangule', 'Khubvumedzi', 'Tshimedzi', 'Ḽara', 'Nyendavhusiku'], 'months_short' => ['Pha', 'Luh', 'Fam', 'Lam', 'Shu', 'Lwi', 'Lwa', 'Ngu', 'Khu', 'Tsh', 'Ḽar', 'Nye'], 'weekdays' => ['Swondaha', 'Musumbuluwo', 'Ḽavhuvhili', 'Ḽavhuraru', 'Ḽavhuṋa', 'Ḽavhuṱanu', 'Mugivhela'], 'weekdays_short' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'], 'weekdays_min' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, // Too unreliable /* 'day' => ':count vhege', // less reliable 'd' => ':count vhege', // less reliable 'a_day' => ':count vhege', // less reliable 'hour' => ':count watshi', // less reliable 'h' => ':count watshi', // less reliable 'a_hour' => ':count watshi', // less reliable 'minute' => ':count watshi', // less reliable 'min' => ':count watshi', // less reliable 'a_minute' => ':count watshi', // less reliable 'second' => ':count Mu', // less reliable 's' => ':count Mu', // less reliable 'a_second' => ':count Mu', // less reliable 'week' => ':count vhege', 'w' => ':count vhege', 'a_week' => ':count vhege', */ ]); ================================================ FILE: src/Carbon/Lang/vi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Andre Polykanine A.K.A. Menelion Elensúlë * - JD Isaacks */ return [ 'year' => ':count năm', 'a_year' => '{1}một năm|]1, Inf[:count năm', 'y' => ':count năm', 'month' => ':count tháng', 'a_month' => '{1}một tháng|]1, Inf[:count tháng', 'm' => ':count tháng', 'week' => ':count tuần', 'a_week' => '{1}một tuần|]1, Inf[:count tuần', 'w' => ':count tuần', 'day' => ':count ngày', 'a_day' => '{1}một ngày|]1, Inf[:count ngày', 'd' => ':count ngày', 'hour' => ':count giờ', 'a_hour' => '{1}một giờ|]1, Inf[:count giờ', 'h' => ':count giờ', 'minute' => ':count phút', 'a_minute' => '{1}một phút|]1, Inf[:count phút', 'min' => ':count phút', 'second' => ':count giây', 'a_second' => '{1}vài giây|]1, Inf[:count giây', 's' => ':count giây', 'ago' => ':time trước', 'from_now' => ':time tới', 'after' => ':time sau', 'before' => ':time trước', 'diff_now' => 'bây giờ', 'diff_today' => 'Hôm', 'diff_today_regexp' => 'Hôm(?:\\s+nay)?(?:\\s+lúc)?', 'diff_yesterday' => 'Hôm qua', 'diff_yesterday_regexp' => 'Hôm(?:\\s+qua)?(?:\\s+lúc)?', 'diff_tomorrow' => 'Ngày mai', 'diff_tomorrow_regexp' => 'Ngày(?:\\s+mai)?(?:\\s+lúc)?', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM [năm] YYYY', 'LLL' => 'D MMMM [năm] YYYY HH:mm', 'LLLL' => 'dddd, D MMMM [năm] YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[Hôm nay lúc] LT', 'nextDay' => '[Ngày mai lúc] LT', 'nextWeek' => 'dddd [tuần tới lúc] LT', 'lastDay' => '[Hôm qua lúc] LT', 'lastWeek' => 'dddd [tuần trước lúc] LT', 'sameElse' => 'L', ], 'meridiem' => ['SA', 'CH'], 'months' => ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], 'months_short' => ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], 'weekdays' => ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], 'weekdays_short' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 'weekdays_min' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' và '], ]; ================================================ FILE: src/Carbon/Lang/vi_VN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/vi.php'; ================================================ FILE: src/Carbon/Lang/vo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY-MM-dd', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D HH:mm', 'LLLL' => 'YYYY MMMM D, dddd HH:mm', ], 'year' => ':count yel', 'y' => ':count yel', 'a_year' => ':count yel', 'month' => ':count mul', 'm' => ':count mul', 'a_month' => ':count mul', 'week' => ':count vig', 'w' => ':count vig', 'a_week' => ':count vig', 'day' => ':count del', 'd' => ':count del', 'a_day' => ':count del', 'hour' => ':count düp', 'h' => ':count düp', 'a_hour' => ':count düp', 'minute' => ':count minut', 'min' => ':count minut', 'a_minute' => ':count minut', 'second' => ':count sekun', 's' => ':count sekun', 'a_second' => ':count sekun', ]); ================================================ FILE: src/Carbon/Lang/vun.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/wa.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/wa_BE.php'; ================================================ FILE: src/Carbon/Lang/wa_BE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Djan SACRE Pablo Saratxaga pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['di djanvî', 'di fevrî', 'di måss', 'd’ avri', 'di may', 'di djun', 'di djulete', 'd’ awousse', 'di setimbe', 'd’ octôbe', 'di nôvimbe', 'di decimbe'], 'months_short' => ['dja', 'fev', 'mås', 'avr', 'may', 'djn', 'djl', 'awo', 'set', 'oct', 'nôv', 'dec'], 'weekdays' => ['dimegne', 'londi', 'mårdi', 'mierkidi', 'djudi', 'vénrdi', 'semdi'], 'weekdays_short' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'], 'weekdays_min' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count anêye', 'y' => ':count anêye', 'a_year' => ':count anêye', 'month' => ':count meûs', 'm' => ':count meûs', 'a_month' => ':count meûs', 'week' => ':count samwinne', 'w' => ':count samwinne', 'a_week' => ':count samwinne', 'day' => ':count djoû', 'd' => ':count djoû', 'a_day' => ':count djoû', 'hour' => ':count eure', 'h' => ':count eure', 'a_hour' => ':count eure', 'minute' => ':count munute', 'min' => ':count munute', 'a_minute' => ':count munute', 'second' => ':count Sigonde', 's' => ':count Sigonde', 'a_second' => ':count Sigonde', ]); ================================================ FILE: src/Carbon/Lang/wae.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/wae_CH.php'; ================================================ FILE: src/Carbon/Lang/wae_CH.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Walser Translation Team ml@translate-wae.ch */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], 'months' => ['Jenner', 'Hornig', 'Märze', 'Abrille', 'Meije', 'Bráčet', 'Heiwet', 'Öigšte', 'Herbštmánet', 'Wímánet', 'Wintermánet', 'Chrištmánet'], 'months_short' => ['Jen', 'Hor', 'Mär', 'Abr', 'Mei', 'Brá', 'Hei', 'Öig', 'Her', 'Wím', 'Win', 'Chr'], 'weekdays' => ['Suntag', 'Mäntag', 'Zischtag', 'Mittwuch', 'Frontag', 'Fritag', 'Samschtag'], 'weekdays_short' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'], 'weekdays_min' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'month' => ':count Maano', // less reliable 'm' => ':count Maano', // less reliable 'a_month' => ':count Maano', // less reliable ]); ================================================ FILE: src/Carbon/Lang/wal.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/wal_ET.php'; ================================================ FILE: src/Carbon/Lang/wal_ET.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Ge'ez Frontier Foundation locales@geez.org */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], 'weekdays' => ['ወጋ', 'ሳይኖ', 'ማቆሳኛ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ'], 'weekdays_short' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '], 'weekdays_min' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['ማለዶ', 'ቃማ'], ]); ================================================ FILE: src/Carbon/Lang/wo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/wo_SN.php'; ================================================ FILE: src/Carbon/Lang/wo_SN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - The Debian Project Christian Perrier bubulle@debian.org */ return [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD.MM.YYYY', 'LL' => 'MMMM DD, YYYY', 'LLL' => 'DD MMM HH:mm', 'LLLL' => 'MMMM DD, YYYY HH:mm', ], 'months' => ['sanwiy\'e', 'feebriy\'e', 'mars', 'awril', 'me', 'suwen', 'sulet', 'uut', 'septaambar', 'oktoobar', 'nowaambar', 'desaambar'], 'months_short' => ['san', 'fee', 'mar', 'awr', 'me ', 'suw', 'sul', 'uut', 'sep', 'okt', 'now', 'des'], 'weekdays' => ['dib\'eer', 'altine', 'talaata', 'allarba', 'alxames', 'ajjuma', 'gaawu'], 'weekdays_short' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'], 'weekdays_min' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'year' => ':count at', 'month' => ':count wèr', 'week' => ':count ayubés', 'day' => ':count bés', 'hour' => ':count waxtu', 'minute' => ':count simili', 'second' => ':count saa', ]; ================================================ FILE: src/Carbon/Lang/xh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/xh_ZA.php'; ================================================ FILE: src/Carbon/Lang/xh_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['eyoMqungu', 'eyoMdumba', 'eyoKwindla', 'uTshazimpuzi', 'uCanzibe', 'eyeSilimela', 'eyeKhala', 'eyeThupa', 'eyoMsintsi', 'eyeDwarha', 'eyeNkanga', 'eyoMnga'], 'months_short' => ['Mqu', 'Mdu', 'Kwi', 'Tsh', 'Can', 'Sil', 'Kha', 'Thu', 'Msi', 'Dwa', 'Nka', 'Mng'], 'weekdays' => ['iCawa', 'uMvulo', 'lwesiBini', 'lwesiThathu', 'ulweSine', 'lwesiHlanu', 'uMgqibelo'], 'weekdays_short' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'], 'weekdays_min' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => ':count ihlobo', // less reliable 'y' => ':count ihlobo', // less reliable 'a_year' => ':count ihlobo', // less reliable 'hour' => ':count iwotshi', // less reliable 'h' => ':count iwotshi', // less reliable 'a_hour' => ':count iwotshi', // less reliable 'minute' => ':count ingqalelo', // less reliable 'min' => ':count ingqalelo', // less reliable 'a_minute' => ':count ingqalelo', // less reliable 'second' => ':count nceda', // less reliable 's' => ':count nceda', // less reliable 'a_second' => ':count nceda', // less reliable 'month' => ':count inyanga', 'm' => ':count inyanga', 'a_month' => ':count inyanga', 'week' => ':count veki', 'w' => ':count veki', 'a_week' => ':count veki', 'day' => ':count imini', 'd' => ':count imini', 'a_day' => ':count imini', ]); ================================================ FILE: src/Carbon/Lang/xog.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Munkyo', 'Eigulo'], 'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'], 'weekdays_short' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'], 'weekdays_min' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'], 'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'], 'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/yav.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'], 'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'], 'weekdays_short' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'], 'weekdays_min' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'], 'months' => ['pikítíkítie, oólí ú kutúan', 'siɛyɛ́, oóli ú kándíɛ', 'ɔnsúmbɔl, oóli ú kátátúɛ', 'mesiŋ, oóli ú kénie', 'ensil, oóli ú kátánuɛ', 'ɔsɔn', 'efute', 'pisuyú', 'imɛŋ i puɔs', 'imɛŋ i putúk,oóli ú kátíɛ', 'makandikɛ', 'pilɔndɔ́'], 'months_short' => ['o.1', 'o.2', 'o.3', 'o.4', 'o.5', 'o.6', 'o.7', 'o.8', 'o.9', 'o.10', 'o.11', 'o.12'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/yi.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/yi_US.php'; ================================================ FILE: src/Carbon/Lang/yi_US.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - http://www.uyip.org/ Pablo Saratxaga pablo@mandrakesoft.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'year' => '{1}:count יאר|{0}:count יאר|[-Inf,Inf]:count יאר', 'a_year' => '{1}א יאר|{0}:count יאר|[-Inf,Inf]:count יאר', 'y' => ':count יאר', 'month' => '{1}:count חודש|{0}:count חדשים|[-Inf,Inf]:count חדשים', 'a_month' => '{1}א חודש|{0}:count חדשים|[-Inf,Inf]:count חדשים', 'm' => '{1}:count חודש|{0}:count חדשים|[-Inf,Inf]:count חדשים', 'week' => '{1}:count וואך|{0}:count וואכן|[-Inf,Inf]:count וואכן', 'a_week' => '{1}א וואך|{0}:count וואכן|[-Inf,Inf]:count וואכן', 'w' => ':count וואך', 'day' => '{1}:count טאג|{0}:count טעג|[-Inf,Inf]:count טעג', 'a_day' => '{1}א טאג|{0}:count טעג|[-Inf,Inf]:count טעג', 'd' => ':count טאג', 'hour' => ':count שעה', 'a_hour' => 'א שעה', 'h' => ':count שעה', 'minute' => '{1}:count מינוט|{0}:count מינוט|[-Inf,Inf]:count מינוט', 'a_minute' => '{1}א מינוט|{0}:count מינוט|[-Inf,Inf]:count מינוט', 'min' => ':count מינוט', 'second' => '{1}:count סעקונדע|{0}:count סעקונדעס|[-Inf,Inf]:count סעקונדעס', 'a_second' => '{0,1}א סעקונדע|[-Inf,Inf]:count סעקונדעס', 's' => ':count סעק', 'millisecond' => '{1}:count מילי-סעקונדע|{0}:count מילי-סעקונדעס|[-Inf,Inf]:count מילי-סעקונדעס', 'a_millisecond' => '{1}א מילי-סעקונדע|{0}:count מילי-סעקונדעס|[-Inf,Inf]:count מילי-סעקונדעס', 'ms' => ':count מס', 'microsecond' => '{1}:count מיקרא-סעקונדע|{0}:count מיקרא-סעקונדעס|[-Inf,Inf]:count מיקרא-סעקונדעס', 'a_microsecond' => '{1}א מיקרא-סעקונדע|{0}:count מיקרא-סעקונדעס|[-Inf,Inf]:count מיקרא-סעקונדעס', 'µs' => ':count מיקרא', 'ago' => ':time פון יעצט', 'from_now' => ':time ארום', 'after' => ':time נאך', 'before' => ':time פאר', 'diff_now' => 'ממש יעצט', 'diff_today' => 'היינט', 'diff_yesterday' => 'נעכטן', 'diff_tomorrow' => 'מארגן', 'diff_before_yesterday' => 'אייער-נעכטן', 'diff_after_tomorrow' => 'איבער-מארגן', 'period_recurrences' => '{1}איין מאל|{0}:count מאל|[-Inf,Inf]:count מאל', 'period_interval' => 'יעדע :interval', 'period_start_date' => 'פון :date', 'period_end_date' => 'ביז :date', 'months' => ['יאנואר', 'פעברואר', 'מארטש', 'אפריל', 'מאי', 'יוני', 'יולי', 'אויגוסט', 'סעפטעמבער', 'אקטאבער', 'נאוועמבער', 'דעצעמבער'], 'months_short' => ['יאנ\'', 'פעב\'', 'מאר\'', 'אפר\'', 'מאי', 'יוני', 'יולי', 'אויג\'', 'סעפ\'', 'אקט\'', 'נאו\'', 'דעצ\''], 'weekdays' => ['זונטאג', 'מאנטאג', 'דינסטאג', 'מיטוואך', 'דאנערשטאג', 'פרייטאג', 'שבת'], 'weekdays_short' => ['זונ\'', 'מאנ\'', 'דינ\'', 'מיט\'', 'דאנ\'', 'פריי\'', 'שבת'], 'weekdays_min' => ['ז\'', 'מ\'', 'ד\'', 'מ\'', 'ד\'', 'ו\'', 'ש\''], 'ordinal' => static function ($number) { return $number.'טע'; }, 'list' => [', ', ' און '], 'formats' => [ 'L' => 'DD/MM/YY', ], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/yo.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - François B * - Atolagbe Abisoye */ return [ 'year' => 'ọdún :count', 'a_year' => '{1}ọdún kan|ọdún :count', 'month' => 'osù :count', 'a_month' => '{1}osù kan|osù :count', 'week' => 'ọsẹ :count', 'a_week' => '{1}ọsẹ kan|ọsẹ :count', 'day' => 'ọjọ́ :count', 'a_day' => '{1}ọjọ́ kan|ọjọ́ :count', 'hour' => 'wákati :count', 'a_hour' => '{1}wákati kan|wákati :count', 'minute' => 'ìsẹjú :count', 'a_minute' => '{1}ìsẹjú kan|ìsẹjú :count', 'second' => 'iaayá :count', 'a_second' => '{1}ìsẹjú aayá die|aayá :count', 'ago' => ':time kọjá', 'from_now' => 'ní :time', 'diff_yesterday' => 'Àna', 'diff_yesterday_regexp' => 'Àna(?:\\s+ni)?', 'diff_today' => 'Ònì', 'diff_today_regexp' => 'Ònì(?:\\s+ni)?', 'diff_tomorrow' => 'Ọ̀la', 'diff_tomorrow_regexp' => 'Ọ̀la(?:\\s+ni)?', 'formats' => [ 'LT' => 'h:mm A', 'LTS' => 'h:mm:ss A', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY h:mm A', 'LLLL' => 'dddd, D MMMM YYYY h:mm A', ], 'calendar' => [ 'sameDay' => '[Ònì ni] LT', 'nextDay' => '[Ọ̀la ni] LT', 'nextWeek' => 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT', 'lastDay' => '[Àna ni] LT', 'lastWeek' => 'dddd [Ọsẹ̀ tólọ́] [ni] LT', 'sameElse' => 'L', ], 'ordinal' => 'ọjọ́ :number', 'months' => ['Sẹ́rẹ́', 'Èrèlè', 'Ẹrẹ̀nà', 'Ìgbé', 'Èbibi', 'Òkùdu', 'Agẹmo', 'Ògún', 'Owewe', 'Ọ̀wàrà', 'Bélú', 'Ọ̀pẹ̀̀'], 'months_short' => ['Sẹ́r', 'Èrl', 'Ẹrn', 'Ìgb', 'Èbi', 'Òkù', 'Agẹ', 'Ògú', 'Owe', 'Ọ̀wà', 'Bél', 'Ọ̀pẹ̀̀'], 'weekdays' => ['Àìkú', 'Ajé', 'Ìsẹ́gun', 'Ọjọ́rú', 'Ọjọ́bọ', 'Ẹtì', 'Àbámẹ́ta'], 'weekdays_short' => ['Àìk', 'Ajé', 'Ìsẹ́', 'Ọjr', 'Ọjb', 'Ẹtì', 'Àbá'], 'weekdays_min' => ['Àì', 'Aj', 'Ìs', 'Ọr', 'Ọb', 'Ẹt', 'Àb'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'meridiem' => ['Àárọ̀', 'Ọ̀sán'], ]; ================================================ FILE: src/Carbon/Lang/yo_BJ.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/yo.php', [ 'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'], 'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'], 'weekdays_short' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'], 'weekdays_min' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'], 'months' => ['Oshù Shɛ́rɛ́', 'Oshù Èrèlè', 'Oshù Ɛrɛ̀nà', 'Oshù Ìgbé', 'Oshù Ɛ̀bibi', 'Oshù Òkúdu', 'Oshù Agɛmɔ', 'Oshù Ògún', 'Oshù Owewe', 'Oshù Ɔ̀wàrà', 'Oshù Bélú', 'Oshù Ɔ̀pɛ̀'], 'months_short' => ['Shɛ́rɛ́', 'Èrèlè', 'Ɛrɛ̀nà', 'Ìgbé', 'Ɛ̀bibi', 'Òkúdu', 'Agɛmɔ', 'Ògún', 'Owewe', 'Ɔ̀wàrà', 'Bélú', 'Ɔ̀pɛ̀'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd, D MMMM YYYY HH:mm', ], ]); ================================================ FILE: src/Carbon/Lang/yo_NG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/yo.php'; ================================================ FILE: src/Carbon/Lang/yue.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/yue_HK.php'; ================================================ FILE: src/Carbon/Lang/yue_HK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/zh_HK.php', [ 'formats' => [ 'L' => 'YYYY年MM月DD日 dddd', ], 'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'meridiem' => ['上午', '下午'], ]); ================================================ FILE: src/Carbon/Lang/yue_Hans.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hans.php'; ================================================ FILE: src/Carbon/Lang/yue_Hant.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hant.php'; ================================================ FILE: src/Carbon/Lang/yuw.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/yuw_PG.php'; ================================================ FILE: src/Carbon/Lang/yuw_PG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Information from native speakers Hannah Sarvasy nungon.localization@gmail.com */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', ], 'months' => ['jenuari', 'febuari', 'mas', 'epril', 'mei', 'jun', 'julai', 'ögus', 'septemba', 'öktoba', 'nöwemba', 'diksemba'], 'months_short' => ['jen', 'feb', 'mas', 'epr', 'mei', 'jun', 'jul', 'ögu', 'sep', 'ökt', 'nöw', 'dis'], 'weekdays' => ['sönda', 'mönda', 'sinda', 'mitiwö', 'sogipbono', 'nenggo', 'söndanggie'], 'weekdays_short' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'], 'weekdays_min' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/zgh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - BAKTETE Miloud */ return [ 'year' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', 'a_year' => 'ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', 'y' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', 'month' => ':count ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ', 'a_month' => 'ⵉⴷⵊ ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ', 'm' => ':count ⴰⵢⵢⵓⵔⵏ', 'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ', 'a_week' => 'ⵉⵛⵜ ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ', 'w' => ':count ⵉⵎⴰⵍⴰⵙⵙ.', 'day' => ':count ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ', 'a_day' => 'ⵉⴷⵊ ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ', 'd' => ':count ⵓ', 'hour' => ':count ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ', 'a_hour' => 'ⵉⵛⵜ ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ', 'h' => ':count ⵜ', 'minute' => ':count ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ', 'a_minute' => 'ⵉⵛⵜ ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ', 'min' => ':count ⵜⵓⵙ', 'second' => ':count ⵜⵙⵉⵏⵜ|:count ⵜⵉⵙⵉⵏⴰ', 'a_second' => 'ⴽⵔⴰ ⵜⵉⵙⵉⵏⴰ|:count ⵜⵉⵙⵉⵏⴰ', 's' => ':count ⵜ', 'ago' => 'ⵣⴳ :time', 'from_now' => 'ⴷⴳ :time', 'after' => ':time ⴰⵡⴰⵔ', 'before' => ':time ⴷⴰⵜ', 'diff_now' => 'ⴰⴷⵡⴰⵍⵉ', 'diff_today' => 'ⴰⵙⵙ', 'diff_today_regexp' => 'ⴰⵙⵙ(?:\\s+ⴰ/ⴰⴷ)?(?:\\s+ⴳ)?', 'diff_yesterday' => 'ⴰⵙⵙⵏⵏⴰⵟ', 'diff_yesterday_regexp' => 'ⴰⵙⵙⵏⵏⴰⵟ(?:\\s+ⴳ)?', 'diff_tomorrow' => 'ⴰⵙⴽⴽⴰ', 'diff_tomorrow_regexp' => 'ⴰⵙⴽⴽⴰ(?:\\s+ⴳ)?', 'diff_before_yesterday' => 'ⴼⵔ ⵉⴹⵏⵏⴰⵟ', 'diff_after_tomorrow' => 'ⵏⴰⴼ ⵓⵙⴽⴽⴰ', 'period_recurrences' => ':count ⵜⵉⴽⴽⴰⵍ', 'period_interval' => 'ⴽⵓ :interval', 'period_start_date' => 'ⴳ :date', 'period_end_date' => 'ⵉ :date', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMMM YYYY', 'LLL' => 'D MMMM YYYY HH:mm', 'LLLL' => 'dddd D MMMM YYYY HH:mm', ], 'calendar' => [ 'sameDay' => '[ⴰⵙⵙ ⴰ/ⴰⴷ ⴳ] LT', 'nextDay' => '[ⴰⵙⴽⴽⴰ ⴳ] LT', 'nextWeek' => 'dddd [ⴳ] LT', 'lastDay' => '[ⴰⵙⵙⵏⵏⴰⵟ ⴳ] LT', 'lastWeek' => 'dddd [ⴰⵎⴳⴳⴰⵔⵓ ⴳ] LT', 'sameElse' => 'L', ], 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'], 'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵟⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'], 'weekdays' => ['ⵓⵙⴰⵎⴰⵙ', 'ⵡⴰⵢⵏⴰⵙ', 'ⵓⵙⵉⵏⴰⵙ', 'ⵡⴰⴽⵕⴰⵙ', 'ⵓⴽⵡⴰⵙ', 'ⵓⵙⵉⵎⵡⴰⵙ', 'ⵓⵙⵉⴹⵢⴰⵙ'], 'weekdays_short' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'], 'weekdays_min' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 1, 'list' => [', ', ' ⴷ '], ]; ================================================ FILE: src/Carbon/Lang/zh.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - xuri * - sycuato * - bokideckonja * - Luo Ning * - William Yang (williamyang233) */ return array_merge(require __DIR__.'/zh_Hans.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY/MM/DD', 'LL' => 'YYYY年M月D日', 'LLL' => 'YYYY年M月D日 A h点mm分', 'LLLL' => 'YYYY年M月D日dddd A h点mm分', ], ]); ================================================ FILE: src/Carbon/Lang/zh_CN.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - monkeycon * - François B * - Jason Katz-Brown * - Serhan Apaydın * - Matt Johnson * - JD Isaacks * - Zeno Zeng * - Chris Hemp * - shankesgk2 */ return array_merge(require __DIR__.'/zh.php', [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY/MM/DD', 'LL' => 'YYYY年M月D日', 'LLL' => 'YYYY年M月D日Ah点mm分', 'LLLL' => 'YYYY年M月D日ddddAh点mm分', ], ]); ================================================ FILE: src/Carbon/Lang/zh_HK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hant_HK.php'; ================================================ FILE: src/Carbon/Lang/zh_Hans.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - monkeycon * - François B * - Jason Katz-Brown * - Konstantin Konev * - Chris Lam * - Serhan Apaydın * - Gary Lo * - JD Isaacks * - Chris Hemp * - shankesgk2 * - Daniel Cheung (danvim) */ return [ 'year' => ':count:optional-space年', 'y' => ':count:optional-space年', 'month' => ':count:optional-space个月', 'm' => ':count:optional-space个月', 'week' => ':count:optional-space周', 'w' => ':count:optional-space周', 'day' => ':count:optional-space天', 'd' => ':count:optional-space天', 'hour' => ':count:optional-space小时', 'h' => ':count:optional-space小时', 'minute' => ':count:optional-space分钟', 'min' => ':count:optional-space分钟', 'second' => ':count:optional-space秒', 'a_second' => '{1}几秒|[-Inf,Inf]:count:optional-space秒', 's' => ':count:optional-space秒', 'ago' => ':time前', 'from_now' => ':time后', 'after' => ':time后', 'before' => ':time前', 'diff_now' => '现在', 'diff_today' => '今天', 'diff_yesterday' => '昨天', 'diff_tomorrow' => '明天', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY/MM/DD', 'LL' => 'YYYY年M月D日', 'LLL' => 'YYYY年M月D日 HH:mm', 'LLLL' => 'YYYY年M月D日dddd HH:mm', ], 'calendar' => [ 'sameDay' => '[今天]LT', 'nextDay' => '[明天]LT', 'nextWeek' => '[下]ddddLT', 'lastDay' => '[昨天]LT', 'lastWeek' => '[上]ddddLT', 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'd', 'D', 'DDD' => $number.'日', 'M' => $number.'月', 'w', 'W' => $number.'周', default => $number, }; }, 'meridiem' => static function ($hour, $minute) { $time = $hour * 100 + $minute; if ($time < 600) { return '凌晨'; } if ($time < 900) { return '早上'; } if ($time < 1130) { return '上午'; } if ($time < 1230) { return '中午'; } if ($time < 1800) { return '下午'; } return '晚上'; }, 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 'weekdays_short' => ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => '', ]; ================================================ FILE: src/Carbon/Lang/zh_Hans_HK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hans.php'; ================================================ FILE: src/Carbon/Lang/zh_Hans_MO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hans.php'; ================================================ FILE: src/Carbon/Lang/zh_Hans_SG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hans.php'; ================================================ FILE: src/Carbon/Lang/zh_Hant.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Adam * - monkeycon * - François B * - Jason Katz-Brown * - Chris Lam * - Serhan Apaydın * - Gary Lo * - JD Isaacks * - Chris Hemp * - Eddie * - KID * - shankesgk2 * - Daniel Cheung (danvim) */ return [ 'year' => ':count:optional-space年', 'y' => ':count:optional-space年', 'month' => ':count:optional-space個月', 'm' => ':count:optional-space月', 'week' => ':count:optional-space週', 'w' => ':count:optional-space週', 'day' => ':count:optional-space天', 'd' => ':count:optional-space天', 'hour' => ':count:optional-space小時', 'h' => ':count:optional-space小時', 'minute' => ':count:optional-space分鐘', 'min' => ':count:optional-space分鐘', 'second' => ':count:optional-space秒', 'a_second' => '{1}幾秒|[-Inf,Inf]:count:optional-space秒', 's' => ':count:optional-space秒', 'ago' => ':time前', 'from_now' => ':time後', 'after' => ':time後', 'before' => ':time前', 'diff_now' => '現在', 'diff_today' => '今天', 'diff_yesterday' => '昨天', 'diff_tomorrow' => '明天', 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'YYYY/MM/DD', 'LL' => 'YYYY年M月D日', 'LLL' => 'YYYY年M月D日 HH:mm', 'LLLL' => 'YYYY年M月D日dddd HH:mm', ], 'calendar' => [ 'sameDay' => '[今天] LT', 'nextDay' => '[明天] LT', 'nextWeek' => '[下]dddd LT', 'lastDay' => '[昨天] LT', 'lastWeek' => '[上]dddd LT', 'sameElse' => 'L', ], 'ordinal' => static function ($number, $period) { return match ($period) { 'd', 'D', 'DDD' => $number.'日', 'M' => $number.'月', 'w', 'W' => $number.'周', default => $number, }; }, 'meridiem' => static function ($hour, $minute) { $time = $hour * 100 + $minute; if ($time < 600) { return '凌晨'; } if ($time < 900) { return '早上'; } if ($time < 1130) { return '上午'; } if ($time < 1230) { return '中午'; } if ($time < 1800) { return '下午'; } return '晚上'; }, 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 'weekdays_short' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => '', ]; ================================================ FILE: src/Carbon/Lang/zh_Hant_HK.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hant.php'; ================================================ FILE: src/Carbon/Lang/zh_Hant_MO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hant.php'; ================================================ FILE: src/Carbon/Lang/zh_Hant_TW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hant.php'; ================================================ FILE: src/Carbon/Lang/zh_MO.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - tarunvelli * - Eddie * - KID * - shankesgk2 */ return array_replace_recursive(require __DIR__.'/zh_Hant.php', [ 'after' => ':time后', ]); ================================================ FILE: src/Carbon/Lang/zh_SG.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/zh.php', [ 'formats' => [ 'L' => 'YYYY年MM月DD日', ], 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'months_short' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], 'day_of_first_week_of_year' => 1, ]); ================================================ FILE: src/Carbon/Lang/zh_TW.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return require __DIR__.'/zh_Hant_TW.php'; ================================================ FILE: src/Carbon/Lang/zh_YUE.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org */ return array_replace_recursive(require __DIR__.'/zh.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', ], ]); ================================================ FILE: src/Carbon/Lang/zu.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Unknown default region, use the first alphabetically. */ return require __DIR__.'/zu_ZA.php'; ================================================ FILE: src/Carbon/Lang/zu_ZA.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Authors: * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za */ return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', ], 'months' => ['Januwari', 'Februwari', 'Mashi', 'Ephreli', 'Meyi', 'Juni', 'Julayi', 'Agasti', 'Septhemba', 'Okthoba', 'Novemba', 'Disemba'], 'months_short' => ['Jan', 'Feb', 'Mas', 'Eph', 'Mey', 'Jun', 'Jul', 'Aga', 'Sep', 'Okt', 'Nov', 'Dis'], 'weekdays' => ['iSonto', 'uMsombuluko', 'uLwesibili', 'uLwesithathu', 'uLwesine', 'uLwesihlanu', 'uMgqibelo'], 'weekdays_short' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'], 'weekdays_min' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'], 'first_day_of_week' => 0, 'day_of_first_week_of_year' => 1, 'year' => 'kweminyaka engu-:count', 'y' => 'kweminyaka engu-:count', 'a_year' => 'kweminyaka engu-:count', 'month' => 'izinyanga ezingu-:count', 'm' => 'izinyanga ezingu-:count', 'a_month' => 'izinyanga ezingu-:count', 'week' => 'lwamasonto angu-:count', 'w' => 'lwamasonto angu-:count', 'a_week' => 'lwamasonto angu-:count', 'day' => 'ezingaba ngu-:count', 'd' => 'ezingaba ngu-:count', 'a_day' => 'ezingaba ngu-:count', 'hour' => 'amahora angu-:count', 'h' => 'amahora angu-:count', 'a_hour' => 'amahora angu-:count', 'minute' => 'ngemizuzu engu-:count', 'min' => 'ngemizuzu engu-:count', 'a_minute' => 'ngemizuzu engu-:count', 'second' => 'imizuzwana engu-:count', 's' => 'imizuzwana engu-:count', 'a_second' => 'imizuzwana engu-:count', ]); ================================================ FILE: src/Carbon/Language.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use JsonSerializable; class Language implements JsonSerializable { protected static ?array $languagesNames = null; protected static ?array $regionsNames = null; protected string $id; protected string $code; protected ?string $variant = null; protected ?string $region = null; protected ?array $names = null; protected ?string $isoName = null; protected ?string $nativeName = null; public function __construct(string $id) { $this->id = str_replace('-', '_', $id); $parts = explode('_', $this->id); $this->code = $parts[0]; if (isset($parts[1])) { if (!preg_match('/^[A-Z]+$/', $parts[1])) { $this->variant = $parts[1]; $parts[1] = $parts[2] ?? null; } if ($parts[1]) { $this->region = $parts[1]; } } } /** * Get the list of the known languages. * * @return array */ public static function all(): array { static::$languagesNames ??= require __DIR__.'/List/languages.php'; return static::$languagesNames; } /** * Get the list of the known regions. * * ⚠ ISO 3166-2 short name provided with no warranty, should not * be used for any purpose to show official state names. */ public static function regions(): array { static::$regionsNames ??= require __DIR__.'/List/regions.php'; return static::$regionsNames; } /** * Get both isoName and nativeName as an array. */ public function getNames(): array { $this->names ??= static::all()[$this->code] ?? [ 'isoName' => $this->code, 'nativeName' => $this->code, ]; return $this->names; } /** * Returns the original locale ID. */ public function getId(): string { return $this->id; } /** * Returns the code of the locale "en"/"fr". */ public function getCode(): string { return $this->code; } /** * Returns the variant code such as cyrl/latn. */ public function getVariant(): ?string { return $this->variant; } /** * Returns the variant such as Cyrillic/Latin. */ public function getVariantName(): ?string { if ($this->variant === 'Latn') { return 'Latin'; } if ($this->variant === 'Cyrl') { return 'Cyrillic'; } return $this->variant; } /** * Returns the region part of the locale. */ public function getRegion(): ?string { return $this->region; } /** * Returns the region name for the current language. * * ⚠ ISO 3166-2 short name provided with no warranty, should not * be used for any purpose to show official state names. */ public function getRegionName(): ?string { return $this->region ? (static::regions()[$this->region] ?? $this->region) : null; } /** * Returns the long ISO language name. */ public function getFullIsoName(): string { $this->isoName ??= $this->getNames()['isoName']; return $this->isoName; } /** * Set the ISO language name. */ public function setIsoName(string $isoName): static { $this->isoName = $isoName; return $this; } /** * Return the full name of the language in this language. */ public function getFullNativeName(): string { $this->nativeName ??= $this->getNames()['nativeName']; return $this->nativeName; } /** * Set the name of the language in this language. */ public function setNativeName(string $nativeName): static { $this->nativeName = $nativeName; return $this; } /** * Returns the short ISO language name. */ public function getIsoName(): string { $name = $this->getFullIsoName(); return trim(strstr($name, ',', true) ?: $name); } /** * Get the short name of the language in this language. */ public function getNativeName(): string { $name = $this->getFullNativeName(); return trim(strstr($name, ',', true) ?: $name); } /** * Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable. */ public function getIsoDescription(): string { $region = $this->getRegionName(); $variant = $this->getVariantName(); return $this->getIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); } /** * Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable. */ public function getNativeDescription(): string { $region = $this->getRegionName(); $variant = $this->getVariantName(); return $this->getNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); } /** * Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable. */ public function getFullIsoDescription(): string { $region = $this->getRegionName(); $variant = $this->getVariantName(); return $this->getFullIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); } /** * Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable. */ public function getFullNativeDescription(): string { $region = $this->getRegionName(); $variant = $this->getVariantName(); return $this->getFullNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); } /** * Returns the original locale ID. */ public function __toString(): string { return $this->getId(); } /** * Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable. */ public function jsonSerialize(): string { return $this->getIsoDescription(); } } ================================================ FILE: src/Carbon/Laravel/ServiceProvider.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Laravel; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; use Illuminate\Events\Dispatcher; use Illuminate\Events\EventDispatcher; use Illuminate\Support\Carbon as IlluminateCarbon; use Illuminate\Support\Facades\Date; use Throwable; class ServiceProvider extends \Illuminate\Support\ServiceProvider { /** @var callable|null */ protected $appGetter = null; /** @var callable|null */ protected $localeGetter = null; /** @var callable|null */ protected $fallbackLocaleGetter = null; public function setAppGetter(?callable $appGetter): void { $this->appGetter = $appGetter; } public function setLocaleGetter(?callable $localeGetter): void { $this->localeGetter = $localeGetter; } public function setFallbackLocaleGetter(?callable $fallbackLocaleGetter): void { $this->fallbackLocaleGetter = $fallbackLocaleGetter; } public function boot() { $this->updateLocale(); $this->updateFallbackLocale(); if (!$this->app->bound('events')) { return; } $service = $this; $events = $this->app['events']; if ($this->isEventDispatcher($events)) { $events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) { $service->updateLocale(); }); } } public function updateLocale() { $locale = $this->getLocale(); if ($locale === null) { return; } Carbon::setLocale($locale); CarbonImmutable::setLocale($locale); CarbonPeriod::setLocale($locale); CarbonInterval::setLocale($locale); if (class_exists(IlluminateCarbon::class)) { IlluminateCarbon::setLocale($locale); } if (class_exists(Date::class)) { try { $root = Date::getFacadeRoot(); $root->setLocale($locale); } catch (Throwable) { // Non Carbon class in use in Date facade } } } public function updateFallbackLocale() { $locale = $this->getFallbackLocale(); if ($locale === null) { return; } Carbon::setFallbackLocale($locale); CarbonImmutable::setFallbackLocale($locale); CarbonPeriod::setFallbackLocale($locale); CarbonInterval::setFallbackLocale($locale); if (class_exists(IlluminateCarbon::class) && method_exists(IlluminateCarbon::class, 'setFallbackLocale')) { IlluminateCarbon::setFallbackLocale($locale); } if (class_exists(Date::class)) { try { $root = Date::getFacadeRoot(); $root->setFallbackLocale($locale); } catch (Throwable) { // @codeCoverageIgnore // Non Carbon class in use in Date facade } } } public function register() { // Needed for Laravel < 5.3 compatibility } protected function getLocale() { if ($this->localeGetter) { return ($this->localeGetter)(); } $app = $this->getApp(); $app = $app && method_exists($app, 'getLocale') ? $app : $this->getGlobalApp('translator'); return $app ? $app->getLocale() : null; } protected function getFallbackLocale() { if ($this->fallbackLocaleGetter) { return ($this->fallbackLocaleGetter)(); } $app = $this->getApp(); return $app && method_exists($app, 'getFallbackLocale') ? $app->getFallbackLocale() : $this->getGlobalApp('translator')?->getFallback(); } protected function getApp() { if ($this->appGetter) { return ($this->appGetter)(); } return $this->app ?? $this->getGlobalApp(); } protected function getGlobalApp(...$args) { return \function_exists('app') ? \app(...$args) : null; } protected function isEventDispatcher($instance) { return $instance instanceof EventDispatcher || $instance instanceof Dispatcher || $instance instanceof DispatcherContract; } } ================================================ FILE: src/Carbon/List/languages.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ /* * ISO 639-2 */ 'ab' => [ 'isoName' => 'Abkhazian', 'nativeName' => 'аҧсуа бызшәа, аҧсшәа', ], 'aa' => [ 'isoName' => 'Afar', 'nativeName' => 'Afaraf', ], 'af' => [ 'isoName' => 'Afrikaans', 'nativeName' => 'Afrikaans', ], 'ak' => [ 'isoName' => 'Akan', 'nativeName' => 'Akan', ], 'sq' => [ 'isoName' => 'Albanian', 'nativeName' => 'Shqip', ], 'am' => [ 'isoName' => 'Amharic', 'nativeName' => 'አማርኛ', ], 'ar' => [ 'isoName' => 'Arabic', 'nativeName' => 'العربية', ], 'an' => [ 'isoName' => 'Aragonese', 'nativeName' => 'aragonés', ], 'hy' => [ 'isoName' => 'Armenian', 'nativeName' => 'Հայերեն', ], 'as' => [ 'isoName' => 'Assamese', 'nativeName' => 'অসমীয়া', ], 'av' => [ 'isoName' => 'Avaric', 'nativeName' => 'авар мацӀ, магӀарул мацӀ', ], 'ae' => [ 'isoName' => 'Avestan', 'nativeName' => 'avesta', ], 'ay' => [ 'isoName' => 'Aymara', 'nativeName' => 'aymar aru', ], 'az' => [ 'isoName' => 'Azerbaijani', 'nativeName' => 'azərbaycan dili', ], 'bm' => [ 'isoName' => 'Bambara', 'nativeName' => 'bamanankan', ], 'ba' => [ 'isoName' => 'Bashkir', 'nativeName' => 'башҡорт теле', ], 'eu' => [ 'isoName' => 'Basque', 'nativeName' => 'euskara, euskera', ], 'be' => [ 'isoName' => 'Belarusian', 'nativeName' => 'беларуская мова', ], 'bn' => [ 'isoName' => 'Bengali', 'nativeName' => 'বাংলা', ], 'bh' => [ 'isoName' => 'Bihari languages', 'nativeName' => 'भोजपुरी', ], 'bi' => [ 'isoName' => 'Bislama', 'nativeName' => 'Bislama', ], 'bs' => [ 'isoName' => 'Bosnian', 'nativeName' => 'bosanski jezik', ], 'br' => [ 'isoName' => 'Breton', 'nativeName' => 'brezhoneg', ], 'bg' => [ 'isoName' => 'Bulgarian', 'nativeName' => 'български език', ], 'my' => [ 'isoName' => 'Burmese', 'nativeName' => 'ဗမာစာ', ], 'ca' => [ 'isoName' => 'Catalan, Valencian', 'nativeName' => 'català, valencià', ], 'ch' => [ 'isoName' => 'Chamorro', 'nativeName' => 'Chamoru', ], 'ce' => [ 'isoName' => 'Chechen', 'nativeName' => 'нохчийн мотт', ], 'ny' => [ 'isoName' => 'Chichewa, Chewa, Nyanja', 'nativeName' => 'chiCheŵa, chinyanja', ], 'zh' => [ 'isoName' => 'Chinese', 'nativeName' => '中文 (Zhōngwén), 汉语, 漢語', ], 'cv' => [ 'isoName' => 'Chuvash', 'nativeName' => 'чӑваш чӗлхи', ], 'kw' => [ 'isoName' => 'Cornish', 'nativeName' => 'Kernewek', ], 'co' => [ 'isoName' => 'Corsican', 'nativeName' => 'corsu, lingua corsa', ], 'cr' => [ 'isoName' => 'Cree', 'nativeName' => 'ᓀᐦᐃᔭᐍᐏᐣ', ], 'hr' => [ 'isoName' => 'Croatian', 'nativeName' => 'hrvatski jezik', ], 'cs' => [ 'isoName' => 'Czech', 'nativeName' => 'čeština, český jazyk', ], 'da' => [ 'isoName' => 'Danish', 'nativeName' => 'dansk', ], 'dv' => [ 'isoName' => 'Divehi, Dhivehi, Maldivian', 'nativeName' => 'ދިވެހި', ], 'nl' => [ 'isoName' => 'Dutch, Flemish', 'nativeName' => 'Nederlands, Vlaams', ], 'dz' => [ 'isoName' => 'Dzongkha', 'nativeName' => 'རྫོང་ཁ', ], 'en' => [ 'isoName' => 'English', 'nativeName' => 'English', ], 'eo' => [ 'isoName' => 'Esperanto', 'nativeName' => 'Esperanto', ], 'et' => [ 'isoName' => 'Estonian', 'nativeName' => 'eesti, eesti keel', ], 'ee' => [ 'isoName' => 'Ewe', 'nativeName' => 'Eʋegbe', ], 'fo' => [ 'isoName' => 'Faroese', 'nativeName' => 'føroyskt', ], 'fj' => [ 'isoName' => 'Fijian', 'nativeName' => 'vosa Vakaviti', ], 'fi' => [ 'isoName' => 'Finnish', 'nativeName' => 'suomi, suomen kieli', ], 'fr' => [ 'isoName' => 'French', 'nativeName' => 'français', ], 'ff' => [ 'isoName' => 'Fulah', 'nativeName' => 'Fulfulde, Pulaar, Pular', ], 'gl' => [ 'isoName' => 'Galician', 'nativeName' => 'Galego', ], 'ka' => [ 'isoName' => 'Georgian', 'nativeName' => 'ქართული', ], 'de' => [ 'isoName' => 'German', 'nativeName' => 'Deutsch', ], 'el' => [ 'isoName' => 'Greek (modern)', 'nativeName' => 'ελληνικά', ], 'gn' => [ 'isoName' => 'Guaraní', 'nativeName' => 'Avañe\'ẽ', ], 'gu' => [ 'isoName' => 'Gujarati', 'nativeName' => 'ગુજરાતી', ], 'ht' => [ 'isoName' => 'Haitian, Haitian Creole', 'nativeName' => 'Kreyòl ayisyen', ], 'ha' => [ 'isoName' => 'Hausa', 'nativeName' => '(Hausa) هَوُسَ', ], 'he' => [ 'isoName' => 'Hebrew (modern)', 'nativeName' => 'עברית', ], 'hz' => [ 'isoName' => 'Herero', 'nativeName' => 'Otjiherero', ], 'hi' => [ 'isoName' => 'Hindi', 'nativeName' => 'हिन्दी, हिंदी', ], 'ho' => [ 'isoName' => 'Hiri Motu', 'nativeName' => 'Hiri Motu', ], 'hu' => [ 'isoName' => 'Hungarian', 'nativeName' => 'magyar', ], 'ia' => [ 'isoName' => 'Interlingua', 'nativeName' => 'Interlingua', ], 'id' => [ 'isoName' => 'Indonesian', 'nativeName' => 'Bahasa Indonesia', ], 'ie' => [ 'isoName' => 'Interlingue', 'nativeName' => 'Originally called Occidental; then Interlingue after WWII', ], 'ga' => [ 'isoName' => 'Irish', 'nativeName' => 'Gaeilge', ], 'ig' => [ 'isoName' => 'Igbo', 'nativeName' => 'Asụsụ Igbo', ], 'ik' => [ 'isoName' => 'Inupiaq', 'nativeName' => 'Iñupiaq, Iñupiatun', ], 'io' => [ 'isoName' => 'Ido', 'nativeName' => 'Ido', ], 'is' => [ 'isoName' => 'Icelandic', 'nativeName' => 'Íslenska', ], 'it' => [ 'isoName' => 'Italian', 'nativeName' => 'Italiano', ], 'iu' => [ 'isoName' => 'Inuktitut', 'nativeName' => 'ᐃᓄᒃᑎᑐᑦ', ], 'ja' => [ 'isoName' => 'Japanese', 'nativeName' => '日本語 (にほんご)', ], 'jv' => [ 'isoName' => 'Javanese', 'nativeName' => 'ꦧꦱꦗꦮ, Basa Jawa', ], 'kl' => [ 'isoName' => 'Kalaallisut, Greenlandic', 'nativeName' => 'kalaallisut, kalaallit oqaasii', ], 'kn' => [ 'isoName' => 'Kannada', 'nativeName' => 'ಕನ್ನಡ', ], 'kr' => [ 'isoName' => 'Kanuri', 'nativeName' => 'Kanuri', ], 'ks' => [ 'isoName' => 'Kashmiri', 'nativeName' => 'कश्मीरी, كشميري‎', ], 'kk' => [ 'isoName' => 'Kazakh', 'nativeName' => 'қазақ тілі', ], 'km' => [ 'isoName' => 'Central Khmer', 'nativeName' => 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', ], 'ki' => [ 'isoName' => 'Kikuyu, Gikuyu', 'nativeName' => 'Gĩkũyũ', ], 'rw' => [ 'isoName' => 'Kinyarwanda', 'nativeName' => 'Ikinyarwanda', ], 'ky' => [ 'isoName' => 'Kirghiz, Kyrgyz', 'nativeName' => 'Кыргызча, Кыргыз тили', ], 'kv' => [ 'isoName' => 'Komi', 'nativeName' => 'коми кыв', ], 'kg' => [ 'isoName' => 'Kongo', 'nativeName' => 'Kikongo', ], 'ko' => [ 'isoName' => 'Korean', 'nativeName' => '한국어', ], 'ku' => [ 'isoName' => 'Kurdish', 'nativeName' => 'Kurdî, کوردی‎', ], 'kj' => [ 'isoName' => 'Kuanyama, Kwanyama', 'nativeName' => 'Kuanyama', ], 'la' => [ 'isoName' => 'Latin', 'nativeName' => 'latine, lingua latina', ], 'lb' => [ 'isoName' => 'Luxembourgish, Letzeburgesch', 'nativeName' => 'Lëtzebuergesch', ], 'lg' => [ 'isoName' => 'Ganda', 'nativeName' => 'Luganda', ], 'li' => [ 'isoName' => 'Limburgan, Limburger, Limburgish', 'nativeName' => 'Limburgs', ], 'ln' => [ 'isoName' => 'Lingala', 'nativeName' => 'Lingála', ], 'lo' => [ 'isoName' => 'Lao', 'nativeName' => 'ພາສາລາວ', ], 'lt' => [ 'isoName' => 'Lithuanian', 'nativeName' => 'lietuvių kalba', ], 'lu' => [ 'isoName' => 'Luba-Katanga', 'nativeName' => 'Kiluba', ], 'lv' => [ 'isoName' => 'Latvian', 'nativeName' => 'latviešu valoda', ], 'gv' => [ 'isoName' => 'Manx', 'nativeName' => 'Gaelg, Gailck', ], 'mk' => [ 'isoName' => 'Macedonian', 'nativeName' => 'македонски јазик', ], 'mg' => [ 'isoName' => 'Malagasy', 'nativeName' => 'fiteny malagasy', ], 'ms' => [ 'isoName' => 'Malay', 'nativeName' => 'Bahasa Melayu, بهاس ملايو‎', ], 'ml' => [ 'isoName' => 'Malayalam', 'nativeName' => 'മലയാളം', ], 'mt' => [ 'isoName' => 'Maltese', 'nativeName' => 'Malti', ], 'mi' => [ 'isoName' => 'Maori', 'nativeName' => 'te reo Māori', ], 'mr' => [ 'isoName' => 'Marathi', 'nativeName' => 'मराठी', ], 'mh' => [ 'isoName' => 'Marshallese', 'nativeName' => 'Kajin M̧ajeļ', ], 'mn' => [ 'isoName' => 'Mongolian', 'nativeName' => 'Монгол хэл', ], 'na' => [ 'isoName' => 'Nauru', 'nativeName' => 'Dorerin Naoero', ], 'nv' => [ 'isoName' => 'Navajo, Navaho', 'nativeName' => 'Diné bizaad', ], 'nd' => [ 'isoName' => 'North Ndebele', 'nativeName' => 'isiNdebele', ], 'ne' => [ 'isoName' => 'Nepali', 'nativeName' => 'नेपाली', ], 'ng' => [ 'isoName' => 'Ndonga', 'nativeName' => 'Owambo', ], 'nb' => [ 'isoName' => 'Norwegian Bokmål', 'nativeName' => 'Norsk Bokmål', ], 'nn' => [ 'isoName' => 'Norwegian Nynorsk', 'nativeName' => 'Norsk Nynorsk', ], 'no' => [ 'isoName' => 'Norwegian', 'nativeName' => 'Norsk', ], 'ii' => [ 'isoName' => 'Sichuan Yi, Nuosu', 'nativeName' => 'ꆈꌠ꒿ Nuosuhxop', ], 'nr' => [ 'isoName' => 'South Ndebele', 'nativeName' => 'isiNdebele', ], 'oc' => [ 'isoName' => 'Occitan', 'nativeName' => 'occitan, lenga d\'òc', ], 'oj' => [ 'isoName' => 'Ojibwa', 'nativeName' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', ], 'cu' => [ 'isoName' => 'Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', 'nativeName' => 'ѩзыкъ словѣньскъ', ], 'om' => [ 'isoName' => 'Oromo', 'nativeName' => 'Afaan Oromoo', ], 'or' => [ 'isoName' => 'Oriya', 'nativeName' => 'ଓଡ଼ିଆ', ], 'os' => [ 'isoName' => 'Ossetian, Ossetic', 'nativeName' => 'ирон æвзаг', ], 'pa' => [ 'isoName' => 'Panjabi, Punjabi', 'nativeName' => 'ਪੰਜਾਬੀ', ], 'pi' => [ 'isoName' => 'Pali', 'nativeName' => 'पाऴि', ], 'fa' => [ 'isoName' => 'Persian', 'nativeName' => 'فارسی', ], 'pl' => [ 'isoName' => 'Polish', 'nativeName' => 'język polski, polszczyzna', ], 'ps' => [ 'isoName' => 'Pashto, Pushto', 'nativeName' => 'پښتو', ], 'pt' => [ 'isoName' => 'Portuguese', 'nativeName' => 'Português', ], 'qu' => [ 'isoName' => 'Quechua', 'nativeName' => 'Runa Simi, Kichwa', ], 'rm' => [ 'isoName' => 'Romansh', 'nativeName' => 'Rumantsch Grischun', ], 'rn' => [ 'isoName' => 'Rundi', 'nativeName' => 'Ikirundi', ], 'ro' => [ 'isoName' => 'Romanian, Moldavian, Moldovan', 'nativeName' => 'Română', ], 'ru' => [ 'isoName' => 'Russian', 'nativeName' => 'русский', ], 'sa' => [ 'isoName' => 'Sanskrit', 'nativeName' => 'संस्कृतम्', ], 'sc' => [ 'isoName' => 'Sardinian', 'nativeName' => 'sardu', ], 'sd' => [ 'isoName' => 'Sindhi', 'nativeName' => 'सिन्धी, سنڌي، سندھی‎', ], 'se' => [ 'isoName' => 'Northern Sami', 'nativeName' => 'Davvisámegiella', ], 'sm' => [ 'isoName' => 'Samoan', 'nativeName' => 'gagana fa\'a Samoa', ], 'sg' => [ 'isoName' => 'Sango', 'nativeName' => 'yângâ tî sängö', ], 'sr' => [ 'isoName' => 'Serbian', 'nativeName' => 'српски језик', ], 'gd' => [ 'isoName' => 'Gaelic, Scottish Gaelic', 'nativeName' => 'Gàidhlig', ], 'sn' => [ 'isoName' => 'Shona', 'nativeName' => 'chiShona', ], 'si' => [ 'isoName' => 'Sinhala, Sinhalese', 'nativeName' => 'සිංහල', ], 'sk' => [ 'isoName' => 'Slovak', 'nativeName' => 'Slovenčina, Slovenský Jazyk', ], 'sl' => [ 'isoName' => 'Slovenian', 'nativeName' => 'Slovenski Jezik, Slovenščina', ], 'so' => [ 'isoName' => 'Somali', 'nativeName' => 'Soomaaliga, af Soomaali', ], 'st' => [ 'isoName' => 'Southern Sotho', 'nativeName' => 'Sesotho', ], 'es' => [ 'isoName' => 'Spanish, Castilian', 'nativeName' => 'Español', ], 'su' => [ 'isoName' => 'Sundanese', 'nativeName' => 'Basa Sunda', ], 'sw' => [ 'isoName' => 'Swahili', 'nativeName' => 'Kiswahili', ], 'ss' => [ 'isoName' => 'Swati', 'nativeName' => 'SiSwati', ], 'sv' => [ 'isoName' => 'Swedish', 'nativeName' => 'Svenska', ], 'ta' => [ 'isoName' => 'Tamil', 'nativeName' => 'தமிழ்', ], 'te' => [ 'isoName' => 'Telugu', 'nativeName' => 'తెలుగు', ], 'tg' => [ 'isoName' => 'Tajik', 'nativeName' => 'тоҷикӣ, toçikī, تاجیکی‎', ], 'th' => [ 'isoName' => 'Thai', 'nativeName' => 'ไทย', ], 'ti' => [ 'isoName' => 'Tigrinya', 'nativeName' => 'ትግርኛ', ], 'bo' => [ 'isoName' => 'Tibetan', 'nativeName' => 'བོད་ཡིག', ], 'tk' => [ 'isoName' => 'Turkmen', 'nativeName' => 'Türkmen, Түркмен', ], 'tl' => [ 'isoName' => 'Tagalog', 'nativeName' => 'Wikang Tagalog', ], 'tn' => [ 'isoName' => 'Tswana', 'nativeName' => 'Setswana', ], 'to' => [ 'isoName' => 'Tongan (Tonga Islands)', 'nativeName' => 'Faka Tonga', ], 'tr' => [ 'isoName' => 'Turkish', 'nativeName' => 'Türkçe', ], 'ts' => [ 'isoName' => 'Tsonga', 'nativeName' => 'Xitsonga', ], 'tt' => [ 'isoName' => 'Tatar', 'nativeName' => 'татар теле, tatar tele', ], 'tw' => [ 'isoName' => 'Twi', 'nativeName' => 'Twi', ], 'ty' => [ 'isoName' => 'Tahitian', 'nativeName' => 'Reo Tahiti', ], 'ug' => [ 'isoName' => 'Uighur, Uyghur', 'nativeName' => 'Uyƣurqə, ‫ئۇيغۇرچ', ], 'uk' => [ 'isoName' => 'Ukrainian', 'nativeName' => 'Українська', ], 'ur' => [ 'isoName' => 'Urdu', 'nativeName' => 'اردو', ], 'uz' => [ 'isoName' => 'Uzbek', 'nativeName' => 'Oʻzbek, Ўзбек, أۇزبېك‎', ], 've' => [ 'isoName' => 'Venda', 'nativeName' => 'Tshivenḓa', ], 'vi' => [ 'isoName' => 'Vietnamese', 'nativeName' => 'Tiếng Việt', ], 'vo' => [ 'isoName' => 'Volapük', 'nativeName' => 'Volapük', ], 'wa' => [ 'isoName' => 'Walloon', 'nativeName' => 'Walon', ], 'cy' => [ 'isoName' => 'Welsh', 'nativeName' => 'Cymraeg', ], 'wo' => [ 'isoName' => 'Wolof', 'nativeName' => 'Wollof', ], 'fy' => [ 'isoName' => 'Western Frisian', 'nativeName' => 'Frysk', ], 'xh' => [ 'isoName' => 'Xhosa', 'nativeName' => 'isiXhosa', ], 'yi' => [ 'isoName' => 'Yiddish', 'nativeName' => 'ייִדיש', ], 'yo' => [ 'isoName' => 'Yoruba', 'nativeName' => 'Yorùbá', ], 'za' => [ 'isoName' => 'Zhuang, Chuang', 'nativeName' => 'Saɯ cueŋƅ, Saw cuengh', ], 'zu' => [ 'isoName' => 'Zulu', 'nativeName' => 'isiZulu', ], /* * Add ISO 639-3 languages available in Carbon */ 'agq' => [ 'isoName' => 'Aghem', 'nativeName' => 'Aghem', ], 'agr' => [ 'isoName' => 'Aguaruna', 'nativeName' => 'Aguaruna', ], 'anp' => [ 'isoName' => 'Angika', 'nativeName' => 'Angika', ], 'asa' => [ 'isoName' => 'Asu', 'nativeName' => 'Asu', ], 'ast' => [ 'isoName' => 'Asturian', 'nativeName' => 'Asturian', ], 'ayc' => [ 'isoName' => 'Southern Aymara', 'nativeName' => 'Southern Aymara', ], 'bas' => [ 'isoName' => 'Basaa', 'nativeName' => 'Basaa', ], 'bem' => [ 'isoName' => 'Bemba', 'nativeName' => 'Bemba', ], 'bez' => [ 'isoName' => 'Bena', 'nativeName' => 'Bena', ], 'bhb' => [ 'isoName' => 'Bhili', 'nativeName' => 'Bhili', ], 'bho' => [ 'isoName' => 'Bhojpuri', 'nativeName' => 'Bhojpuri', ], 'brx' => [ 'isoName' => 'Bodo', 'nativeName' => 'Bodo', ], 'byn' => [ 'isoName' => 'Bilin', 'nativeName' => 'Bilin', ], 'ccp' => [ 'isoName' => 'Chakma', 'nativeName' => 'Chakma', ], 'cgg' => [ 'isoName' => 'Chiga', 'nativeName' => 'Chiga', ], 'chr' => [ 'isoName' => 'Cherokee', 'nativeName' => 'Cherokee', ], 'cmn' => [ 'isoName' => 'Chinese', 'nativeName' => 'Chinese', ], 'crh' => [ 'isoName' => 'Crimean Turkish', 'nativeName' => 'Crimean Turkish', ], 'csb' => [ 'isoName' => 'Kashubian', 'nativeName' => 'Kashubian', ], 'dav' => [ 'isoName' => 'Taita', 'nativeName' => 'Taita', ], 'dje' => [ 'isoName' => 'Zarma', 'nativeName' => 'Zarma', ], 'doi' => [ 'isoName' => 'Dogri (macrolanguage)', 'nativeName' => 'Dogri (macrolanguage)', ], 'dsb' => [ 'isoName' => 'Lower Sorbian', 'nativeName' => 'Lower Sorbian', ], 'dua' => [ 'isoName' => 'Duala', 'nativeName' => 'Duala', ], 'dyo' => [ 'isoName' => 'Jola-Fonyi', 'nativeName' => 'Jola-Fonyi', ], 'ebu' => [ 'isoName' => 'Embu', 'nativeName' => 'Embu', ], 'ewo' => [ 'isoName' => 'Ewondo', 'nativeName' => 'Ewondo', ], 'fil' => [ 'isoName' => 'Filipino', 'nativeName' => 'Filipino', ], 'fur' => [ 'isoName' => 'Friulian', 'nativeName' => 'Friulian', ], 'gez' => [ 'isoName' => 'Geez', 'nativeName' => 'Geez', ], 'gom' => [ 'isoName' => 'Konkani, Goan', 'nativeName' => 'ಕೊಂಕಣಿ', ], 'gsw' => [ 'isoName' => 'Swiss German', 'nativeName' => 'Swiss German', ], 'guz' => [ 'isoName' => 'Gusii', 'nativeName' => 'Gusii', ], 'hak' => [ 'isoName' => 'Hakka Chinese', 'nativeName' => 'Hakka Chinese', ], 'haw' => [ 'isoName' => 'Hawaiian', 'nativeName' => 'Hawaiian', ], 'hif' => [ 'isoName' => 'Fiji Hindi', 'nativeName' => 'Fiji Hindi', ], 'hne' => [ 'isoName' => 'Chhattisgarhi', 'nativeName' => 'Chhattisgarhi', ], 'hsb' => [ 'isoName' => 'Upper Sorbian', 'nativeName' => 'Upper Sorbian', ], 'jgo' => [ 'isoName' => 'Ngomba', 'nativeName' => 'Ngomba', ], 'jmc' => [ 'isoName' => 'Machame', 'nativeName' => 'Machame', ], 'kab' => [ 'isoName' => 'Kabyle', 'nativeName' => 'Kabyle', ], 'kam' => [ 'isoName' => 'Kamba', 'nativeName' => 'Kamba', ], 'kde' => [ 'isoName' => 'Makonde', 'nativeName' => 'Makonde', ], 'kea' => [ 'isoName' => 'Kabuverdianu', 'nativeName' => 'Kabuverdianu', ], 'khq' => [ 'isoName' => 'Koyra Chiini', 'nativeName' => 'Koyra Chiini', ], 'kkj' => [ 'isoName' => 'Kako', 'nativeName' => 'Kako', ], 'kln' => [ 'isoName' => 'Kalenjin', 'nativeName' => 'Kalenjin', ], 'kok' => [ 'isoName' => 'Konkani', 'nativeName' => 'Konkani', ], 'ksb' => [ 'isoName' => 'Shambala', 'nativeName' => 'Shambala', ], 'ksf' => [ 'isoName' => 'Bafia', 'nativeName' => 'Bafia', ], 'ksh' => [ 'isoName' => 'Colognian', 'nativeName' => 'Colognian', ], 'lag' => [ 'isoName' => 'Langi', 'nativeName' => 'Langi', ], 'lij' => [ 'isoName' => 'Ligurian', 'nativeName' => 'Ligurian', ], 'lkt' => [ 'isoName' => 'Lakota', 'nativeName' => 'Lakota', ], 'lrc' => [ 'isoName' => 'Northern Luri', 'nativeName' => 'Northern Luri', ], 'luo' => [ 'isoName' => 'Luo', 'nativeName' => 'Luo', ], 'luy' => [ 'isoName' => 'Luyia', 'nativeName' => 'Luyia', ], 'lzh' => [ 'isoName' => 'Literary Chinese', 'nativeName' => 'Literary Chinese', ], 'mag' => [ 'isoName' => 'Magahi', 'nativeName' => 'Magahi', ], 'mai' => [ 'isoName' => 'Maithili', 'nativeName' => 'Maithili', ], 'mas' => [ 'isoName' => 'Masai', 'nativeName' => 'Masai', ], 'mer' => [ 'isoName' => 'Meru', 'nativeName' => 'Meru', ], 'mfe' => [ 'isoName' => 'Morisyen', 'nativeName' => 'Morisyen', ], 'mgh' => [ 'isoName' => 'Makhuwa-Meetto', 'nativeName' => 'Makhuwa-Meetto', ], 'mgo' => [ 'isoName' => 'Metaʼ', 'nativeName' => 'Metaʼ', ], 'mhr' => [ 'isoName' => 'Eastern Mari', 'nativeName' => 'Eastern Mari', ], 'miq' => [ 'isoName' => 'Mískito', 'nativeName' => 'Mískito', ], 'mjw' => [ 'isoName' => 'Karbi', 'nativeName' => 'Karbi', ], 'mni' => [ 'isoName' => 'Manipuri', 'nativeName' => 'Manipuri', ], 'mua' => [ 'isoName' => 'Mundang', 'nativeName' => 'Mundang', ], 'mzn' => [ 'isoName' => 'Mazanderani', 'nativeName' => 'Mazanderani', ], 'nan' => [ 'isoName' => 'Min Nan Chinese', 'nativeName' => 'Min Nan Chinese', ], 'naq' => [ 'isoName' => 'Nama', 'nativeName' => 'Nama', ], 'nds' => [ 'isoName' => 'Low German', 'nativeName' => 'Low German', ], 'nhn' => [ 'isoName' => 'Central Nahuatl', 'nativeName' => 'Central Nahuatl', ], 'niu' => [ 'isoName' => 'Niuean', 'nativeName' => 'Niuean', ], 'nmg' => [ 'isoName' => 'Kwasio', 'nativeName' => 'Kwasio', ], 'nnh' => [ 'isoName' => 'Ngiemboon', 'nativeName' => 'Ngiemboon', ], 'nso' => [ 'isoName' => 'Northern Sotho', 'nativeName' => 'Northern Sotho', ], 'nus' => [ 'isoName' => 'Nuer', 'nativeName' => 'Nuer', ], 'nyn' => [ 'isoName' => 'Nyankole', 'nativeName' => 'Nyankole', ], 'pap' => [ 'isoName' => 'Papiamento', 'nativeName' => 'Papiamento', ], 'prg' => [ 'isoName' => 'Prussian', 'nativeName' => 'Prussian', ], 'quz' => [ 'isoName' => 'Cusco Quechua', 'nativeName' => 'Cusco Quechua', ], 'raj' => [ 'isoName' => 'Rajasthani', 'nativeName' => 'Rajasthani', ], 'rof' => [ 'isoName' => 'Rombo', 'nativeName' => 'Rombo', ], 'rwk' => [ 'isoName' => 'Rwa', 'nativeName' => 'Rwa', ], 'sah' => [ 'isoName' => 'Sakha', 'nativeName' => 'Sakha', ], 'saq' => [ 'isoName' => 'Samburu', 'nativeName' => 'Samburu', ], 'sat' => [ 'isoName' => 'Santali', 'nativeName' => 'Santali', ], 'sbp' => [ 'isoName' => 'Sangu', 'nativeName' => 'Sangu', ], 'scr' => [ 'isoName' => 'Serbo Croatian', 'nativeName' => 'Serbo Croatian', ], 'seh' => [ 'isoName' => 'Sena', 'nativeName' => 'Sena', ], 'ses' => [ 'isoName' => 'Koyraboro Senni', 'nativeName' => 'Koyraboro Senni', ], 'sgs' => [ 'isoName' => 'Samogitian', 'nativeName' => 'Samogitian', ], 'shi' => [ 'isoName' => 'Tachelhit', 'nativeName' => 'Tachelhit', ], 'shn' => [ 'isoName' => 'Shan', 'nativeName' => 'Shan', ], 'shs' => [ 'isoName' => 'Shuswap', 'nativeName' => 'Shuswap', ], 'sid' => [ 'isoName' => 'Sidamo', 'nativeName' => 'Sidamo', ], 'smn' => [ 'isoName' => 'Inari Sami', 'nativeName' => 'Inari Sami', ], 'szl' => [ 'isoName' => 'Silesian', 'nativeName' => 'Silesian', ], 'tcy' => [ 'isoName' => 'Tulu', 'nativeName' => 'Tulu', ], 'teo' => [ 'isoName' => 'Teso', 'nativeName' => 'Teso', ], 'tet' => [ 'isoName' => 'Tetum', 'nativeName' => 'Tetum', ], 'the' => [ 'isoName' => 'Chitwania Tharu', 'nativeName' => 'Chitwania Tharu', ], 'tig' => [ 'isoName' => 'Tigre', 'nativeName' => 'Tigre', ], 'tlh' => [ 'isoName' => 'Klingon', 'nativeName' => 'tlhIngan Hol', ], 'tpi' => [ 'isoName' => 'Tok Pisin', 'nativeName' => 'Tok Pisin', ], 'twq' => [ 'isoName' => 'Tasawaq', 'nativeName' => 'Tasawaq', ], 'tzl' => [ 'isoName' => 'Talossan', 'nativeName' => 'Talossan', ], 'tzm' => [ 'isoName' => 'Tamazight, Central Atlas', 'nativeName' => 'ⵜⵎⴰⵣⵉⵖⵜ', ], 'unm' => [ 'isoName' => 'Unami', 'nativeName' => 'Unami', ], 'vai' => [ 'isoName' => 'Vai', 'nativeName' => 'Vai', ], 'vun' => [ 'isoName' => 'Vunjo', 'nativeName' => 'Vunjo', ], 'wae' => [ 'isoName' => 'Walser', 'nativeName' => 'Walser', ], 'wal' => [ 'isoName' => 'Wolaytta', 'nativeName' => 'Wolaytta', ], 'xog' => [ 'isoName' => 'Soga', 'nativeName' => 'Soga', ], 'yav' => [ 'isoName' => 'Yangben', 'nativeName' => 'Yangben', ], 'yue' => [ 'isoName' => 'Cantonese', 'nativeName' => 'Cantonese', ], 'yuw' => [ 'isoName' => 'Yau (Morobe Province)', 'nativeName' => 'Yau (Morobe Province)', ], 'zgh' => [ 'isoName' => 'Standard Moroccan Tamazight', 'nativeName' => 'Standard Moroccan Tamazight', ], ]; ================================================ FILE: src/Carbon/List/regions.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * ISO 3166-2 short names. * * ⚠ Provided with No Warranty * * This list has no official value, and it's using short name, i.e. the first column of * https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes * * Without the extra parenthesis unless a particular ambiguity in the list. * * For instance: * - Falkland Islands and Malvinas both to FK, but we keep only the first for brevity and * because there is no ambiguity in the list to justify longer name. * - For Sint Maarten/Saint Martin not to have any confusion between FM and SX codes that * are on the same island and so to be clear it's not referring to the whole island, * south (dutch-speaking) and north (french-speaking) parentheses are kept for disambiguation. * - For Virgin Islands, that can refer to either VG or VI, parentheses are also kept for * disambiguation. * * We won't take into consideration any change request in this list unless there is an update * in ISO 3166-2 itself that we need to align to. * * It's a purely geographical helper, state sovereignty is out of scope, for political * complains you should address them directly to https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes * * Anyone needing official state names (such as the second column of the wikipedia page above) * should seek for another tool, this list is not meant to provide long names. */ return [ 'AD' => 'Andorra', 'AE' => 'United Arab Emirates', 'AF' => 'Afghanistan', 'AG' => 'Antigua and Barbuda', 'AI' => 'Anguilla', 'AL' => 'Albania', 'AM' => 'Armenia', 'AO' => 'Angola', 'AQ' => 'Antarctica', 'AR' => 'Argentina', 'AS' => 'American Samoa', 'AT' => 'Austria', 'AU' => 'Australia', 'AW' => 'Aruba', 'AX' => 'Åland Islands', 'AZ' => 'Azerbaijan', 'BA' => 'Bosnia and Herzegovina', 'BB' => 'Barbados', 'BD' => 'Bangladesh', 'BE' => 'Belgium', 'BF' => 'Burkina Faso', 'BG' => 'Bulgaria', 'BH' => 'Bahrain', 'BI' => 'Burundi', 'BJ' => 'Benin', 'BL' => 'Saint Barthélemy', 'BM' => 'Bermuda', 'BN' => 'Brunei Darussalam', 'BO' => 'Bolivia', 'BQ' => 'Bonaire, Sint Eustatius and Saba', 'BR' => 'Brazil', 'BS' => 'Bahamas', 'BT' => 'Bhutan', 'BV' => 'Bouvet Island', 'BW' => 'Botswana', 'BY' => 'Belarus', 'BZ' => 'Belize', 'CA' => 'Canada', 'CC' => 'Cocos (Keeling) Islands', 'CD' => 'Congo, Democratic Republic of the', 'CF' => 'Central African Republic', 'CG' => 'Congo', 'CH' => 'Switzerland', 'CI' => 'Côte d\'Ivoire', 'CK' => 'Cook Islands', 'CL' => 'Chile', 'CM' => 'Cameroon', 'CN' => 'China', 'CO' => 'Colombia', 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CV' => 'Cabo Verde', 'CW' => 'Curaçao', 'CX' => 'Christmas Island', 'CY' => 'Cyprus', 'CZ' => 'Czechia', 'DE' => 'Germany', 'DJ' => 'Djibouti', 'DK' => 'Denmark', 'DM' => 'Dominica', 'DO' => 'Dominican Republic', 'DZ' => 'Algeria', 'EC' => 'Ecuador', 'EE' => 'Estonia', 'EG' => 'Egypt', 'EH' => 'Western Sahara', 'ER' => 'Eritrea', 'ES' => 'Spain', 'ET' => 'Ethiopia', 'FI' => 'Finland', 'FJ' => 'Fiji', 'FK' => 'Falkland Islands', 'FM' => 'Micronesia', 'FO' => 'Faroe Islands', 'FR' => 'France', 'GA' => 'Gabon', 'GB' => 'United Kingdom of Great Britain and Northern Ireland', 'GD' => 'Grenada', 'GE' => 'Georgia', 'GF' => 'French Guiana', 'GG' => 'Guernsey', 'GH' => 'Ghana', 'GI' => 'Gibraltar', 'GL' => 'Greenland', 'GM' => 'Gambia', 'GN' => 'Guinea', 'GP' => 'Guadeloupe', 'GQ' => 'Equatorial Guinea', 'GR' => 'Greece', 'GS' => 'South Georgia and the South Sandwich Islands', 'GT' => 'Guatemala', 'GU' => 'Guam', 'GW' => 'Guinea-Bissau', 'GY' => 'Guyana', 'HK' => 'Hong Kong', 'HM' => 'Heard Island and McDonald Islands', 'HN' => 'Honduras', 'HR' => 'Croatia', 'HT' => 'Haiti', 'HU' => 'Hungary', 'ID' => 'Indonesia', 'IE' => 'Ireland', 'IL' => 'Israel', 'IM' => 'Isle of Man', 'IN' => 'India', 'IO' => 'British Indian Ocean Territory', 'IQ' => 'Iraq', 'IR' => 'Iran', 'IS' => 'Iceland', 'IT' => 'Italy', 'JE' => 'Jersey', 'JM' => 'Jamaica', 'JO' => 'Jordan', 'JP' => 'Japan', 'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia', 'KI' => 'Kiribati', 'KM' => 'Comoros', 'KN' => 'Saint Kitts and Nevis', 'KP' => 'Korea (Democratic People\'s Republic of)', 'KR' => 'Korea, Republic of', 'KW' => 'Kuwait', 'KY' => 'Cayman Islands', 'KZ' => 'Kazakhstan', 'LA' => 'Lao People\'s Democratic Republic', 'LB' => 'Lebanon', 'LC' => 'Saint Lucia', 'LI' => 'Liechtenstein', 'LK' => 'Sri Lanka', 'LR' => 'Liberia', 'LS' => 'Lesotho', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'LV' => 'Latvia', 'LY' => 'Libya', 'MA' => 'Morocco', 'MC' => 'Monaco', 'MD' => 'Moldova', 'ME' => 'Montenegro', 'MF' => 'Saint Martin (French part)', 'MG' => 'Madagascar', 'MH' => 'Marshall Islands', 'MK' => 'North Macedonia', 'ML' => 'Mali', 'MM' => 'Myanmar', 'MN' => 'Mongolia', 'MO' => 'Macao', 'MP' => 'Northern Mariana Islands', 'MQ' => 'Martinique', 'MR' => 'Mauritania', 'MS' => 'Montserrat', 'MT' => 'Malta', 'MU' => 'Mauritius', 'MV' => 'Maldives', 'MW' => 'Malawi', 'MX' => 'Mexico', 'MY' => 'Malaysia', 'MZ' => 'Mozambique', 'NA' => 'Namibia', 'NC' => 'New Caledonia', 'NE' => 'Niger', 'NF' => 'Norfolk Island', 'NG' => 'Nigeria', 'NI' => 'Nicaragua', 'NL' => 'Netherlands', 'NO' => 'Norway', 'NP' => 'Nepal', 'NR' => 'Nauru', 'NU' => 'Niue', 'NZ' => 'New Zealand', 'OM' => 'Oman', 'PA' => 'Panama', 'PE' => 'Peru', 'PF' => 'French Polynesia', 'PG' => 'Papua New Guinea', 'PH' => 'Philippines', 'PK' => 'Pakistan', 'PL' => 'Poland', 'PM' => 'Saint Pierre and Miquelon', 'PN' => 'Pitcairn', 'PR' => 'Puerto Rico', 'PS' => 'Palestine', 'PT' => 'Portugal', 'PW' => 'Palau', 'PY' => 'Paraguay', 'QA' => 'Qatar', 'RE' => 'Réunion', 'RO' => 'Romania', 'RS' => 'Serbia', 'RU' => 'Russian Federation', 'RW' => 'Rwanda', 'SA' => 'Saudi Arabia', 'SB' => 'Solomon Islands', 'SC' => 'Seychelles', 'SD' => 'Sudan', 'SE' => 'Sweden', 'SG' => 'Singapore', 'SH' => 'Saint Helena, Ascension and Tristan da Cunha', 'SI' => 'Slovenia', 'SJ' => 'Svalbard and Jan Mayen', 'SK' => 'Slovakia', 'SL' => 'Sierra Leone', 'SM' => 'San Marino', 'SN' => 'Senegal', 'SO' => 'Somalia', 'SR' => 'Suriname', 'SS' => 'South Sudan', 'ST' => 'Sao Tome and Principe', 'SV' => 'El Salvador', 'SX' => 'Sint Maarten (Dutch part)', 'SY' => 'Syrian Arab Republic', 'SZ' => 'Eswatini', 'TC' => 'Turks and Caicos Islands', 'TD' => 'Chad', 'TF' => 'French Southern Territories', 'TG' => 'Togo', 'TH' => 'Thailand', 'TJ' => 'Tajikistan', 'TK' => 'Tokelau', 'TL' => 'Timor-Leste', 'TM' => 'Turkmenistan', 'TN' => 'Tunisia', 'TO' => 'Tonga', 'TR' => 'Turkey', 'TT' => 'Trinidad and Tobago', 'TV' => 'Tuvalu', 'TW' => 'Taiwan', 'TZ' => 'Tanzania', 'UA' => 'Ukraine', 'UG' => 'Uganda', 'UM' => 'United States Minor Outlying Islands', 'US' => 'United States of America', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan', 'VA' => 'Holy See', 'VC' => 'Saint Vincent and the Grenadines', 'VE' => 'Venezuela', 'VG' => 'Virgin Islands (British)', 'VI' => 'Virgin Islands (U.S.)', 'VN' => 'Viet Nam', 'VU' => 'Vanuatu', 'WF' => 'Wallis and Futuna', 'WS' => 'Samoa', 'YE' => 'Yemen', 'YT' => 'Mayotte', 'ZA' => 'South Africa', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe', ]; ================================================ FILE: src/Carbon/MessageFormatter/MessageFormatterMapper.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\MessageFormatter; use ReflectionMethod; use Symfony\Component\Translation\Formatter\MessageFormatter; use Symfony\Component\Translation\Formatter\MessageFormatterInterface; // @codeCoverageIgnoreStart $transMethod = new ReflectionMethod(MessageFormatterInterface::class, 'format'); require $transMethod->getParameters()[0]->hasType() ? __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php' : __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php'; // @codeCoverageIgnoreEnd final class MessageFormatterMapper extends LazyMessageFormatter { /** * Wrapped formatter. * * @var MessageFormatterInterface */ protected $formatter; public function __construct(?MessageFormatterInterface $formatter = null) { $this->formatter = $formatter ?? new MessageFormatter(); } protected function transformLocale(?string $locale): ?string { return $locale ? preg_replace('/[_@][A-Za-z][a-z]{2,}/', '', $locale) : $locale; } } ================================================ FILE: src/Carbon/Month.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Exceptions\InvalidFormatException; enum Month: int { // Using constants is only safe starting from PHP 8.2 case January = 1; // CarbonInterface::JANUARY case February = 2; // CarbonInterface::FEBRUARY case March = 3; // CarbonInterface::MARCH case April = 4; // CarbonInterface::APRIL case May = 5; // CarbonInterface::MAY case June = 6; // CarbonInterface::JUNE case July = 7; // CarbonInterface::JULY case August = 8; // CarbonInterface::AUGUST case September = 9; // CarbonInterface::SEPTEMBER case October = 10; // CarbonInterface::OCTOBER case November = 11; // CarbonInterface::NOVEMBER case December = 12; // CarbonInterface::DECEMBER public static function int(self|int|null $value): ?int { return $value instanceof self ? $value->value : $value; } public static function fromNumber(int $number): self { $month = $number % CarbonInterface::MONTHS_PER_YEAR; return self::from($month + ($month < 1 ? CarbonInterface::MONTHS_PER_YEAR : 0)); } public static function fromName(string $name, ?string $locale = null): self { try { return self::from(CarbonImmutable::parseFromLocale("$name 1", $locale)->month); } catch (InvalidFormatException $exception) { // Possibly current language expect a dot after short name, but it's missing if ($locale !== null && !mb_strlen($name) < 4 && !str_ends_with($name, '.')) { try { return self::from(CarbonImmutable::parseFromLocale("$name. 1", $locale)->month); } catch (InvalidFormatException $e) { // Throw previous error } } throw $exception; } } public function ofTheYear(CarbonImmutable|int|null $now = null): CarbonImmutable { if (\is_int($now)) { return CarbonImmutable::create($now, $this->value); } $modifier = $this->name.' 1st'; return $now?->modify($modifier) ?? new CarbonImmutable($modifier); } public function locale(string $locale, ?CarbonImmutable $now = null): CarbonImmutable { return $this->ofTheYear($now)->locale($locale); } } ================================================ FILE: src/Carbon/PHPStan/MacroExtension.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\PHPStan; use Carbon\CarbonInterface; use Carbon\FactoryImmutable; use Closure; use InvalidArgumentException; use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\MethodReflection; use PHPStan\Reflection\MethodsClassReflectionExtension; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Type\ClosureTypeFactory; use ReflectionFunction; use ReflectionMethod; use stdClass; use Throwable; /** * Class MacroExtension. * * @codeCoverageIgnore Pure PHPStan wrapper. */ final class MacroExtension implements MethodsClassReflectionExtension { /** * @var ReflectionProvider */ protected $reflectionProvider; /** * @var ClosureTypeFactory */ protected $closureTypeFactory; /** * Extension constructor. * * @param ReflectionProvider $reflectionProvider * @param ClosureTypeFactory $closureTypeFactory */ public function __construct( ReflectionProvider $reflectionProvider, ClosureTypeFactory $closureTypeFactory ) { $this->reflectionProvider = $reflectionProvider; $this->closureTypeFactory = $closureTypeFactory; } /** * {@inheritdoc} */ public function hasMethod(ClassReflection $classReflection, string $methodName): bool { if ( $classReflection->getName() !== CarbonInterface::class && !$classReflection->isSubclassOf(CarbonInterface::class) ) { return false; } $className = $classReflection->getName(); return \is_callable([$className, 'hasMacro']) && $className::hasMacro($methodName); } /** * {@inheritdoc} */ public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection { $macros = FactoryImmutable::getDefaultInstance()->getSettings()['macros'] ?? []; $macro = $macros[$methodName] ?? throw new InvalidArgumentException("Macro '$methodName' not found"); $static = false; $final = false; $deprecated = false; $docComment = null; if (\is_array($macro) && \count($macro) === 2 && \is_string($macro[1])) { \assert($macro[1] !== ''); $reflection = new ReflectionMethod($macro[0], $macro[1]); $closure = \is_object($macro[0]) ? $reflection->getClosure($macro[0]) : $reflection->getClosure(); $static = $reflection->isStatic(); $final = $reflection->isFinal(); $deprecated = $reflection->isDeprecated(); $docComment = $reflection->getDocComment() ?: null; } elseif (\is_string($macro)) { $reflection = new ReflectionFunction($macro); $closure = $reflection->getClosure(); $deprecated = $reflection->isDeprecated(); $docComment = $reflection->getDocComment() ?: null; } elseif ($macro instanceof Closure) { $closure = $macro; try { $boundClosure = Closure::bind($closure, new stdClass()); $static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); } catch (Throwable) { $static = true; } $reflection = new ReflectionFunction($macro); $deprecated = $reflection->isDeprecated(); $docComment = $reflection->getDocComment() ?: null; } if (!isset($closure)) { throw new InvalidArgumentException('Could not create reflection from the spec given'); // @codeCoverageIgnore } $closureType = $this->closureTypeFactory->fromClosureObject($closure); return new MacroMethodReflection( $classReflection, $methodName, $closureType, $static, $final, $deprecated, $docComment, ); } } ================================================ FILE: src/Carbon/PHPStan/MacroMethodReflection.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\PHPStan; use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\MethodReflection; use PHPStan\Reflection\ParametersAcceptor; use PHPStan\TrinaryLogic; use PHPStan\Type\Type; use function preg_match; class MacroMethodReflection implements MethodReflection { private ClassReflection $declaringClass; private string $methodName; private ParametersAcceptor $macroClosureType; private bool $static; private bool $final; private bool $deprecated; private ?string $docComment; public function __construct( ClassReflection $declaringClass, string $methodName, ParametersAcceptor $macroClosureType, bool $static, bool $final, bool $deprecated, ?string $docComment ) { $this->declaringClass = $declaringClass; $this->methodName = $methodName; $this->macroClosureType = $macroClosureType; $this->static = $static; $this->final = $final; $this->deprecated = $deprecated; $this->docComment = $docComment; } public function getDeclaringClass(): ClassReflection { return $this->declaringClass; } public function isStatic(): bool { return $this->static; } public function isPrivate(): bool { return false; } public function isPublic(): bool { return true; } public function getDocComment(): ?string { return $this->docComment; } public function getName(): string { return $this->methodName; } public function getPrototype(): \PHPStan\Reflection\ClassMemberReflection { return $this; } public function getVariants(): array { return [$this->macroClosureType]; } public function isDeprecated(): TrinaryLogic { return TrinaryLogic::createFromBoolean( $this->deprecated || preg_match('/@deprecated/i', $this->getDocComment() ?: '') ); } public function getDeprecatedDescription(): ?string { return null; } public function isFinal(): TrinaryLogic { return TrinaryLogic::createFromBoolean($this->final); } public function isInternal(): TrinaryLogic { return TrinaryLogic::createNo(); } public function getThrowType(): ?Type { return null; } public function hasSideEffects(): TrinaryLogic { return TrinaryLogic::createMaybe(); } } ================================================ FILE: src/Carbon/Traits/Boundaries.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Exceptions\UnknownUnitException; use Carbon\Unit; use Carbon\WeekDay; /** * Trait Boundaries. * * startOf, endOf and derived method for each unit. * * Depends on the following properties: * * @property int $year * @property int $month * @property int $daysInMonth * @property int $quarter * * Depends on the following methods: * * @method $this setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0) * @method $this setDate(int $year, int $month, int $day) * @method $this addMonths(int $value = 1) */ trait Boundaries { /** * Resets the time to 00:00:00 start of day * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfDay(); * ``` * * @return static */ public function startOfDay() { return $this->setTime(0, 0, 0, 0); } /** * Resets the time to 23:59:59.999999 end of day * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfDay(); * ``` * * @return static */ public function endOfDay() { return $this->setTime(static::HOURS_PER_DAY - 1, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); } /** * Resets the date to the first day of the month and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth(); * ``` * * @return static */ public function startOfMonth() { return $this->setDate($this->year, $this->month, 1)->startOfDay(); } /** * Resets the date to end of the month and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth(); * ``` * * @return static */ public function endOfMonth() { return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay(); } /** * Resets the date to the first day of the quarter and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter(); * ``` * * @return static */ public function startOfQuarter() { $month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1; return $this->setDate($this->year, $month, 1)->startOfDay(); } /** * Resets the date to end of the quarter and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter(); * ``` * * @return static */ public function endOfQuarter() { return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth(); } /** * Resets the date to the first day of the year and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfYear(); * ``` * * @return static */ public function startOfYear() { return $this->setDate($this->year, 1, 1)->startOfDay(); } /** * Resets the date to end of the year and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfYear(); * ``` * * @return static */ public function endOfYear() { return $this->setDate($this->year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of the decade and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade(); * ``` * * @return static */ public function startOfDecade() { $year = $this->year - $this->year % static::YEARS_PER_DECADE; return $this->setDate($year, 1, 1)->startOfDay(); } /** * Resets the date to end of the decade and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade(); * ``` * * @return static */ public function endOfDecade() { $year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1; return $this->setDate($year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of the century and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury(); * ``` * * @return static */ public function startOfCentury() { $year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY; return $this->setDate($year, 1, 1)->startOfDay(); } /** * Resets the date to end of the century and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury(); * ``` * * @return static */ public function endOfCentury() { $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY; return $this->setDate($year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of the millennium and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium(); * ``` * * @return static */ public function startOfMillennium() { $year = $this->year - ($this->year - 1) % static::YEARS_PER_MILLENNIUM; return $this->setDate($year, 1, 1)->startOfDay(); } /** * Resets the date to end of the millennium and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium(); * ``` * * @return static */ public function endOfMillennium() { $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_MILLENNIUM + static::YEARS_PER_MILLENNIUM; return $this->setDate($year, 12, 31)->endOfDay(); } /** * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n"; * ``` * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week * * @return static */ public function startOfWeek(WeekDay|int|null $weekStartsAt = null): static { return $this ->subDays( (static::DAYS_PER_WEEK + $this->dayOfWeek - (WeekDay::int($weekStartsAt) ?? $this->firstWeekDay)) % static::DAYS_PER_WEEK, ) ->startOfDay(); } /** * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n"; * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n"; * ``` * * @param WeekDay|int|null $weekEndsAt optional end allow you to specify the day of week to use to end the week * * @return static */ public function endOfWeek(WeekDay|int|null $weekEndsAt = null): static { return $this ->addDays( (static::DAYS_PER_WEEK - $this->dayOfWeek + (WeekDay::int($weekEndsAt) ?? $this->lastWeekDay)) % static::DAYS_PER_WEEK, ) ->endOfDay(); } /** * Modify to start of current hour, minutes and seconds become 0 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfHour(); * ``` */ public function startOfHour(): static { return $this->setTime($this->hour, 0, 0, 0); } /** * Modify to end of current hour, minutes and seconds become 59 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfHour(); * ``` */ public function endOfHour(): static { return $this->setTime($this->hour, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); } /** * Modify to start of current minute, seconds become 0 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute(); * ``` */ public function startOfMinute(): static { return $this->setTime($this->hour, $this->minute, 0, 0); } /** * Modify to end of current minute, seconds become 59 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute(); * ``` */ public function endOfMinute(): static { return $this->setTime($this->hour, $this->minute, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); } /** * Modify to start of current second, microseconds become 0 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOfSecond() * ->format('H:i:s.u'); * ``` */ public function startOfSecond(): static { return $this->setTime($this->hour, $this->minute, $this->second, 0); } /** * Modify to end of current second, microseconds become 999999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->endOfSecond() * ->format('H:i:s.u'); * ``` */ public function endOfSecond(): static { return $this->setTime($this->hour, $this->minute, $this->second, static::MICROSECONDS_PER_SECOND - 1); } /** * Modify to start of current millisecond, microseconds such as 12345 become 123000 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOfSecond() * ->format('H:i:s.u'); * ``` */ public function startOfMillisecond(): static { $millisecond = (int) floor($this->micro / 1000); return $this->setTime($this->hour, $this->minute, $this->second, $millisecond * 1000); } /** * Modify to end of current millisecond, microseconds such as 12345 become 123999 * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->endOfSecond() * ->format('H:i:s.u'); * ``` */ public function endOfMillisecond(): static { $millisecond = (int) floor($this->micro / 1000); return $this->setTime($this->hour, $this->minute, $this->second, $millisecond * 1000 + 999); } /** * Modify to start of current given unit. * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOf(Unit::Month) * ->endOf(Unit::Week, Carbon::FRIDAY); * ``` */ public function startOf(Unit|string $unit, mixed ...$params): static { $ucfUnit = ucfirst($unit instanceof Unit ? $unit->value : static::singularUnit($unit)); $method = "startOf$ucfUnit"; if (!method_exists($this, $method)) { throw new UnknownUnitException($unit); } return $this->$method(...$params); } /** * Modify to end of current given unit. * * @example * ``` * echo Carbon::parse('2018-07-25 12:45:16.334455') * ->startOf(Unit::Month) * ->endOf(Unit::Week, Carbon::FRIDAY); * ``` */ public function endOf(Unit|string $unit, mixed ...$params): static { $ucfUnit = ucfirst($unit instanceof Unit ? $unit->value : static::singularUnit($unit)); $method = "endOf$ucfUnit"; if (!method_exists($this, $method)) { throw new UnknownUnitException($unit); } return $this->$method(...$params); } } ================================================ FILE: src/Carbon/Traits/Cast.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Exceptions\InvalidCastException; use DateTimeInterface; /** * Trait Cast. * * Utils to cast into an other class. */ trait Cast { /** * Cast the current instance into the given class. * * @template T * * @param class-string $className The $className::instance() method will be called to cast the current object. * * @return T */ public function cast(string $className): mixed { if (!method_exists($className, 'instance')) { if (is_a($className, DateTimeInterface::class, true)) { return $className::createFromFormat('U.u', $this->rawFormat('U.u')) ->setTimezone($this->getTimezone()); } throw new InvalidCastException("$className has not the instance() method needed to cast the date."); } return $className::instance($this); } } ================================================ FILE: src/Carbon/Traits/Comparison.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use BackedEnum; use BadMethodCallException; use Carbon\CarbonConverterInterface; use Carbon\CarbonInterface; use Carbon\Exceptions\BadComparisonUnitException; use Carbon\FactoryImmutable; use Carbon\Month; use Carbon\Unit; use Carbon\WeekDay; use Closure; use DateInterval; use DateTimeInterface; use InvalidArgumentException; /** * Trait Comparison. * * Comparison utils and testers. All the following methods return booleans. * nowWithSameTz * * Depends on the following methods: * * @method static resolveCarbon($date) * @method static copy() * @method static nowWithSameTz() * @method static static yesterday($timezone = null) * @method static static tomorrow($timezone = null) */ trait Comparison { protected bool $endOfTime = false; protected bool $startOfTime = false; /** * Determines if the instance is equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->eq(Carbon::parse('2018-07-25 12:45:16')); // true * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:17'); // false * ``` * * @see equalTo() */ public function eq(DateTimeInterface|string $date): bool { return $this->equalTo($date); } /** * Determines if the instance is equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->equalTo(Carbon::parse('2018-07-25 12:45:16')); // true * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:17'); // false * ``` */ public function equalTo(DateTimeInterface|string $date): bool { return $this == $this->resolveCarbon($date); } /** * Determines if the instance is not equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->ne(Carbon::parse('2018-07-25 12:45:16')); // false * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:17'); // true * ``` * * @see notEqualTo() */ public function ne(DateTimeInterface|string $date): bool { return $this->notEqualTo($date); } /** * Determines if the instance is not equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->notEqualTo(Carbon::parse('2018-07-25 12:45:16')); // false * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:17'); // true * ``` */ public function notEqualTo(DateTimeInterface|string $date): bool { return !$this->equalTo($date); } /** * Determines if the instance is greater (after) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:17'); // false * ``` * * @see greaterThan() */ public function gt(DateTimeInterface|string $date): bool { return $this->greaterThan($date); } /** * Determines if the instance is greater (after) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:17'); // false * ``` */ public function greaterThan(DateTimeInterface|string $date): bool { return $this > $this->resolveCarbon($date); } /** * Determines if the instance is greater (after) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:17'); // false * ``` * * @see greaterThan() */ public function isAfter(DateTimeInterface|string $date): bool { return $this->greaterThan($date); } /** * Determines if the instance is greater (after) than or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:17'); // false * ``` * * @see greaterThanOrEqualTo() */ public function gte(DateTimeInterface|string $date): bool { return $this->greaterThanOrEqualTo($date); } /** * Determines if the instance is greater (after) than or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:15'); // true * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:17'); // false * ``` */ public function greaterThanOrEqualTo(DateTimeInterface|string $date): bool { return $this >= $this->resolveCarbon($date); } /** * Determines if the instance is less (before) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:17'); // true * ``` * * @see lessThan() */ public function lt(DateTimeInterface|string $date): bool { return $this->lessThan($date); } /** * Determines if the instance is less (before) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:17'); // true * ``` */ public function lessThan(DateTimeInterface|string $date): bool { return $this < $this->resolveCarbon($date); } /** * Determines if the instance is less (before) than another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:16'); // false * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:17'); // true * ``` * * @see lessThan() */ public function isBefore(DateTimeInterface|string $date): bool { return $this->lessThan($date); } /** * Determines if the instance is less (before) or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:17'); // true * ``` * * @see lessThanOrEqualTo() */ public function lte(DateTimeInterface|string $date): bool { return $this->lessThanOrEqualTo($date); } /** * Determines if the instance is less (before) or equal to another * * @example * ``` * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:15'); // false * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:16'); // true * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:17'); // true * ``` */ public function lessThanOrEqualTo(DateTimeInterface|string $date): bool { return $this <= $this->resolveCarbon($date); } /** * Determines if the instance is between two others. * * The third argument allow you to specify if bounds are included or not (true by default) * but for when you including/excluding bounds may produce different results in your application, * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. * * @example * ``` * Carbon::parse('2018-07-25')->between('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->between('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01'); // true * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01', false); // false * ``` * * @param bool $equal Indicates if an equal to comparison should be done */ public function between(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool { $date1 = $this->resolveCarbon($date1); $date2 = $this->resolveCarbon($date2); if ($date1->greaterThan($date2)) { [$date1, $date2] = [$date2, $date1]; } if ($equal) { return $this >= $date1 && $this <= $date2; } return $this > $date1 && $this < $date2; } /** * Determines if the instance is between two others, bounds included. * * @example * ``` * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->betweenIncluded('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-25', '2018-08-01'); // true * ``` */ public function betweenIncluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool { return $this->between($date1, $date2, true); } /** * Determines if the instance is between two others, bounds excluded. * * @example * ``` * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->betweenExcluded('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-25', '2018-08-01'); // false * ``` */ public function betweenExcluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool { return $this->between($date1, $date2, false); } /** * Determines if the instance is between two others * * @example * ``` * Carbon::parse('2018-07-25')->isBetween('2018-07-14', '2018-08-01'); // true * Carbon::parse('2018-07-25')->isBetween('2018-08-01', '2018-08-20'); // false * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01'); // true * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01', false); // false * ``` * * @param bool $equal Indicates if an equal to comparison should be done */ public function isBetween(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool { return $this->between($date1, $date2, $equal); } /** * Determines if the instance is a weekday. * * @example * ``` * Carbon::parse('2019-07-14')->isWeekday(); // false * Carbon::parse('2019-07-15')->isWeekday(); // true * ``` */ public function isWeekday(): bool { return !$this->isWeekend(); } /** * Determines if the instance is a weekend day. * * @example * ``` * Carbon::parse('2019-07-14')->isWeekend(); // true * Carbon::parse('2019-07-15')->isWeekend(); // false * ``` */ public function isWeekend(): bool { return \in_array( $this->dayOfWeek, $this->transmitFactory(static fn () => static::getWeekendDays()), true, ); } /** * Determines if the instance is yesterday. * * @example * ``` * Carbon::yesterday()->isYesterday(); // true * Carbon::tomorrow()->isYesterday(); // false * ``` */ public function isYesterday(): bool { return $this->toDateString() === $this->transmitFactory( fn () => static::yesterday($this->getTimezone())->toDateString(), ); } /** * Determines if the instance is today. * * @example * ``` * Carbon::today()->isToday(); // true * Carbon::tomorrow()->isToday(); // false * ``` */ public function isToday(): bool { return $this->toDateString() === $this->nowWithSameTz()->toDateString(); } /** * Determines if the instance is tomorrow. * * @example * ``` * Carbon::tomorrow()->isTomorrow(); // true * Carbon::yesterday()->isTomorrow(); // false * ``` */ public function isTomorrow(): bool { return $this->toDateString() === $this->transmitFactory( fn () => static::tomorrow($this->getTimezone())->toDateString(), ); } /** * Determines if the instance is in the future, ie. greater (after) than now. * * @example * ``` * Carbon::now()->addHours(5)->isFuture(); // true * Carbon::now()->subHours(5)->isFuture(); // false * ``` */ public function isFuture(): bool { return $this->greaterThan($this->nowWithSameTz()); } /** * Determines if the instance is in the past, ie. less (before) than now. * * @example * ``` * Carbon::now()->subHours(5)->isPast(); // true * Carbon::now()->addHours(5)->isPast(); // false * ``` */ public function isPast(): bool { return $this->lessThan($this->nowWithSameTz()); } /** * Determines if the instance is now or in the future, ie. greater (after) than or equal to now. * * @example * ``` * Carbon::now()->isNowOrFuture(); // true * Carbon::now()->addHours(5)->isNowOrFuture(); // true * Carbon::now()->subHours(5)->isNowOrFuture(); // false * ``` */ public function isNowOrFuture(): bool { return $this->greaterThanOrEqualTo($this->nowWithSameTz()); } /** * Determines if the instance is now or in the past, ie. less (before) than or equal to now. * * @example * ``` * Carbon::now()->isNowOrPast(); // true * Carbon::now()->subHours(5)->isNowOrPast(); // true * Carbon::now()->addHours(5)->isNowOrPast(); // false * ``` */ public function isNowOrPast(): bool { return $this->lessThanOrEqualTo($this->nowWithSameTz()); } /** * Determines if the instance is a leap year. * * @example * ``` * Carbon::parse('2020-01-01')->isLeapYear(); // true * Carbon::parse('2019-01-01')->isLeapYear(); // false * ``` */ public function isLeapYear(): bool { return $this->rawFormat('L') === '1'; } /** * Determines if the instance is a long year (using calendar year). * * ⚠️ This method completely ignores month and day to use the numeric year number, * it's not correct if the exact date matters. For instance as `2019-12-30` is already * in the first week of the 2020 year, if you want to know from this date if ISO week * year 2020 is a long year, use `isLongIsoYear` instead. * * @example * ``` * Carbon::create(2015)->isLongYear(); // true * Carbon::create(2016)->isLongYear(); // false * ``` * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates */ public function isLongYear(): bool { return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === static::WEEKS_PER_YEAR + 1; } /** * Determines if the instance is a long year (using ISO 8601 year). * * @example * ``` * Carbon::parse('2015-01-01')->isLongIsoYear(); // true * Carbon::parse('2016-01-01')->isLongIsoYear(); // true * Carbon::parse('2016-01-03')->isLongIsoYear(); // false * Carbon::parse('2019-12-29')->isLongIsoYear(); // false * Carbon::parse('2019-12-30')->isLongIsoYear(); // true * ``` * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates */ public function isLongIsoYear(): bool { return static::create($this->isoWeekYear, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53; } /** * Compares the formatted values of the two dates. * * @example * ``` * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false * ``` * * @param string $format date formats to compare. * @param DateTimeInterface|string $date instance to compare with or null to use current day. */ public function isSameAs(string $format, DateTimeInterface|string $date): bool { return $this->rawFormat($format) === $this->resolveCarbon($date)->rawFormat($format); } /** * Determines if the instance is in the current unit given. * * @example * ``` * Carbon::parse('2019-01-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // true * Carbon::parse('2018-12-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // false * ``` * * @param string $unit singular unit string * @param DateTimeInterface|string $date instance to compare with or null to use current day. * * @throws BadComparisonUnitException * * @return bool */ public function isSameUnit(string $unit, DateTimeInterface|string $date): bool { if ($unit === /* @call isSameUnit */ 'quarter') { $other = $this->resolveCarbon($date); return $other->year === $this->year && $other->quarter === $this->quarter; } $units = [ // @call isSameUnit 'year' => 'Y', // @call isSameUnit 'month' => 'Y-n', // @call isSameUnit 'week' => 'o-W', // @call isSameUnit 'day' => 'Y-m-d', // @call isSameUnit 'hour' => 'Y-m-d H', // @call isSameUnit 'minute' => 'Y-m-d H:i', // @call isSameUnit 'second' => 'Y-m-d H:i:s', // @call isSameUnit 'milli' => 'Y-m-d H:i:s.v', // @call isSameUnit 'millisecond' => 'Y-m-d H:i:s.v', // @call isSameUnit 'micro' => 'Y-m-d H:i:s.u', // @call isSameUnit 'microsecond' => 'Y-m-d H:i:s.u', ]; if (isset($units[$unit])) { return $this->isSameAs($units[$unit], $date); } if (isset($this->$unit)) { return $this->resolveCarbon($date)->$unit === $this->$unit; } if ($this->isLocalStrictModeEnabled()) { throw new BadComparisonUnitException($unit); } return false; } /** * Determines if the instance is in the current unit given. * * @example * ``` * Carbon::now()->isCurrentUnit('hour'); // true * Carbon::now()->subHours(2)->isCurrentUnit('hour'); // false * ``` * * @param string $unit The unit to test. * * @throws BadMethodCallException */ public function isCurrentUnit(string $unit): bool { return $this->{'isSame'.ucfirst($unit)}('now'); } /** * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). * * @example * ``` * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-03-01')); // true * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-04-01')); // false * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01')); // false * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01'), false); // true * ``` * * @param DateTimeInterface|string $date The instance to compare with or null to use current day. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameQuarter(DateTimeInterface|string $date, bool $ofSameYear = true): bool { $date = $this->resolveCarbon($date); return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date)); } /** * Checks if the passed in date is in the same month as the instance´s month. * * @example * ``` * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-01-01')); // true * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-02-01')); // false * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true * ``` * * @param DateTimeInterface|string $date The instance to compare with or null to use the current date. * @param bool $ofSameYear Check if it is the same month in the same year. * * @return bool */ public function isSameMonth(DateTimeInterface|string $date, bool $ofSameYear = true): bool { return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date); } /** * Checks if this day is a specific day of the week. * * @example * ``` * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::WEDNESDAY); // true * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::FRIDAY); // false * Carbon::parse('2019-07-17')->isDayOfWeek('Wednesday'); // true * Carbon::parse('2019-07-17')->isDayOfWeek('Friday'); // false * ``` * * @param int|string $dayOfWeek * * @return bool */ public function isDayOfWeek($dayOfWeek): bool { if (\is_string($dayOfWeek) && \defined($constant = static::class.'::'.strtoupper($dayOfWeek))) { $dayOfWeek = \constant($constant); } return $this->dayOfWeek === $dayOfWeek; } /** * Check if its the birthday. Compares the date/month values of the two dates. * * @example * ``` * Carbon::now()->subYears(5)->isBirthday(); // true * Carbon::now()->subYears(5)->subDay()->isBirthday(); // false * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false * ``` * * @param DateTimeInterface|string|null $date The instance to compare with or null to use current day. * * @return bool */ public function isBirthday(DateTimeInterface|string|null $date = null): bool { return $this->isSameAs('md', $date ?? 'now'); } /** * Check if today is the last day of the Month * * @example * ``` * Carbon::parse('2019-02-28')->isLastOfMonth(); // true * Carbon::parse('2019-03-28')->isLastOfMonth(); // false * Carbon::parse('2019-03-30')->isLastOfMonth(); // false * Carbon::parse('2019-03-31')->isLastOfMonth(); // true * Carbon::parse('2019-04-30')->isLastOfMonth(); // true * ``` */ public function isLastOfMonth(): bool { return $this->day === $this->daysInMonth; } /** * Check if the instance is start of a given unit (tolerating a given interval). * * @example * ``` * // Check if a date-time is the first 15 minutes of the hour it's in * Carbon::parse('2019-02-28 20:13:00')->isStartOfUnit(Unit::Hour, '15 minutes'); // true * ``` */ public function isStartOfUnit( Unit $unit, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, mixed ...$params, ): bool { $interval ??= match ($unit) { Unit::Day, Unit::Hour, Unit::Minute, Unit::Second, Unit::Millisecond, Unit::Microsecond => Unit::Microsecond, default => Unit::Day, }; $startOfUnit = $this->avoidMutation()->startOf($unit, ...$params); $startOfUnitDateTime = $startOfUnit->rawFormat('Y-m-d H:i:s.u'); $maximumDateTime = $startOfUnit ->add($interval instanceof Unit ? '1 '.$interval->value : $interval) ->rawFormat('Y-m-d H:i:s.u'); if ($maximumDateTime < $startOfUnitDateTime) { return false; } return $this->rawFormat('Y-m-d H:i:s.u') < $maximumDateTime; } /** * Check if the instance is end of a given unit (tolerating a given interval). * * @example * ``` * // Check if a date-time is the last 15 minutes of the hour it's in * Carbon::parse('2019-02-28 20:13:00')->isEndOfUnit(Unit::Hour, '15 minutes'); // false * ``` */ public function isEndOfUnit( Unit $unit, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, mixed ...$params, ): bool { $interval ??= match ($unit) { Unit::Day, Unit::Hour, Unit::Minute, Unit::Second, Unit::Millisecond, Unit::Microsecond => Unit::Microsecond, default => Unit::Day, }; $endOfUnit = $this->avoidMutation()->endOf($unit, ...$params); $endOfUnitDateTime = $endOfUnit->rawFormat('Y-m-d H:i:s.u'); $minimumDateTime = $endOfUnit ->sub($interval instanceof Unit ? '1 '.$interval->value : $interval) ->rawFormat('Y-m-d H:i:s.u'); if ($minimumDateTime > $endOfUnitDateTime) { return false; } return $this->rawFormat('Y-m-d H:i:s.u') > $minimumDateTime; } /** * Determines if the instance is start of millisecond (first microsecond by default but interval can be customized). */ public function isStartOfMillisecond( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Millisecond, $interval); } /** * Determines if the instance is end of millisecond (last microsecond by default but interval can be customized). */ public function isEndOfMillisecond( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Millisecond, $interval); } /** * Determines if the instance is start of second (first microsecond by default but interval can be customized). */ public function isStartOfSecond( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Second, $interval); } /** * Determines if the instance is end of second (last microsecond by default but interval can be customized). */ public function isEndOfSecond( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Second, $interval); } /** * Determines if the instance is start of minute (first microsecond by default but interval can be customized). */ public function isStartOfMinute( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Minute, $interval); } /** * Determines if the instance is end of minute (last microsecond by default but interval can be customized). */ public function isEndOfMinute( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Minute, $interval); } /** * Determines if the instance is start of hour (first microsecond by default but interval can be customized). */ public function isStartOfHour( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Hour, $interval); } /** * Determines if the instance is end of hour (last microsecond by default but interval can be customized). */ public function isEndOfHour( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Hour, $interval); } /** * Check if the instance is start of day / midnight. * * @example * ``` * Carbon::parse('2019-02-28 00:00:00')->isStartOfDay(); // true * Carbon::parse('2019-02-28 00:00:00.999999')->isStartOfDay(); // true * Carbon::parse('2019-02-28 00:00:01')->isStartOfDay(); // false * Carbon::parse('2019-02-28 00:00:00.000000')->isStartOfDay(true); // true * Carbon::parse('2019-02-28 00:00:00.000012')->isStartOfDay(true); // false * ``` * * @param bool $checkMicroseconds check time at microseconds precision * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision * for instance with "15 minutes", it checks if current date-time * is in the last 15 minutes of the day, with Unit::Hour, it * checks if it's in the last hour of the day. */ public function isStartOfDay( Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { if ($checkMicroseconds === true) { @trigger_error( "Since 3.8.0, it's deprecated to use \$checkMicroseconds.\n". "It will be removed in 4.0.0.\n". "Instead, you should use either isStartOfDay(interval: Unit::Microsecond) or isStartOfDay(interval: Unit::Second)\n". 'And you can now use any custom interval as precision, such as isStartOfDay(interval: "15 minutes")', \E_USER_DEPRECATED, ); } if ($interval === null && !\is_bool($checkMicroseconds)) { $interval = $checkMicroseconds; } if ($interval !== null) { if ($interval instanceof Unit) { $interval = '1 '.$interval->value; } $date = $this->rawFormat('Y-m-d'); $time = $this->rawFormat('H:i:s.u'); $maximum = $this->avoidMutation()->startOfDay()->add($interval); $maximumDate = $maximum->rawFormat('Y-m-d'); if ($date === $maximumDate) { return $time < $maximum->rawFormat('H:i:s.u'); } return $maximumDate > $date; } /* @var CarbonInterface $this */ return $checkMicroseconds ? $this->rawFormat('H:i:s.u') === '00:00:00.000000' : $this->rawFormat('H:i:s') === '00:00:00'; } /** * Check if the instance is end of day. * * @example * ``` * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(); // true * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(); // true * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(); // true * Carbon::parse('2019-02-28 23:59:58.999999')->isEndOfDay(); // false * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(true); // true * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(true); // false * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(true); // false * ``` * * @param bool $checkMicroseconds check time at microseconds precision * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision * for instance with "15 minutes", it checks if current date-time * is in the last 15 minutes of the day, with Unit::Hour, it * checks if it's in the last hour of the day. */ public function isEndOfDay( Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { if ($checkMicroseconds === true) { @trigger_error( "Since 3.8.0, it's deprecated to use \$checkMicroseconds.\n". "It will be removed in 4.0.0.\n". "Instead, you should use either isEndOfDay(interval: Unit::Microsecond) or isEndOfDay(interval: Unit::Second)\n". 'And you can now use any custom interval as precision, such as isEndOfDay(interval: "15 minutes")', \E_USER_DEPRECATED, ); } if ($interval === null && !\is_bool($checkMicroseconds)) { $interval = $checkMicroseconds; } if ($interval !== null) { $date = $this->rawFormat('Y-m-d'); $time = $this->rawFormat('H:i:s.u'); $minimum = $this->avoidMutation() ->endOfDay() ->sub($interval instanceof Unit ? '1 '.$interval->value : $interval); $minimumDate = $minimum->rawFormat('Y-m-d'); if ($date === $minimumDate) { return $time > $minimum->rawFormat('H:i:s.u'); } return $minimumDate < $date; } /* @var CarbonInterface $this */ return $checkMicroseconds ? $this->rawFormat('H:i:s.u') === '23:59:59.999999' : $this->rawFormat('H:i:s') === '23:59:59'; } /** * Determines if the instance is start of week (first day by default but interval can be customized). * * @example * ``` * Carbon::parse('2024-08-31')->startOfWeek()->isStartOfWeek(); // true * Carbon::parse('2024-08-31')->isStartOfWeek(); // false * ``` */ public function isStartOfWeek( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, WeekDay|int|null $weekStartsAt = null, ): bool { return $this->isStartOfUnit(Unit::Week, $interval, $weekStartsAt); } /** * Determines if the instance is end of week (last day by default but interval can be customized). * * @example * ``` * Carbon::parse('2024-08-31')->endOfWeek()->isEndOfWeek(); // true * Carbon::parse('2024-08-31')->isEndOfWeek(); // false * ``` */ public function isEndOfWeek( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, WeekDay|int|null $weekEndsAt = null, ): bool { return $this->isEndOfUnit(Unit::Week, $interval, $weekEndsAt); } /** * Determines if the instance is start of month (first day by default but interval can be customized). */ public function isStartOfMonth( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Month, $interval); } /** * Determines if the instance is end of month (last day by default but interval can be customized). */ public function isEndOfMonth( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Month, $interval); } /** * Determines if the instance is start of quarter (first day by default but interval can be customized). */ public function isStartOfQuarter( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Quarter, $interval); } /** * Determines if the instance is end of quarter (last day by default but interval can be customized). */ public function isEndOfQuarter( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Quarter, $interval); } /** * Determines if the instance is start of year (first day by default but interval can be customized). */ public function isStartOfYear( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Year, $interval); } /** * Determines if the instance is end of year (last day by default but interval can be customized). */ public function isEndOfYear( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Year, $interval); } /** * Determines if the instance is start of decade (first day by default but interval can be customized). */ public function isStartOfDecade( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Decade, $interval); } /** * Determines if the instance is end of decade (last day by default but interval can be customized). */ public function isEndOfDecade( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Decade, $interval); } /** * Determines if the instance is start of century (first day by default but interval can be customized). */ public function isStartOfCentury( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Century, $interval); } /** * Determines if the instance is end of century (last day by default but interval can be customized). */ public function isEndOfCentury( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Century, $interval); } /** * Determines if the instance is start of millennium (first day by default but interval can be customized). */ public function isStartOfMillennium( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isStartOfUnit(Unit::Millennium, $interval); } /** * Determines if the instance is end of millennium (last day by default but interval can be customized). */ public function isEndOfMillennium( Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, ): bool { return $this->isEndOfUnit(Unit::Millennium, $interval); } /** * Check if the instance is start of day / midnight. * * @example * ``` * Carbon::parse('2019-02-28 00:00:00')->isMidnight(); // true * Carbon::parse('2019-02-28 00:00:00.999999')->isMidnight(); // true * Carbon::parse('2019-02-28 00:00:01')->isMidnight(); // false * ``` */ public function isMidnight(): bool { return $this->isStartOfDay(); } /** * Check if the instance is midday. * * @example * ``` * Carbon::parse('2019-02-28 11:59:59.999999')->isMidday(); // false * Carbon::parse('2019-02-28 12:00:00')->isMidday(); // true * Carbon::parse('2019-02-28 12:00:00.999999')->isMidday(); // true * Carbon::parse('2019-02-28 12:00:01')->isMidday(); // false * ``` */ public function isMidday(): bool { /* @var CarbonInterface $this */ return $this->rawFormat('G:i:s') === static::$midDayAt.':00:00'; } /** * Checks if the (date)time string is in a given format. * * @example * ``` * Carbon::hasFormat('11:12:45', 'h:i:s'); // true * Carbon::hasFormat('13:12:45', 'h:i:s'); // false * ``` */ public static function hasFormat(string $date, string $format): bool { return FactoryImmutable::getInstance()->hasFormat($date, $format); } /** * Checks if the (date)time string is in a given format. * * @example * ``` * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false * ``` * * @param string $date * @param string $format * * @return bool */ public static function hasFormatWithModifiers(?string $date, string $format): bool { return FactoryImmutable::getInstance()->hasFormatWithModifiers($date, $format); } /** * Checks if the (date)time string is in a given format and valid to create a * new instance. * * @example * ``` * Carbon::canBeCreatedFromFormat('11:12:45', 'h:i:s'); // true * Carbon::canBeCreatedFromFormat('13:12:45', 'h:i:s'); // false * ``` */ public static function canBeCreatedFromFormat(?string $date, string $format): bool { if ($date === null) { return false; } try { // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string // doesn't match the format in any way. if (!static::rawCreateFromFormat($format, $date)) { return false; } } catch (InvalidArgumentException) { return false; } return static::hasFormatWithModifiers($date, $format); } /** * Returns true if the current date matches the given string. * * @example * ``` * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false * ``` * * @param string $tester day name, month name, hour, date, etc. as string */ public function is(WeekDay|Month|string $tester): bool { if ($tester instanceof BackedEnum) { $tester = $tester->name; } $tester = trim($tester); if (preg_match('/^\d+$/', $tester)) { return $this->year === (int) $tester; } if (preg_match('/^(?:Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)$/i', $tester)) { return $this->isSameMonth( $this->transmitFactory(static fn () => static::parse("$tester 1st")), false, ); } if (preg_match('/^\d{3,}-\d{1,2}$/', $tester)) { return $this->isSameMonth( $this->transmitFactory(static fn () => static::parse($tester)), ); } if (preg_match('/^(\d{1,2})-(\d{1,2})$/', $tester, $match)) { return $this->month === (int) $match[1] && $this->day === (int) $match[2]; } $modifier = preg_replace('/(\d)h$/i', '$1:00', $tester); /* @var CarbonInterface $max */ $median = $this->transmitFactory(static fn () => static::parse('5555-06-15 12:30:30.555555')) ->modify($modifier); $current = $this->avoidMutation(); /* @var CarbonInterface $other */ $other = $this->avoidMutation()->modify($modifier); if ($current->eq($other)) { return true; } if (preg_match('/\d:\d{1,2}:\d{1,2}$/', $tester)) { return $current->startOfSecond()->eq($other); } if (preg_match('/\d:\d{1,2}$/', $tester)) { return $current->startOfMinute()->eq($other); } if (preg_match('/\d(?:h|am|pm)$/', $tester)) { return $current->startOfHour()->eq($other); } if (preg_match( '/^(?:january|february|march|april|may|june|july|august|september|october|november|december)(?:\s+\d+)?$/i', $tester, )) { return $current->startOfMonth()->eq($other->startOfMonth()); } $units = [ 'month' => [1, 'year'], 'day' => [1, 'month'], 'hour' => [0, 'day'], 'minute' => [0, 'hour'], 'second' => [0, 'minute'], 'microsecond' => [0, 'second'], ]; foreach ($units as $unit => [$minimum, $startUnit]) { if ($minimum === $median->$unit) { $current = $current->startOf($startUnit); break; } } return $current->eq($other); } /** * Returns true if the date was created using CarbonImmutable::startOfTime() * * @return bool */ public function isStartOfTime(): bool { return $this->startOfTime ?? false; } /** * Returns true if the date was created using CarbonImmutable::endOfTime() * * @return bool */ public function isEndOfTime(): bool { return $this->endOfTime ?? false; } } ================================================ FILE: src/Carbon/Traits/Converter.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\CarbonPeriodImmutable; use Carbon\Exceptions\UnitException; use Closure; use DateTime; use DateTimeImmutable; use DateTimeInterface; /** * Trait Converter. * * Change date into different string formats and types and * handle the string cast. * * Depends on the following methods: * * @method static copy() */ trait Converter { use ToStringFormat; /** * Returns the formatted date string on success or FALSE on failure. * * @see https://php.net/manual/en/datetime.format.php */ public function format(string $format): string { $function = $this->localFormatFunction ?? $this->getFactory()->getSettings()['formatFunction'] ?? static::$formatFunction; if (!$function) { return $this->rawFormat($format); } if (\is_string($function) && method_exists($this, $function)) { $function = [$this, $function]; } return $function(...\func_get_args()); } /** * @see https://php.net/manual/en/datetime.format.php */ public function rawFormat(string $format): string { return parent::format($format); } /** * Format the instance as a string using the set format * * @example * ``` * echo Carbon::now(); // Carbon instances can be cast to string * ``` */ public function __toString(): string { $format = $this->localToStringFormat ?? $this->getFactory()->getSettings()['toStringFormat'] ?? null; return $format instanceof Closure ? $format($this) : $this->rawFormat($format ?: ( \defined('static::DEFAULT_TO_STRING_FORMAT') ? static::DEFAULT_TO_STRING_FORMAT : CarbonInterface::DEFAULT_TO_STRING_FORMAT )); } /** * Format the instance as date * * @example * ``` * echo Carbon::now()->toDateString(); * ``` */ public function toDateString(): string { return $this->rawFormat('Y-m-d'); } /** * Format the instance as a readable date * * @example * ``` * echo Carbon::now()->toFormattedDateString(); * ``` */ public function toFormattedDateString(): string { return $this->rawFormat('M j, Y'); } /** * Format the instance with the day, and a readable date * * @example * ``` * echo Carbon::now()->toFormattedDayDateString(); * ``` */ public function toFormattedDayDateString(): string { return $this->rawFormat('D, M j, Y'); } /** * Format the instance as time * * @example * ``` * echo Carbon::now()->toTimeString(); * ``` */ public function toTimeString(string $unitPrecision = 'second'): string { return $this->rawFormat(static::getTimeFormatByPrecision($unitPrecision)); } /** * Format the instance as date and time * * @example * ``` * echo Carbon::now()->toDateTimeString(); * ``` */ public function toDateTimeString(string $unitPrecision = 'second'): string { return $this->rawFormat('Y-m-d '.static::getTimeFormatByPrecision($unitPrecision)); } /** * Return a format from H:i to H:i:s.u according to given unit precision. * * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" */ public static function getTimeFormatByPrecision(string $unitPrecision): string { return match (static::singularUnit($unitPrecision)) { 'minute' => 'H:i', 'second' => 'H:i:s', 'm', 'millisecond' => 'H:i:s.v', 'µ', 'microsecond' => 'H:i:s.u', default => throw new UnitException('Precision unit expected among: minute, second, millisecond and microsecond.'), }; } /** * Format the instance as date and time T-separated with no timezone * * @example * ``` * echo Carbon::now()->toDateTimeLocalString(); * echo "\n"; * echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond * ``` */ public function toDateTimeLocalString(string $unitPrecision = 'second'): string { return $this->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision)); } /** * Format the instance with day, date and time * * @example * ``` * echo Carbon::now()->toDayDateTimeString(); * ``` */ public function toDayDateTimeString(): string { return $this->rawFormat('D, M j, Y g:i A'); } /** * Format the instance as ATOM * * @example * ``` * echo Carbon::now()->toAtomString(); * ``` */ public function toAtomString(): string { return $this->rawFormat(DateTime::ATOM); } /** * Format the instance as COOKIE * * @example * ``` * echo Carbon::now()->toCookieString(); * ``` */ public function toCookieString(): string { return $this->rawFormat(DateTimeInterface::COOKIE); } /** * Format the instance as ISO8601 * * @example * ``` * echo Carbon::now()->toIso8601String(); * ``` */ public function toIso8601String(): string { return $this->toAtomString(); } /** * Format the instance as RFC822 * * @example * ``` * echo Carbon::now()->toRfc822String(); * ``` */ public function toRfc822String(): string { return $this->rawFormat(DateTimeInterface::RFC822); } /** * Convert the instance to UTC and return as Zulu ISO8601 * * @example * ``` * echo Carbon::now()->toIso8601ZuluString(); * ``` */ public function toIso8601ZuluString(string $unitPrecision = 'second'): string { return $this->avoidMutation() ->utc() ->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision).'\Z'); } /** * Format the instance as RFC850 * * @example * ``` * echo Carbon::now()->toRfc850String(); * ``` */ public function toRfc850String(): string { return $this->rawFormat(DateTimeInterface::RFC850); } /** * Format the instance as RFC1036 * * @example * ``` * echo Carbon::now()->toRfc1036String(); * ``` */ public function toRfc1036String(): string { return $this->rawFormat(DateTimeInterface::RFC1036); } /** * Format the instance as RFC1123 * * @example * ``` * echo Carbon::now()->toRfc1123String(); * ``` */ public function toRfc1123String(): string { return $this->rawFormat(DateTimeInterface::RFC1123); } /** * Format the instance as RFC2822 * * @example * ``` * echo Carbon::now()->toRfc2822String(); * ``` */ public function toRfc2822String(): string { return $this->rawFormat(DateTimeInterface::RFC2822); } /** * Format the instance as RFC3339. * * @example * ``` * echo Carbon::now()->toRfc3339String() . "\n"; * echo Carbon::now()->toRfc3339String(true) . "\n"; * ``` */ public function toRfc3339String(bool $extended = false): string { return $this->rawFormat($extended ? DateTimeInterface::RFC3339_EXTENDED : DateTimeInterface::RFC3339); } /** * Format the instance as RSS * * @example * ``` * echo Carbon::now()->toRssString(); * ``` */ public function toRssString(): string { return $this->rawFormat(DateTimeInterface::RSS); } /** * Format the instance as W3C * * @example * ``` * echo Carbon::now()->toW3cString(); * ``` */ public function toW3cString(): string { return $this->rawFormat(DateTimeInterface::W3C); } /** * Format the instance as RFC7231 * * @example * ``` * echo Carbon::now()->toRfc7231String(); * ``` */ public function toRfc7231String(): string { return $this->avoidMutation() ->setTimezone('GMT') ->rawFormat(\defined('static::RFC7231_FORMAT') ? static::RFC7231_FORMAT : CarbonInterface::RFC7231_FORMAT); } /** * Get default array representation. * * @example * ``` * var_dump(Carbon::now()->toArray()); * ``` */ public function toArray(): array { return [ 'year' => $this->year, 'month' => $this->month, 'day' => $this->day, 'dayOfWeek' => $this->dayOfWeek, 'dayOfYear' => $this->dayOfYear, 'hour' => $this->hour, 'minute' => $this->minute, 'second' => $this->second, 'micro' => $this->micro, 'timestamp' => $this->timestamp, 'formatted' => $this->rawFormat(\defined('static::DEFAULT_TO_STRING_FORMAT') ? static::DEFAULT_TO_STRING_FORMAT : CarbonInterface::DEFAULT_TO_STRING_FORMAT), 'timezone' => $this->timezone, ]; } /** * Get default object representation. * * @example * ``` * var_dump(Carbon::now()->toObject()); * ``` */ public function toObject(): object { return (object) $this->toArray(); } /** * Returns english human-readable complete date string. * * @example * ``` * echo Carbon::now()->toString(); * ``` */ public function toString(): string { return $this->avoidMutation()->locale('en')->isoFormat('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } /** * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: * 1977-04-22T01:00:00-05:00). * * @example * ``` * echo Carbon::now('America/Toronto')->toISOString() . "\n"; * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; * ``` * * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. */ public function toISOString(bool $keepOffset = false): ?string { if (!$this->isValid()) { return null; } $yearFormat = $this->year < 0 || $this->year > 9999 ? 'YYYYYY' : 'YYYY'; $timezoneFormat = $keepOffset ? 'Z' : '[Z]'; $date = $keepOffset ? $this : $this->avoidMutation()->utc(); return $date->isoFormat("$yearFormat-MM-DD[T]HH:mm:ss.SSSSSS$timezoneFormat"); } /** * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. * * @example * ``` * echo Carbon::now('America/Toronto')->toJSON(); * ``` */ public function toJSON(): ?string { return $this->toISOString(); } /** * Return native DateTime PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDateTime()); * ``` */ public function toDateTime(): DateTime { return DateTime::createFromFormat('U.u', $this->rawFormat('U.u')) ->setTimezone($this->getTimezone()); } /** * Return native toDateTimeImmutable PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDateTimeImmutable()); * ``` */ public function toDateTimeImmutable(): DateTimeImmutable { return DateTimeImmutable::createFromFormat('U.u', $this->rawFormat('U.u')) ->setTimezone($this->getTimezone()); } /** * @alias toDateTime * * Return native DateTime PHP object matching the current instance. * * @example * ``` * var_dump(Carbon::now()->toDate()); * ``` */ public function toDate(): DateTime { return $this->toDateTime(); } /** * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). * * @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit * @param string|null $unit if specified, $interval must be an integer */ public function toPeriod($end = null, $interval = null, $unit = null): CarbonPeriod { if ($unit) { $interval = CarbonInterval::make("$interval ".static::pluralUnit($unit)); } $isDefaultInterval = !$interval; $interval ??= CarbonInterval::day(); $class = $this->isMutable() ? CarbonPeriod::class : CarbonPeriodImmutable::class; if (\is_int($end) || (\is_string($end) && ctype_digit($end))) { $end = (int) $end; } $end ??= 1; if (!\is_int($end)) { $end = $this->resolveCarbon($end); } return new $class( raw: [$this, CarbonInterval::make($interval), $end], dateClass: static::class, isDefaultInterval: $isDefaultInterval, ); } /** * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). * * @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit * @param string|null $unit if specified, $interval must be an integer */ public function range($end = null, $interval = null, $unit = null): CarbonPeriod { return $this->toPeriod($end, $interval, $unit); } } ================================================ FILE: src/Carbon/Traits/Creator.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidTimeZoneException; use Carbon\Exceptions\OutOfRangeException; use Carbon\Exceptions\UnitException; use Carbon\Month; use Carbon\Translator; use Carbon\WeekDay; use Closure; use DateMalformedStringException; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Exception; use ReturnTypeWillChange; use Symfony\Contracts\Translation\TranslatorInterface; /** * Trait Creator. * * Static creators. * * Depends on the following methods: * * @method static Carbon|CarbonImmutable getTestNow() */ trait Creator { use ObjectInitialisation; use LocalFactory; /** * The errors that can occur. */ protected static array|bool $lastErrors = false; /** * Create a new Carbon instance. * * Please see the testing aids section (specifically static::setTestNow()) * for more on the possibility of this constructor returning a test instance. * * @throws InvalidFormatException */ public function __construct( DateTimeInterface|WeekDay|Month|string|int|float|null $time = null, DateTimeZone|string|int|null $timezone = null, ) { $this->initLocalFactory(); if ($time instanceof Month) { $time = $time->name.' 1'; } elseif ($time instanceof WeekDay) { $time = $time->name; } elseif ($time instanceof DateTimeInterface) { $time = $this->constructTimezoneFromDateTime($time, $timezone)->format('Y-m-d H:i:s.u'); } if (\is_string($time) && str_starts_with($time, '@')) { $time = static::createFromTimestampUTC(substr($time, 1))->format('Y-m-d\TH:i:s.uP'); } elseif (is_numeric($time) && (!\is_string($time) || !preg_match('/^\d{1,14}$/', $time))) { $time = static::createFromTimestampUTC($time)->format('Y-m-d\TH:i:s.uP'); } // If the class has a test now set, and we are trying to create a now() // instance then override as required $isNow = \in_array($time, [null, '', 'now'], true); $timezone = static::safeCreateDateTimeZone($timezone) ?? null; if ( ($this->clock || ( method_exists(static::class, 'hasTestNow') && method_exists(static::class, 'getTestNow') && static::hasTestNow() )) && ($isNow || static::hasRelativeKeywords($time)) ) { $this->mockConstructorParameters($time, $timezone); } try { parent::__construct($time ?? 'now', $timezone); } catch (Exception $exception) { throw new InvalidFormatException($exception->getMessage(), 0, $exception); } $this->constructedObjectId = spl_object_hash($this); self::setLastErrors(parent::getLastErrors()); } /** * Get timezone from a datetime instance. */ private function constructTimezoneFromDateTime( DateTimeInterface $date, DateTimeZone|string|int|null &$timezone, ): DateTimeInterface { if ($timezone !== null) { $safeTz = static::safeCreateDateTimeZone($timezone); if ($safeTz) { $date = ($date instanceof DateTimeImmutable ? $date : clone $date)->setTimezone($safeTz); } return $date; } $timezone = $date->getTimezone(); return $date; } /** * Update constructedObjectId on cloned. */ public function __clone(): void { $this->constructedObjectId = spl_object_hash($this); } /** * Create a Carbon instance from a DateTime one. */ public static function instance(DateTimeInterface $date): static { if ($date instanceof static) { return clone $date; } $instance = parent::createFromFormat('U.u', $date->format('U.u')) ->setTimezone($date->getTimezone()); if ($date instanceof CarbonInterface) { $settings = $date->getSettings(); if (!$date->hasLocalTranslator()) { unset($settings['locale']); } $instance->settings($settings); } return $instance; } /** * Create a carbon instance from a string. * * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * * @throws InvalidFormatException */ public static function rawParse( DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null, ): static { if ($time instanceof DateTimeInterface) { return static::instance($time); } try { return new static($time, $timezone); } catch (Exception $exception) { // @codeCoverageIgnoreStart try { $date = @static::now($timezone)->change($time); } catch (DateMalformedStringException|InvalidFormatException) { $date = null; } // @codeCoverageIgnoreEnd return $date ?? throw new InvalidFormatException("Could not parse '$time': ".$exception->getMessage(), 0, $exception); } } /** * Create a carbon instance from a string. * * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather * than (new Carbon('Monday next week'))->fn(). * * @throws InvalidFormatException */ public static function parse( DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null, ): static { $function = static::$parseFunction; if (!$function) { return static::rawParse($time, $timezone); } if (\is_string($function) && method_exists(static::class, $function)) { $function = [static::class, $function]; } return $function(...\func_get_args()); } /** * Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). * * @param string $time date/time string in the given language (may also contain English). * @param string|null $locale if locale is null or not specified, current global locale will be * used instead. * @param DateTimeZone|string|int|null $timezone optional timezone for the new instance. * * @throws InvalidFormatException */ public static function parseFromLocale( string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null, ): static { return static::rawParse(static::translateTimeString($time, $locale, static::DEFAULT_LOCALE), $timezone); } /** * Get a Carbon instance for the current date and time. */ public static function now(DateTimeZone|string|int|null $timezone = null): static { return new static(null, $timezone); } /** * Create a Carbon instance for today. */ public static function today(DateTimeZone|string|int|null $timezone = null): static { return static::rawParse('today', $timezone); } /** * Create a Carbon instance for tomorrow. */ public static function tomorrow(DateTimeZone|string|int|null $timezone = null): static { return static::rawParse('tomorrow', $timezone); } /** * Create a Carbon instance for yesterday. */ public static function yesterday(DateTimeZone|string|int|null $timezone = null): static { return static::rawParse('yesterday', $timezone); } private static function assertBetween($unit, $value, $min, $max): void { if (static::isStrictModeEnabled() && ($value < $min || $value > $max)) { throw new OutOfRangeException($unit, $min, $max, $value); } } private static function createNowInstance($timezone) { if (!static::hasTestNow()) { return static::now($timezone); } $now = static::getTestNow(); if ($now instanceof Closure) { return $now(static::now($timezone)); } $now = $now->avoidMutation(); return $timezone === null ? $now : $now->setTimezone($timezone); } /** * Create a new Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values will * be used. * * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * * If $hour is not null then the default values for $minute and $second * will be 0. * * @param DateTimeInterface|string|int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null): ?static { $month = self::monthToInt($month); if ((\is_string($year) && !is_numeric($year)) || $year instanceof DateTimeInterface) { return static::parse($year, $timezone ?? (\is_string($month) || $month instanceof DateTimeZone ? $month : null)); } $defaults = null; $getDefault = function ($unit) use ($timezone, &$defaults) { if ($defaults === null) { $now = self::createNowInstance($timezone); $defaults = array_combine([ 'year', 'month', 'day', 'hour', 'minute', 'second', ], explode('-', $now->rawFormat('Y-n-j-G-i-s.u'))); } return $defaults[$unit]; }; $year = $year ?? $getDefault('year'); $month = $month ?? $getDefault('month'); $day = $day ?? $getDefault('day'); $hour = $hour ?? $getDefault('hour'); $minute = $minute ?? $getDefault('minute'); $second = (float) ($second ?? $getDefault('second')); self::assertBetween('month', $month, 0, 99); self::assertBetween('day', $day, 0, 99); self::assertBetween('hour', $hour, 0, 99); self::assertBetween('minute', $minute, 0, 99); self::assertBetween('second', $second, 0, 99); $fixYear = null; if ($year < 0) { $fixYear = $year; $year = 0; } elseif ($year > 9999) { $fixYear = $year - 9999; $year = 9999; } $second = ($second < 10 ? '0' : '').number_format($second, 6); $instance = static::rawCreateFromFormat('!Y-n-j G:i:s.u', \sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $timezone); if ($instance && $fixYear !== null) { $instance = $instance->addYears($fixYear); } return $instance ?? null; } /** * Create a new safe Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values will * be used. * * If $hour is null it will be set to its now() value and the default * values for $minute and $second will be their now() values. * * If $hour is not null then the default values for $minute and $second * will be 0. * * If one of the set values is not valid, an InvalidDateException * will be thrown. * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidDateException * * @return static|null */ public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null): ?static { $month = self::monthToInt($month); $fields = static::getRangesByUnit(); foreach ($fields as $field => $range) { if ($$field !== null && (!\is_int($$field) || $$field < $range[0] || $$field > $range[1])) { if (static::isStrictModeEnabled()) { throw new InvalidDateException($field, $$field); } return null; } } $instance = static::create($year, $month, $day, $hour, $minute, $second, $timezone); foreach (array_reverse($fields) as $field => $range) { if ($$field !== null && (!\is_int($$field) || $$field !== $instance->$field)) { if (static::isStrictModeEnabled()) { throw new InvalidDateException($field, $$field); } return null; } } return $instance; } /** * Create a new Carbon instance from a specific date and time using strict validation. * * @see create() * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null): static { $initialStrictMode = static::isStrictModeEnabled(); static::useStrictMode(true); try { $date = static::create($year, $month, $day, $hour, $minute, $second, $timezone); } finally { static::useStrictMode($initialStrictMode); } return $date; } /** * Create a Carbon instance from just a date. The time portion is set to now. * * @param int|null $year * @param int|null $month * @param int|null $day * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createFromDate($year = null, $month = null, $day = null, $timezone = null) { return static::create($year, $month, $day, null, null, null, $timezone); } /** * Create a Carbon instance from just a date. The time portion is set to midnight. * * @param int|null $year * @param int|null $month * @param int|null $day * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createMidnightDate($year = null, $month = null, $day = null, $timezone = null) { return static::create($year, $month, $day, 0, 0, 0, $timezone); } /** * Create a Carbon instance from just a time. The date portion is set to today. * * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static */ public static function createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null): static { return static::create(null, null, null, $hour, $minute, $second, $timezone); } /** * Create a Carbon instance from a time string. The date portion is set to today. * * @throws InvalidFormatException */ public static function createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null): static { return static::today($timezone)->setTimeFromTimeString($time); } private static function createFromFormatAndTimezone( string $format, string $time, DateTimeZone|string|int|null $originalTimezone, ): ?DateTimeInterface { if ($originalTimezone === null) { return parent::createFromFormat($format, $time) ?: null; } $timezone = \is_int($originalTimezone) ? self::getOffsetTimezone($originalTimezone) : $originalTimezone; $timezone = static::safeCreateDateTimeZone($timezone, $originalTimezone); return parent::createFromFormat($format, $time, $timezone) ?: null; } private static function getOffsetTimezone(int $offset): string { $minutes = (int) ($offset * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE); return @timezone_name_from_abbr('', $minutes, 1) ?: throw new InvalidTimeZoneException( "Invalid offset timezone $offset", ); } /** * Create a Carbon instance from a specific format. * * @param string $format Datetime format * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function rawCreateFromFormat(string $format, string $time, $timezone = null): ?static { // Work-around for https://bugs.php.net/bug.php?id=80141 $format = preg_replace('/(?getTimezone(); } $mock = $mock->copy(); // Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag. if (!preg_match("/{$nonEscaped}[!|]/", $format)) { if (preg_match('/[HhGgisvuB]/', $format)) { $mock = $mock->setTime(0, 0); } $format = static::MOCK_DATETIME_FORMAT.' '.$format; $time = ($mock instanceof self ? $mock->rawFormat(static::MOCK_DATETIME_FORMAT) : $mock->format(static::MOCK_DATETIME_FORMAT)).' '.$time; } // Regenerate date from the modified format to base result on the mocked instance instead of now. $date = self::createFromFormatAndTimezone($format, $time, $timezone); } if ($date instanceof DateTimeInterface) { $instance = static::instance($date); $instance::setLastErrors($lastErrors); return $instance; } if (static::isStrictModeEnabled()) { throw new InvalidFormatException(implode(PHP_EOL, (array) $lastErrors['errors'])); } return null; } /** * Create a Carbon instance from a specific format. * * @param string $format Datetime format * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ #[ReturnTypeWillChange] public static function createFromFormat($format, $time, $timezone = null): ?static { $function = static::$createFromFormatFunction; // format is a single numeric unit if (\is_int($time) && \in_array(ltrim($format, '!'), ['U', 'Y', 'y', 'X', 'x', 'm', 'n', 'd', 'j', 'w', 'W', 'H', 'h', 'G', 'g', 'i', 's', 'u', 'z', 'v'], true)) { $time = (string) $time; } if (!\is_string($time)) { @trigger_error( 'createFromFormat() $time parameter will only accept string or integer for 1-letter format representing a numeric unit in the next version', \E_USER_DEPRECATED, ); $time = (string) $time; } if (!$function) { return static::rawCreateFromFormat($format, $time, $timezone); } if (\is_string($function) && method_exists(static::class, $function)) { $function = [static::class, $function]; } return $function(...\func_get_args()); } /** * Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). * * @param string $format Datetime format * @param string $time * @param DateTimeZone|string|int|null $timezone optional timezone * @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use) * @param TranslatorInterface|null $translator optional custom translator to use for macro-formats * * @throws InvalidFormatException * * @return static|null */ public static function createFromIsoFormat( string $format, string $time, $timezone = null, ?string $locale = CarbonInterface::DEFAULT_LOCALE, ?TranslatorInterface $translator = null ): ?static { $format = preg_replace_callback('/(? static::getTranslationMessageWith($translator, 'formats.LT', $locale), 'LTS' => static::getTranslationMessageWith($translator, 'formats.LTS', $locale), 'L' => static::getTranslationMessageWith($translator, 'formats.L', $locale), 'LL' => static::getTranslationMessageWith($translator, 'formats.LL', $locale), 'LLL' => static::getTranslationMessageWith($translator, 'formats.LLL', $locale), 'LLLL' => static::getTranslationMessageWith($translator, 'formats.LLLL', $locale), ]; } return $formats[$code] ?? preg_replace_callback( '/MMMM|MM|DD|dddd/', static fn (array $code) => mb_substr($code[0], 1), $formats[strtoupper($code)] ?? '', ); }, $format); $format = preg_replace_callback('/(? 'd', 'OM' => 'M', 'OY' => 'Y', 'OH' => 'G', 'Oh' => 'g', 'Om' => 'i', 'Os' => 's', 'D' => 'd', 'DD' => 'd', 'Do' => 'd', 'd' => '!', 'dd' => '!', 'ddd' => 'D', 'dddd' => 'D', 'DDD' => 'z', 'DDDD' => 'z', 'DDDo' => 'z', 'e' => '!', 'E' => '!', 'H' => 'G', 'HH' => 'H', 'h' => 'g', 'hh' => 'h', 'k' => 'G', 'kk' => 'G', 'hmm' => 'gi', 'hmmss' => 'gis', 'Hmm' => 'Gi', 'Hmmss' => 'Gis', 'm' => 'i', 'mm' => 'i', 'a' => 'a', 'A' => 'a', 's' => 's', 'ss' => 's', 'S' => '*', 'SS' => '*', 'SSS' => '*', 'SSSS' => '*', 'SSSSS' => '*', 'SSSSSS' => 'u', 'SSSSSSS' => 'u*', 'SSSSSSSS' => 'u*', 'SSSSSSSSS' => 'u*', 'M' => 'm', 'MM' => 'm', 'MMM' => 'M', 'MMMM' => 'M', 'Mo' => 'm', 'Q' => '!', 'Qo' => '!', 'G' => '!', 'GG' => '!', 'GGG' => '!', 'GGGG' => '!', 'GGGGG' => '!', 'g' => '!', 'gg' => '!', 'ggg' => '!', 'gggg' => '!', 'ggggg' => '!', 'W' => '!', 'WW' => '!', 'Wo' => '!', 'w' => '!', 'ww' => '!', 'wo' => '!', 'x' => 'U???', 'X' => 'U', 'Y' => 'Y', 'YY' => 'y', 'YYYY' => 'Y', 'YYYYY' => 'Y', 'YYYYYY' => 'Y', 'z' => 'e', 'zz' => 'e', 'Z' => 'e', 'ZZ' => 'e', ]; } $format = $replacements[$code] ?? '?'; if ($format === '!') { throw new InvalidFormatException("Format $code not supported for creation."); } return $format; }, $format); return static::rawCreateFromFormat($format, $time, $timezone); } /** * Create a Carbon instance from a specific format and a string in a given language. * * @param string $format Datetime format * @param string $locale * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null): ?static { $format = preg_replace_callback( '/(?:\\\\[a-zA-Z]|[bfkqCEJKQRV]){2,}/', static function (array $match) use ($locale): string { $word = str_replace('\\', '', $match[0]); $translatedWord = static::translateTimeString($word, $locale, static::DEFAULT_LOCALE); return $word === $translatedWord ? $match[0] : preg_replace('/[a-zA-Z]/', '\\\\$0', $translatedWord); }, $format ); return static::rawCreateFromFormat($format, static::translateTimeString($time, $locale, static::DEFAULT_LOCALE), $timezone); } /** * Create a Carbon instance from a specific ISO format and a string in a given language. * * @param string $format Datetime ISO format * @param string $locale * @param string $time * @param DateTimeZone|string|int|null $timezone * * @throws InvalidFormatException * * @return static|null */ public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null): ?static { $time = static::translateTimeString($time, $locale, static::DEFAULT_LOCALE, CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS | CarbonInterface::TRANSLATE_MERIDIEM); return static::createFromIsoFormat($format, $time, $timezone, $locale); } /** * Make a Carbon instance from given variable if possible. * * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals * and recurrences). Throw an exception for invalid format, but otherwise return null. * * @param mixed $var * * @throws InvalidFormatException * * @return static|null */ public static function make($var, DateTimeZone|string|null $timezone = null): ?static { if ($var instanceof DateTimeInterface) { return static::instance($var); } $date = null; if (\is_string($var)) { $var = trim($var); if (!preg_match('/^P[\dT]/', $var) && !preg_match('/^R\d/', $var) && preg_match('/[a-z\d]/i', $var) ) { $date = static::parse($var, $timezone); } } return $date; } /** * Set last errors. * * @param array|bool $lastErrors * * @return void */ private static function setLastErrors($lastErrors): void { static::$lastErrors = $lastErrors; } /** * {@inheritdoc} */ public static function getLastErrors(): array|false { return static::$lastErrors; } private static function monthToInt(mixed $value, string $unit = 'month'): mixed { if ($value instanceof Month) { if ($unit !== 'month') { throw new UnitException("Month enum cannot be used to set $unit"); } return Month::int($value); } return $value; } } ================================================ FILE: src/Carbon/Traits/Date.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterface; use Carbon\CarbonPeriod; use Carbon\CarbonTimeZone; use Carbon\Exceptions\BadComparisonUnitException; use Carbon\Exceptions\ImmutableException; use Carbon\Exceptions\InvalidTimeZoneException; use Carbon\Exceptions\UnitException; use Carbon\Exceptions\UnknownGetterException; use Carbon\Exceptions\UnknownMethodException; use Carbon\Exceptions\UnknownSetterException; use Carbon\Exceptions\UnknownUnitException; use Carbon\FactoryImmutable; use Carbon\Month; use Carbon\Translator; use Carbon\Unit; use Carbon\WeekDay; use Closure; use DateInterval; use DatePeriod; use DateTime; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Generator; use InvalidArgumentException; use ReflectionException; use Symfony\Component\Clock\NativeClock; use Throwable; /** * A simple API extension for DateTime. * * * * @property string $localeDayOfWeek the day of week in current locale * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale * @property string $localeMonth the month in current locale * @property string $shortLocaleMonth the abbreviated month in current locale * @property int $year * @property int $yearIso * @property int $month * @property int $day * @property int $hour * @property int $minute * @property int $second * @property int $micro * @property int $microsecond * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) * @property int|float|string $timestamp seconds since the Unix Epoch * @property string $englishDayOfWeek the day of week in English * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English * @property int $milliseconds * @property int $millisecond * @property int $milli * @property int $week 1 through 53 * @property int $isoWeek 1 through 53 * @property int $weekYear year according to week format * @property int $isoWeekYear year according to ISO week format * @property int $age does a diffInYears() with default parameters * @property int $offset the timezone offset in seconds from UTC * @property int $offsetMinutes the timezone offset in minutes from UTC * @property int $offsetHours the timezone offset in hours from UTC * @property CarbonTimeZone $timezone the current timezone * @property CarbonTimeZone $tz alias of $timezone * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium * @property int $dayOfCentury The value of the day starting from the beginning of the current century * @property int $dayOfDecade The value of the day starting from the beginning of the current decade * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium * @property int $dayOfMonth The value of the day starting from the beginning of the current month * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property int $dayOfYear 1 through 366 * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium * @property int $hourOfCentury The value of the hour starting from the beginning of the current century * @property int $hourOfDay The value of the hour starting from the beginning of the current day * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium * @property int $hourOfMonth The value of the hour starting from the beginning of the current month * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter * @property int $hourOfWeek The value of the hour starting from the beginning of the current week * @property int $hourOfYear The value of the hour starting from the beginning of the current year * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century * @property int $minuteOfDay The value of the minute starting from the beginning of the current day * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week * @property int $minuteOfYear The value of the minute starting from the beginning of the current year * @property int $monthOfCentury The value of the month starting from the beginning of the current century * @property int $monthOfDecade The value of the month starting from the beginning of the current decade * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter * @property int $monthOfYear The value of the month starting from the beginning of the current year * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year * @property int $secondOfCentury The value of the second starting from the beginning of the current century * @property int $secondOfDay The value of the second starting from the beginning of the current day * @property int $secondOfDecade The value of the second starting from the beginning of the current decade * @property int $secondOfHour The value of the second starting from the beginning of the current hour * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium * @property int $secondOfMinute The value of the second starting from the beginning of the current minute * @property int $secondOfMonth The value of the second starting from the beginning of the current month * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter * @property int $secondOfWeek The value of the second starting from the beginning of the current week * @property int $secondOfYear The value of the second starting from the beginning of the current year * @property int $weekOfCentury The value of the week starting from the beginning of the current century * @property int $weekOfDecade The value of the week starting from the beginning of the current decade * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium * @property int $weekOfMonth 1 through 5 * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property int $yearOfCentury The value of the year starting from the beginning of the current century * @property int $yearOfDecade The value of the year starting from the beginning of the current decade * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language * @property-read int $noZeroHour current hour from 1 to 24 * @property-read int $isoWeeksInYear 51 through 53 * @property-read int $weekNumberInMonth 1 through 5 * @property-read int $firstWeekDay 0 through 6 * @property-read int $lastWeekDay 0 through 6 * @property-read int $quarter the quarter of this instance, 1 - 4 * @property-read int $decade the decade of this instance * @property-read int $century the century of this instance * @property-read int $millennium the millennium of this instance * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise * @property-read bool $local checks if the timezone is local, true if local, false otherwise * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName the current timezone name * @property-read string $tzName alias of $timezoneName * @property-read string $locale locale of the current instance * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium * @property-read int $daysInCentury The number of days contained in the current century * @property-read int $daysInDecade The number of days contained in the current decade * @property-read int $daysInMillennium The number of days contained in the current millennium * @property-read int $daysInMonth number of days in the given month * @property-read int $daysInQuarter The number of days contained in the current quarter * @property-read int $daysInWeek The number of days contained in the current week * @property-read int $daysInYear 365 or 366 * @property-read int $decadesInCentury The number of decades contained in the current century * @property-read int $decadesInMillennium The number of decades contained in the current millennium * @property-read int $hoursInCentury The number of hours contained in the current century * @property-read int $hoursInDay The number of hours contained in the current day * @property-read int $hoursInDecade The number of hours contained in the current decade * @property-read int $hoursInMillennium The number of hours contained in the current millennium * @property-read int $hoursInMonth The number of hours contained in the current month * @property-read int $hoursInQuarter The number of hours contained in the current quarter * @property-read int $hoursInWeek The number of hours contained in the current week * @property-read int $hoursInYear The number of hours contained in the current year * @property-read int $microsecondsInCentury The number of microseconds contained in the current century * @property-read int $microsecondsInDay The number of microseconds contained in the current day * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade * @property-read int $microsecondsInHour The number of microseconds contained in the current hour * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute * @property-read int $microsecondsInMonth The number of microseconds contained in the current month * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter * @property-read int $microsecondsInSecond The number of microseconds contained in the current second * @property-read int $microsecondsInWeek The number of microseconds contained in the current week * @property-read int $microsecondsInYear The number of microseconds contained in the current year * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century * @property-read int $millisecondsInDay The number of milliseconds contained in the current day * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week * @property-read int $millisecondsInYear The number of milliseconds contained in the current year * @property-read int $minutesInCentury The number of minutes contained in the current century * @property-read int $minutesInDay The number of minutes contained in the current day * @property-read int $minutesInDecade The number of minutes contained in the current decade * @property-read int $minutesInHour The number of minutes contained in the current hour * @property-read int $minutesInMillennium The number of minutes contained in the current millennium * @property-read int $minutesInMonth The number of minutes contained in the current month * @property-read int $minutesInQuarter The number of minutes contained in the current quarter * @property-read int $minutesInWeek The number of minutes contained in the current week * @property-read int $minutesInYear The number of minutes contained in the current year * @property-read int $monthsInCentury The number of months contained in the current century * @property-read int $monthsInDecade The number of months contained in the current decade * @property-read int $monthsInMillennium The number of months contained in the current millennium * @property-read int $monthsInQuarter The number of months contained in the current quarter * @property-read int $monthsInYear The number of months contained in the current year * @property-read int $quartersInCentury The number of quarters contained in the current century * @property-read int $quartersInDecade The number of quarters contained in the current decade * @property-read int $quartersInMillennium The number of quarters contained in the current millennium * @property-read int $quartersInYear The number of quarters contained in the current year * @property-read int $secondsInCentury The number of seconds contained in the current century * @property-read int $secondsInDay The number of seconds contained in the current day * @property-read int $secondsInDecade The number of seconds contained in the current decade * @property-read int $secondsInHour The number of seconds contained in the current hour * @property-read int $secondsInMillennium The number of seconds contained in the current millennium * @property-read int $secondsInMinute The number of seconds contained in the current minute * @property-read int $secondsInMonth The number of seconds contained in the current month * @property-read int $secondsInQuarter The number of seconds contained in the current quarter * @property-read int $secondsInWeek The number of seconds contained in the current week * @property-read int $secondsInYear The number of seconds contained in the current year * @property-read int $weeksInCentury The number of weeks contained in the current century * @property-read int $weeksInDecade The number of weeks contained in the current decade * @property-read int $weeksInMillennium The number of weeks contained in the current millennium * @property-read int $weeksInMonth The number of weeks contained in the current month * @property-read int $weeksInQuarter The number of weeks contained in the current quarter * @property-read int $weeksInYear 51 through 53 * @property-read int $yearsInCentury The number of years contained in the current century * @property-read int $yearsInDecade The number of years contained in the current decade * @property-read int $yearsInMillennium The number of years contained in the current millennium * * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) * @method bool isLocal() Check if the current instance has non-UTC timezone. * @method bool isValid() Check if the current instance is a valid date. * @method bool isDST() Check if the current instance is in a daylight saving time. * @method bool isSunday() Checks if the instance day is sunday. * @method bool isMonday() Checks if the instance day is monday. * @method bool isTuesday() Checks if the instance day is tuesday. * @method bool isWednesday() Checks if the instance day is wednesday. * @method bool isThursday() Checks if the instance day is thursday. * @method bool isFriday() Checks if the instance day is friday. * @method bool isSaturday() Checks if the instance day is saturday. * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. * @method CarbonInterface years(int $value) Set current instance year to the given value. * @method CarbonInterface year(int $value) Set current instance year to the given value. * @method CarbonInterface setYears(int $value) Set current instance year to the given value. * @method CarbonInterface setYear(int $value) Set current instance year to the given value. * @method CarbonInterface months(Month|int $value) Set current instance month to the given value. * @method CarbonInterface month(Month|int $value) Set current instance month to the given value. * @method CarbonInterface setMonths(Month|int $value) Set current instance month to the given value. * @method CarbonInterface setMonth(Month|int $value) Set current instance month to the given value. * @method CarbonInterface days(int $value) Set current instance day to the given value. * @method CarbonInterface day(int $value) Set current instance day to the given value. * @method CarbonInterface setDays(int $value) Set current instance day to the given value. * @method CarbonInterface setDay(int $value) Set current instance day to the given value. * @method CarbonInterface hours(int $value) Set current instance hour to the given value. * @method CarbonInterface hour(int $value) Set current instance hour to the given value. * @method CarbonInterface setHours(int $value) Set current instance hour to the given value. * @method CarbonInterface setHour(int $value) Set current instance hour to the given value. * @method CarbonInterface minutes(int $value) Set current instance minute to the given value. * @method CarbonInterface minute(int $value) Set current instance minute to the given value. * @method CarbonInterface setMinutes(int $value) Set current instance minute to the given value. * @method CarbonInterface setMinute(int $value) Set current instance minute to the given value. * @method CarbonInterface seconds(int $value) Set current instance second to the given value. * @method CarbonInterface second(int $value) Set current instance second to the given value. * @method CarbonInterface setSeconds(int $value) Set current instance second to the given value. * @method CarbonInterface setSecond(int $value) Set current instance second to the given value. * @method CarbonInterface millis(int $value) Set current instance millisecond to the given value. * @method CarbonInterface milli(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMillis(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMilli(int $value) Set current instance millisecond to the given value. * @method CarbonInterface milliseconds(int $value) Set current instance millisecond to the given value. * @method CarbonInterface millisecond(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMilliseconds(int $value) Set current instance millisecond to the given value. * @method CarbonInterface setMillisecond(int $value) Set current instance millisecond to the given value. * @method CarbonInterface micros(int $value) Set current instance microsecond to the given value. * @method CarbonInterface micro(int $value) Set current instance microsecond to the given value. * @method CarbonInterface setMicros(int $value) Set current instance microsecond to the given value. * @method CarbonInterface setMicro(int $value) Set current instance microsecond to the given value. * @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value. * @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value. * @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value. * @method self setMicrosecond(int $value) Set current instance microsecond to the given value. * @method CarbonInterface addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addYear() Add one year to the instance (using date interval). * @method CarbonInterface subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subYear() Sub one year to the instance (using date interval). * @method CarbonInterface addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMonth() Add one month to the instance (using date interval). * @method CarbonInterface subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMonth() Sub one month to the instance (using date interval). * @method CarbonInterface addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addDay() Add one day to the instance (using date interval). * @method CarbonInterface subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subDay() Sub one day to the instance (using date interval). * @method CarbonInterface addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addHour() Add one hour to the instance (using date interval). * @method CarbonInterface subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subHour() Sub one hour to the instance (using date interval). * @method CarbonInterface addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMinute() Add one minute to the instance (using date interval). * @method CarbonInterface subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMinute() Sub one minute to the instance (using date interval). * @method CarbonInterface addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addSecond() Add one second to the instance (using date interval). * @method CarbonInterface subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subSecond() Sub one second to the instance (using date interval). * @method CarbonInterface addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMilli() Add one millisecond to the instance (using date interval). * @method CarbonInterface subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMilli() Sub one millisecond to the instance (using date interval). * @method CarbonInterface addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMillisecond() Add one millisecond to the instance (using date interval). * @method CarbonInterface subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMillisecond() Sub one millisecond to the instance (using date interval). * @method CarbonInterface addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMicro() Add one microsecond to the instance (using date interval). * @method CarbonInterface subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMicro() Sub one microsecond to the instance (using date interval). * @method CarbonInterface addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMicrosecond() Add one microsecond to the instance (using date interval). * @method CarbonInterface subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMicrosecond() Sub one microsecond to the instance (using date interval). * @method CarbonInterface addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addMillennium() Add one millennium to the instance (using date interval). * @method CarbonInterface subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subMillennium() Sub one millennium to the instance (using date interval). * @method CarbonInterface addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addCentury() Add one century to the instance (using date interval). * @method CarbonInterface subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subCentury() Sub one century to the instance (using date interval). * @method CarbonInterface addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addDecade() Add one decade to the instance (using date interval). * @method CarbonInterface subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subDecade() Sub one decade to the instance (using date interval). * @method CarbonInterface addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addQuarter() Add one quarter to the instance (using date interval). * @method CarbonInterface subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subQuarter() Sub one quarter to the instance (using date interval). * @method CarbonInterface addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. * @method CarbonInterface addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. * @method CarbonInterface addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addWeek() Add one week to the instance (using date interval). * @method CarbonInterface subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subWeek() Sub one week to the instance (using date interval). * @method CarbonInterface addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). * @method CarbonInterface addWeekday() Add one weekday to the instance (using date interval). * @method CarbonInterface subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). * @method CarbonInterface subWeekday() Sub one weekday to the instance (using date interval). * @method CarbonInterface addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMicro() Add one microsecond to the instance (using timestamp). * @method CarbonInterface subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMicro() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method CarbonInterface addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMicrosecond() Add one microsecond to the instance (using timestamp). * @method CarbonInterface subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. * @method CarbonInterface addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMilli() Add one millisecond to the instance (using timestamp). * @method CarbonInterface subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMilli() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method CarbonInterface addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMillisecond() Add one millisecond to the instance (using timestamp). * @method CarbonInterface subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMillisecond() Sub one millisecond to the instance (using timestamp). * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. * @method CarbonInterface addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCSecond() Add one second to the instance (using timestamp). * @method CarbonInterface subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCSecond() Sub one second to the instance (using timestamp). * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. * @method CarbonInterface addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMinute() Add one minute to the instance (using timestamp). * @method CarbonInterface subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMinute() Sub one minute to the instance (using timestamp). * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. * @method CarbonInterface addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCHour() Add one hour to the instance (using timestamp). * @method CarbonInterface subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCHour() Sub one hour to the instance (using timestamp). * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. * @method CarbonInterface addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCDay() Add one day to the instance (using timestamp). * @method CarbonInterface subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCDay() Sub one day to the instance (using timestamp). * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. * @method CarbonInterface addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCWeek() Add one week to the instance (using timestamp). * @method CarbonInterface subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCWeek() Sub one week to the instance (using timestamp). * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. * @method CarbonInterface addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMonth() Add one month to the instance (using timestamp). * @method CarbonInterface subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMonth() Sub one month to the instance (using timestamp). * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. * @method CarbonInterface addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCQuarter() Add one quarter to the instance (using timestamp). * @method CarbonInterface subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCQuarter() Sub one quarter to the instance (using timestamp). * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. * @method CarbonInterface addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCYear() Add one year to the instance (using timestamp). * @method CarbonInterface subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCYear() Sub one year to the instance (using timestamp). * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. * @method CarbonInterface addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCDecade() Add one decade to the instance (using timestamp). * @method CarbonInterface subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCDecade() Sub one decade to the instance (using timestamp). * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. * @method CarbonInterface addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCCentury() Add one century to the instance (using timestamp). * @method CarbonInterface subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCCentury() Sub one century to the instance (using timestamp). * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. * @method CarbonInterface addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface addUTCMillennium() Add one millennium to the instance (using timestamp). * @method CarbonInterface subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). * @method CarbonInterface subUTCMillennium() Sub one millennium to the instance (using timestamp). * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. * @method CarbonInterface roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method CarbonInterface roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method CarbonInterface floorYear(float $precision = 1) Truncate the current instance year with given precision. * @method CarbonInterface floorYears(float $precision = 1) Truncate the current instance year with given precision. * @method CarbonInterface ceilYear(float $precision = 1) Ceil the current instance year with given precision. * @method CarbonInterface ceilYears(float $precision = 1) Ceil the current instance year with given precision. * @method CarbonInterface roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method CarbonInterface roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. * @method CarbonInterface floorMonth(float $precision = 1) Truncate the current instance month with given precision. * @method CarbonInterface floorMonths(float $precision = 1) Truncate the current instance month with given precision. * @method CarbonInterface ceilMonth(float $precision = 1) Ceil the current instance month with given precision. * @method CarbonInterface ceilMonths(float $precision = 1) Ceil the current instance month with given precision. * @method CarbonInterface roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method CarbonInterface roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. * @method CarbonInterface floorDay(float $precision = 1) Truncate the current instance day with given precision. * @method CarbonInterface floorDays(float $precision = 1) Truncate the current instance day with given precision. * @method CarbonInterface ceilDay(float $precision = 1) Ceil the current instance day with given precision. * @method CarbonInterface ceilDays(float $precision = 1) Ceil the current instance day with given precision. * @method CarbonInterface roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method CarbonInterface roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. * @method CarbonInterface floorHour(float $precision = 1) Truncate the current instance hour with given precision. * @method CarbonInterface floorHours(float $precision = 1) Truncate the current instance hour with given precision. * @method CarbonInterface ceilHour(float $precision = 1) Ceil the current instance hour with given precision. * @method CarbonInterface ceilHours(float $precision = 1) Ceil the current instance hour with given precision. * @method CarbonInterface roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method CarbonInterface roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. * @method CarbonInterface floorMinute(float $precision = 1) Truncate the current instance minute with given precision. * @method CarbonInterface floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. * @method CarbonInterface ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. * @method CarbonInterface ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. * @method CarbonInterface roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method CarbonInterface roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. * @method CarbonInterface floorSecond(float $precision = 1) Truncate the current instance second with given precision. * @method CarbonInterface floorSeconds(float $precision = 1) Truncate the current instance second with given precision. * @method CarbonInterface ceilSecond(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonInterface ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonInterface roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonInterface roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonInterface floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonInterface floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonInterface ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonInterface ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonInterface roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonInterface roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonInterface floorCentury(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonInterface floorCenturies(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonInterface ceilCentury(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonInterface ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonInterface roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonInterface roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonInterface floorDecade(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonInterface floorDecades(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonInterface ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonInterface ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonInterface roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonInterface roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonInterface floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonInterface floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonInterface ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonInterface ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonInterface roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonInterface roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonInterface floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonInterface floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonInterface ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonInterface ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonInterface roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonInterface roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonInterface floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonInterface floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonInterface ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method CarbonInterface ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value * @method int daysInCentury() Return the number of days contained in the current century * @method int daysInDecade() Return the number of days contained in the current decade * @method int daysInMillennium() Return the number of days contained in the current millennium * @method int daysInMonth() Return the number of days contained in the current month * @method int daysInQuarter() Return the number of days contained in the current quarter * @method int daysInWeek() Return the number of days contained in the current week * @method int daysInYear() Return the number of days contained in the current year * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value * @method int decadesInCentury() Return the number of decades contained in the current century * @method int decadesInMillennium() Return the number of decades contained in the current millennium * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value * @method int hoursInCentury() Return the number of hours contained in the current century * @method int hoursInDay() Return the number of hours contained in the current day * @method int hoursInDecade() Return the number of hours contained in the current decade * @method int hoursInMillennium() Return the number of hours contained in the current millennium * @method int hoursInMonth() Return the number of hours contained in the current month * @method int hoursInQuarter() Return the number of hours contained in the current quarter * @method int hoursInWeek() Return the number of hours contained in the current week * @method int hoursInYear() Return the number of hours contained in the current year * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value * @method int microsecondsInCentury() Return the number of microseconds contained in the current century * @method int microsecondsInDay() Return the number of microseconds contained in the current day * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade * @method int microsecondsInHour() Return the number of microseconds contained in the current hour * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute * @method int microsecondsInMonth() Return the number of microseconds contained in the current month * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter * @method int microsecondsInSecond() Return the number of microseconds contained in the current second * @method int microsecondsInWeek() Return the number of microseconds contained in the current week * @method int microsecondsInYear() Return the number of microseconds contained in the current year * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century * @method int millisecondsInDay() Return the number of milliseconds contained in the current day * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week * @method int millisecondsInYear() Return the number of milliseconds contained in the current year * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value * @method int minutesInCentury() Return the number of minutes contained in the current century * @method int minutesInDay() Return the number of minutes contained in the current day * @method int minutesInDecade() Return the number of minutes contained in the current decade * @method int minutesInHour() Return the number of minutes contained in the current hour * @method int minutesInMillennium() Return the number of minutes contained in the current millennium * @method int minutesInMonth() Return the number of minutes contained in the current month * @method int minutesInQuarter() Return the number of minutes contained in the current quarter * @method int minutesInWeek() Return the number of minutes contained in the current week * @method int minutesInYear() Return the number of minutes contained in the current year * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value * @method int monthsInCentury() Return the number of months contained in the current century * @method int monthsInDecade() Return the number of months contained in the current decade * @method int monthsInMillennium() Return the number of months contained in the current millennium * @method int monthsInQuarter() Return the number of months contained in the current quarter * @method int monthsInYear() Return the number of months contained in the current year * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value * @method int quartersInCentury() Return the number of quarters contained in the current century * @method int quartersInDecade() Return the number of quarters contained in the current decade * @method int quartersInMillennium() Return the number of quarters contained in the current millennium * @method int quartersInYear() Return the number of quarters contained in the current year * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value * @method int secondsInCentury() Return the number of seconds contained in the current century * @method int secondsInDay() Return the number of seconds contained in the current day * @method int secondsInDecade() Return the number of seconds contained in the current decade * @method int secondsInHour() Return the number of seconds contained in the current hour * @method int secondsInMillennium() Return the number of seconds contained in the current millennium * @method int secondsInMinute() Return the number of seconds contained in the current minute * @method int secondsInMonth() Return the number of seconds contained in the current month * @method int secondsInQuarter() Return the number of seconds contained in the current quarter * @method int secondsInWeek() Return the number of seconds contained in the current week * @method int secondsInYear() Return the number of seconds contained in the current year * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value * @method int weeksInCentury() Return the number of weeks contained in the current century * @method int weeksInDecade() Return the number of weeks contained in the current decade * @method int weeksInMillennium() Return the number of weeks contained in the current millennium * @method int weeksInMonth() Return the number of weeks contained in the current month * @method int weeksInQuarter() Return the number of weeks contained in the current quarter * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value * @method int yearsInCentury() Return the number of years contained in the current century * @method int yearsInDecade() Return the number of years contained in the current decade * @method int yearsInMillennium() Return the number of years contained in the current millennium * * */ trait Date { use Boundaries; use Comparison; use Converter; use Creator; use Difference; use Macro; use MagicParameter; use Modifiers; use Mutability; use ObjectInitialisation; use Options; use Rounding; use Serialization; use Test; use Timestamp; use Units; use Week; /** * Names of days of the week. * * @var array */ protected static $days = [ // @call isDayOfWeek CarbonInterface::SUNDAY => 'Sunday', // @call isDayOfWeek CarbonInterface::MONDAY => 'Monday', // @call isDayOfWeek CarbonInterface::TUESDAY => 'Tuesday', // @call isDayOfWeek CarbonInterface::WEDNESDAY => 'Wednesday', // @call isDayOfWeek CarbonInterface::THURSDAY => 'Thursday', // @call isDayOfWeek CarbonInterface::FRIDAY => 'Friday', // @call isDayOfWeek CarbonInterface::SATURDAY => 'Saturday', ]; /** * List of unit and magic methods associated as doc-comments. * * @var array */ protected static $units = [ // @call setUnit // @call addUnit 'year', // @call setUnit // @call addUnit 'month', // @call setUnit // @call addUnit 'day', // @call setUnit // @call addUnit 'hour', // @call setUnit // @call addUnit 'minute', // @call setUnit // @call addUnit 'second', // @call setUnit // @call addUnit 'milli', // @call setUnit // @call addUnit 'millisecond', // @call setUnit // @call addUnit 'micro', // @call setUnit // @call addUnit 'microsecond', ]; /** * Creates a DateTimeZone from a string, DateTimeZone or integer offset. * * @param DateTimeZone|string|int|false|null $object original value to get CarbonTimeZone from it. * @param DateTimeZone|string|int|false|null $objectDump dump of the object for error messages. * * @throws InvalidTimeZoneException * * @return CarbonTimeZone|null */ protected static function safeCreateDateTimeZone( DateTimeZone|string|int|false|null $object, DateTimeZone|string|int|false|null $objectDump = null, ): ?CarbonTimeZone { return CarbonTimeZone::instance($object, $objectDump); } /** * Get the TimeZone associated with the Carbon instance (as CarbonTimeZone). * * @link https://php.net/manual/en/datetime.gettimezone.php */ public function getTimezone(): CarbonTimeZone { return $this->transmitFactory(fn () => CarbonTimeZone::instance(parent::getTimezone())); } /** * List of minimum and maximums for each unit. */ protected static function getRangesByUnit(int $daysInMonth = 31): array { return [ // @call roundUnit 'year' => [1, 9999], // @call roundUnit 'month' => [1, static::MONTHS_PER_YEAR], // @call roundUnit 'day' => [1, $daysInMonth], // @call roundUnit 'hour' => [0, static::HOURS_PER_DAY - 1], // @call roundUnit 'minute' => [0, static::MINUTES_PER_HOUR - 1], // @call roundUnit 'second' => [0, static::SECONDS_PER_MINUTE - 1], ]; } /** * Get a copy of the instance. * * @return static */ public function copy() { return clone $this; } /** * @alias copy * * Get a copy of the instance. * * @return static */ public function clone() { return clone $this; } /** * Clone the current instance if it's mutable. * * This method is convenient to ensure you don't mutate the initial object * but avoid to make a useless copy of it if it's already immutable. * * @return static */ public function avoidMutation(): static { if ($this instanceof DateTimeImmutable) { return $this; } return clone $this; } /** * Returns a present instance in the same timezone. * * @return static */ public function nowWithSameTz(): static { $timezone = $this->getTimezone(); return $this->getClock()?->nowAs(static::class, $timezone) ?? static::now($timezone); } /** * Return the Carbon instance passed through, a now instance in the same timezone * if null given or parse the input if string given. * * @param Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|DateTimeInterface|string|null $date * * @return static */ public function carbonize($date = null) { if ($date instanceof DateInterval) { return $this->avoidMutation()->add($date); } if ($date instanceof DatePeriod || $date instanceof CarbonPeriod) { $date = $date->getStartDate(); } return $this->resolveCarbon($date); } /////////////////////////////////////////////////////////////////// ///////////////////////// GETTERS AND SETTERS ///////////////////// /////////////////////////////////////////////////////////////////// /** * Get a part of the Carbon object. * * @throws UnknownGetterException * * @return string|int|bool|DateTimeZone|null */ public function __get(string $name): mixed { return $this->get($name); } /** * Get a part of the Carbon object. * * @throws UnknownGetterException * * @return string|int|bool|DateTimeZone */ public function get(Unit|string $name): mixed { static $localizedFormats = [ // @property string the day of week in current locale 'localeDayOfWeek' => 'dddd', // @property string the abbreviated day of week in current locale 'shortLocaleDayOfWeek' => 'ddd', // @property string the month in current locale 'localeMonth' => 'MMMM', // @property string the abbreviated month in current locale 'shortLocaleMonth' => 'MMM', ]; $name = Unit::toName($name); if (isset($localizedFormats[$name])) { return $this->isoFormat($localizedFormats[$name]); } static $formats = [ // @property int 'year' => 'Y', // @property int 'yearIso' => 'o', // @--property-read int // @--property-write Month|int // @property int 'month' => 'n', // @property int 'day' => 'j', // @property int 'hour' => 'G', // @property int 'minute' => 'i', // @property int 'second' => 's', // @property int 'micro' => 'u', // @property int 'microsecond' => 'u', // @property int 0 (for Sunday) through 6 (for Saturday) 'dayOfWeek' => 'w', // @property int 1 (for Monday) through 7 (for Sunday) 'dayOfWeekIso' => 'N', // @property int ISO-8601 week number of year, weeks starting on Monday 'weekOfYear' => 'W', // @property-read int number of days in the given month 'daysInMonth' => 't', // @property int|float|string seconds since the Unix Epoch 'timestamp' => 'U', // @property-read string "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) 'latinMeridiem' => 'a', // @property-read string "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) 'latinUpperMeridiem' => 'A', // @property string the day of week in English 'englishDayOfWeek' => 'l', // @property string the abbreviated day of week in English 'shortEnglishDayOfWeek' => 'D', // @property string the month in English 'englishMonth' => 'F', // @property string the abbreviated month in English 'shortEnglishMonth' => 'M', // @property-read string $timezoneAbbreviatedName the current timezone abbreviated name 'timezoneAbbreviatedName' => 'T', // @property-read string $tzAbbrName alias of $timezoneAbbreviatedName 'tzAbbrName' => 'T', ]; switch (true) { case isset($formats[$name]): $value = $this->rawFormat($formats[$name]); return is_numeric($value) ? (int) $value : $value; // @property-read string long name of weekday translated according to Carbon locale, in english if no translation available for current language case $name === 'dayName': return $this->getTranslatedDayName(); // @property-read string short name of weekday translated according to Carbon locale, in english if no translation available for current language case $name === 'shortDayName': return $this->getTranslatedShortDayName(); // @property-read string very short name of weekday translated according to Carbon locale, in english if no translation available for current language case $name === 'minDayName': return $this->getTranslatedMinDayName(); // @property-read string long name of month translated according to Carbon locale, in english if no translation available for current language case $name === 'monthName': return $this->getTranslatedMonthName(); // @property-read string short name of month translated according to Carbon locale, in english if no translation available for current language case $name === 'shortMonthName': return $this->getTranslatedShortMonthName(); // @property-read string lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language case $name === 'meridiem': return $this->meridiem(true); // @property-read string uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language case $name === 'upperMeridiem': return $this->meridiem(); // @property-read int current hour from 1 to 24 case $name === 'noZeroHour': return $this->hour ?: 24; // @property int case $name === 'milliseconds': // @property int case $name === 'millisecond': // @property int case $name === 'milli': return (int) floor(((int) $this->rawFormat('u')) / 1000); // @property int 1 through 53 case $name === 'week': return (int) $this->week(); // @property int 1 through 53 case $name === 'isoWeek': return (int) $this->isoWeek(); // @property int year according to week format case $name === 'weekYear': return (int) $this->weekYear(); // @property int year according to ISO week format case $name === 'isoWeekYear': return (int) $this->isoWeekYear(); // @property-read int 51 through 53 case $name === 'weeksInYear': return $this->weeksInYear(); // @property-read int 51 through 53 case $name === 'isoWeeksInYear': return $this->isoWeeksInYear(); // @property int 1 through 5 case $name === 'weekOfMonth': return (int) ceil($this->day / static::DAYS_PER_WEEK); // @property-read int 1 through 5 case $name === 'weekNumberInMonth': return (int) ceil(($this->day + $this->avoidMutation()->startOfMonth()->dayOfWeekIso - 1) / static::DAYS_PER_WEEK); // @property-read int 0 through 6 case $name === 'firstWeekDay': return (int) $this->getTranslationMessage('first_day_of_week'); // @property-read int 0 through 6 case $name === 'lastWeekDay': return $this->transmitFactory(fn () => static::weekRotate((int) $this->getTranslationMessage('first_day_of_week'), -1)); // @property int 1 through 366 case $name === 'dayOfYear': return 1 + (int) ($this->rawFormat('z')); // @property-read int 365 or 366 case $name === 'daysInYear': return static::DAYS_PER_YEAR + ($this->isLeapYear() ? 1 : 0); // @property int does a diffInYears() with default parameters case $name === 'age': return (int) $this->diffInYears(); // @property-read int the quarter of this instance, 1 - 4 case $name === 'quarter': return (int) ceil($this->month / static::MONTHS_PER_QUARTER); // @property-read int the decade of this instance // @call isSameUnit case $name === 'decade': return (int) ceil($this->year / static::YEARS_PER_DECADE); // @property-read int the century of this instance // @call isSameUnit case $name === 'century': $factor = 1; $year = $this->year; if ($year < 0) { $year = -$year; $factor = -1; } return (int) ($factor * ceil($year / static::YEARS_PER_CENTURY)); // @property-read int the millennium of this instance // @call isSameUnit case $name === 'millennium': $factor = 1; $year = $this->year; if ($year < 0) { $year = -$year; $factor = -1; } return (int) ($factor * ceil($year / static::YEARS_PER_MILLENNIUM)); // @property int the timezone offset in seconds from UTC case $name === 'offset': return $this->getOffset(); // @property int the timezone offset in minutes from UTC case $name === 'offsetMinutes': return $this->getOffset() / static::SECONDS_PER_MINUTE; // @property int the timezone offset in hours from UTC case $name === 'offsetHours': return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR; // @property-read bool daylight savings time indicator, true if DST, false otherwise case $name === 'dst': return $this->rawFormat('I') === '1'; // @property-read bool checks if the timezone is local, true if local, false otherwise case $name === 'local': return $this->getOffset() === $this->avoidMutation()->setTimezone(date_default_timezone_get())->getOffset(); // @property-read bool checks if the timezone is UTC, true if UTC, false otherwise case $name === 'utc': return $this->getOffset() === 0; // @--property-write DateTimeZone|string|int $timezone the current timezone // @--property-write DateTimeZone|string|int $tz alias of $timezone // @--property-read CarbonTimeZone $timezone the current timezone // @--property-read CarbonTimeZone $tz alias of $timezone // @property CarbonTimeZone $timezone the current timezone // @property CarbonTimeZone $tz alias of $timezone case $name === 'timezone' || $name === 'tz': return $this->getTimezone(); // @property-read string $timezoneName the current timezone name // @property-read string $tzName alias of $timezoneName case $name === 'timezoneName' || $name === 'tzName': return $this->getTimezone()->getName(); // @property-read string locale of the current instance case $name === 'locale': return $this->getTranslatorLocale(); case preg_match('/^([a-z]{2,})(In|Of)([A-Z][a-z]+)$/', $name, $match): [, $firstUnit, $operator, $secondUnit] = $match; try { $start = $this->avoidMutation()->startOf($secondUnit); $value = $operator === 'Of' ? (\in_array($firstUnit, [ // Unit with indexes starting at 1 (other units start at 0) 'day', 'week', 'month', 'quarter', ], true) ? 1 : 0) + floor($start->diffInUnit($firstUnit, $this)) : round($start->diffInUnit($firstUnit, $start->avoidMutation()->add($secondUnit, 1))); return (int) $value; } catch (UnknownUnitException) { // default to macro } default: $macro = $this->getLocalMacro('get'.ucfirst($name)); if ($macro) { return $this->executeCallableWithContext($macro); } throw new UnknownGetterException($name); } } /** * Check if an attribute exists on the object * * @param string $name * * @return bool */ public function __isset($name) { try { $this->__get($name); } catch (UnknownGetterException | ReflectionException) { return false; } return true; } /** * Set a part of the Carbon object * * @param string $name * @param string|int|DateTimeZone $value * * @throws UnknownSetterException|ReflectionException * * @return void */ public function __set($name, $value) { if ($this->constructedObjectId === spl_object_hash($this)) { $this->set($name, $value); return; } $this->$name = $value; } /** * Set a part of the Carbon object. * * @throws ImmutableException|UnknownSetterException * * @return $this */ public function set(Unit|array|string $name, DateTimeZone|Month|string|int|float|null $value = null): static { if ($this->isImmutable()) { throw new ImmutableException(\sprintf('%s class', static::class)); } if (\is_array($name)) { foreach ($name as $key => $value) { $this->set($key, $value); } return $this; } $name = Unit::toName($name); switch ($name) { case 'milliseconds': case 'millisecond': case 'milli': case 'microseconds': case 'microsecond': case 'micro': if (str_starts_with($name, 'milli')) { $value *= 1000; } while ($value < 0) { $this->subSecond(); $value += static::MICROSECONDS_PER_SECOND; } while ($value >= static::MICROSECONDS_PER_SECOND) { $this->addSecond(); $value -= static::MICROSECONDS_PER_SECOND; } $this->modify($this->rawFormat('H:i:s.').str_pad((string) round($value), 6, '0', STR_PAD_LEFT)); break; case 'year': case 'month': case 'day': case 'hour': case 'minute': case 'second': [$year, $month, $day, $hour, $minute, $second] = array_map('intval', explode('-', $this->rawFormat('Y-n-j-G-i-s'))); $$name = self::monthToInt($value, $name); $this->setDateTime($year, $month, $day, $hour, $minute, $second); break; case 'week': $this->week($value); break; case 'isoWeek': $this->isoWeek($value); break; case 'weekYear': $this->weekYear($value); break; case 'isoWeekYear': $this->isoWeekYear($value); break; case 'dayOfYear': $this->addDays($value - $this->dayOfYear); break; case 'dayOfWeek': $this->addDays($value - $this->dayOfWeek); break; case 'dayOfWeekIso': $this->addDays($value - $this->dayOfWeekIso); break; case 'timestamp': $this->setTimestamp($value); break; case 'offset': $this->setTimezone(static::safeCreateDateTimeZone($value / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR)); break; case 'offsetMinutes': $this->setTimezone(static::safeCreateDateTimeZone($value / static::MINUTES_PER_HOUR)); break; case 'offsetHours': $this->setTimezone(static::safeCreateDateTimeZone($value)); break; case 'timezone': case 'tz': $this->setTimezone($value); break; default: if (preg_match('/^([a-z]{2,})Of([A-Z][a-z]+)$/', $name, $match)) { [, $firstUnit, $secondUnit] = $match; try { $start = $this->avoidMutation()->startOf($secondUnit); $currentValue = (\in_array($firstUnit, [ // Unit with indexes starting at 1 (other units start at 0) 'day', 'week', 'month', 'quarter', ], true) ? 1 : 0) + (int) floor($start->diffInUnit($firstUnit, $this)); // We check $value a posteriori to give precedence to UnknownUnitException if (!\is_int($value)) { throw new UnitException("->$name expects integer value"); } $this->addUnit($firstUnit, $value - $currentValue); break; } catch (UnknownUnitException) { // default to macro } } $macro = $this->getLocalMacro('set'.ucfirst($name)); if ($macro) { $this->executeCallableWithContext($macro, $value); break; } if ($this->isLocalStrictModeEnabled()) { throw new UnknownSetterException($name); } $this->$name = $value; } return $this; } /** * Get the translation of the current week day name (with context for languages with multiple forms). * * @param string|null $context whole format string * @param string $keySuffix "", "_short" or "_min" * @param string|null $defaultValue default value if translation missing */ public function getTranslatedDayName( ?string $context = null, string $keySuffix = '', ?string $defaultValue = null, ): string { return $this->getTranslatedFormByRegExp('weekdays', $keySuffix, $context, $this->dayOfWeek, $defaultValue ?: $this->englishDayOfWeek); } /** * Get the translation of the current short week day name (with context for languages with multiple forms). * * @param string|null $context whole format string */ public function getTranslatedShortDayName(?string $context = null): string { return $this->getTranslatedDayName($context, '_short', $this->shortEnglishDayOfWeek); } /** * Get the translation of the current abbreviated week day name (with context for languages with multiple forms). * * @param string|null $context whole format string */ public function getTranslatedMinDayName(?string $context = null): string { return $this->getTranslatedDayName($context, '_min', $this->shortEnglishDayOfWeek); } /** * Get the translation of the current month day name (with context for languages with multiple forms). * * @param string|null $context whole format string * @param string $keySuffix "" or "_short" * @param string|null $defaultValue default value if translation missing */ public function getTranslatedMonthName( ?string $context = null, string $keySuffix = '', ?string $defaultValue = null, ): string { return $this->getTranslatedFormByRegExp('months', $keySuffix, $context, $this->month - 1, $defaultValue ?: $this->englishMonth); } /** * Get the translation of the current short month day name (with context for languages with multiple forms). * * @param string|null $context whole format string */ public function getTranslatedShortMonthName(?string $context = null): string { return $this->getTranslatedMonthName($context, '_short', $this->shortEnglishMonth); } /** * Get/set the day of year. * * @template T of int|null * * @param int|null $value new value for day of year if using as setter. * * @psalm-param T $value * * @return static|int * * @psalm-return (T is int ? static : int) */ public function dayOfYear(?int $value = null): static|int { $dayOfYear = $this->dayOfYear; return $value === null ? $dayOfYear : $this->addDays($value - $dayOfYear); } /** * Get/set the weekday from 0 (Sunday) to 6 (Saturday). * * @param WeekDay|int|null $value new value for weekday if using as setter. */ public function weekday(WeekDay|int|null $value = null): static|int { if ($value === null) { return $this->dayOfWeek; } $firstDay = (int) ($this->getTranslationMessage('first_day_of_week') ?? 0); $dayOfWeek = ($this->dayOfWeek + 7 - $firstDay) % 7; return $this->addDays(((WeekDay::int($value) + 7 - $firstDay) % 7) - $dayOfWeek); } /** * Get/set the ISO weekday from 1 (Monday) to 7 (Sunday). * * @param WeekDay|int|null $value new value for weekday if using as setter. */ public function isoWeekday(WeekDay|int|null $value = null): static|int { $dayOfWeekIso = $this->dayOfWeekIso; return $value === null ? $dayOfWeekIso : $this->addDays(WeekDay::int($value) - $dayOfWeekIso); } /** * Return the number of days since the start of the week (using the current locale or the first parameter * if explicitly given). * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, * if not provided, start of week is inferred from the locale * (Sunday for en_US, Monday for de_DE, etc.) */ public function getDaysFromStartOfWeek(WeekDay|int|null $weekStartsAt = null): int { $firstDay = (int) (WeekDay::int($weekStartsAt) ?? $this->getTranslationMessage('first_day_of_week') ?? 0); return ($this->dayOfWeek + 7 - $firstDay) % 7; } /** * Set the day (keeping the current time) to the start of the week + the number of days passed as the first * parameter. First day of week is driven by the locale unless explicitly set with the second parameter. * * @param int $numberOfDays number of days to add after the start of the current week * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, * if not provided, start of week is inferred from the locale * (Sunday for en_US, Monday for de_DE, etc.) */ public function setDaysFromStartOfWeek(int $numberOfDays, WeekDay|int|null $weekStartsAt = null): static { return $this->addDays($numberOfDays - $this->getDaysFromStartOfWeek(WeekDay::int($weekStartsAt))); } /** * Set any unit to a new value without overflowing current other unit given. * * @param string $valueUnit unit name to modify * @param int $value new value for the input unit * @param string $overflowUnit unit name to not overflow */ public function setUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static { try { $start = $this->avoidMutation()->startOf($overflowUnit); $end = $this->avoidMutation()->endOf($overflowUnit); /** @var static $date */ $date = $this->$valueUnit($value); if ($date < $start) { return $date->mutateIfMutable($start); } if ($date > $end) { return $date->mutateIfMutable($end); } return $date; } catch (BadMethodCallException | ReflectionException $exception) { throw new UnknownUnitException($valueUnit, 0, $exception); } } /** * Add any unit to a new value without overflowing current other unit given. * * @param string $valueUnit unit name to modify * @param int $value amount to add to the input unit * @param string $overflowUnit unit name to not overflow */ public function addUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static { return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit + $value, $overflowUnit); } /** * Subtract any unit to a new value without overflowing current other unit given. * * @param string $valueUnit unit name to modify * @param int $value amount to subtract to the input unit * @param string $overflowUnit unit name to not overflow */ public function subUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static { return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit - $value, $overflowUnit); } /** * Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed. */ public function utcOffset(?int $minuteOffset = null): static|int { if ($minuteOffset === null) { return $this->offsetMinutes; } return $this->setTimezone(CarbonTimeZone::createFromMinuteOffset($minuteOffset)); } /** * Set the date with gregorian year, month and day numbers. * * @see https://php.net/manual/en/datetime.setdate.php */ public function setDate(int $year, int $month, int $day): static { return parent::setDate($year, $month, $day); } /** * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. * * @see https://php.net/manual/en/datetime.setisodate.php */ public function setISODate(int $year, int $week, int $day = 1): static { return parent::setISODate($year, $week, $day); } /** * Set the date and time all together. */ public function setDateTime( int $year, int $month, int $day, int $hour, int $minute, int $second = 0, int $microseconds = 0, ): static { return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second, $microseconds); } /** * Resets the current time of the DateTime object to a different time. * * @see https://php.net/manual/en/datetime.settime.php */ public function setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0): static { return parent::setTime($hour, $minute, $second, $microseconds); } /** * Set the instance's timestamp. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public function setTimestamp(float|int|string $timestamp): static { [$seconds, $microseconds] = self::getIntegerAndDecimalParts($timestamp); return parent::setTimestamp((int) $seconds)->setMicroseconds((int) $microseconds); } /** * Set the time by time string. */ public function setTimeFromTimeString(string $time): static { if (!str_contains($time, ':')) { $time .= ':0'; } return $this->modify($time); } /** * @alias setTimezone */ public function timezone(DateTimeZone|string|int $value): static { return $this->setTimezone($value); } /** * Set the timezone or returns the timezone name if no arguments passed. * * @return ($value is null ? string : static) */ public function tz(DateTimeZone|string|int|null $value = null): static|string { if ($value === null) { return $this->tzName; } return $this->setTimezone($value); } /** * Set the instance's timezone from a string or object. */ public function setTimezone(DateTimeZone|string|int $timeZone): static { return parent::setTimezone(static::safeCreateDateTimeZone($timeZone)); } /** * Set the instance's timezone from a string or object and add/subtract the offset difference. */ public function shiftTimezone(DateTimeZone|string $value): static { $dateTimeString = $this->format('Y-m-d H:i:s.u'); return $this ->setTimezone($value) ->modify($dateTimeString); } /** * Set the instance's timezone to UTC. */ public function utc(): static { return $this->setTimezone('UTC'); } /** * Set the year, month, and date for this instance to that of the passed instance. */ public function setDateFrom(DateTimeInterface|string $date): static { $date = $this->resolveCarbon($date); return $this->setDate($date->year, $date->month, $date->day); } /** * Set the hour, minute, second and microseconds for this instance to that of the passed instance. */ public function setTimeFrom(DateTimeInterface|string $date): static { $date = $this->resolveCarbon($date); return $this->setTime($date->hour, $date->minute, $date->second, $date->microsecond); } /** * Set the date and time for this instance to that of the passed instance. */ public function setDateTimeFrom(DateTimeInterface|string $date): static { $date = $this->resolveCarbon($date); return $this->modify($date->rawFormat('Y-m-d H:i:s.u')); } /** * Get the days of the week. */ public static function getDays(): array { return static::$days; } /////////////////////////////////////////////////////////////////// /////////////////////// WEEK SPECIAL DAYS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Get the first day of week. * * @return int */ public static function getWeekStartsAt(?string $locale = null): int { return (int) static::getTranslationMessageWith( $locale ? Translator::get($locale) : static::getTranslator(), 'first_day_of_week', ); } /** * Get the last day of week. * * @param string $locale local to consider the last day of week. * * @return int */ public static function getWeekEndsAt(?string $locale = null): int { return static::weekRotate(static::getWeekStartsAt($locale), -1); } /** * Get weekend days */ public static function getWeekendDays(): array { return FactoryImmutable::getInstance()->getWeekendDays(); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather consider week-end is always saturday and sunday, and if you have some custom * week-end days to handle, give to those days an other name and create a macro for them: * * ``` * Carbon::macro('isDayOff', function ($date) { * return $date->isSunday() || $date->isMonday(); * }); * Carbon::macro('isNotDayOff', function ($date) { * return !$date->isDayOff(); * }); * if ($someDate->isDayOff()) ... * if ($someDate->isNotDayOff()) ... * // Add 5 not-off days * $count = 5; * while ($someDate->isDayOff() || ($count-- > 0)) { * $someDate->addDay(); * } * ``` * * Set weekend days */ public static function setWeekendDays(array $days): void { FactoryImmutable::getDefaultInstance()->setWeekendDays($days); } /** * Determine if a time string will produce a relative date. * * @return bool true if time match a relative date, false if absolute or invalid time string */ public static function hasRelativeKeywords(?string $time): bool { if (!$time || strtotime($time) === false) { return false; } $date1 = new DateTime('2000-01-01T00:00:00Z'); $date1->modify($time); $date2 = new DateTime('2001-12-25T00:00:00Z'); $date2->modify($time); return $date1 != $date2; } /////////////////////////////////////////////////////////////////// /////////////////////// STRING FORMATTING ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Returns list of locale formats for ISO formatting. * * @param string|null $locale current locale used if null */ public function getIsoFormats(?string $locale = null): array { return [ 'LT' => $this->getTranslationMessage('formats.LT', $locale), 'LTS' => $this->getTranslationMessage('formats.LTS', $locale), 'L' => $this->getTranslationMessage('formats.L', $locale), 'LL' => $this->getTranslationMessage('formats.LL', $locale), 'LLL' => $this->getTranslationMessage('formats.LLL', $locale), 'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale), 'l' => $this->getTranslationMessage('formats.l', $locale), 'll' => $this->getTranslationMessage('formats.ll', $locale), 'lll' => $this->getTranslationMessage('formats.lll', $locale), 'llll' => $this->getTranslationMessage('formats.llll', $locale), ]; } /** * Returns list of calendar formats for ISO formatting. * * @param string|null $locale current locale used if null */ public function getCalendarFormats(?string $locale = null): array { return [ 'sameDay' => $this->getTranslationMessage('calendar.sameDay', $locale, '[Today at] LT'), 'nextDay' => $this->getTranslationMessage('calendar.nextDay', $locale, '[Tomorrow at] LT'), 'nextWeek' => $this->getTranslationMessage('calendar.nextWeek', $locale, 'dddd [at] LT'), 'lastDay' => $this->getTranslationMessage('calendar.lastDay', $locale, '[Yesterday at] LT'), 'lastWeek' => $this->getTranslationMessage('calendar.lastWeek', $locale, '[Last] dddd [at] LT'), 'sameElse' => $this->getTranslationMessage('calendar.sameElse', $locale, 'L'), ]; } /** * Returns list of locale units for ISO formatting. */ public static function getIsoUnits(): array { static $units = null; $units ??= [ 'OD' => ['getAltNumber', ['day']], 'OM' => ['getAltNumber', ['month']], 'OY' => ['getAltNumber', ['year']], 'OH' => ['getAltNumber', ['hour']], 'Oh' => ['getAltNumber', ['h']], 'Om' => ['getAltNumber', ['minute']], 'Os' => ['getAltNumber', ['second']], 'D' => 'day', 'DD' => ['rawFormat', ['d']], 'Do' => ['ordinal', ['day', 'D']], 'd' => 'dayOfWeek', 'dd' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedMinDayName( $originalFormat, ), 'ddd' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedShortDayName( $originalFormat, ), 'dddd' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedDayName( $originalFormat, ), 'DDD' => 'dayOfYear', 'DDDD' => ['getPaddedUnit', ['dayOfYear', 3]], 'DDDo' => ['ordinal', ['dayOfYear', 'DDD']], 'e' => ['weekday', []], 'E' => 'dayOfWeekIso', 'H' => ['rawFormat', ['G']], 'HH' => ['rawFormat', ['H']], 'h' => ['rawFormat', ['g']], 'hh' => ['rawFormat', ['h']], 'k' => 'noZeroHour', 'kk' => ['getPaddedUnit', ['noZeroHour']], 'hmm' => ['rawFormat', ['gi']], 'hmmss' => ['rawFormat', ['gis']], 'Hmm' => ['rawFormat', ['Gi']], 'Hmmss' => ['rawFormat', ['Gis']], 'm' => 'minute', 'mm' => ['rawFormat', ['i']], 'a' => 'meridiem', 'A' => 'upperMeridiem', 's' => 'second', 'ss' => ['getPaddedUnit', ['second']], 'S' => static fn (CarbonInterface $date) => (string) floor($date->micro / 100000), 'SS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 10000, 2), 'SSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 1000, 3), 'SSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 100, 4), 'SSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 10, 5), 'SSSSSS' => ['getPaddedUnit', ['micro', 6]], 'SSSSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro * 10, 7), 'SSSSSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro * 100, 8), 'SSSSSSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro * 1000, 9), 'M' => 'month', 'MM' => ['rawFormat', ['m']], 'MMM' => static function (CarbonInterface $date, $originalFormat = null) { $month = $date->getTranslatedShortMonthName($originalFormat); $suffix = $date->getTranslationMessage('mmm_suffix'); if ($suffix && $month !== $date->monthName) { $month .= $suffix; } return $month; }, 'MMMM' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedMonthName( $originalFormat, ), 'Mo' => ['ordinal', ['month', 'M']], 'Q' => 'quarter', 'Qo' => ['ordinal', ['quarter', 'M']], 'G' => 'isoWeekYear', 'GG' => ['getPaddedUnit', ['isoWeekYear']], 'GGG' => ['getPaddedUnit', ['isoWeekYear', 3]], 'GGGG' => ['getPaddedUnit', ['isoWeekYear', 4]], 'GGGGG' => ['getPaddedUnit', ['isoWeekYear', 5]], 'g' => 'weekYear', 'gg' => ['getPaddedUnit', ['weekYear']], 'ggg' => ['getPaddedUnit', ['weekYear', 3]], 'gggg' => ['getPaddedUnit', ['weekYear', 4]], 'ggggg' => ['getPaddedUnit', ['weekYear', 5]], 'W' => 'isoWeek', 'WW' => ['getPaddedUnit', ['isoWeek']], 'Wo' => ['ordinal', ['isoWeek', 'W']], 'w' => 'week', 'ww' => ['getPaddedUnit', ['week']], 'wo' => ['ordinal', ['week', 'w']], 'x' => ['valueOf', []], 'X' => 'timestamp', 'Y' => 'year', 'YY' => ['rawFormat', ['y']], 'YYYY' => ['getPaddedUnit', ['year', 4]], 'YYYYY' => ['getPaddedUnit', ['year', 5]], 'YYYYYY' => static fn (CarbonInterface $date) => ($date->year < 0 ? '' : '+'). $date->getPaddedUnit('year', 6), 'z' => ['rawFormat', ['T']], 'zz' => 'tzName', 'Z' => ['getOffsetString', []], 'ZZ' => ['getOffsetString', ['']], ]; return $units; } /** * Returns a unit of the instance padded with 0 by default or any other string if specified. * * @param string $unit Carbon unit name * @param int $length Length of the output (2 by default) * @param string $padString String to use for padding ("0" by default) * @param int $padType Side(s) to pad (STR_PAD_LEFT by default) */ public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = STR_PAD_LEFT): string { return ($this->$unit < 0 ? '-' : '').str_pad((string) abs($this->$unit), $length, $padString, $padType); } /** * Return a property with its ordinal. */ public function ordinal(string $key, ?string $period = null): string { $number = $this->$key; $result = $this->translate('ordinal', [ ':number' => $number, ':period' => (string) $period, ]); return (string) ($result === 'ordinal' ? $number : $result); } /** * Return the meridiem of the current time in the current locale. * * @param bool $isLower if true, returns lowercase variant if available in the current locale. */ public function meridiem(bool $isLower = false): string { $hour = $this->hour; $index = $hour < static::HOURS_PER_DAY / 2 ? 0 : 1; if ($isLower) { $key = 'meridiem.'.($index + 2); $result = $this->translate($key); if ($result !== $key) { return $result; } } $key = "meridiem.$index"; $result = $this->translate($key); if ($result === $key) { $result = $this->translate('meridiem', [ ':hour' => $this->hour, ':minute' => $this->minute, ':isLower' => $isLower, ]); if ($result === 'meridiem') { return $isLower ? $this->latinMeridiem : $this->latinUpperMeridiem; } } elseif ($isLower) { $result = mb_strtolower($result); } return $result; } /** * Returns the alternative number for a given date property if available in the current locale. * * @param string $key date property */ public function getAltNumber(string $key): string { return $this->translateNumber((int) (\strlen($key) > 1 ? $this->$key : $this->rawFormat($key))); } /** * Format in the current language using ISO replacement patterns. * * @param string|null $originalFormat provide context if a chunk has been passed alone */ public function isoFormat(string $format, ?string $originalFormat = null): string { $result = ''; $length = mb_strlen($format); $originalFormat ??= $format; $inEscaped = false; $formats = null; $units = null; for ($i = 0; $i < $length; $i++) { $char = mb_substr($format, $i, 1); if ($char === '\\') { $result .= mb_substr($format, ++$i, 1); continue; } if ($char === '[' && !$inEscaped) { $inEscaped = true; continue; } if ($char === ']' && $inEscaped) { $inEscaped = false; continue; } if ($inEscaped) { $result .= $char; continue; } $input = mb_substr($format, $i); if (preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) { if ($formats === null) { $formats = $this->getIsoFormats(); } $code = $match[0]; $sequence = $formats[$code] ?? preg_replace_callback( '/MMMM|MM|DD|dddd/', static fn ($code) => mb_substr($code[0], 1), $formats[strtoupper($code)] ?? '', ); $rest = mb_substr($format, $i + mb_strlen($code)); $format = mb_substr($format, 0, $i).$sequence.$rest; $length = mb_strlen($format); $input = $sequence.$rest; } if (preg_match('/^'.CarbonInterface::ISO_FORMAT_REGEXP.'/', $input, $match)) { $code = $match[0]; if ($units === null) { $units = static::getIsoUnits(); } $sequence = $units[$code] ?? ''; if ($sequence instanceof Closure) { $sequence = $sequence($this, $originalFormat); } elseif (\is_array($sequence)) { try { $sequence = $this->{$sequence[0]}(...$sequence[1]); } catch (ReflectionException | InvalidArgumentException | BadMethodCallException) { $sequence = ''; } } elseif (\is_string($sequence)) { $sequence = $this->$sequence ?? $code; } $format = mb_substr($format, 0, $i).$sequence.mb_substr($format, $i + mb_strlen($code)); $i += mb_strlen((string) $sequence) - 1; $length = mb_strlen($format); $char = $sequence; } $result .= $char; } return $result; } /** * List of replacements from date() format to isoFormat(). */ public static function getFormatsToIsoReplacements(): array { static $replacements = null; $replacements ??= [ 'd' => true, 'D' => 'ddd', 'j' => true, 'l' => 'dddd', 'N' => true, 'S' => static fn ($date) => str_replace((string) $date->rawFormat('j'), '', $date->isoFormat('Do')), 'w' => true, 'z' => true, 'W' => true, 'F' => 'MMMM', 'm' => true, 'M' => 'MMM', 'n' => true, 't' => true, 'L' => true, 'o' => true, 'Y' => true, 'y' => true, 'a' => 'a', 'A' => 'A', 'B' => true, 'g' => true, 'G' => true, 'h' => true, 'H' => true, 'i' => true, 's' => true, 'u' => true, 'v' => true, 'E' => true, 'I' => true, 'O' => true, 'P' => true, 'Z' => true, 'c' => true, 'r' => true, 'U' => true, 'T' => true, ]; return $replacements; } /** * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) * but translate words whenever possible (months, day names, etc.) using the current locale. */ public function translatedFormat(string $format): string { $replacements = static::getFormatsToIsoReplacements(); $context = ''; $isoFormat = ''; $length = mb_strlen($format); for ($i = 0; $i < $length; $i++) { $char = mb_substr($format, $i, 1); if ($char === '\\') { $replacement = mb_substr($format, $i, 2); $isoFormat .= $replacement; $i++; continue; } if (!isset($replacements[$char])) { $replacement = preg_match('/^[A-Za-z]$/', $char) ? "\\$char" : $char; $isoFormat .= $replacement; $context .= $replacement; continue; } $replacement = $replacements[$char]; if ($replacement === true) { static $contextReplacements = null; if ($contextReplacements === null) { $contextReplacements = [ 'm' => 'MM', 'd' => 'DD', 't' => 'D', 'j' => 'D', 'N' => 'e', 'w' => 'e', 'n' => 'M', 'o' => 'YYYY', 'Y' => 'YYYY', 'y' => 'YY', 'g' => 'h', 'G' => 'H', 'h' => 'hh', 'H' => 'HH', 'i' => 'mm', 's' => 'ss', ]; } $isoFormat .= '['.$this->rawFormat($char).']'; $context .= $contextReplacements[$char] ?? ' '; continue; } if ($replacement instanceof Closure) { $replacement = '['.$replacement($this).']'; $isoFormat .= $replacement; $context .= $replacement; continue; } $isoFormat .= $replacement; $context .= $replacement; } return $this->isoFormat($isoFormat, $context); } /** * Returns the offset hour and minute formatted with +/- and a given separator (":" by default). * For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first * argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something * like "-12:00". * * @param string $separator string to place between hours and minutes (":" by default) */ public function getOffsetString(string $separator = ':'): string { $second = $this->getOffset(); $symbol = $second < 0 ? '-' : '+'; $minute = abs($second) / static::SECONDS_PER_MINUTE; $hour = self::floorZeroPad($minute / static::MINUTES_PER_HOUR, 2); $minute = self::floorZeroPad(((int) $minute) % static::MINUTES_PER_HOUR, 2); return "$symbol$hour$separator$minute"; } /** * Dynamically handle calls to the class. * * @param string $method magic method name called * @param array $parameters parameters list * * @throws BadMethodCallException */ public static function __callStatic(string $method, array $parameters): mixed { if (!static::hasMacro($method)) { foreach (static::getGenericMacros() as $callback) { try { return static::executeStaticCallable($callback, $method, ...$parameters); } catch (BadMethodCallException) { continue; } } if (static::isStrictModeEnabled()) { throw new UnknownMethodException(\sprintf('%s::%s', static::class, $method)); } return null; } return static::executeStaticCallable(static::getMacro($method), ...$parameters); } /** * Set specified unit to new given value. * * @param string $unit year, month, day, hour, minute, second or microsecond * @param Month|int $value new value for given unit */ public function setUnit(string $unit, Month|int|float|null $value = null): static { if (\is_float($value)) { $int = (int) $value; if ((float) $int !== $value) { throw new InvalidArgumentException( "$unit cannot be changed to float value $value, integer expected", ); } $value = $int; } $unit = static::singularUnit($unit); $value = self::monthToInt($value, $unit); $dateUnits = ['year', 'month', 'day']; if (\in_array($unit, $dateUnits)) { return $this->setDate(...array_map( fn ($name) => (int) ($name === $unit ? $value : $this->$name), $dateUnits, )); } $units = ['hour', 'minute', 'second', 'micro']; if ($unit === 'millisecond' || $unit === 'milli') { $value *= 1000; $unit = 'micro'; } elseif ($unit === 'microsecond') { $unit = 'micro'; } return $this->setTime(...array_map( fn ($name) => (int) ($name === $unit ? $value : $this->$name), $units, )); } /** * Returns standardized singular of a given singular/plural unit name (in English). */ public static function singularUnit(string $unit): string { $unit = rtrim(mb_strtolower($unit), 's'); return match ($unit) { 'centurie' => 'century', 'millennia' => 'millennium', default => $unit, }; } /** * Returns standardized plural of a given singular/plural unit name (in English). */ public static function pluralUnit(string $unit): string { $unit = rtrim(strtolower($unit), 's'); return match ($unit) { 'century' => 'centuries', 'millennium', 'millennia' => 'millennia', default => "{$unit}s", }; } public static function sleep(int|float $seconds): void { if (static::hasTestNow()) { static::setTestNow(static::getTestNow()->avoidMutation()->addSeconds($seconds)); return; } (new NativeClock('UTC'))->sleep($seconds); } /** * Dynamically handle calls to the class. * * @param string $method magic method name called * @param array $parameters parameters list * * @throws UnknownMethodException|BadMethodCallException|ReflectionException|Throwable */ public function __call(string $method, array $parameters): mixed { $unit = rtrim($method, 's'); return $this->callDiffAlias($unit, $parameters) ?? $this->callHumanDiffAlias($unit, $parameters) ?? $this->callRoundMethod($unit, $parameters) ?? $this->callIsMethod($unit, $parameters) ?? $this->callModifierMethod($unit, $parameters) ?? $this->callPeriodMethod($method, $parameters) ?? $this->callGetOrSetMethod($method, $parameters) ?? $this->callMacroMethod($method, $parameters); } /** * Return the Carbon instance passed through, a now instance in the same timezone * if null given or parse the input if string given. */ protected function resolveCarbon(DateTimeInterface|string|null $date): self { if (!$date) { return $this->nowWithSameTz(); } if (\is_string($date)) { return $this->transmitFactory(fn () => static::parse($date, $this->getTimezone())); } return $date instanceof self ? $date : $this->transmitFactory(static fn () => static::instance($date)); } protected static function weekRotate(int $day, int $rotation): int { return (static::DAYS_PER_WEEK + $rotation % static::DAYS_PER_WEEK + $day) % static::DAYS_PER_WEEK; } protected function executeCallable(callable $macro, ...$parameters) { if ($macro instanceof Closure) { $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); return \call_user_func_array($boundMacro ?: $macro, $parameters); } return \call_user_func_array($macro, $parameters); } protected function executeCallableWithContext(callable $macro, ...$parameters) { return static::bindMacroContext($this, function () use (&$macro, &$parameters) { return $this->executeCallable($macro, ...$parameters); }); } protected function getAllGenericMacros(): Generator { yield from $this->localGenericMacros ?? []; yield from $this->transmitFactory(static fn () => static::getGenericMacros()); } protected static function getGenericMacros(): Generator { foreach ((FactoryImmutable::getInstance()->getSettings()['genericMacros'] ?? []) as $list) { foreach ($list as $macro) { yield $macro; } } } protected static function executeStaticCallable(callable $macro, ...$parameters) { return static::bindMacroContext(null, function () use (&$macro, &$parameters) { if ($macro instanceof Closure) { $boundMacro = @Closure::bind($macro, null, static::class); return \call_user_func_array($boundMacro ?: $macro, $parameters); } return \call_user_func_array($macro, $parameters); }); } protected function getTranslatedFormByRegExp($baseKey, $keySuffix, $context, $subKey, $defaultValue) { $key = $baseKey.$keySuffix; $standaloneKey = $key.'_standalone'; $baseTranslation = $this->getTranslationMessage($key); if ($baseTranslation instanceof Closure) { return $baseTranslation($this, $context, $subKey) ?: $defaultValue; } if ( $this->getTranslationMessage("$standaloneKey.$subKey") && (!$context || (($regExp = $this->getTranslationMessage($baseKey.'_regexp')) && !preg_match($regExp, $context))) ) { $key = $standaloneKey; } return $this->getTranslationMessage("$key.$subKey", null, $defaultValue); } private function callGetOrSetMethod(string $method, array $parameters): mixed { if (preg_match('/^([a-z]{2,})(In|Of)([A-Z][a-z]+)$/', $method)) { $localStrictModeEnabled = $this->localStrictModeEnabled; $this->localStrictModeEnabled = true; try { return $this->callGetOrSet($method, $parameters[0] ?? null); } catch (UnknownGetterException|UnknownSetterException|ImmutableException) { // continue to macro } finally { $this->localStrictModeEnabled = $localStrictModeEnabled; } } return null; } private function callGetOrSet(string $name, mixed $value): mixed { if ($value !== null) { if (\is_string($value) || \is_int($value) || \is_float($value) || $value instanceof DateTimeZone || $value instanceof Month) { return $this->set($name, $value); } return null; } return $this->get($name); } private function getUTCUnit(string $unit): ?string { if (str_starts_with($unit, 'Real')) { return substr($unit, 4); } if (str_starts_with($unit, 'UTC')) { return substr($unit, 3); } return null; } private function callDiffAlias(string $method, array $parameters): mixed { if (preg_match('/^(diff|floatDiff)In(Real|UTC|Utc)?(.+)$/', $method, $match)) { $mode = strtoupper($match[2] ?? ''); $betterMethod = $match[1] === 'floatDiff' ? str_replace('floatDiff', 'diff', $method) : null; if ($mode === 'REAL') { $mode = 'UTC'; $betterMethod = str_replace($match[2], 'UTC', $betterMethod ?? $method); } if ($betterMethod) { @trigger_error( "Use the method $betterMethod instead to make it more explicit about what it does.\n". 'On next major version, "float" prefix will be removed (as all diff are now returning floating numbers)'. ' and "Real" methods will be removed in favor of "UTC" because what it actually does is to convert both'. ' dates to UTC timezone before comparison, while by default it does it only if both dates don\'t have'. ' exactly the same timezone (Note: 2 timezones with the same offset but different names are considered'. " different as it's not safe to assume they will always have the same offset).", \E_USER_DEPRECATED, ); } $unit = self::pluralUnit($match[3]); $diffMethod = 'diffIn'.ucfirst($unit); if (\in_array($unit, ['days', 'weeks', 'months', 'quarters', 'years'])) { $parameters['utc'] = ($mode === 'UTC'); } if (method_exists($this, $diffMethod)) { return $this->$diffMethod(...$parameters); } } return null; } private function callHumanDiffAlias(string $method, array $parameters): ?string { $diffSizes = [ // @mode diffForHumans 'short' => true, // @mode diffForHumans 'long' => false, ]; $diffSyntaxModes = [ // @call diffForHumans 'Absolute' => CarbonInterface::DIFF_ABSOLUTE, // @call diffForHumans 'Relative' => CarbonInterface::DIFF_RELATIVE_AUTO, // @call diffForHumans 'RelativeToNow' => CarbonInterface::DIFF_RELATIVE_TO_NOW, // @call diffForHumans 'RelativeToOther' => CarbonInterface::DIFF_RELATIVE_TO_OTHER, ]; $sizePattern = implode('|', array_keys($diffSizes)); $syntaxPattern = implode('|', array_keys($diffSyntaxModes)); if (preg_match("/^(?$sizePattern)(?$syntaxPattern)DiffForHuman$/", $method, $match)) { $dates = array_filter($parameters, function ($parameter) { return $parameter instanceof DateTimeInterface; }); $other = null; if (\count($dates)) { $key = key($dates); $other = current($dates); array_splice($parameters, $key, 1); } return $this->diffForHumans($other, $diffSyntaxModes[$match['syntax']], $diffSizes[$match['size']], ...$parameters); } return null; } private function callIsMethod(string $unit, array $parameters): ?bool { if (!str_starts_with($unit, 'is')) { return null; } $word = substr($unit, 2); if (\in_array($word, static::$days, true)) { return $this->isDayOfWeek($word); } return match ($word) { // @call is Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) 'Utc', 'UTC' => $this->utc, // @call is Check if the current instance has non-UTC timezone. 'Local' => $this->local, // @call is Check if the current instance is a valid date. 'Valid' => $this->year !== 0, // @call is Check if the current instance is in a daylight saving time. 'DST' => $this->dst, default => $this->callComparatorMethod($word, $parameters), }; } private function callComparatorMethod(string $unit, array $parameters): ?bool { $start = substr($unit, 0, 4); $factor = -1; if ($start === 'Last') { $start = 'Next'; $factor = 1; } if ($start === 'Next') { $lowerUnit = strtolower(substr($unit, 4)); if (static::isModifiableUnit($lowerUnit)) { return $this->avoidMutation()->addUnit($lowerUnit, $factor, false)->isSameUnit($lowerUnit, ...($parameters ?: ['now'])); } } if ($start === 'Same') { try { return $this->isSameUnit(strtolower(substr($unit, 4)), ...$parameters); } catch (BadComparisonUnitException) { // Try next } } if (str_starts_with($unit, 'Current')) { try { return $this->isCurrentUnit(strtolower(substr($unit, 7))); } catch (BadComparisonUnitException | BadMethodCallException) { // Try next } } return null; } private function callModifierMethod(string $unit, array $parameters): ?static { $action = substr($unit, 0, 3); $overflow = null; if ($action === 'set') { $unit = strtolower(substr($unit, 3)); } if (\in_array($unit, static::$units, true)) { return $this->setUnit($unit, ...$parameters); } if ($action === 'add' || $action === 'sub') { $unit = substr($unit, 3); $utcUnit = $this->getUTCUnit($unit); if ($utcUnit) { $unit = static::singularUnit($utcUnit); return $this->{"{$action}UTCUnit"}($unit, ...$parameters); } if (preg_match('/^(Month|Quarter|Year|Decade|Century|Centurie|Millennium|Millennia)s?(No|With|Without|WithNo)Overflow$/', $unit, $match)) { $unit = $match[1]; $overflow = $match[2] === 'With'; } $unit = static::singularUnit($unit); } if (static::isModifiableUnit($unit)) { return $this->{"{$action}Unit"}($unit, $this->getMagicParameter($parameters, 0, 'value', 1), $overflow); } return null; } private function callPeriodMethod(string $method, array $parameters): ?CarbonPeriod { if (str_ends_with($method, 'Until')) { try { $unit = static::singularUnit(substr($method, 0, -5)); return $this->range( $this->getMagicParameter($parameters, 0, 'endDate', $this), $this->getMagicParameter($parameters, 1, 'factor', 1), $unit ); } catch (InvalidArgumentException) { // Try macros } } return null; } private function callMacroMethod(string $method, array $parameters): mixed { return static::bindMacroContext($this, function () use (&$method, &$parameters) { $macro = $this->getLocalMacro($method); if (!$macro) { foreach ($this->getAllGenericMacros() as $callback) { try { return $this->executeCallable($callback, $method, ...$parameters); } catch (BadMethodCallException) { continue; } } if ($this->isLocalStrictModeEnabled()) { throw new UnknownMethodException($method); } return null; } return $this->executeCallable($macro, ...$parameters); }); } private static function floorZeroPad(int|float $value, int $length): string { return str_pad((string) floor($value), $length, '0', STR_PAD_LEFT); } /** * @template T of CarbonInterface * * @param T $date * * @return T */ private function mutateIfMutable(CarbonInterface $date): CarbonInterface { return $this instanceof DateTimeImmutable ? $date : $this->modify('@'.$date->rawFormat('U.u'))->setTimezone($date->getTimezone()); } } ================================================ FILE: src/Carbon/Traits/DeprecatedPeriodProperties.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use Carbon\CarbonInterval; trait DeprecatedPeriodProperties { /** * Period start in PHP < 8.2. * * @var CarbonInterface * * @deprecated PHP 8.2 this property is no longer in sync with the actual period start. */ public $start; /** * Period end in PHP < 8.2. * * @var CarbonInterface|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period end. */ public $end; /** * Period current iterated date in PHP < 8.2. * * @var CarbonInterface|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period current iterated date. */ public $current; /** * Period interval in PHP < 8.2. * * @var CarbonInterval|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period interval. */ public $interval; /** * Period recurrences in PHP < 8.2. * * @var int|float|null * * @deprecated PHP 8.2 this property is no longer in sync with the actual period recurrences. */ public $recurrences; /** * Period start included option in PHP < 8.2. * * @var bool * * @deprecated PHP 8.2 this property is no longer in sync with the actual period start included option. */ public $include_start_date; /** * Period end included option in PHP < 8.2. * * @var bool * * @deprecated PHP 8.2 this property is no longer in sync with the actual period end included option. */ public $include_end_date; } ================================================ FILE: src/Carbon/Traits/Difference.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\Exceptions\UnknownUnitException; use Carbon\Unit; use Closure; use DateInterval; use DateTimeInterface; /** * Trait Difference. * * Depends on the following methods: * * @method bool lessThan($date) * @method static copy() * @method static resolveCarbon($date = null) */ trait Difference { /** * Get the difference as a DateInterval instance. * Return relative interval (negative if $absolute flag is not set to true and the given date is before * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return DateInterval */ public function diffAsDateInterval($date = null, bool $absolute = false): DateInterval { $other = $this->resolveCarbon($date); // Work-around for https://bugs.php.net/bug.php?id=81458 // It was initially introduced for https://bugs.php.net/bug.php?id=80998 // The very specific case of 80998 was fixed in PHP 8.1beta3, but it introduced 81458 // So we still need to keep this for now if ($other->tz !== $this->tz) { $other = $other->avoidMutation()->setTimezone($this->tz); } return parent::diff($other, $absolute); } /** * Get the difference as a CarbonInterval instance. * Return relative interval (negative if $absolute flag is not set to true and the given date is before * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return CarbonInterval */ public function diffAsCarbonInterval($date = null, bool $absolute = false, array $skip = []): CarbonInterval { return CarbonInterval::diff($this, $this->resolveCarbon($date), $absolute, $skip) ->setLocalTranslator($this->getLocalTranslator()); } /** * @alias diffAsCarbonInterval * * Get the difference as a DateInterval instance. * Return relative interval (negative if $absolute flag is not set to true and the given date is before * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return CarbonInterval */ public function diff($date = null, bool $absolute = false, array $skip = []): CarbonInterval { return $this->diffAsCarbonInterval($date, $absolute, $skip); } /** * @param Unit|string $unit microsecond, millisecond, second, minute, * hour, day, week, month, quarter, year, * century, millennium * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInUnit(Unit|string $unit, $date = null, bool $absolute = false, bool $utc = false): float { $unit = static::pluralUnit($unit instanceof Unit ? $unit->value : rtrim($unit, 'z')); $method = 'diffIn'.$unit; if (!method_exists($this, $method)) { throw new UnknownUnitException($unit); } return $this->$method($date, $absolute, $utc); } /** * Get the difference in years * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInYears($date = null, bool $absolute = false, bool $utc = false): float { $start = $this; $end = $this->resolveCarbon($date); if ($utc) { $start = $start->avoidMutation()->utc(); $end = $end->avoidMutation()->utc(); } $ascending = ($start <= $end); $sign = $absolute || $ascending ? 1 : -1; if (!$ascending) { [$start, $end] = [$end, $start]; } $yearsDiff = (int) $start->diff($end, $absolute)->format('%r%y'); /** @var Carbon|CarbonImmutable $floorEnd */ $floorEnd = $start->avoidMutation()->addYears($yearsDiff); if ($floorEnd >= $end) { return $sign * $yearsDiff; } /** @var Carbon|CarbonImmutable $ceilEnd */ $ceilEnd = $start->avoidMutation()->addYears($yearsDiff + 1); $daysToFloor = $floorEnd->diffInDays($end); $daysToCeil = $end->diffInDays($ceilEnd); return $sign * ($yearsDiff + $daysToFloor / ($daysToCeil + $daysToFloor)); } /** * Get the difference in quarters. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInQuarters($date = null, bool $absolute = false, bool $utc = false): float { return $this->diffInMonths($date, $absolute, $utc) / static::MONTHS_PER_QUARTER; } /** * Get the difference in months. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInMonths($date = null, bool $absolute = false, bool $utc = false): float { $start = $this; $end = $this->resolveCarbon($date); // Compare using UTC if ($utc || ($end->timezoneName !== $start->timezoneName)) { $start = $start->avoidMutation()->utc(); $end = $end->avoidMutation()->utc(); } [$yearStart, $monthStart, $dayStart] = explode('-', $start->format('Y-m-dHisu')); [$yearEnd, $monthEnd, $dayEnd] = explode('-', $end->format('Y-m-dHisu')); $monthsDiff = (((int) $yearEnd) - ((int) $yearStart)) * static::MONTHS_PER_YEAR + ((int) $monthEnd) - ((int) $monthStart); if ($monthsDiff > 0) { $monthsDiff -= ($dayStart > $dayEnd ? 1 : 0); } elseif ($monthsDiff < 0) { $monthsDiff += ($dayStart < $dayEnd ? 1 : 0); } $ascending = ($start <= $end); $sign = $absolute || $ascending ? 1 : -1; $monthsDiff = abs($monthsDiff); if (!$ascending) { [$start, $end] = [$end, $start]; } /** @var Carbon|CarbonImmutable $floorEnd */ $floorEnd = $start->avoidMutation()->addMonths($monthsDiff); if ($floorEnd >= $end) { return $sign * $monthsDiff; } /** @var Carbon|CarbonImmutable $ceilEnd */ $ceilEnd = $start->avoidMutation()->addMonths($monthsDiff + 1); $daysToFloor = $floorEnd->diffInDays($end); $daysToCeil = $end->diffInDays($ceilEnd); return $sign * ($monthsDiff + $daysToFloor / ($daysToCeil + $daysToFloor)); } /** * Get the difference in weeks. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInWeeks($date = null, bool $absolute = false, bool $utc = false): float { return $this->diffInDays($date, $absolute, $utc) / static::DAYS_PER_WEEK; } /** * Get the difference in days. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) * * @return float */ public function diffInDays($date = null, bool $absolute = false, bool $utc = false): float { $date = $this->resolveCarbon($date); $current = $this; // Compare using UTC if ($utc || ($date->timezoneName !== $current->timezoneName)) { $date = $date->avoidMutation()->utc(); $current = $current->avoidMutation()->utc(); } $negative = ($date < $current); [$start, $end] = $negative ? [$date, $current] : [$current, $date]; $interval = $start->diffAsDateInterval($end); $daysA = $this->getIntervalDayDiff($interval); $floorEnd = $start->avoidMutation()->addDays($daysA); $daysB = $daysA + ($floorEnd <= $end ? 1 : -1); $ceilEnd = $start->avoidMutation()->addDays($daysB); $microsecondsBetween = $floorEnd->diffInMicroseconds($ceilEnd); $microsecondsToEnd = $floorEnd->diffInMicroseconds($end); return ($negative && !$absolute ? -1 : 1) * ($daysA * ($microsecondsBetween - $microsecondsToEnd) + $daysB * $microsecondsToEnd) / $microsecondsBetween; } /** * Get the difference in days using a filter closure. * * @param Closure $callback * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInDaysFiltered(Closure $callback, $date = null, bool $absolute = false): int { return $this->diffFiltered(CarbonInterval::day(), $callback, $date, $absolute); } /** * Get the difference in hours using a filter closure. * * @param Closure $callback * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInHoursFiltered(Closure $callback, $date = null, bool $absolute = false): int { return $this->diffFiltered(CarbonInterval::hour(), $callback, $date, $absolute); } /** * Get the difference by the given interval using a filter closure. * * @param CarbonInterval $ci An interval to traverse by * @param Closure $callback * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false): int { $start = $this; $end = $this->resolveCarbon($date); $inverse = false; if ($end < $start) { $start = $end; $end = $this; $inverse = true; } $options = CarbonPeriod::EXCLUDE_END_DATE | ($this->isMutable() ? 0 : CarbonPeriod::IMMUTABLE); $diff = $ci->toPeriod($start, $end, $options)->filter($callback)->count(); return $inverse && !$absolute ? -$diff : $diff; } /** * Get the difference in weekdays. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeekdays($date = null, bool $absolute = false): int { return $this->diffInDaysFiltered( static fn (CarbonInterface $date) => $date->isWeekday(), $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), $absolute, ); } /** * Get the difference in weekend days using a filter. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return int */ public function diffInWeekendDays($date = null, bool $absolute = false): int { return $this->diffInDaysFiltered( static fn (CarbonInterface $date) => $date->isWeekend(), $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), $absolute, ); } /** * Get the difference in hours. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInHours($date = null, bool $absolute = false): float { return $this->diffInMinutes($date, $absolute) / static::MINUTES_PER_HOUR; } /** * Get the difference in minutes. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInMinutes($date = null, bool $absolute = false): float { return $this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE; } /** * Get the difference in seconds. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInSeconds($date = null, bool $absolute = false): float { return $this->diffInMilliseconds($date, $absolute) / static::MILLISECONDS_PER_SECOND; } /** * Get the difference in microseconds. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInMicroseconds($date = null, bool $absolute = false): float { /** @var CarbonInterface $date */ $date = $this->resolveCarbon($date); $value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND + $date->micro - $this->micro; return $absolute ? abs($value) : $value; } /** * Get the difference in milliseconds. * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference * * @return float */ public function diffInMilliseconds($date = null, bool $absolute = false): float { return $this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND; } /** * The number of seconds since midnight. * * @return float */ public function secondsSinceMidnight(): float { return $this->diffInSeconds($this->copy()->startOfDay(), true); } /** * The number of seconds until 23:59:59. * * @return float */ public function secondsUntilEndOfDay(): float { return $this->diffInSeconds($this->copy()->endOfDay(), true); } /** * Get the difference in a human readable format in the current locale from current instance to an other * instance given (or now if null given). * * @example * ``` * echo Carbon::tomorrow()->diffForHumans() . "\n"; * echo Carbon::tomorrow()->diffForHumans(['parts' => 2]) . "\n"; * echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n"; * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n"; * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n"; * ``` * * @param Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * ⦿ 'syntax' entry (see below) * ⦿ 'short' entry (see below) * ⦿ 'parts' entry (see below) * ⦿ 'options' entry (see below) * ⦿ 'skip' entry, list of units to skip (array of strings or a single string, * ` it can be the unit name (singular or plural) or its shortcut * ` (y, m, w, d, h, min, s, ms, µs). * ⦿ 'aUnit' entry, prefer "an hour" over "1 hour" if true * ⦿ 'altNumbers' entry, use alternative numbers if available * ` (from the current language if true is passed, from the given language(s) * ` if array or string is passed) * ⦿ 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * ⦿ 'other' entry (see above) * ⦿ 'minimumUnit' entry determines the smallest unit of time to display can be long or * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * ⦿ 'locale' language in which the diff should be output (has no effect if 'translator' key is set) * ⦿ 'translator' a custom translator to use to translator the output. * if int passed, it adds modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options */ public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null): string { /* @var CarbonInterface $this */ if (\is_array($other)) { $other['syntax'] = \array_key_exists('syntax', $other) ? $other['syntax'] : $syntax; $syntax = $other; $other = $syntax['other'] ?? null; } $intSyntax = &$syntax; if (\is_array($syntax)) { $syntax['syntax'] = $syntax['syntax'] ?? null; $intSyntax = &$syntax['syntax']; } $intSyntax = (int) ($intSyntax ?? static::DIFF_RELATIVE_AUTO); $intSyntax = $intSyntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $intSyntax; $parts = min(7, max(1, (int) $parts)); $skip = \is_array($syntax) ? ($syntax['skip'] ?? []) : []; $options ??= $this->localHumanDiffOptions ?? $this->transmitFactory( static fn () => static::getHumanDiffOptions(), ); return $this->diff($other, skip: (array) $skip)->forHumans($syntax, (bool) $short, $parts, $options); } /** * @alias diffForHumans * * Get the difference in a human readable format in the current locale from current instance to an other * instance given (or now if null given). * * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null) { return $this->diffForHumans($other, $syntax, $short, $parts, $options); } /** * @alias diffForHumans * * Get the difference in a human readable format in the current locale from current instance to an other * instance given (or now if null given). */ public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null) { return $this->diffForHumans($other, $syntax, $short, $parts, $options); } /** * Get the difference in a human readable format in the current locale from an other * instance given (or now if null given) to current instance. * * When comparing a value in the past to default now: * 1 hour from now * 5 months from now * * When comparing a value in the future to default now: * 1 hour ago * 5 months ago * * When comparing a value in the past to another value: * 1 hour after * 5 months after * * When comparing a value in the future to another value: * 1 hour before * 5 months before * * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null) { if (!$syntax && !$other) { $syntax = CarbonInterface::DIFF_RELATIVE_TO_NOW; } return $this->resolveCarbon($other)->diffForHumans($this, $syntax, $short, $parts, $options); } /** * @alias to * * Get the difference in a human readable format in the current locale from an other * instance given (or now if null given) to current instance. * * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; * if null passed, now will be used as comparison reference; * if any other type, it will be converted to date and used as reference. * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null) { return $this->to($other, $syntax, $short, $parts, $options); } /** * Get the difference in a human readable format in the current locale from current * instance to now. * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single unit) * @param int $options human diff options * * @return string */ public function fromNow($syntax = null, $short = false, $parts = 1, $options = null) { $other = null; if ($syntax instanceof DateTimeInterface) { [$other, $syntax, $short, $parts, $options] = array_pad(\func_get_args(), 5, null); } return $this->from($other, $syntax, $short, $parts, $options); } /** * Get the difference in a human readable format in the current locale from an other * instance given to now * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single part) * @param int $options human diff options * * @return string */ public function toNow($syntax = null, $short = false, $parts = 1, $options = null) { return $this->to(null, $syntax, $short, $parts, $options); } /** * Get the difference in a human readable format in the current locale from an other * instance given to now * * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: * - 'syntax' entry (see below) * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string * ` - if $join is an array, the first item will be the default glue, and the second item * ` will be used instead of the glue for the last item * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier * Default value: CarbonInterface::DIFF_ABSOLUTE * @param bool $short displays short format of time units * @param int $parts maximum number of parts to display (default value: 1: single part) * @param int $options human diff options * * @return string */ public function ago($syntax = null, $short = false, $parts = 1, $options = null) { $other = null; if ($syntax instanceof DateTimeInterface) { [$other, $syntax, $short, $parts, $options] = array_pad(\func_get_args(), 5, null); } return $this->from($other, $syntax, $short, $parts, $options); } /** * Get the difference in a human-readable format in the current locale from current instance to another * instance given (or now if null given). * * @return string */ public function timespan($other = null, $timezone = null): string { if (\is_string($other)) { $other = $this->transmitFactory(static fn () => static::parse($other, $timezone)); } return $this->diffForHumans($other, [ 'join' => ', ', 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'parts' => INF, ]); } /** * Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, * or a calendar date (e.g. "10/29/2017") otherwise. * * Language, date and time formats will change according to the current locale. * * @param Carbon|\DateTimeInterface|string|null $referenceTime * @param array $formats * * @return string */ public function calendar($referenceTime = null, array $formats = []) { /** @var CarbonInterface $current */ $current = $this->avoidMutation()->startOfDay(); /** @var CarbonInterface $other */ $other = $this->resolveCarbon($referenceTime)->avoidMutation()->setTimezone($this->getTimezone())->startOfDay(); $diff = $other->diffInDays($current, false); $format = $diff <= -static::DAYS_PER_WEEK ? 'sameElse' : ( $diff < -1 ? 'lastWeek' : ( $diff < 0 ? 'lastDay' : ( $diff < 1 ? 'sameDay' : ( $diff < 2 ? 'nextDay' : ( $diff < static::DAYS_PER_WEEK ? 'nextWeek' : 'sameElse' ) ) ) ) ); $format = array_merge($this->getCalendarFormats(), $formats)[$format]; if ($format instanceof Closure) { $format = $format($current, $other) ?? ''; } return $this->isoFormat((string) $format); } private function getIntervalDayDiff(DateInterval $interval): int { return (int) $interval->format('%r%a'); } } ================================================ FILE: src/Carbon/Traits/IntervalRounding.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterval; use Carbon\Exceptions\InvalidIntervalException; use DateInterval; /** * Trait to call rounding methods to interval or the interval of a period. */ trait IntervalRounding { protected function callRoundMethod(string $method, array $parameters): ?static { $action = substr($method, 0, 4); if ($action !== 'ceil') { $action = substr($method, 0, 5); } if (\in_array($action, ['round', 'floor', 'ceil'])) { return $this->{$action.'Unit'}(substr($method, \strlen($action)), ...$parameters); } return null; } protected function roundWith(DateInterval|string|float|int $precision, callable|string $function): ?static { $unit = 'second'; if ($precision instanceof DateInterval) { $precision = CarbonInterval::instance($precision)->forHumans(['locale' => 'en']); } if (\is_string($precision) && preg_match('/^\s*(?\d+)?\s*(?\w+)(?\W.*)?$/', $precision, $match)) { if (trim($match['other'] ?? '') !== '') { throw new InvalidIntervalException('Rounding is only possible with single unit intervals.'); } $precision = (int) ($match['precision'] ?: 1); $unit = $match['unit']; } return $this->roundUnit($unit, $precision, $function); } } ================================================ FILE: src/Carbon/Traits/IntervalStep.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Callback; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Closure; use DateTimeImmutable; use DateTimeInterface; trait IntervalStep { /** * Step to apply instead of a fixed interval to get the new date. * * @var Closure|null */ protected $step; /** * Get the dynamic step in use. * * @return Closure */ public function getStep(): ?Closure { return $this->step; } /** * Set a step to apply instead of a fixed interval to get the new date. * * Or pass null to switch to fixed interval. * * @param Closure|null $step */ public function setStep(?Closure $step): void { $this->step = $step; } /** * Take a date and apply either the step if set, or the current interval else. * * The interval/step is applied negatively (typically subtraction instead of addition) if $negated is true. * * @param DateTimeInterface $dateTime * @param bool $negated * * @return CarbonInterface */ public function convertDate(DateTimeInterface $dateTime, bool $negated = false): CarbonInterface { /** @var CarbonInterface $carbonDate */ $carbonDate = $dateTime instanceof CarbonInterface ? $dateTime : $this->resolveCarbon($dateTime); if ($this->step) { $carbonDate = Callback::parameter($this->step, $carbonDate->avoidMutation()); return $carbonDate->modify(($this->step)($carbonDate, $negated)->format('Y-m-d H:i:s.u e O')); } if ($negated) { return $carbonDate->rawSub($this); } return $carbonDate->rawAdd($this); } /** * Convert DateTimeImmutable instance to CarbonImmutable instance and DateTime instance to Carbon instance. */ private function resolveCarbon(DateTimeInterface $dateTime): Carbon|CarbonImmutable { if ($dateTime instanceof DateTimeImmutable) { return CarbonImmutable::instance($dateTime); } return Carbon::instance($dateTime); } } ================================================ FILE: src/Carbon/Traits/LocalFactory.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Factory; use Carbon\FactoryImmutable; use Carbon\WrapperClock; use Closure; /** * Remember the factory that was the current at the creation of the object. */ trait LocalFactory { /** * The clock that generated the current instance (or FactoryImmutable::getDefaultInstance() if none) */ private ?WrapperClock $clock = null; public function getClock(): ?WrapperClock { return $this->clock; } private function initLocalFactory(): void { $this->clock = FactoryImmutable::getCurrentClock(); } /** * Trigger the given action using the local factory of the object, so it will be transmitted * to any object also using this trait and calling initLocalFactory() in its constructor. * * @template T * * @param Closure(): T $action * * @return T */ private function transmitFactory(Closure $action): mixed { $previousClock = FactoryImmutable::getCurrentClock(); FactoryImmutable::setCurrentClock($this->clock); try { return $action(); } finally { FactoryImmutable::setCurrentClock($previousClock); } } private function getFactory(): Factory { return $this->getClock()?->getFactory() ?? FactoryImmutable::getDefaultInstance(); } } ================================================ FILE: src/Carbon/Traits/Localization.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use Carbon\Exceptions\InvalidTypeException; use Carbon\Exceptions\NotLocaleAwareException; use Carbon\Language; use Carbon\Translator; use Carbon\TranslatorStrongTypeInterface; use Closure; use Symfony\Component\Translation\TranslatorBagInterface; use Symfony\Contracts\Translation\LocaleAwareInterface; use Symfony\Contracts\Translation\TranslatorInterface; /** * Trait Localization. * * Embed default and locale translators and translation base methods. */ trait Localization { use StaticLocalization; /** * Specific translator of the current instance. */ protected ?TranslatorInterface $localTranslator = null; /** * Return true if the current instance has its own translator. */ public function hasLocalTranslator(): bool { return isset($this->localTranslator); } /** * Get the translator of the current instance or the default if none set. */ public function getLocalTranslator(): TranslatorInterface { return $this->localTranslator ?? $this->transmitFactory(static fn () => static::getTranslator()); } /** * Set the translator for the current instance. */ public function setLocalTranslator(TranslatorInterface $translator): self { $this->localTranslator = $translator; return $this; } /** * Returns raw translation message for a given key. * * @param TranslatorInterface|null $translator the translator to use * @param string $key key to find * @param string|null $locale current locale used if null * @param string|null $default default value if translation returns the key * * @return string|Closure|null */ public static function getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) { if (!($translator instanceof TranslatorBagInterface && $translator instanceof TranslatorInterface)) { throw new InvalidTypeException( 'Translator does not implement '.TranslatorInterface::class.' and '.TranslatorBagInterface::class.'. '. (\is_object($translator) ? \get_class($translator) : \gettype($translator)).' has been given.', ); } if (!$locale && $translator instanceof LocaleAwareInterface) { $locale = $translator->getLocale(); } $result = self::getFromCatalogue($translator, $translator->getCatalogue($locale), $key); return $result === $key ? $default : $result; } /** * Returns raw translation message for a given key. * * @param string $key key to find * @param string|null $locale current locale used if null * @param string|null $default default value if translation returns the key * @param TranslatorInterface $translator an optional translator to use * * @return string */ public function getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null) { return static::getTranslationMessageWith($translator ?? $this->getLocalTranslator(), $key, $locale, $default); } /** * Translate using translation string or callback available. * * @param TranslatorInterface $translator an optional translator to use * @param string $key key to find * @param array $parameters replacement parameters * @param int|float|null $number number if plural * * @return string */ public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string { $message = static::getTranslationMessageWith($translator, $key, null, $key); if ($message instanceof Closure) { return (string) $message(...array_values($parameters)); } if ($number !== null) { $parameters['%count%'] = $number; } if (isset($parameters['%count%'])) { $parameters[':count'] = $parameters['%count%']; } return (string) $translator->trans($key, $parameters); } /** * Translate using translation string or callback available. * * @param string $key key to find * @param array $parameters replacement parameters * @param string|int|float|null $number number if plural * @param TranslatorInterface|null $translator an optional translator to use * @param bool $altNumbers pass true to use alternative numbers * * @return string */ public function translate( string $key, array $parameters = [], string|int|float|null $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false, ): string { $translation = static::translateWith($translator ?? $this->getLocalTranslator(), $key, $parameters, $number); if ($number !== null && $altNumbers) { return str_replace((string) $number, $this->translateNumber((int) $number), $translation); } return $translation; } /** * Returns the alternative number for a given integer if available in the current locale. * * @param int $number * * @return string */ public function translateNumber(int $number): string { $translateKey = "alt_numbers.$number"; $symbol = $this->translate($translateKey); if ($symbol !== $translateKey) { return $symbol; } if ($number > 99 && $this->translate('alt_numbers.99') !== 'alt_numbers.99') { $start = ''; foreach ([10000, 1000, 100] as $exp) { $key = "alt_numbers_pow.$exp"; if ($number >= $exp && $number < $exp * 10 && ($pow = $this->translate($key)) !== $key) { $unit = floor($number / $exp); $number -= $unit * $exp; $start .= ($unit > 1 ? $this->translate("alt_numbers.$unit") : '').$pow; } } $result = ''; while ($number) { $chunk = $number % 100; $result = $this->translate("alt_numbers.$chunk").$result; $number = floor($number / 100); } return "$start$result"; } if ($number > 9 && $this->translate('alt_numbers.9') !== 'alt_numbers.9') { $result = ''; while ($number) { $chunk = $number % 10; $result = $this->translate("alt_numbers.$chunk").$result; $number = floor($number / 10); } return $result; } return (string) $number; } /** * Translate a time string from a locale to an other. * * @param string $timeString date/time/duration string to translate (may also contain English) * @param string|null $from input locale of the $timeString parameter (`Carbon::getLocale()` by default) * @param string|null $to output locale of the result returned (`"en"` by default) * @param int $mode specify what to translate with options: * - CarbonInterface::TRANSLATE_ALL (default) * - CarbonInterface::TRANSLATE_MONTHS * - CarbonInterface::TRANSLATE_DAYS * - CarbonInterface::TRANSLATE_UNITS * - CarbonInterface::TRANSLATE_MERIDIEM * You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS * * @return string */ public static function translateTimeString( string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL, ): string { // Fallback source and destination locales $from = $from ?: static::getLocale(); $to = $to ?: CarbonInterface::DEFAULT_LOCALE; if ($from === $to) { return $timeString; } // Standardize apostrophe $timeString = strtr($timeString, ['’' => "'"]); $fromTranslations = []; $toTranslations = []; foreach (['from', 'to'] as $key) { $language = $$key; $translator = Translator::get($language); $translations = $translator->getMessages(); if (!isset($translations[$language])) { return $timeString; } $translationKey = $key.'Translations'; $messages = $translations[$language]; $months = $messages['months'] ?? []; $weekdays = $messages['weekdays'] ?? []; $meridiem = $messages['meridiem'] ?? ['AM', 'PM']; if (isset($messages['ordinal_words'])) { $timeString = self::replaceOrdinalWords( $timeString, $key === 'from' ? array_flip($messages['ordinal_words']) : $messages['ordinal_words'] ); } if ($key === 'from') { foreach (['months', 'weekdays'] as $variable) { $list = $messages[$variable.'_standalone'] ?? null; if ($list) { foreach ($$variable as $index => &$name) { $name .= '|'.$list[$index]; } } } } $$translationKey = array_merge( $mode & CarbonInterface::TRANSLATE_MONTHS ? self::getTranslationArray($months, static::MONTHS_PER_YEAR, $timeString) : [], $mode & CarbonInterface::TRANSLATE_MONTHS ? self::getTranslationArray($messages['months_short'] ?? [], static::MONTHS_PER_YEAR, $timeString) : [], $mode & CarbonInterface::TRANSLATE_DAYS ? self::getTranslationArray($weekdays, static::DAYS_PER_WEEK, $timeString) : [], $mode & CarbonInterface::TRANSLATE_DAYS ? self::getTranslationArray($messages['weekdays_short'] ?? [], static::DAYS_PER_WEEK, $timeString) : [], $mode & CarbonInterface::TRANSLATE_DIFF ? self::translateWordsByKeys([ 'diff_now', 'diff_today', 'diff_yesterday', 'diff_tomorrow', 'diff_before_yesterday', 'diff_after_tomorrow', ], $messages, $key) : [], $mode & CarbonInterface::TRANSLATE_UNITS ? self::translateWordsByKeys([ 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', ], $messages, $key) : [], $mode & CarbonInterface::TRANSLATE_MERIDIEM ? array_map(function ($hour) use ($meridiem) { if (\is_array($meridiem)) { return $meridiem[$hour < static::HOURS_PER_DAY / 2 ? 0 : 1]; } return $meridiem($hour, 0, false); }, range(0, 23)) : [], ); } return substr(preg_replace_callback('/(?<=[\d\s+.\/,_-])('.implode('|', $fromTranslations).')(?=[\d\s+.\/,_-])/iu', function ($match) use ($fromTranslations, $toTranslations) { [$chunk] = $match; foreach ($fromTranslations as $index => $word) { if (preg_match("/^$word\$/iu", $chunk)) { return $toTranslations[$index] ?? ''; } } return $chunk; // @codeCoverageIgnore }, " $timeString "), 1, -1); } /** * Translate a time string from the current locale (`$date->locale()`) to another one. * * @param string $timeString time string to translate * @param string|null $to output locale of the result returned ("en" by default) * * @return string */ public function translateTimeStringTo(string $timeString, ?string $to = null): string { return static::translateTimeString($timeString, $this->getTranslatorLocale(), $to); } /** * Get/set the locale for the current instance. * * @param string|null $locale * @param string ...$fallbackLocales * * @return $this|string */ public function locale(?string $locale = null, string ...$fallbackLocales): static|string { if ($locale === null) { return $this->getTranslatorLocale(); } if (!$this->localTranslator || $this->getTranslatorLocale($this->localTranslator) !== $locale) { $translator = Translator::get($locale); if (!empty($fallbackLocales)) { $translator->setFallbackLocales($fallbackLocales); foreach ($fallbackLocales as $fallbackLocale) { $messages = Translator::get($fallbackLocale)->getMessages(); if (isset($messages[$fallbackLocale])) { $translator->setMessages($fallbackLocale, $messages[$fallbackLocale]); } } } $this->localTranslator = $translator; } return $this; } /** * Get the current translator locale. * * @return string */ public static function getLocale(): string { return static::getLocaleAwareTranslator()->getLocale(); } /** * Set the current translator locale and indicate if the source locale file exists. * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. * * @param string $locale locale ex. en */ public static function setLocale(string $locale): void { static::getLocaleAwareTranslator()->setLocale($locale); } /** * Set the fallback locale. * * @see https://symfony.com/doc/current/components/translation.html#fallback-locales * * @param string $locale */ public static function setFallbackLocale(string $locale): void { $translator = static::getTranslator(); if (method_exists($translator, 'setFallbackLocales')) { $translator->setFallbackLocales([$locale]); if ($translator instanceof Translator) { $preferredLocale = $translator->getLocale(); $fallbackMessages = []; $preferredMessages = $translator->getMessages($preferredLocale); foreach (Translator::get($locale)->getMessages()[$locale] ?? [] as $key => $value) { if ( preg_match('/^(?:a_)?(.+)_(?:standalone|ago|from_now|before|after|short|min)$/', $key, $match) && isset($preferredMessages[$match[1]]) ) { continue; } $fallbackMessages[$key] = $value; } $translator->setMessages($preferredLocale, array_replace_recursive( $translator->getMessages()[$locale] ?? [], $fallbackMessages, $preferredMessages, )); } } } /** * Get the fallback locale. * * @see https://symfony.com/doc/current/components/translation.html#fallback-locales */ public static function getFallbackLocale(): ?string { $translator = static::getTranslator(); if (method_exists($translator, 'getFallbackLocales')) { return $translator->getFallbackLocales()[0] ?? null; } return null; } /** * Set the current locale to the given, execute the passed function, reset the locale to previous one, * then return the result of the closure (or null if the closure was void). * * @param string $locale locale ex. en * @param callable $func * * @return mixed */ public static function executeWithLocale(string $locale, callable $func): mixed { $currentLocale = static::getLocale(); static::setLocale($locale); $newLocale = static::getLocale(); $result = $func( $newLocale === 'en' && strtolower(substr((string) $locale, 0, 2)) !== 'en' ? false : $newLocale, static::getTranslator(), ); static::setLocale($currentLocale); return $result; } /** * Returns true if the given locale is internally supported and has short-units support. * Support is considered enabled if either year, day or hour has a short variant translated. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasShortUnits(string $locale): bool { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return ($newLocale && (($y = static::translateWith($translator, 'y')) !== 'y' && $y !== static::translateWith($translator, 'year'))) || ( ($y = static::translateWith($translator, 'd')) !== 'd' && $y !== static::translateWith($translator, 'day') ) || ( ($y = static::translateWith($translator, 'h')) !== 'h' && $y !== static::translateWith($translator, 'hour') ); }); } /** * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). * Support is considered enabled if the 4 sentences are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffSyntax(string $locale): bool { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { if (!$newLocale) { return false; } foreach (['ago', 'from_now', 'before', 'after'] as $key) { if ($translator instanceof TranslatorBagInterface && self::getFromCatalogue($translator, $translator->getCatalogue($newLocale), $key) instanceof Closure ) { continue; } if ($translator->trans($key) === $key) { return false; } } return true; }); } /** * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). * Support is considered enabled if the 3 words are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffOneDayWords(string $locale): bool { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('diff_now') !== 'diff_now' && $translator->trans('diff_yesterday') !== 'diff_yesterday' && $translator->trans('diff_tomorrow') !== 'diff_tomorrow'; }); } /** * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). * Support is considered enabled if the 2 words are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasDiffTwoDayWords(string $locale): bool { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('diff_before_yesterday') !== 'diff_before_yesterday' && $translator->trans('diff_after_tomorrow') !== 'diff_after_tomorrow'; }); } /** * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). * Support is considered enabled if the 4 sentences are translated in the given locale. * * @param string $locale locale ex. en * * @return bool */ public static function localeHasPeriodSyntax($locale) { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { return $newLocale && $translator->trans('period_recurrences') !== 'period_recurrences' && $translator->trans('period_interval') !== 'period_interval' && $translator->trans('period_start_date') !== 'period_start_date' && $translator->trans('period_end_date') !== 'period_end_date'; }); } /** * Returns the list of internally available locales and already loaded custom locales. * (It will ignore custom translator dynamic loading.) * * @return array */ public static function getAvailableLocales(): array { $translator = static::getLocaleAwareTranslator(); return $translator instanceof Translator ? $translator->getAvailableLocales() : [$translator->getLocale()]; } /** * Returns list of Language object for each available locale. This object allow you to get the ISO name, native * name, region and variant of the locale. * * @return Language[] */ public static function getAvailableLocalesInfo(): array { $languages = []; foreach (static::getAvailableLocales() as $id) { $languages[$id] = new Language($id); } return $languages; } /** * Get the locale of a given translator. * * If null or omitted, current local translator is used. * If no local translator is in use, current global translator is used. */ protected function getTranslatorLocale($translator = null): ?string { if (\func_num_args() === 0) { $translator = $this->getLocalTranslator(); } $translator = static::getLocaleAwareTranslator($translator); return $translator?->getLocale(); } /** * Throw an error if passed object is not LocaleAwareInterface. * * @param LocaleAwareInterface|null $translator * * @return LocaleAwareInterface|null */ protected static function getLocaleAwareTranslator($translator = null) { if (\func_num_args() === 0) { $translator = static::getTranslator(); } if ($translator && !($translator instanceof LocaleAwareInterface || method_exists($translator, 'getLocale'))) { throw new NotLocaleAwareException($translator); // @codeCoverageIgnore } return $translator; } /** * @param mixed $translator * @param \Symfony\Component\Translation\MessageCatalogueInterface $catalogue * * @return mixed */ private static function getFromCatalogue($translator, $catalogue, string $id, string $domain = 'messages') { return $translator instanceof TranslatorStrongTypeInterface ? $translator->getFromCatalogue($catalogue, $id, $domain) : $catalogue->get($id, $domain); // @codeCoverageIgnore } /** * Return the word cleaned from its translation codes. * * @param string $word * * @return string */ private static function cleanWordFromTranslationString($word) { $word = str_replace([':count', '%count', ':time'], '', $word); $word = strtr($word, ['’' => "'"]); $word = preg_replace( '/\{(?:-?\d+(?:\.\d+)?|-?Inf)(?:,(?:-?\d+|-?Inf))?}|[\[\]](?:-?\d+(?:\.\d+)?|-?Inf)(?:,(?:-?\d+|-?Inf))?[\[\]]/', '', $word, ); return trim($word); } /** * Translate a list of words. * * @param string[] $keys keys to translate. * @param string[] $messages messages bag handling translations. * @param string $key 'to' (to get the translation) or 'from' (to get the detection RegExp pattern). * * @return string[] */ private static function translateWordsByKeys($keys, $messages, $key): array { return array_map(function ($wordKey) use ($messages, $key) { $message = $key === 'from' && isset($messages[$wordKey.'_regexp']) ? $messages[$wordKey.'_regexp'] : ($messages[$wordKey] ?? null); if (!$message) { return '>>DO NOT REPLACE<<'; } $parts = explode('|', $message); return $key === 'to' ? self::cleanWordFromTranslationString(end($parts)) : '(?:'.implode('|', array_map(static::cleanWordFromTranslationString(...), $parts)).')'; }, $keys); } /** * Get an array of translations based on the current date. * * @param callable $translation * @param int $length * @param string $timeString * * @return string[] */ private static function getTranslationArray($translation, $length, $timeString): array { $filler = '>>DO NOT REPLACE<<'; if (\is_array($translation)) { return array_pad($translation, $length, $filler); } $list = []; $date = static::now(); for ($i = 0; $i < $length; $i++) { $list[] = $translation($date, $timeString, $i) ?? $filler; } return $list; } private static function replaceOrdinalWords(string $timeString, array $ordinalWords): string { return preg_replace_callback('/(? * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\FactoryImmutable; /** * Trait Macros. * * Allows users to register macros within the Carbon class. */ trait Macro { use Mixin; /** * Register a custom macro. * * Pass null macro to remove it. * * @example * ``` * $userSettings = [ * 'locale' => 'pt', * 'timezone' => 'America/Sao_Paulo', * ]; * Carbon::macro('userFormat', function () use ($userSettings) { * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); * }); * echo Carbon::yesterday()->hours(11)->userFormat(); * ``` * * @param-closure-this static $macro */ public static function macro(string $name, ?callable $macro): void { FactoryImmutable::getDefaultInstance()->macro($name, $macro); } /** * Remove all macros and generic macros. */ public static function resetMacros(): void { FactoryImmutable::getDefaultInstance()->resetMacros(); } /** * Register a custom macro. * * @param callable $macro * @param int $priority marco with higher priority is tried first * * @return void */ public static function genericMacro(callable $macro, int $priority = 0): void { FactoryImmutable::getDefaultInstance()->genericMacro($macro, $priority); } /** * Checks if macro is registered globally. * * @param string $name * * @return bool */ public static function hasMacro(string $name): bool { return FactoryImmutable::getInstance()->hasMacro($name); } /** * Get the raw callable macro registered globally for a given name. */ public static function getMacro(string $name): ?callable { return FactoryImmutable::getInstance()->getMacro($name); } /** * Checks if macro is registered globally or locally. */ public function hasLocalMacro(string $name): bool { return ($this->localMacros && isset($this->localMacros[$name])) || $this->transmitFactory( static fn () => static::hasMacro($name), ); } /** * Get the raw callable macro registered globally or locally for a given name. */ public function getLocalMacro(string $name): ?callable { return ($this->localMacros ?? [])[$name] ?? $this->transmitFactory( static fn () => static::getMacro($name), ); } } ================================================ FILE: src/Carbon/Traits/MagicParameter.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; /** * Trait MagicParameter. * * Allows to retrieve parameter in magic calls by index or name. */ trait MagicParameter { private function getMagicParameter(array $parameters, int $index, string $key, $default) { if (\array_key_exists($index, $parameters)) { return $parameters[$index]; } if (\array_key_exists($key, $parameters)) { return $parameters[$key]; } return $default; } } ================================================ FILE: src/Carbon/Traits/Mixin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Closure; use Generator; use ReflectionClass; use ReflectionException; use ReflectionMethod; use ReflectionNamedType; use Throwable; /** * Trait Mixin. * * Allows mixing in entire classes with multiple macros. */ trait Mixin { /** * Stack of macro instance contexts. */ protected static array $macroContextStack = []; /** * Mix another object into the class. * * @example * ``` * Carbon::mixin(new class { * public function addMoon() { * return function () { * return $this->addDays(30); * }; * } * public function subMoon() { * return function () { * return $this->subDays(30); * }; * } * }); * $fullMoon = Carbon::create('2018-12-22'); * $nextFullMoon = $fullMoon->addMoon(); * $blackMoon = Carbon::create('2019-01-06'); * $previousBlackMoon = $blackMoon->subMoon(); * echo "$nextFullMoon\n"; * echo "$previousBlackMoon\n"; * ``` * * @throws ReflectionException */ public static function mixin(object|string $mixin): void { \is_string($mixin) && trait_exists($mixin) ? self::loadMixinTrait($mixin) : self::loadMixinClass($mixin); } /** * @throws ReflectionException */ private static function loadMixinClass(object|string $mixin): void { $methods = (new ReflectionClass($mixin))->getMethods( ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED, ); foreach ($methods as $method) { if (self::cannotBeAMixinMethod($method)) { continue; } $macro = $method->invoke($mixin); if (\is_callable($macro)) { static::macro($method->name, $macro); } } } private static function cannotBeAMixinMethod(ReflectionMethod $method): bool { if ($method->isConstructor() || $method->isDestructor()) { return true; } $returnType = $method->getReturnType(); if ($returnType instanceof ReflectionNamedType) { $returnedTypeName = $returnType->getName(); if ($returnType->isBuiltin()) { return !\in_array($returnedTypeName, [ 'callable', 'object', // could have __invoke 'array', // could be [MyClass::class, 'myMethod'] 'mixed', // could be one of the above // The other builtin types cannot be callable, so we can skip invoking them ], true); } // If it returns a non-invokable object, it cannot be a mixin method if (class_exists($returnedTypeName)) { return !is_a($returnedTypeName, Closure::class, true) && !\is_callable([$returnedTypeName, '__invoke']); } } return false; } private static function loadMixinTrait(string $trait): void { $context = eval(self::getAnonymousClassCodeForTrait($trait)); $className = \get_class($context); $baseClass = static::class; foreach (self::getMixableMethods($context) as $name) { $closureBase = Closure::fromCallable([$context, $name]); static::macro($name, function (...$parameters) use ($closureBase, $className, $baseClass) { $downContext = isset($this) ? ($this) : new $baseClass(); $context = isset($this) ? $this->cast($className) : new $className(); try { // @ is required to handle error if not converted into exceptions $closure = @$closureBase->bindTo($context); } catch (Throwable) { // @codeCoverageIgnore $closure = $closureBase; // @codeCoverageIgnore } // in case of errors not converted into exceptions $closure = $closure ?: $closureBase; $result = $closure(...$parameters); if (!($result instanceof $className)) { return $result; } if ($downContext instanceof CarbonInterface && $result instanceof CarbonInterface) { if ($context !== $result) { $downContext = $downContext->copy(); } return $downContext ->setTimezone($result->getTimezone()) ->modify($result->format('Y-m-d H:i:s.u')) ->settings($result->getSettings()); } if ($downContext instanceof CarbonInterval && $result instanceof CarbonInterval) { if ($context !== $result) { $downContext = $downContext->copy(); } $downContext->copyProperties($result); self::copyStep($downContext, $result); self::copyNegativeUnits($downContext, $result); return $downContext->settings($result->getSettings()); } if ($downContext instanceof CarbonPeriod && $result instanceof CarbonPeriod) { if ($context !== $result) { $downContext = $downContext->copy(); } return $downContext ->setDates($result->getStartDate(), $result->getEndDate()) ->setRecurrences($result->getRecurrences()) ->setOptions($result->getOptions()) ->settings($result->getSettings()); } return $result; }); } } private static function getAnonymousClassCodeForTrait(string $trait): string { return 'return new class() extends '.static::class.' {use '.$trait.';};'; } private static function getMixableMethods(self $context): Generator { foreach (get_class_methods($context) as $name) { if (method_exists(static::class, $name)) { continue; } yield $name; } } /** * Stack a Carbon context from inside calls of self::this() and execute a given action. */ protected static function bindMacroContext(?self $context, callable $callable): mixed { static::$macroContextStack[] = $context; try { return $callable(); } finally { array_pop(static::$macroContextStack); } } /** * Return the current context from inside a macro callee or a null if static. */ protected static function context(): ?static { return end(static::$macroContextStack) ?: null; } /** * Return the current context from inside a macro callee or a new one if static. */ protected static function this(): static { return end(static::$macroContextStack) ?: new static(); } } ================================================ FILE: src/Carbon/Traits/Modifiers.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use Carbon\Exceptions\InvalidFormatException; use ReturnTypeWillChange; /** * Trait Modifiers. * * Returns dates relative to current date using modifier short-hand. */ trait Modifiers { /** * Midday/noon hour. * * @var int */ protected static $midDayAt = 12; /** * get midday/noon hour * * @return int */ public static function getMidDayAt() { return static::$midDayAt; } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather consider mid-day is always 12pm, then if you need to test if it's an other * hour, test it explicitly: * $date->format('G') == 13 * or to set explicitly to a given hour: * $date->setTime(13, 0, 0, 0) * * Set midday/noon hour * * @param int $hour midday hour * * @return void */ public static function setMidDayAt($hour) { static::$midDayAt = $hour; } /** * Modify to midday, default to self::$midDayAt * * @return static */ public function midDay() { return $this->setTime(static::$midDayAt, 0, 0, 0); } /** * Modify to the next occurrence of a given modifier such as a day of * the week. If no modifier is provided, modify to the next occurrence * of the current day of the week. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param string|int|null $modifier * * @return static */ public function next($modifier = null) { if ($modifier === null) { $modifier = $this->dayOfWeek; } return $this->change( 'next '.(\is_string($modifier) ? $modifier : static::$days[$modifier]), ); } /** * Go forward or backward to the next week- or weekend-day. * * @param bool $weekday * @param bool $forward * * @return static */ private function nextOrPreviousDay($weekday = true, $forward = true) { /** @var CarbonInterface $date */ $date = $this; $step = $forward ? 1 : -1; do { $date = $date->addDays($step); } while ($weekday ? $date->isWeekend() : $date->isWeekday()); return $date; } /** * Go forward to the next weekday. * * @return static */ public function nextWeekday() { return $this->nextOrPreviousDay(); } /** * Go backward to the previous weekday. * * @return static */ public function previousWeekday() { return $this->nextOrPreviousDay(true, false); } /** * Go forward to the next weekend day. * * @return static */ public function nextWeekendDay() { return $this->nextOrPreviousDay(false); } /** * Go backward to the previous weekend day. * * @return static */ public function previousWeekendDay() { return $this->nextOrPreviousDay(false, false); } /** * Modify to the previous occurrence of a given modifier such as a day of * the week. If no dayOfWeek is provided, modify to the previous occurrence * of the current day of the week. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param string|int|null $modifier * * @return static */ public function previous($modifier = null) { if ($modifier === null) { $modifier = $this->dayOfWeek; } return $this->change( 'last '.(\is_string($modifier) ? $modifier : static::$days[$modifier]), ); } /** * Modify to the first occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * first day of the current month. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function firstOfMonth($dayOfWeek = null) { $date = $this->startOfDay(); if ($dayOfWeek === null) { return $date->day(1); } return $date->modify('first '.static::$days[$dayOfWeek].' of '.$date->rawFormat('F').' '.$date->year); } /** * Modify to the last occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * last day of the current month. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function lastOfMonth($dayOfWeek = null) { $date = $this->startOfDay(); if ($dayOfWeek === null) { return $date->day($date->daysInMonth); } return $date->modify('last '.static::$days[$dayOfWeek].' of '.$date->rawFormat('F').' '.$date->year); } /** * Modify to the given occurrence of a given day of the week * in the current month. If the calculated occurrence is outside the scope * of the current month, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfMonth($nth, $dayOfWeek) { $date = $this->avoidMutation()->firstOfMonth(); $check = $date->rawFormat('Y-m'); $date = $date->modify('+'.$nth.' '.static::$days[$dayOfWeek]); return $date->rawFormat('Y-m') === $check ? $this->modify((string) $date) : false; } /** * Modify to the first occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * first day of the current quarter. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function firstOfQuarter($dayOfWeek = null) { return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek); } /** * Modify to the last occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * last day of the current quarter. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function lastOfQuarter($dayOfWeek = null) { return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek); } /** * Modify to the given occurrence of a given day of the week * in the current quarter. If the calculated occurrence is outside the scope * of the current quarter, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfQuarter($nth, $dayOfWeek) { $date = $this->avoidMutation()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER); $lastMonth = $date->month; $year = $date->year; $date = $date->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); return ($lastMonth < $date->month || $year !== $date->year) ? false : $this->modify((string) $date); } /** * Modify to the first occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * first day of the current year. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function firstOfYear($dayOfWeek = null) { return $this->month(1)->firstOfMonth($dayOfWeek); } /** * Modify to the last occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * last day of the current year. Use the supplied constants * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek day of the week default null * * @return static */ public function lastOfYear($dayOfWeek = null) { return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); } /** * Modify to the given occurrence of a given day of the week * in the current year. If the calculated occurrence is outside the scope * of the current year, then return false and no modifications are made. * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfYear($nth, $dayOfWeek) { $date = $this->avoidMutation()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); return $this->year === $date->year ? $this->modify((string) $date) : false; } /** * Modify the current instance to the average of a given instance (default now) and the current instance * (second-precision). * * @param \Carbon\Carbon|\DateTimeInterface|null $date * * @return static */ public function average($date = null) { return $this->addRealMicroseconds((int) ($this->diffInMicroseconds($this->resolveCarbon($date), false) / 2)); } /** * Get the closest date from the instance (second-precision). * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * * @return static */ public function closest($date1, $date2) { return $this->diffInMicroseconds($date1, true) < $this->diffInMicroseconds($date2, true) ? $date1 : $date2; } /** * Get the farthest date from the instance (second-precision). * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 * * @return static */ public function farthest($date1, $date2) { return $this->diffInMicroseconds($date1, true) > $this->diffInMicroseconds($date2, true) ? $date1 : $date2; } /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return static */ public function min($date = null) { $date = $this->resolveCarbon($date); return $this->lt($date) ? $this : $date; } /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see min() * * @return static */ public function minimum($date = null) { return $this->min($date); } /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @return static */ public function max($date = null) { $date = $this->resolveCarbon($date); return $this->gt($date) ? $this : $date; } /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param \Carbon\Carbon|\DateTimeInterface|mixed $date * * @see max() * * @return static */ public function maximum($date = null) { return $this->max($date); } /** * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php * * @return static */ #[ReturnTypeWillChange] public function modify($modify) { return parent::modify((string) $modify) ?: throw new InvalidFormatException('Could not modify with: '.var_export($modify, true)); } /** * Similar to native modify() method of DateTime but can handle more grammars. * * @example * ``` * echo Carbon::now()->change('next 2pm'); * ``` * * @link https://php.net/manual/en/datetime.modify.php * * @param string $modifier * * @return static */ public function change($modifier) { return $this->modify(preg_replace_callback('/^(next|previous|last)\s+(\d{1,2}(h|am|pm|:\d{1,2}(:\d{1,2})?))$/i', function ($match) { $match[2] = str_replace('h', ':00', $match[2]); $test = $this->avoidMutation()->modify($match[2]); $method = $match[1] === 'next' ? 'lt' : 'gt'; $match[1] = $test->$method($this) ? $match[1].' day' : 'today'; return $match[1].' '.$match[2]; }, strtr(trim($modifier), [ ' at ' => ' ', 'just now' => 'now', 'after tomorrow' => 'tomorrow +1 day', 'before yesterday' => 'yesterday -1 day', ]))); } } ================================================ FILE: src/Carbon/Traits/Mutability.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Carbon; use Carbon\CarbonImmutable; /** * Trait Mutability. * * Utils to know if the current object is mutable or immutable and convert it. */ trait Mutability { use Cast; /** * Returns true if the current class/instance is mutable. */ public static function isMutable(): bool { return false; } /** * Returns true if the current class/instance is immutable. */ public static function isImmutable(): bool { return !static::isMutable(); } /** * Return a mutable copy of the instance. */ public function toMutable(): Carbon { return $this->cast(Carbon::class); } /** * Return an immutable copy of the instance. */ public function toImmutable(): CarbonImmutable { // Immutable objects are fine as is (uncloned) if ($this::class === CarbonImmutable::class) { return $this; } return $this->cast(CarbonImmutable::class); } } ================================================ FILE: src/Carbon/Traits/ObjectInitialisation.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; trait ObjectInitialisation { /** * True when parent::__construct has been called. * * @var string */ protected $constructedObjectId; } ================================================ FILE: src/Carbon/Traits/Options.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use DateTimeInterface; use Throwable; /** * Trait Options. * * Embed base methods to change settings of Carbon classes. * * Depends on the following methods: * * @method static shiftTimezone($timezone) Set the timezone */ trait Options { use StaticOptions; use Localization; /** * Indicates if months should be calculated with overflow. * Specific setting. */ protected ?bool $localMonthsOverflow = null; /** * Indicates if years should be calculated with overflow. * Specific setting. */ protected ?bool $localYearsOverflow = null; /** * Indicates if the strict mode is in use. * Specific setting. */ protected ?bool $localStrictModeEnabled = null; /** * Options for diffForHumans and forHumans methods. */ protected ?int $localHumanDiffOptions = null; /** * Format to use on string cast. * * @var string|callable|null */ protected $localToStringFormat = null; /** * Format to use on JSON serialization. * * @var string|callable|null */ protected $localSerializer = null; /** * Instance-specific macros. */ protected ?array $localMacros = null; /** * Instance-specific generic macros. */ protected ?array $localGenericMacros = null; /** * Function to call instead of format. * * @var string|callable|null */ protected $localFormatFunction = null; /** * Set specific options. * - strictMode: true|false|null * - monthOverflow: true|false|null * - yearOverflow: true|false|null * - humanDiffOptions: int|null * - toStringFormat: string|Closure|null * - toJsonFormat: string|Closure|null * - locale: string|null * - timezone: \DateTimeZone|string|int|null * - macros: array|null * - genericMacros: array|null * * @param array $settings * * @return $this|static */ public function settings(array $settings): static { $this->localStrictModeEnabled = $settings['strictMode'] ?? null; $this->localMonthsOverflow = $settings['monthOverflow'] ?? null; $this->localYearsOverflow = $settings['yearOverflow'] ?? null; $this->localHumanDiffOptions = $settings['humanDiffOptions'] ?? null; $this->localToStringFormat = $settings['toStringFormat'] ?? null; $this->localSerializer = $settings['toJsonFormat'] ?? null; $this->localMacros = $settings['macros'] ?? null; $this->localGenericMacros = $settings['genericMacros'] ?? null; $this->localFormatFunction = $settings['formatFunction'] ?? null; if (isset($settings['locale'])) { $locales = $settings['locale']; if (!\is_array($locales)) { $locales = [$locales]; } $this->locale(...$locales); } elseif (isset($settings['translator']) && property_exists($this, 'localTranslator')) { $this->localTranslator = $settings['translator']; } if (isset($settings['innerTimezone'])) { return $this->setTimezone($settings['innerTimezone']); } if (isset($settings['timezone'])) { return $this->shiftTimezone($settings['timezone']); } return $this; } /** * Returns current local settings. */ public function getSettings(): array { $settings = []; $map = [ 'localStrictModeEnabled' => 'strictMode', 'localMonthsOverflow' => 'monthOverflow', 'localYearsOverflow' => 'yearOverflow', 'localHumanDiffOptions' => 'humanDiffOptions', 'localToStringFormat' => 'toStringFormat', 'localSerializer' => 'toJsonFormat', 'localMacros' => 'macros', 'localGenericMacros' => 'genericMacros', 'locale' => 'locale', 'tzName' => 'timezone', 'localFormatFunction' => 'formatFunction', ]; foreach ($map as $property => $key) { $value = $this->$property ?? null; if ($value !== null && ($key !== 'locale' || $value !== 'en' || $this->localTranslator)) { $settings[$key] = $value; } } return $settings; } /** * Show truthy properties on var_dump(). */ public function __debugInfo(): array { $infos = array_filter(get_object_vars($this), static function ($var) { return $var; }); foreach (['dumpProperties', 'constructedObjectId', 'constructed', 'originalInput'] as $property) { if (isset($infos[$property])) { unset($infos[$property]); } } $this->addExtraDebugInfos($infos); foreach (["\0*\0", ''] as $prefix) { $key = $prefix.'carbonRecurrences'; if (\array_key_exists($key, $infos)) { $infos['recurrences'] = $infos[$key]; unset($infos[$key]); } } return $infos; } protected function isLocalStrictModeEnabled(): bool { return $this->localStrictModeEnabled ?? $this->transmitFactory(static fn () => static::isStrictModeEnabled()); } protected function addExtraDebugInfos(array &$infos): void { if ($this instanceof DateTimeInterface) { try { $infos['date'] ??= $this->format(CarbonInterface::MOCK_DATETIME_FORMAT); $infos['timezone'] ??= $this->tzName ?? $this->timezoneSetting ?? $this->timezone ?? null; } catch (Throwable) { // noop } } } } ================================================ FILE: src/Carbon/Traits/Rounding.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use Carbon\Exceptions\UnknownUnitException; use Carbon\WeekDay; use DateInterval; /** * Trait Rounding. * * Round, ceil, floor units. * * Depends on the following methods: * * @method static copy() * @method static startOfWeek(int $weekStartsAt = null) */ trait Rounding { use IntervalRounding; /** * Round the current instance at the given unit with given precision if specified and the given function. */ public function roundUnit( string $unit, DateInterval|string|float|int $precision = 1, callable|string $function = 'round', ): static { $metaUnits = [ // @call roundUnit 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], // @call roundUnit 'century' => [static::YEARS_PER_CENTURY, 'year'], // @call roundUnit 'decade' => [static::YEARS_PER_DECADE, 'year'], // @call roundUnit 'quarter' => [static::MONTHS_PER_QUARTER, 'month'], // @call roundUnit 'millisecond' => [1000, 'microsecond'], ]; $normalizedUnit = static::singularUnit($unit); $ranges = array_merge(static::getRangesByUnit($this->daysInMonth), [ // @call roundUnit 'microsecond' => [0, 999999], ]); $factor = 1; if ($normalizedUnit === 'week') { $normalizedUnit = 'day'; $precision *= static::DAYS_PER_WEEK; } if (isset($metaUnits[$normalizedUnit])) { [$factor, $normalizedUnit] = $metaUnits[$normalizedUnit]; } $precision *= $factor; if (!isset($ranges[$normalizedUnit])) { throw new UnknownUnitException($unit); } $found = false; $fraction = 0; $arguments = null; $initialValue = null; $factor = $this->year < 0 ? -1 : 1; $changes = []; $minimumInc = null; foreach ($ranges as $unit => [$minimum, $maximum]) { if ($normalizedUnit === $unit) { $arguments = [$this->$unit, $minimum]; $initialValue = $this->$unit; $fraction = $precision - floor($precision); $found = true; continue; } if ($found) { $delta = $maximum + 1 - $minimum; $factor /= $delta; $fraction *= $delta; $inc = ($this->$unit - $minimum) * $factor; if ($inc !== 0.0) { $minimumInc = $minimumInc ?? ($arguments[0] / pow(2, 52)); // If value is still the same when adding a non-zero increment/decrement, // it means precision got lost in the addition if (abs($inc) < $minimumInc) { $inc = $minimumInc * ($inc < 0 ? -1 : 1); } // If greater than $precision, assume precision loss caused an overflow if ($function !== 'floor' || abs($arguments[0] + $inc - $initialValue) >= $precision) { $arguments[0] += $inc; } } $changes[$unit] = round( $minimum + ($fraction ? $fraction * $function(($this->$unit - $minimum) / $fraction) : 0), ); // Cannot use modulo as it lose double precision while ($changes[$unit] >= $delta) { $changes[$unit] -= $delta; } $fraction -= floor($fraction); } } [$value, $minimum] = $arguments; $normalizedValue = floor($function(($value - $minimum) / $precision) * $precision + $minimum); /** @var CarbonInterface $result */ $result = $this; foreach ($changes as $unit => $value) { $result = $result->$unit($value); } return $result->$normalizedUnit($normalizedValue); } /** * Truncate the current instance at the given unit with given precision if specified. */ public function floorUnit(string $unit, DateInterval|string|float|int $precision = 1): static { return $this->roundUnit($unit, $precision, 'floor'); } /** * Ceil the current instance at the given unit with given precision if specified. */ public function ceilUnit(string $unit, DateInterval|string|float|int $precision = 1): static { return $this->roundUnit($unit, $precision, 'ceil'); } /** * Round the current instance second with given precision if specified. */ public function round(DateInterval|string|float|int $precision = 1, callable|string $function = 'round'): static { return $this->roundWith($precision, $function); } /** * Round the current instance second with given precision if specified. */ public function floor(DateInterval|string|float|int $precision = 1): static { return $this->round($precision, 'floor'); } /** * Ceil the current instance second with given precision if specified. */ public function ceil(DateInterval|string|float|int $precision = 1): static { return $this->round($precision, 'ceil'); } /** * Round the current instance week. * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week */ public function roundWeek(WeekDay|int|null $weekStartsAt = null): static { return $this->closest( $this->avoidMutation()->floorWeek($weekStartsAt), $this->avoidMutation()->ceilWeek($weekStartsAt), ); } /** * Truncate the current instance week. * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week */ public function floorWeek(WeekDay|int|null $weekStartsAt = null): static { return $this->startOfWeek($weekStartsAt); } /** * Ceil the current instance week. * * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week */ public function ceilWeek(WeekDay|int|null $weekStartsAt = null): static { if ($this->isMutable()) { $startOfWeek = $this->avoidMutation()->startOfWeek($weekStartsAt); return $startOfWeek != $this ? $this->startOfWeek($weekStartsAt)->addWeek() : $this; } $startOfWeek = $this->startOfWeek($weekStartsAt); return $startOfWeek != $this ? $startOfWeek->addWeek() : $this->avoidMutation(); } } ================================================ FILE: src/Carbon/Traits/Serialization.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\Exceptions\InvalidFormatException; use Carbon\FactoryImmutable; use DateTimeZone; use ReturnTypeWillChange; use Throwable; /** * Trait Serialization. * * Serialization and JSON stuff. * * Depends on the following properties: * * @property int $year * @property int $month * @property int $daysInMonth * @property int $quarter * * Depends on the following methods: * * @method string|static locale(string $locale = null, string ...$fallbackLocales) * @method string toJSON() */ trait Serialization { use ObjectInitialisation; /** * List of key to use for dump/serialization. * * @var string[] */ protected array $dumpProperties = ['date', 'timezone_type', 'timezone']; /** * Locale to dump comes here before serialization. * * @var string|null */ protected $dumpLocale; /** * Embed date properties to dump in a dedicated variables so it won't overlap native * DateTime ones. * * @var array|null */ protected $dumpDateProperties; /** * Return a serialized string of the instance. */ public function serialize(): string { return serialize($this); } /** * Create an instance from a serialized string. * * If $value is not from a trusted source, consider using the allowed_classes option to limit * the types of objects that can be built, for instance: * * @example * ```php * $object = Carbon::fromSerialized($value, ['allowed_classes' => [Carbon::class, CarbonImmutable::class]]); * ``` * * @param \Stringable|string $value * @param array $options example: ['allowed_classes' => [CarbonImmutable::class]] * * @throws InvalidFormatException * * @return static */ public static function fromSerialized($value, array $options = []): static { $instance = @unserialize((string) $value, $options); if (!$instance instanceof static) { throw new InvalidFormatException("Invalid serialized value: $value"); } return $instance; } /** * The __set_state handler. * * @param string|array $dump * * @return static */ #[ReturnTypeWillChange] public static function __set_state($dump): static { if (\is_string($dump)) { return static::parse($dump); } /** @var \DateTimeInterface $date */ $date = get_parent_class(static::class) && method_exists(parent::class, '__set_state') ? parent::__set_state((array) $dump) : (object) $dump; return static::instance($date); } /** * Returns the values to dump on serialize() called on. * * @return array */ public function __serialize(): array { // @codeCoverageIgnoreStart if (isset($this->timezone_type, $this->timezone, $this->date)) { return [ 'date' => $this->date, 'timezone_type' => $this->timezone_type, 'timezone' => $this->dumpTimezone($this->timezone), ]; } // @codeCoverageIgnoreEnd $timezone = $this->getTimezone(); $export = [ 'date' => $this->format('Y-m-d H:i:s.u'), 'timezone_type' => $timezone->getType(), 'timezone' => $timezone->getName(), ]; // @codeCoverageIgnoreStart if (\extension_loaded('msgpack') && isset($this->constructedObjectId)) { $timezone = $this->timezone ?? null; $export['dumpDateProperties'] = [ 'date' => $this->format('Y-m-d H:i:s.u'), 'timezone' => $this->dumpTimezone($timezone), ]; } // @codeCoverageIgnoreEnd if ($this->localTranslator ?? null) { $export['dumpLocale'] = $this->locale ?? null; } return $export; } /** * Set locale if specified on unserialize() called. */ public function __unserialize(array $data): void { // @codeCoverageIgnoreStart try { $this->__construct($data['date'] ?? null, $data['timezone'] ?? null); } catch (Throwable $exception) { if (!isset($data['dumpDateProperties']['date'], $data['dumpDateProperties']['timezone'])) { throw $exception; } try { // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. ['date' => $date, 'timezone' => $timezone] = $data['dumpDateProperties']; $this->__construct($date, $timezone); } catch (Throwable) { throw $exception; } } // @codeCoverageIgnoreEnd if (isset($data['dumpLocale'])) { $this->locale($data['dumpLocale']); } } /** * Prepare the object for JSON serialization. */ public function jsonSerialize(): mixed { $serializer = $this->localSerializer ?? $this->getFactory()->getSettings()['toJsonFormat'] ?? null; if ($serializer) { return \is_string($serializer) ? $this->rawFormat($serializer) : $serializer($this); } return $this->toJSON(); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather transform Carbon object before the serialization. * * JSON serialize all Carbon instances using the given callback. */ public static function serializeUsing(string|callable|null $format): void { FactoryImmutable::getDefaultInstance()->serializeUsing($format); } /** * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. * foreach ($date as $_) {} * serializer($date) * var_export($date) * get_object_vars($date) */ public function cleanupDumpProperties(): self { // @codeCoverageIgnoreStart if (PHP_VERSION < 8.2) { foreach ($this->dumpProperties as $property) { if (isset($this->$property)) { unset($this->$property); } } } // @codeCoverageIgnoreEnd return $this; } /** @codeCoverageIgnore */ private function dumpTimezone(mixed $timezone): mixed { return $timezone instanceof DateTimeZone ? $timezone->getName() : $timezone; } } ================================================ FILE: src/Carbon/Traits/StaticLocalization.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\FactoryImmutable; use Symfony\Contracts\Translation\TranslatorInterface; /** * Static config for localization. */ trait StaticLocalization { /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings */ public static function setHumanDiffOptions(int $humanDiffOptions): void { FactoryImmutable::getDefaultInstance()->setHumanDiffOptions($humanDiffOptions); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings */ public static function enableHumanDiffOption(int $humanDiffOption): void { FactoryImmutable::getDefaultInstance()->enableHumanDiffOption($humanDiffOption); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings */ public static function disableHumanDiffOption(int $humanDiffOption): void { FactoryImmutable::getDefaultInstance()->disableHumanDiffOption($humanDiffOption); } /** * Return default humanDiff() options (merged flags as integer). */ public static function getHumanDiffOptions(): int { return FactoryImmutable::getInstance()->getHumanDiffOptions(); } /** * Set the default translator instance to use. * * @param TranslatorInterface $translator * * @return void */ public static function setTranslator(TranslatorInterface $translator): void { FactoryImmutable::getDefaultInstance()->setTranslator($translator); } /** * Initialize the default translator instance if necessary. */ public static function getTranslator(): TranslatorInterface { return FactoryImmutable::getInstance()->getTranslator(); } } ================================================ FILE: src/Carbon/Traits/StaticOptions.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\FactoryImmutable; /** * Options related to a static variable. */ trait StaticOptions { /////////////////////////////////////////////////////////////////// ///////////// Behavior customization for sub-classes ////////////// /////////////////////////////////////////////////////////////////// /** * Function to call instead of format. * * @var string|callable|null */ protected static $formatFunction; /** * Function to call instead of createFromFormat. * * @var string|callable|null */ protected static $createFromFormatFunction; /** * Function to call instead of parse. * * @var string|callable|null */ protected static $parseFunction; /////////////////////////////////////////////////////////////////// ///////////// Use default factory for static options ////////////// /////////////////////////////////////////////////////////////////// /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * @see settings * * Enable the strict mode (or disable with passing false). * * @param bool $strictModeEnabled */ public static function useStrictMode(bool $strictModeEnabled = true): void { FactoryImmutable::getDefaultInstance()->useStrictMode($strictModeEnabled); } /** * Returns true if the strict mode is globally in use, false else. * (It can be overridden in specific instances.) * * @return bool */ public static function isStrictModeEnabled(): bool { return FactoryImmutable::getInstance()->isStrictModeEnabled(); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Indicates if months should be calculated with overflow. * * @param bool $monthsOverflow * * @return void */ public static function useMonthsOverflow(bool $monthsOverflow = true): void { FactoryImmutable::getDefaultInstance()->useMonthsOverflow($monthsOverflow); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Reset the month overflow behavior. * * @return void */ public static function resetMonthsOverflow(): void { FactoryImmutable::getDefaultInstance()->resetMonthsOverflow(); } /** * Get the month overflow global behavior (can be overridden in specific instances). * * @return bool */ public static function shouldOverflowMonths(): bool { return FactoryImmutable::getInstance()->shouldOverflowMonths(); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Indicates if years should be calculated with overflow. * * @param bool $yearsOverflow * * @return void */ public static function useYearsOverflow(bool $yearsOverflow = true): void { FactoryImmutable::getDefaultInstance()->useYearsOverflow($yearsOverflow); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather use the ->settings() method. * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). * @see settings * * Reset the month overflow behavior. * * @return void */ public static function resetYearsOverflow(): void { FactoryImmutable::getDefaultInstance()->resetYearsOverflow(); } /** * Get the month overflow global behavior (can be overridden in specific instances). * * @return bool */ public static function shouldOverflowYears(): bool { return FactoryImmutable::getInstance()->shouldOverflowYears(); } } ================================================ FILE: src/Carbon/Traits/Test.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterface; use Carbon\CarbonTimeZone; use Carbon\Factory; use Carbon\FactoryImmutable; use Closure; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; trait Test { /////////////////////////////////////////////////////////////////// ///////////////////////// TESTING AIDS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * * Only the moment is mocked with setTestNow(), the timezone will still be the one passed * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). * * To clear the test instance call this method using the default * parameter of null. * * /!\ Use this method for unit tests only. * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance */ public static function setTestNow(mixed $testNow = null): void { FactoryImmutable::getDefaultInstance()->setTestNow($testNow); } /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * - When a string containing the desired time is passed to Carbon::parse(). * * It will also align default timezone (e.g. call date_default_timezone_set()) with * the second argument or if null, with the timezone of the given date object. * * To clear the test instance call this method using the default * parameter of null. * * /!\ Use this method for unit tests only. * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance */ public static function setTestNowAndTimezone($testNow = null, $timezone = null): void { FactoryImmutable::getDefaultInstance()->setTestNowAndTimezone($testNow, $timezone); } /** * Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then * clearing the test instance. * * /!\ Use this method for unit tests only. * * @template T * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance * @param Closure(): T $callback * * @return T */ public static function withTestNow(mixed $testNow, callable $callback): mixed { return FactoryImmutable::getDefaultInstance()->withTestNow($testNow, $callback); } /** * Get the Carbon instance (real or mock) to be returned when a "now" * instance is created. * * @return Closure|CarbonInterface|null the current instance used for testing */ public static function getTestNow(): Closure|CarbonInterface|null { return FactoryImmutable::getInstance()->getTestNow(); } /** * Determine if there is a valid test instance set. A valid test instance * is anything that is not null. * * @return bool true if there is a test instance, otherwise false */ public static function hasTestNow(): bool { return FactoryImmutable::getInstance()->hasTestNow(); } /** * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. */ protected static function getMockedTestNow(DateTimeZone|string|int|null $timezone): ?CarbonInterface { $testNow = FactoryImmutable::getInstance()->handleTestNowClosure(static::getTestNow(), $timezone); if ($testNow === null) { return null; } $testNow = $testNow->avoidMutation(); return $timezone ? $testNow->setTimezone($timezone) : $testNow; } private function mockConstructorParameters(&$time, ?CarbonTimeZone $timezone): void { $clock = $this->clock?->unwrap(); $now = $clock instanceof Factory ? $clock->getTestNow() : $this->nowFromClock($timezone); $testInstance = $now ?? self::getMockedTestNowClone($timezone); if (!$testInstance) { return; } if ($testInstance instanceof DateTimeInterface) { $testInstance = $testInstance->setTimezone($timezone ?? date_default_timezone_get()); } if (static::hasRelativeKeywords($time)) { $testInstance = $testInstance->modify($time); } $factory = $this->getClock()?->unwrap(); if (!($factory instanceof Factory)) { $factory = FactoryImmutable::getInstance(); } $testInstance = $factory->handleTestNowClosure($testInstance, $timezone); $time = $testInstance instanceof self ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) : $testInstance->format(static::MOCK_DATETIME_FORMAT); } private static function getMockedTestNowClone($timezone): CarbonInterface|self|null { $mock = static::getMockedTestNow($timezone); return $mock ? clone $mock : null; } private function nowFromClock(?CarbonTimeZone $timezone): ?DateTimeImmutable { $now = $this->clock?->now(); return $now && $timezone ? $now->setTimezone($timezone) : null; } } ================================================ FILE: src/Carbon/Traits/Timestamp.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use DateTimeZone; /** * Trait Timestamp. */ trait Timestamp { /** * Create a Carbon instance from a timestamp and set the timezone (UTC by default). * * Timestamp input can be given as int, float or a string containing one or more numbers. */ #[\ReturnTypeWillChange] public static function createFromTimestamp( float|int|string $timestamp, DateTimeZone|string|int|null $timezone = null, ): static { $date = static::createFromTimestampUTC($timestamp); return $timezone === null ? $date : $date->setTimezone($timezone); } /** * Create a Carbon instance from a timestamp keeping the timezone to UTC. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public static function createFromTimestampUTC(float|int|string $timestamp): static { [$integer, $decimal] = self::getIntegerAndDecimalParts($timestamp); $delta = floor($decimal / static::MICROSECONDS_PER_SECOND); $integer += $delta; $decimal -= $delta * static::MICROSECONDS_PER_SECOND; $decimal = str_pad((string) $decimal, 6, '0', STR_PAD_LEFT); return static::rawCreateFromFormat('U u', "$integer $decimal"); } /** * Create a Carbon instance from a timestamp in milliseconds. * * Timestamp input can be given as int, float or a string containing one or more numbers. * * @param float|int|string $timestamp * * @return static */ public static function createFromTimestampMsUTC($timestamp): static { [$milliseconds, $microseconds] = self::getIntegerAndDecimalParts($timestamp, 3); $sign = $milliseconds < 0 || ($milliseconds === 0.0 && $microseconds < 0) ? -1 : 1; $milliseconds = abs($milliseconds); $microseconds = $sign * abs($microseconds) + static::MICROSECONDS_PER_MILLISECOND * ($milliseconds % static::MILLISECONDS_PER_SECOND); $seconds = $sign * floor($milliseconds / static::MILLISECONDS_PER_SECOND); $delta = floor($microseconds / static::MICROSECONDS_PER_SECOND); $seconds = (int) ($seconds + $delta); $microseconds -= $delta * static::MICROSECONDS_PER_SECOND; $microseconds = str_pad((string) (int) $microseconds, 6, '0', STR_PAD_LEFT); return static::rawCreateFromFormat('U u', "$seconds $microseconds"); } /** * Create a Carbon instance from a timestamp in milliseconds. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public static function createFromTimestampMs( float|int|string $timestamp, DateTimeZone|string|int|null $timezone = null, ): static { $date = static::createFromTimestampMsUTC($timestamp); return $timezone === null ? $date : $date->setTimezone($timezone); } /** * Set the instance's timestamp. * * Timestamp input can be given as int, float or a string containing one or more numbers. */ public function timestamp(float|int|string $timestamp): static { return $this->setTimestamp($timestamp); } /** * Returns a timestamp rounded with the given precision (6 by default). * * @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision) * @example getPreciseTimestamp(6) 1532087464437474 * @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision) * @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision) * @example getPreciseTimestamp(3) 1532087464437 (millisecond precision) * @example getPreciseTimestamp(2) 153208746444 (1/100 second precision) * @example getPreciseTimestamp(1) 15320874644 (1/10 second precision) * @example getPreciseTimestamp(0) 1532087464 (second precision) * @example getPreciseTimestamp(-1) 153208746 (10 second precision) * @example getPreciseTimestamp(-2) 15320875 (100 second precision) * * @param int $precision * * @return float */ public function getPreciseTimestamp($precision = 6): float { return round(((float) $this->rawFormat('Uu')) / pow(10, 6 - $precision)); } /** * Returns the milliseconds timestamps used amongst other by Date javascript objects. * * @return float */ public function valueOf(): float { return $this->getPreciseTimestamp(3); } /** * Returns the timestamp with millisecond precision. * * @return int */ public function getTimestampMs(): int { return (int) $this->getPreciseTimestamp(3); } /** * @alias getTimestamp * * Returns the UNIX timestamp for the current date. * * @return int */ public function unix(): int { return $this->getTimestamp(); } /** * Return an array with integer part digits and decimals digits split from one or more positive numbers * (such as timestamps) as string with the given number of decimals (6 by default). * * By splitting integer and decimal, this method obtain a better precision than * number_format when the input is a string. * * @param float|int|string $numbers one or more numbers * @param int $decimals number of decimals precision (6 by default) * * @return array 0-index is integer part, 1-index is decimal part digits */ private static function getIntegerAndDecimalParts($numbers, $decimals = 6): array { if (\is_int($numbers) || \is_float($numbers)) { $numbers = number_format($numbers, $decimals, '.', ''); } $sign = str_starts_with($numbers, '-') ? -1 : 1; $integer = 0; $decimal = 0; foreach (preg_split('`[^\d.]+`', $numbers) as $chunk) { [$integerPart, $decimalPart] = explode('.', "$chunk."); $integer += (int) $integerPart; $decimal += (float) ("0.$decimalPart"); } $overflow = floor($decimal); $integer += $overflow; $decimal -= $overflow; return [$sign * $integer, $decimal === 0.0 ? 0.0 : $sign * round($decimal * pow(10, $decimals))]; } } ================================================ FILE: src/Carbon/Traits/ToStringFormat.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\FactoryImmutable; use Closure; /** * Trait ToStringFormat. * * Handle global format customization for string cast of the object. */ trait ToStringFormat { /** * Reset the format used to the default when type juggling a Carbon instance to a string * * @return void */ public static function resetToStringFormat(): void { FactoryImmutable::getDefaultInstance()->resetToStringFormat(); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and * use other method or custom format passed to format() method if you need to dump another string * format. * * Set the default format used when type juggling a Carbon instance to a string. * * @param string|Closure|null $format * * @return void */ public static function setToStringFormat(string|Closure|null $format): void { FactoryImmutable::getDefaultInstance()->setToStringFormat($format); } } ================================================ FILE: src/Carbon/Traits/Units.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonConverterInterface; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidIntervalException; use Carbon\Exceptions\UnitException; use Carbon\Exceptions\UnsupportedUnitException; use Carbon\Unit; use Closure; use DateInterval; use DateMalformedStringException; use ReturnTypeWillChange; /** * Trait Units. * * Add, subtract and set units. */ trait Units { /** * @deprecated Prefer to use add addUTCUnit() which more accurately defines what it's doing. * * Add seconds to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param string $unit * @param int|float|null $value * * @return static */ public function addRealUnit(string $unit, $value = 1): static { return $this->addUTCUnit($unit, $value); } /** * Add seconds to the instance using timestamp. Positive $value travels * forward while negative $value travels into the past. * * @param string $unit * @param int|float|null $value * * @return static */ public function addUTCUnit(string $unit, $value = 1): static { $value ??= 0; switch ($unit) { // @call addUTCUnit case 'micro': // @call addUTCUnit case 'microsecond': /* @var CarbonInterface $this */ $diff = $this->microsecond + $value; $time = $this->getTimestamp(); $seconds = (int) floor($diff / static::MICROSECONDS_PER_SECOND); $time += $seconds; $diff -= $seconds * static::MICROSECONDS_PER_SECOND; $microtime = str_pad((string) $diff, 6, '0', STR_PAD_LEFT); $timezone = $this->tz; return $this->tz('UTC')->modify("@$time.$microtime")->setTimezone($timezone); // @call addUTCUnit case 'milli': // @call addUTCUnit case 'millisecond': return $this->addUTCUnit('microsecond', $value * static::MICROSECONDS_PER_MILLISECOND); // @call addUTCUnit case 'second': break; // @call addUTCUnit case 'minute': $value *= static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'hour': $value *= static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'day': $value *= static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'week': $value *= static::DAYS_PER_WEEK * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'month': $value *= 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'quarter': $value *= static::MONTHS_PER_QUARTER * 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'year': $value *= 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'decade': $value *= static::YEARS_PER_DECADE * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'century': $value *= static::YEARS_PER_CENTURY * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; // @call addUTCUnit case 'millennium': $value *= static::YEARS_PER_MILLENNIUM * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; break; default: if ($this->isLocalStrictModeEnabled()) { throw new UnitException("Invalid unit for real timestamp add/sub: '$unit'"); } return $this; } $seconds = (int) $value; $microseconds = (int) round( (abs($value) - abs($seconds)) * ($value < 0 ? -1 : 1) * static::MICROSECONDS_PER_SECOND, ); $date = $this->setTimestamp($this->getTimestamp() + $seconds); return $microseconds ? $date->addUTCUnit('microsecond', $microseconds) : $date; } /** * @deprecated Prefer to use add subUTCUnit() which more accurately defines what it's doing. * * Subtract seconds to the instance using timestamp. Positive $value travels * into the past while negative $value travels forward. * * @param string $unit * @param int $value * * @return static */ public function subRealUnit($unit, $value = 1): static { return $this->addUTCUnit($unit, -$value); } /** * Subtract seconds to the instance using timestamp. Positive $value travels * into the past while negative $value travels forward. * * @param string $unit * @param int $value * * @return static */ public function subUTCUnit($unit, $value = 1): static { return $this->addUTCUnit($unit, -$value); } /** * Returns true if a property can be changed via setter. * * @param string $unit * * @return bool */ public static function isModifiableUnit($unit): bool { static $modifiableUnits = [ // @call addUnit 'millennium', // @call addUnit 'century', // @call addUnit 'decade', // @call addUnit 'quarter', // @call addUnit 'week', // @call addUnit 'weekday', ]; return \in_array($unit, $modifiableUnits, true) || \in_array($unit, static::$units, true); } /** * Call native PHP DateTime/DateTimeImmutable add() method. * * @param DateInterval $interval * * @return static */ public function rawAdd(DateInterval $interval): static { return parent::add($interval); } /** * Add given units or interval to the current instance. * * @example $date->add('hour', 3) * @example $date->add(15, 'days') * @example $date->add(CarbonInterval::days(4)) * * @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit * @param Unit|int|float|string $value * @param bool|null $overflow * * @return static */ #[ReturnTypeWillChange] public function add($unit, $value = 1, ?bool $overflow = null): static { $unit = Unit::toNameIfUnit($unit); $value = Unit::toNameIfUnit($value); if (\is_string($unit) && \func_num_args() === 1) { $unit = CarbonInterval::make($unit, [], true); } if ($unit instanceof CarbonConverterInterface) { $unit = Closure::fromCallable([$unit, 'convertDate']); } if ($unit instanceof Closure) { $result = $this->resolveCarbon($unit($this, false)); if ($this !== $result && $this->isMutable()) { return $this->modify($result->rawFormat('Y-m-d H:i:s.u e O')); } return $result; } if ($unit instanceof DateInterval) { return parent::add($unit); } if (is_numeric($unit)) { [$value, $unit] = [$unit, $value]; } return $this->addUnit((string) $unit, $value, $overflow); } /** * Add given units to the current instance. */ public function addUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static { $unit = Unit::toName($unit); $originalArgs = \func_get_args(); $date = $this; if (!is_numeric($value) || !(float) $value) { return $date->isMutable() ? $date : $date->copy(); } $unit = self::singularUnit($unit); $metaUnits = [ 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], 'century' => [static::YEARS_PER_CENTURY, 'year'], 'decade' => [static::YEARS_PER_DECADE, 'year'], 'quarter' => [static::MONTHS_PER_QUARTER, 'month'], ]; if (isset($metaUnits[$unit])) { [$factor, $unit] = $metaUnits[$unit]; $value *= $factor; } if ($unit === 'weekday') { $weekendDays = $this->transmitFactory(static fn () => static::getWeekendDays()); if ($weekendDays !== [static::SATURDAY, static::SUNDAY]) { $absoluteValue = abs($value); $sign = $value / max(1, $absoluteValue); $weekDaysCount = static::DAYS_PER_WEEK - min(static::DAYS_PER_WEEK - 1, \count(array_unique($weekendDays))); $weeks = floor($absoluteValue / $weekDaysCount); for ($diff = $absoluteValue % $weekDaysCount; $diff; $diff--) { /** @var static $date */ $date = $date->addDays($sign); while (\in_array($date->dayOfWeek, $weekendDays, true)) { $date = $date->addDays($sign); } } $value = $weeks * $sign; $unit = 'week'; } $timeString = $date->toTimeString(); } elseif ($canOverflow = (\in_array($unit, [ 'month', 'year', ]) && ($overflow === false || ( $overflow === null && ($ucUnit = ucfirst($unit).'s') && !($this->{'local'.$ucUnit.'Overflow'} ?? static::{'shouldOverflow'.$ucUnit}()) )))) { $day = $date->day; } if ($unit === 'milli' || $unit === 'millisecond') { $unit = 'microsecond'; $value *= static::MICROSECONDS_PER_MILLISECOND; } $previousException = null; try { $date = self::rawAddUnit($date, $unit, $value); if (isset($timeString)) { $date = $date?->setTimeFromTimeString($timeString); } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date?->day) { $date = $date?->modify('last day of previous month'); } } catch (DateMalformedStringException|InvalidFormatException|UnsupportedUnitException $exception) { $date = null; $previousException = $exception; } return $date ?? throw new UnitException( 'Unable to add unit '.var_export($originalArgs, true), previous: $previousException, ); } /** * Subtract given units to the current instance. */ public function subUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static { return $this->addUnit($unit, -$value, $overflow); } /** * Call native PHP DateTime/DateTimeImmutable sub() method. */ public function rawSub(DateInterval $interval): static { return parent::sub($interval); } /** * Subtract given units or interval to the current instance. * * @example $date->sub('hour', 3) * @example $date->sub(15, 'days') * @example $date->sub(CarbonInterval::days(4)) * * @param Unit|int|string|DateInterval|Closure|CarbonConverterInterface $unit * @param Unit|int|float|string $value * @param bool|null $overflow * * @return static */ #[ReturnTypeWillChange] public function sub($unit, $value = 1, ?bool $overflow = null): static { $unit = Unit::toNameIfUnit($unit); $value = Unit::toNameIfUnit($value); if (\is_string($unit) && \func_num_args() === 1) { $unit = CarbonInterval::make($unit, [], true); } if ($unit instanceof CarbonConverterInterface) { $unit = Closure::fromCallable([$unit, 'convertDate']); } if ($unit instanceof Closure) { $result = $this->resolveCarbon($unit($this, true)); if ($this !== $result && $this->isMutable()) { return $this->modify($result->rawFormat('Y-m-d H:i:s.u e O')); } return $result; } if ($unit instanceof DateInterval) { return parent::sub($unit); } if (is_numeric($unit)) { [$value, $unit] = [$unit, $value]; } return $this->addUnit((string) $unit, -(float) $value, $overflow); } /** * Subtract given units or interval to the current instance. * * @see sub() * * @param Unit|int|string|DateInterval $unit * @param Unit|int|float|string $value * @param bool|null $overflow * * @return static */ public function subtract($unit, $value = 1, ?bool $overflow = null): static { if (\is_string($unit) && \func_num_args() === 1) { $unit = CarbonInterval::make($unit, [], true); } return $this->sub($unit, $value, $overflow); } private static function rawAddUnit(self $date, string $unit, int|float $value): ?static { try { return $date->rawAdd( CarbonInterval::fromString(abs($value)." $unit")->invert($value < 0), ); } catch (InvalidIntervalException $exception) { try { return $date->modify("$value $unit"); } catch (InvalidFormatException) { throw new UnsupportedUnitException($unit, previous: $exception); } } } } ================================================ FILE: src/Carbon/Traits/Week.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon\Traits; use Carbon\CarbonInterval; /** * Trait Week. * * week and ISO week number, year and count in year. * * Depends on the following properties: * * @property int $daysInYear * @property int $dayOfWeek * @property int $dayOfYear * @property int $year * * Depends on the following methods: * * @method static addWeeks(int $weeks = 1) * @method static copy() * @method static dayOfYear(int $dayOfYear) * @method string getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null) * @method static next(int|string $modifier = null) * @method static startOfWeek(int $day = null) * @method static subWeeks(int $weeks = 1) * @method static year(int $year = null) */ trait Week { /** * Set/get the week number of year using given first day of week and first * day of year included in the first week. Or use ISO format if no settings * given. * * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int|static */ public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null) { return $this->weekYear( $year, $dayOfWeek ?? static::MONDAY, $dayOfYear ?? static::THURSDAY, ); } /** * Set/get the week number of year using given first day of week and first * day of year included in the first week. Or use US format if no settings * given (Sunday / Jan 6). * * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int|static */ public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null) { $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? static::SUNDAY; $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; if ($year !== null) { $year = (int) round($year); if ($this->weekYear(null, $dayOfWeek, $dayOfYear) === $year) { return $this->avoidMutation(); } $week = $this->week(null, $dayOfWeek, $dayOfYear); $day = $this->dayOfWeek; $date = $this->year($year); $date = match ($date->weekYear(null, $dayOfWeek, $dayOfYear) - $year) { CarbonInterval::POSITIVE => $date->subWeeks(static::WEEKS_PER_YEAR / 2), CarbonInterval::NEGATIVE => $date->addWeeks(static::WEEKS_PER_YEAR / 2), default => $date, }; $date = $date ->addWeeks($week - $date->week(null, $dayOfWeek, $dayOfYear)) ->startOfWeek($dayOfWeek); if ($date->dayOfWeek === $day) { return $date; } return $date->next($day); } $year = $this->year; $day = $this->dayOfYear; $date = $this->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); if ($date->year === $year && $day < $date->dayOfYear) { return $year - 1; } $date = $this->avoidMutation()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); if ($date->year === $year && $day >= $date->dayOfYear) { return $year + 1; } return $year; } /** * Get the number of weeks of the current week-year using given first day of week and first * day of year included in the first week. Or use ISO format if no settings * given. * * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int */ public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null) { return $this->weeksInYear( $dayOfWeek ?? static::MONDAY, $dayOfYear ?? static::THURSDAY, ); } /** * Get the number of weeks of the current week-year using given first day of week and first * day of year included in the first week. Or use US format if no settings * given (Sunday / Jan 6). * * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) * @param int|null $dayOfYear first day of year included in the week #1 * * @return int */ public function weeksInYear($dayOfWeek = null, $dayOfYear = null) { $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? static::SUNDAY; $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; $year = $this->year; $start = $this->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); $startDay = $start->dayOfYear; if ($start->year !== $year) { $startDay -= $start->daysInYear; } $end = $this->avoidMutation()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); $endDay = $end->dayOfYear; if ($end->year !== $year) { $endDay += $this->daysInYear; } return (int) round(($endDay - $startDay) / static::DAYS_PER_WEEK); } /** * Get/set the week number using given first day of week and first * day of year included in the first week. Or use US format if no settings * given (Sunday / Jan 6). * * @param int|null $week * @param int|null $dayOfWeek * @param int|null $dayOfYear * * @return int|static */ public function week($week = null, $dayOfWeek = null, $dayOfYear = null) { $date = $this; $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0; $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; if ($week !== null) { return $date->addWeeks(round($week) - $this->week(null, $dayOfWeek, $dayOfYear)); } $start = $date->avoidMutation()->shiftTimezone('UTC')->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); $end = $date->avoidMutation()->shiftTimezone('UTC')->startOfWeek($dayOfWeek); if ($start > $end) { $start = $start->subWeeks(static::WEEKS_PER_YEAR / 2)->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); } $week = (int) ($start->diffInDays($end) / static::DAYS_PER_WEEK + 1); return $week > $end->weeksInYear($dayOfWeek, $dayOfYear) ? 1 : $week; } /** * Get/set the week number using given first day of week and first * day of year included in the first week. Or use ISO format if no settings * given. * * @param int|null $week * @param int|null $dayOfWeek * @param int|null $dayOfYear * * @return int|static */ public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null) { return $this->week( $week, $dayOfWeek ?? static::MONDAY, $dayOfYear ?? static::THURSDAY, ); } } ================================================ FILE: src/Carbon/Translator.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use ReflectionMethod; use Symfony\Component\Translation; use Symfony\Contracts\Translation\TranslatorInterface; $transMethod = new ReflectionMethod( class_exists(TranslatorInterface::class) ? TranslatorInterface::class : Translation\Translator::class, 'trans', ); require $transMethod->hasReturnType() ? __DIR__.'/../../lazy/Carbon/TranslatorStrongType.php' : __DIR__.'/../../lazy/Carbon/TranslatorWeakType.php'; class Translator extends LazyTranslator { // Proxy dynamically loaded LazyTranslator in a static way } ================================================ FILE: src/Carbon/TranslatorImmutable.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Exceptions\ImmutableException; use Symfony\Component\Config\ConfigCacheFactoryInterface; use Symfony\Component\Translation\Formatter\MessageFormatterInterface; class TranslatorImmutable extends Translator { private bool $constructed = false; public function __construct($locale, ?MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) { parent::__construct($locale, $formatter, $cacheDir, $debug); $this->constructed = true; } /** * @codeCoverageIgnore */ public function setDirectories(array $directories): static { $this->disallowMutation(__METHOD__); return parent::setDirectories($directories); } public function setLocale($locale): void { $this->disallowMutation(__METHOD__); parent::setLocale($locale); } /** * @codeCoverageIgnore */ public function setMessages(string $locale, array $messages): static { $this->disallowMutation(__METHOD__); return parent::setMessages($locale, $messages); } /** * @codeCoverageIgnore */ public function setTranslations(array $messages): static { $this->disallowMutation(__METHOD__); return parent::setTranslations($messages); } /** * @codeCoverageIgnore */ public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void { $this->disallowMutation(__METHOD__); parent::setConfigCacheFactory($configCacheFactory); } public function resetMessages(?string $locale = null): bool { $this->disallowMutation(__METHOD__); return parent::resetMessages($locale); } /** * @codeCoverageIgnore */ public function setFallbackLocales(array $locales): void { $this->disallowMutation(__METHOD__); parent::setFallbackLocales($locales); } private function disallowMutation($method) { if ($this->constructed) { throw new ImmutableException($method.' not allowed on '.static::class); } } } ================================================ FILE: src/Carbon/TranslatorStrongTypeInterface.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Symfony\Component\Translation\MessageCatalogueInterface; /** * Mark translator using strong type from symfony/translation >= 6. */ interface TranslatorStrongTypeInterface { public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages'); } ================================================ FILE: src/Carbon/Unit.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; enum Unit: string { case Microsecond = 'microsecond'; case Millisecond = 'millisecond'; case Second = 'second'; case Minute = 'minute'; case Hour = 'hour'; case Day = 'day'; case Week = 'week'; case Month = 'month'; case Quarter = 'quarter'; case Year = 'year'; case Decade = 'decade'; case Century = 'century'; case Millennium = 'millennium'; public static function toName(self|string $unit): string { return $unit instanceof self ? $unit->value : $unit; } /** @internal */ public static function toNameIfUnit(mixed $unit): mixed { return $unit instanceof self ? $unit->value : $unit; } public static function fromName(string $name, ?string $locale = null): self { if ($locale !== null) { $messages = Translator::get($locale)->getMessages($locale) ?? []; if ($messages !== []) { $lowerName = mb_strtolower($name); foreach (self::cases() as $unit) { foreach (['', '_from_now', '_ago', '_after', '_before'] as $suffix) { $message = $messages[$unit->value.$suffix] ?? null; if (\is_string($message)) { $words = explode('|', mb_strtolower(preg_replace( '/[{\[\]].+?[}\[\]]/', '', str_replace(':count', '', $message), ))); foreach ($words as $word) { if (trim($word) === $lowerName) { return $unit; } } } } } } } return self::from(CarbonImmutable::singularUnit($name)); } public function singular(?string $locale = null): string { if ($locale !== null) { return trim(Translator::get($locale)->trans($this->value, [ '%count%' => 1, ':count' => 1, ]), "1 \n\r\t\v\0"); } return $this->value; } public function plural(?string $locale = null): string { if ($locale !== null) { return trim(Translator::get($locale)->trans($this->value, [ '%count%' => 9, ':count' => 9, ]), "9 \n\r\t\v\0"); } return CarbonImmutable::pluralUnit($this->value); } public function interval(int|float $value = 1): CarbonInterval { return CarbonInterval::fromString("$value $this->name"); } public function locale(string $locale): CarbonInterval { return $this->interval()->locale($locale); } public function toPeriod(...$params): CarbonPeriod { return $this->interval()->toPeriod(...$params); } public function stepBy(mixed $interval, Unit|string|null $unit = null): CarbonPeriod { return $this->interval()->stepBy($interval, $unit); } } ================================================ FILE: src/Carbon/WeekDay.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Exceptions\InvalidFormatException; enum WeekDay: int { // Using constants is only safe starting from PHP 8.2 case Sunday = 0; // CarbonInterface::SUNDAY case Monday = 1; // CarbonInterface::MONDAY case Tuesday = 2; // CarbonInterface::TUESDAY case Wednesday = 3; // CarbonInterface::WEDNESDAY case Thursday = 4; // CarbonInterface::THURSDAY case Friday = 5; // CarbonInterface::FRIDAY case Saturday = 6; // CarbonInterface::SATURDAY public static function int(self|int|null $value): ?int { return $value instanceof self ? $value->value : $value; } public static function fromNumber(int $number): self { $day = $number % CarbonInterface::DAYS_PER_WEEK; return self::from($day + ($day < 0 ? CarbonInterface::DAYS_PER_WEEK : 0)); } public static function fromName(string $name, ?string $locale = null): self { try { return self::from(CarbonImmutable::parseFromLocale($name, $locale)->dayOfWeek); } catch (InvalidFormatException $exception) { // Possibly current language expect a dot after short name, but it's missing if ($locale !== null && !mb_strlen($name) < 4 && !str_ends_with($name, '.')) { try { return self::from(CarbonImmutable::parseFromLocale($name.'.', $locale)->dayOfWeek); } catch (InvalidFormatException) { // Throw previous error } } throw $exception; } } public function next(?CarbonImmutable $now = null): CarbonImmutable { return $now?->modify($this->name) ?? new CarbonImmutable($this->name); } public function locale(string $locale, ?CarbonImmutable $now = null): CarbonImmutable { return $this->next($now)->locale($locale); } } ================================================ FILE: src/Carbon/WrapperClock.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use DateTime; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Psr\Clock\ClockInterface as PsrClockInterface; use RuntimeException; use Symfony\Component\Clock\ClockInterface; final class WrapperClock implements ClockInterface { public function __construct( private PsrClockInterface|Factory|DateTimeInterface $currentClock, ) { } public function unwrap(): PsrClockInterface|Factory|DateTimeInterface { return $this->currentClock; } public function getFactory(): Factory { if ($this->currentClock instanceof Factory) { return $this->currentClock; } if ($this->currentClock instanceof DateTime) { $factory = new Factory(); $factory->setTestNowAndTimezone($this->currentClock); return $factory; } if ($this->currentClock instanceof DateTimeImmutable) { $factory = new FactoryImmutable(); $factory->setTestNowAndTimezone($this->currentClock); return $factory; } $factory = new FactoryImmutable(); $factory->setTestNowAndTimezone(fn () => $this->currentClock->now()); return $factory; } private function nowRaw(): DateTimeInterface { if ($this->currentClock instanceof DateTimeInterface) { return $this->currentClock; } if ($this->currentClock instanceof Factory) { return $this->currentClock->__call('now', []); } return $this->currentClock->now(); } public function now(): DateTimeImmutable { $now = $this->nowRaw(); return $now instanceof DateTimeImmutable ? $now : new CarbonImmutable($now); } /** * @template T of CarbonInterface * * @param class-string $class * * @return T */ public function nowAs(string $class, DateTimeZone|string|int|null $timezone = null): CarbonInterface { $now = $this->nowRaw(); $date = $now instanceof $class ? $now : $class::instance($now); return $timezone === null ? $date : $date->setTimezone($timezone); } public function nowAsCarbon(DateTimeZone|string|int|null $timezone = null): CarbonInterface { $now = $this->nowRaw(); return $now instanceof CarbonInterface ? ($timezone === null ? $now : $now->setTimezone($timezone)) : $this->dateAsCarbon($now, $timezone); } private function dateAsCarbon(DateTimeInterface $date, DateTimeZone|string|int|null $timezone): CarbonInterface { return $date instanceof DateTimeImmutable ? new CarbonImmutable($date, $timezone) : new Carbon($date, $timezone); } public function sleep(float|int $seconds): void { if ($seconds === 0 || $seconds === 0.0) { return; } if ($seconds < 0) { throw new RuntimeException('Expected positive number of seconds, '.$seconds.' given'); } if ($this->currentClock instanceof DateTimeInterface) { $this->currentClock = $this->addSeconds($this->currentClock, $seconds); return; } if ($this->currentClock instanceof ClockInterface) { $this->currentClock->sleep($seconds); return; } $this->currentClock = $this->addSeconds($this->currentClock->now(), $seconds); } public function withTimeZone(DateTimeZone|string $timezone): static { if ($this->currentClock instanceof ClockInterface) { return new self($this->currentClock->withTimeZone($timezone)); } $now = $this->currentClock instanceof DateTimeInterface ? $this->currentClock : $this->currentClock->now(); if (!($now instanceof DateTimeImmutable)) { $now = clone $now; } if (\is_string($timezone)) { $timezone = new DateTimeZone($timezone); } return new self($now->setTimezone($timezone)); } private function addSeconds(DateTimeInterface $date, float|int $seconds): DateTimeInterface { $secondsPerHour = CarbonInterface::SECONDS_PER_MINUTE * CarbonInterface::MINUTES_PER_HOUR; $hours = number_format( floor($seconds / $secondsPerHour), thousands_separator: '', ); $microseconds = number_format( ($seconds - $hours * $secondsPerHour) * CarbonInterface::MICROSECONDS_PER_SECOND, thousands_separator: '', ); if (!($date instanceof DateTimeImmutable)) { $date = clone $date; } if ($hours !== '0') { $date = $date->modify("$hours hours"); } if ($microseconds !== '0') { $date = $date->modify("$microseconds microseconds"); } return $date; } } ================================================ FILE: tests/AbstractTestCase.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\CarbonPeriodImmutable; use Carbon\CarbonTimeZone; use Carbon\Translator; use Closure; use DateTime; use ErrorException; use LogicException; use PHPUnit\Framework\TestCase; use PHPUnit\Runner\Version; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use ReflectionProperty; use Tests\PHPUnit\AssertObjectHasPropertyTrait; use Throwable; /** * @SuppressWarnings(NumberOfChildren) */ abstract class AbstractTestCase extends TestCase { use AssertObjectHasPropertyTrait; private ?string $saveTz = null; protected ?Carbon $now = null; protected ?CarbonImmutable $immutableNow = null; protected bool $oldNow = false; protected bool $oldImmutableNow = false; /** @var class-string */ protected static string $periodClass = CarbonPeriod::class; protected int $initialOptions = 0; protected function getTimestamp(): int { return (new DateTime())->getTimestamp(); } protected function setUp(): void { $this->initialOptions = static::$periodClass === CarbonPeriodImmutable::class ? CarbonPeriod::IMMUTABLE : 0; //save current timezone $this->saveTz = date_default_timezone_get(); date_default_timezone_set('America/Toronto'); /** @var Carbon $now */ $now = $this->oldNow ? Carbon::create(2017, 6, 27, 13, 14, 15, 'UTC') : Carbon::now(); /** @var CarbonImmutable $immutableNow */ $immutableNow = $this->oldImmutableNow ? CarbonImmutable::create(2017, 6, 27, 13, 14, 15, 'UTC') : CarbonImmutable::now(); Carbon::setTestNowAndTimezone($this->now = $now); CarbonImmutable::setTestNowAndTimezone($this->immutableNow = $immutableNow); Carbon::useStrictMode(true); CarbonImmutable::useStrictMode(true); } protected function tearDown(): void { date_default_timezone_set($this->saveTz); Carbon::setTestNow(); Carbon::resetToStringFormat(); Carbon::resetMonthsOverflow(); Carbon::setTranslator(new Translator('en')); Carbon::setLocale('en'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); CarbonImmutable::setTestNow(); CarbonImmutable::resetToStringFormat(); CarbonImmutable::resetMonthsOverflow(); CarbonImmutable::setTranslator(new Translator('en')); CarbonImmutable::setLocale('en'); /** @var Translator $translator */ $translator = CarbonImmutable::getTranslator(); $translator->resetMessages(); } public function assertCarbon(CarbonInterface $d, $year, $month, $day, $hour = null, $minute = null, $second = null, $micro = null): void { $expected = [ 'years' => $year, 'months' => $month, 'day' => $day, ]; $actual = [ 'years' => $d->year, 'months' => $d->month, 'day' => $d->day, ]; if ($hour !== null) { $actual['hours'] = $d->hour; $expected['hours'] = $hour; } if ($minute !== null) { $actual['minutes'] = $d->minute; $expected['minutes'] = $minute; } if ($second !== null) { $actual['seconds'] = $d->second; $expected['seconds'] = $second; } if ($micro !== null) { $actual['micro'] = $d->micro; $expected['micro'] = $micro; } $this->assertSame($expected, $actual); } public function assertCarbonTime(CarbonInterface $d, $hour = null, $minute = null, $second = null, $micro = null): void { $actual = []; $expected = []; if ($hour !== null) { $actual['hours'] = $d->hour; $expected['hours'] = $hour; } if ($minute !== null) { $actual['minutes'] = $d->minute; $expected['minutes'] = $minute; } if ($second !== null) { $actual['seconds'] = $d->second; $expected['seconds'] = $second; } if ($micro !== null) { $actual['micro'] = $d->micro; $expected['micro'] = $micro; } $this->assertSame($expected, $actual); } /** * @phpstan-assert CarbonInterface $d */ public function assertInstanceOfCarbon($d): void { $this->assertInstanceOf(CarbonInterface::class, $d); } public function assertCarbonInterval(CarbonInterval $ci, $years, $months = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null, $inverted = null): void { $actual = ['years' => $ci->years]; $expected = ['years' => $years]; if ($months !== null) { $actual['months'] = $ci->months; $expected['months'] = $months; } if ($days !== null) { $actual['days'] = $ci->dayz; $expected['days'] = $days; } if ($hours !== null) { $actual['hours'] = $ci->hours; $expected['hours'] = $hours; } if ($minutes !== null) { $actual['minutes'] = $ci->minutes; $expected['minutes'] = $minutes; } if ($seconds !== null) { $actual['seconds'] = $ci->seconds; $expected['seconds'] = $seconds; } if ($microseconds !== null) { $actual['microseconds'] = $ci->microseconds; $expected['microseconds'] = $microseconds; } $this->assertSame($expected, $actual); if ($inverted !== null) { $this->assertSame((bool) $inverted, (bool) $ci->invert); } } /** * @phpstan-assert CarbonInterval $d */ public function assertInstanceOfCarbonInterval($d): void { $this->assertInstanceOf(CarbonInterval::class, $d); } public function wrapWithTestNow(Closure $func, ?CarbonInterface $dt = null): void { $test = Carbon::getTestNow(); $immutableTest = CarbonImmutable::getTestNow(); $dt = $dt ?: Carbon::now(); Carbon::setTestNowAndTimezone($dt); CarbonImmutable::setTestNowAndTimezone($dt); $func(); Carbon::setTestNowAndTimezone($test); CarbonImmutable::setTestNowAndTimezone($immutableTest); } public function wrapWithNonDstDate(Closure $func): void { $this->wrapWithTestNow($func, Carbon::now()->startOfYear()); } public function wrapWithUtf8LcTimeLocale($locale, Closure $func): void { $currentLocale = setlocale(LC_TIME, '0'); $locales = ["$locale.UTF-8", "$locale.utf8"]; $mapping = [ 'fr_FR' => 'French_France', ]; $windowsLocale = $mapping[$locale] ?? null; if ($windowsLocale) { $locales[] = "$windowsLocale.UTF8"; } if (setlocale(LC_TIME, ...$locales) === false) { $this->markTestSkipped("UTF-8 test need $locale.UTF-8 (a locale with accents)."); } try { $func(); } finally { setlocale(LC_TIME, $currentLocale); } } public function withErrorAsException(Closure $func): void { $previous = set_error_handler(static function (int $code, string $message, string $file, int $line) { throw new ErrorException($message, $code, $code, $file, $line); }); $errorReporting = error_reporting(); try { error_reporting(E_ALL); $func(); } finally { error_reporting($errorReporting); restore_error_handler(); } } /** * Standardize given set of dates (or period) before assertion. * * @param array|\DatePeriod $dates * * @return array */ public function standardizeDates($dates) { $result = []; foreach ($dates as $date) { if ($date instanceof DateTime) { $date = Carbon::instance($date); } elseif (\is_string($date)) { $date = Carbon::parse($date); } $result[] = $date->format('Y-m-d H:i:s P'); } return $result; } protected function areSameLocales($a, $b): bool { static $aliases = null; if ($aliases === null) { $property = new ReflectionProperty(Translator::class, 'aliases'); $aliases = $property->getValue(Translator::get()); } $a = $aliases[$a] ?? $a; $b = $aliases[$b] ?? $b; return $a === $b; } protected function firstValidTimezoneAmong(array $timezones): CarbonTimeZone { $firstError = null; foreach ($timezones as $timezone) { try { return new CarbonTimeZone($timezone); } catch (Throwable $exception) { $firstError = $firstError ?? $exception; } } throw $firstError; } protected function assertPeriodOptions(int $options, CarbonPeriod $period): void { $this->assertSame($this->initialOptions | $options, $period->getOptions()); } protected function assertVeryClose(mixed $expected, mixed $actual, string $message = ''): void { $this->assertEqualsWithDelta( $expected, $actual, 0.000000000000001, $message, ); } protected function assertSameIntervals(CarbonInterval $expected, CarbonInterval $actual, int $microsecondApproximation = 0): void { if ( $expected->microseconds !== $actual->microseconds && $microsecondApproximation > 0 && $actual->microseconds >= $expected->microseconds - $microsecondApproximation && $actual->microseconds <= $expected->microseconds + $microsecondApproximation ) { $actual->optimize(); $expected->optimize(); $expected->microseconds = $actual->microseconds; } $expectedProperties = $this->fetchProperties($expected); $actualProperties = $this->fetchProperties($actual); if ( isset($expectedProperties['f'], $actualProperties['f']) && $expectedProperties['f'] !== $actualProperties['f'] && (abs($expectedProperties['f'] - $actualProperties['f']) * 1_000_000) < ($microsecondApproximation * 1.2) ) { $expectedProperties['f'] = $actualProperties['f']; } if (PHP_VERSION < 8.2) { unset($expectedProperties['days']); unset($actualProperties['days']); } if ( isset($expectedProperties['rawInterval'], $actualProperties['rawInterval']) && $expectedProperties['rawInterval']->f !== $actualProperties['rawInterval']->f && $microsecondApproximation > 0 && $actualProperties['rawInterval']->f >= $expectedProperties['rawInterval']->f - $microsecondApproximation && $actualProperties['rawInterval']->f <= $expectedProperties['rawInterval']->f + $microsecondApproximation ) { unset($expectedProperties['rawInterval']); unset($expectedProperties['originalInput']); unset($actualProperties['rawInterval']); unset($actualProperties['originalInput']); } if (Version::id() >= 12 && isset($expectedProperties['localTranslator'])) { /** @var Translator $expectedTranslator */ $expectedTranslator = $expectedProperties['localTranslator']; /** @var Translator $actualTranslator */ $actualTranslator = $actualProperties['localTranslator'] ?? null; $this->assertInstanceOf(Translator::class, $actualTranslator); $this->assertSame($expectedTranslator->getLocale(), $actualTranslator->getLocale()); $this->assertSameWithClosures($expectedTranslator->getMessages(), $actualTranslator->getMessages()); unset($expectedProperties['localTranslator'], $actualProperties['localTranslator']); } $this->assertEquals($expectedProperties, $actualProperties); } protected function assertSameWithClosures(array $expected, array $actual): void { $expected = $this->acceptClosuresFrom($expected, $actual); $this->assertSame($expected, $actual); } protected function setLocaleOrSkip(string ...$locales): void { if (setlocale(LC_ALL, ...$locales) === false) { $this->markTestSkipped("testSetLocaleToAuto test need $locales[0]."); } $currentLocale = setlocale(LC_TIME, '0'); if (!\in_array($currentLocale, $locales, true)) { throw new LogicException( 'setlocale(LC_ALL, "'.implode('", "', $locales).'") failed, '. 'current locale is unexpected: '.$currentLocale, ); } } protected function remove(string $path): void { if (is_file($path)) { unlink($path); return; } $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST ); foreach ($files as $fileinfo) { ($fileinfo->isDir() ? rmdir(...) : unlink(...))($fileinfo->getRealPath()); } rmdir($path); } private function acceptClosuresFrom(array $destination, array $source): array { foreach ($source as $key => $value) { if (\is_array($value) && \is_array($destination[$key])) { $destination[$key] = $this->acceptClosuresFrom($destination[$key], $value); continue; } if (($value instanceof Closure) && ($destination[$key] instanceof Closure)) { if ($destination[$key] !== $value && $this->captureVarDump($value) === $this->captureVarDump($destination[$key])) { $destination[$key] = $value; } } } return $destination; } /** @SuppressWarnings(DevelopmentCodeFragment) */ private function captureVarDump(mixed $value): string { ob_start(); var_dump($value); $content = ob_get_contents(); ob_end_clean(); return preg_replace('/(Closure.*)#\d+(\s)/', '$1$2', "$content"); } private function fetchProperties(object $object): array { $properties = (array) $object; return array_combine( array_map( static fn (string $property): string => preg_replace('/^\0\*\0/', '', $property), array_keys($properties), ), $properties, ); } } ================================================ FILE: tests/AbstractTestCaseWithOldNow.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests; use Carbon\Carbon; use Carbon\CarbonImmutable; abstract class AbstractTestCaseWithOldNow extends AbstractTestCase { protected bool $oldNow = true; protected bool $oldImmutableNow = true; protected function tearDown(): void { Carbon::resetMacros(); Carbon::serializeUsing(null); CarbonImmutable::resetMacros(); CarbonImmutable::serializeUsing(null); parent::tearDown(); } } ================================================ FILE: tests/Carbon/AddMonthsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class AddMonthsTest extends AbstractTestCase { /** * @var \Carbon\Carbon */ private $carbon; protected function setUp(): void { parent::setUp(); $date = Carbon::create(2016, 1, 31); $this->carbon = $date; } public static function dataForTestAddMonthNoOverflow(): Generator { yield [-2, 2015, 11, 30]; yield [-1, 2015, 12, 31]; yield [0, 2016, 1, 31]; yield [1, 2016, 2, 29]; yield [2, 2016, 3, 31]; } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testAddMonthNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthNoOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testAddMonthsNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthsNoOverflow($months), $y, $m, $d); } public static function dataForTestSubMonthNoOverflow(): Generator { yield [-2, 2016, 3, 31]; yield [-1, 2016, 2, 29]; yield [0, 2016, 1, 31]; yield [1, 2015, 12, 31]; yield [2, 2015, 11, 30]; } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSubMonthNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthNoOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSubMonthsNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthsNoOverflow($months), $y, $m, $d); } public static function dataForTestAddMonthWithOverflow(): Generator { yield [-2, 2015, 12, 1]; yield [-1, 2015, 12, 31]; yield [0, 2016, 1, 31]; yield [1, 2016, 3, 2]; yield [2, 2016, 3, 31]; } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testAddMonthWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthWithOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testAddMonthsWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthsWithOverflow($months), $y, $m, $d); } public static function dataForTestSubMonthWithOverflow(): Generator { yield [-2, 2016, 3, 31]; yield [-1, 2016, 3, 2]; yield [0, 2016, 1, 31]; yield [1, 2015, 12, 31]; yield [2, 2015, 12, 1]; } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testSubMonthWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthWithOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testSubMonthsWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthsWithOverflow($months), $y, $m, $d); } public function testSetOverflowIsTrue() { Carbon::useMonthsOverflow(true); $this->assertTrue(Carbon::shouldOverflowMonths()); } public function testSetOverflowIsFalse() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::shouldOverflowMonths()); } public function testSetOverflowIsResetInTests() { $this->assertTrue(Carbon::shouldOverflowMonths()); } public function testSetOverflowIsReset() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::shouldOverflowMonths()); Carbon::resetMonthsOverflow(); $this->assertTrue(Carbon::shouldOverflowMonths()); } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testUseOverflowAddMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->addMonth($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testUseOverflowAddMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->addMonths($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testUseOverflowSubMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->subMonth($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testUseOverflowSubMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->subMonths($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testSkipOverflowAddMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->addMonth($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testSkipOverflowAddMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->addMonths($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSkipOverflowSubMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->subMonth($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSkipOverflowSubMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->subMonths($months), $y, $m, $d); } } ================================================ FILE: tests/Carbon/AddTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\Unit; use DateTime; use Tests\AbstractTestCase; class AddTest extends AbstractTestCase { public function testAddMethod() { $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, 'year')->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add('year', 2)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, Unit::Year)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(Unit::Year, 2)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add('2 years')->year); $lastNegated = null; $date = Carbon::createFromDate(1975)->add( function (DateTime $date, bool $negated = false) use (&$lastNegated): DateTime { $lastNegated = $negated; return new DateTime($date->format('Y-m-d H:i:s').' + 2 years'); }, ); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(1977, $date->year); $this->assertFalse($lastNegated); /** @var CarbonInterval $interval */ $interval = include __DIR__.'/../Fixtures/dynamicInterval.php'; $originalDate = Carbon::parse('2020-06-04'); $date = $originalDate->add($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-06-08', $date->format('Y-m-d')); $this->assertSame($date, $originalDate); $date = Carbon::parse('2020-06-23')->add($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-07-16', $date->format('Y-m-d')); } public function testAddYearsPositive() { $this->assertSame(1976, Carbon::createFromDate(1975)->addYears(1)->year); } public function testAddYearsZero() { $this->assertSame(1975, Carbon::createFromDate(1975)->addYears(0)->year); } public function testAddYearsNegative() { $this->assertSame(1974, Carbon::createFromDate(1975)->addYears(-1)->year); } public function testAddYear() { $this->assertSame(1976, Carbon::createFromDate(1975)->addYear()->year); } public function testAddDaysPositive() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 31)->addDays(1)->day); } public function testAddDaysZero() { $this->assertSame(31, Carbon::createFromDate(1975, 5, 31)->addDays(0)->day); } public function testAddDaysNegative() { $this->assertSame(30, Carbon::createFromDate(1975, 5, 31)->addDays(-1)->day); } public function testAddDay() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 31)->addDay()->day); } public function testAddOverflow() { $this->assertSame( '2021-03-03', Carbon::parse('2021-01-31')->add(1, 'months', true)->format('Y-m-d'), ); $this->assertSame( '2021-03-03', Carbon::parse('2021-01-31')->add(1, 'months')->format('Y-m-d'), ); $this->assertSame( '2021-02-28', Carbon::parse('2021-01-31')->add(1, 'months', false)->format('Y-m-d'), ); } public function testAddWeekdaysPositive() { $dt = Carbon::create(2012, 1, 4, 13, 2, 1)->addWeekdays(9); $this->assertSame(17, $dt->day); // test for https://bugs.php.net/bug.php?id=54909 $this->assertSame(13, $dt->hour); $this->assertSame(2, $dt->minute); $this->assertSame(1, $dt->second); } public function testAddCustomWeekdays() { $date = Carbon::createMidnightDate(2018, 5, 25); $weekendDays = Carbon::getWeekendDays(); Carbon::setWeekendDays([ Carbon::WEDNESDAY, ]); $date->addWeekdays(2); $this->assertSame(27, $date->day); $date->subWeekdays(-3); $this->assertSame(31, $date->day); $date->addWeekdays(-3); $this->assertSame(27, $date->day); $date->subWeekdays(2); $this->assertSame(25, $date->day); $date->addWeekdays(14); $this->assertSame(10, $date->day); $date->subWeekdays(14); $this->assertSame(25, $date->day); $date->addWeekdays(12); $this->assertSame(8, $date->day); $date->subWeekdays(12); $this->assertSame(25, $date->day); Carbon::setWeekendDays($weekendDays); } public function testAddWeekdaysZero() { $this->assertSame(4, Carbon::createFromDate(2012, 1, 4)->addWeekdays(0)->day); } public function testAddWeekdaysNegative() { $this->assertSame(18, Carbon::createFromDate(2012, 1, 31)->addWeekdays(-9)->day); } public function testAddWeekday() { $this->assertSame(9, Carbon::createFromDate(2012, 1, 6)->addWeekday()->day); } public function testAddWeekdayDuringWeekend() { $this->assertSame(9, Carbon::createFromDate(2012, 1, 7)->addWeekday()->day); } public function testAddWeeksPositive() { $this->assertSame(28, Carbon::createFromDate(1975, 5, 21)->addWeeks(1)->day); } public function testAddWeeksZero() { $this->assertSame(21, Carbon::createFromDate(1975, 5, 21)->addWeeks(0)->day); } public function testAddWeeksNegative() { $this->assertSame(14, Carbon::createFromDate(1975, 5, 21)->addWeeks(-1)->day); } public function testAddWeek() { $this->assertSame(28, Carbon::createFromDate(1975, 5, 21)->addWeek()->day); } public function testAddHoursPositive() { $this->assertSame(1, Carbon::createFromTime(0)->addHours(1)->hour); } public function testAddHoursZero() { $this->assertSame(0, Carbon::createFromTime(0)->addHours(0)->hour); } public function testAddHoursNegative() { $this->assertSame(23, Carbon::createFromTime(0)->addHours(-1)->hour); } public function testAddHour() { $this->assertSame(1, Carbon::createFromTime(0)->addHour()->hour); } public function testAddMinutesPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0)->addMinutes(1)->minute); } public function testAddMinutesZero() { $this->assertSame(0, Carbon::createFromTime(0, 0)->addMinutes(0)->minute); } public function testAddMinutesNegative() { $this->assertSame(59, Carbon::createFromTime(0, 0)->addMinutes(-1)->minute); } public function testAddMinute() { $this->assertSame(1, Carbon::createFromTime(0, 0)->addMinute()->minute); } public function testAddSecondsPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addSeconds(1)->second); } public function testAddSecondsZero() { $this->assertSame(0, Carbon::createFromTime(0, 0, 0)->addSeconds(0)->second); } public function testAddSecondsNegative() { $this->assertSame(59, Carbon::createFromTime(0, 0, 0)->addSeconds(-1)->second); } public function testAddDecimalSeconds() { $this->assertSame( '1999-12-31 23:59:58.500000', Carbon::parse('2000-01-01 00:00:00')->addSeconds(-1.5)->format('Y-m-d H:i:s.u'), ); $this->assertSame( '2000-01-01 00:00:01.500000', Carbon::parse('2000-01-01 00:00:00')->addSeconds(1.5)->format('Y-m-d H:i:s.u'), ); $this->assertSame( '1999-12-31 23:59:58.500000', Carbon::parse('2000-01-01 00:00:00')->addRealSeconds(-1.5)->format('Y-m-d H:i:s.u'), ); $this->assertSame( '2000-01-01 00:00:01.500000', Carbon::parse('2000-01-01 00:00:00')->addRealSeconds(1.5)->format('Y-m-d H:i:s.u'), ); } public function testAddSecond() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addSecond()->second); } public function testAddMillisecondsPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addMilliseconds(1)->millisecond); } public function testAddMillisecondsZero() { $this->assertSame(100, Carbon::createFromTime(0, 0, 0.1)->addMilliseconds(0)->millisecond); } public function testAddMillisecondsNegative() { $this->assertSame(999, Carbon::createFromTime(0, 0, 0)->addMilliseconds(-1)->millisecond); $this->assertSame(99, Carbon::createFromTime(0, 0, 0.1)->addMilliseconds(-1)->millisecond); } public function testAddMillisecond() { $this->assertSame(101, Carbon::createFromTime(0, 0, 0.1)->addMillisecond()->millisecond); } public function testAddMicrosecondsPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addMicroseconds(1)->microsecond); } public function testAddMicrosecondsZero() { $this->assertSame(100000, Carbon::createFromTime(0, 0, 0.1)->addMicroseconds(0)->microsecond); } public function testAddMicrosecondsNegative() { $this->assertSame(999999, Carbon::createFromTime(0, 0, 0)->addMicroseconds(-1)->microsecond); $this->assertSame(99999, Carbon::createFromTime(0, 0, 0.1)->addMicroseconds(-1)->microsecond); } public function testAddMicrosecond() { $this->assertSame(100001, Carbon::createFromTime(0, 0, 0.1)->addMicrosecond()->microsecond); } /** * Test non plural methods with non default args. */ public function testAddYearPassingArg() { // addYear should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1977, $date->addYear(2)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, 'year')->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, 'years')->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(CarbonInterval::years(2))->year); } public function testAddDayPassingArg() { // addDay should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 10); $this->assertSame(12, $date->addDay(2)->day); } public function testAddHourPassingArg() { // addHour should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromTime(10); $this->assertSame(12, $date->addHour(2)->hour); } public function testAddMinutePassingArg() { // addMinute should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(2, $date->addMinute(2)->minute); } public function testAddSecondPassingArg() { // addSecond should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(2, $date->addSecond(2)->second); } public function testAddQuarter() { $this->assertSame(8, Carbon::createFromDate(1975, 5, 6)->addQuarter()->month); } public function testAddQuarterNegative() { // addQuarter should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 6); $this->assertSame(2, $date->addQuarter(-1)->month); } public function testSubQuarter() { $this->assertSame(2, Carbon::createFromDate(1975, 5, 6)->subQuarter()->month); } public function testSubQuarterNegative() { $this->assertCarbon(Carbon::createFromDate(1975, 5, 6)->subQuarters(2), 1974, 11, 6); } public function testAddCentury() { $this->assertSame(2075, Carbon::createFromDate(1975)->addCentury()->year); // addCentury should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2075, $date->addCentury(1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2175, $date->addCentury(2)->year); } public function testAddCenturyNegative() { // addCentury should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1875, $date->addCentury(-1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1775, $date->addCentury(-2)->year); } public function testAddCenturies() { $this->assertSame(2075, Carbon::createFromDate(1975)->addCenturies(1)->year); $this->assertSame(2175, Carbon::createFromDate(1975)->addCenturies(2)->year); } public function testAddCenturiesNegative() { $this->assertSame(1875, Carbon::createFromDate(1975)->addCenturies(-1)->year); $this->assertSame(1775, Carbon::createFromDate(1975)->addCenturies(-2)->year); } public function testSubCentury() { $this->assertSame(1875, Carbon::createFromDate(1975)->subCentury()->year); // subCentury should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1875, $date->subCentury(1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1775, $date->subCentury(2)->year); } public function testSubCenturyNegative() { // subCentury should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2075, $date->subCentury(-1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2175, $date->subCentury(-2)->year); } public function testSubCenturies() { $this->assertSame(1875, Carbon::createFromDate(1975)->subCenturies(1)->year); $this->assertSame(1775, Carbon::createFromDate(1975)->subCenturies(2)->year); } public function testSubCenturiesNegative() { $this->assertSame(2075, Carbon::createFromDate(1975)->subCenturies(-1)->year); $this->assertSame(2175, Carbon::createFromDate(1975)->subCenturies(-2)->year); } public function testAddYearNoOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearNoOverflow(), 2017, 2, 28); } public function testAddYearWithOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearWithOverflow(), 2017, 3, 1); } public function testAddYearNoOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearsNoOverflow(2), 2018, 2, 28); } public function testAddYearWithOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearsWithOverflow(2), 2018, 3, 1); } public function testSubYearNoOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearsNoOverflow(2), 2014, 2, 28); } public function testSubYearWithOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearsWithOverflow(2), 2014, 3, 1); } public function testSubYearNoOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearNoOverflow(), 2015, 2, 28); } public function testSubYearWithOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearWithOverflow(), 2015, 3, 1); } public function testUseYearsOverflow() { $this->assertTrue(Carbon::shouldOverflowYears()); $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYears(2), 2018, 3, 1); Carbon::useYearsOverflow(false); $this->assertFalse(Carbon::shouldOverflowYears()); $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYears(2), 2018, 2, 28); Carbon::resetYearsOverflow(); $this->assertTrue(Carbon::shouldOverflowYears()); $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYears(2), 2018, 3, 1); } } ================================================ FILE: tests/Carbon/ArraysTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Translator; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\DumpCarbon; class ArraysTest extends AbstractTestCase { public function testToArray() { $dt = Carbon::now(); $dtToArray = $dt->toArray(); $this->assertIsArray($dtToArray); $this->assertArrayHasKey('year', $dtToArray); $this->assertSame($dt->year, $dtToArray['year']); $this->assertArrayHasKey('month', $dtToArray); $this->assertSame($dt->month, $dtToArray['month']); $this->assertArrayHasKey('day', $dtToArray); $this->assertSame($dt->day, $dtToArray['day']); $this->assertArrayHasKey('dayOfWeek', $dtToArray); $this->assertSame($dt->dayOfWeek, $dtToArray['dayOfWeek']); $this->assertArrayHasKey('dayOfYear', $dtToArray); $this->assertSame($dt->dayOfYear, $dtToArray['dayOfYear']); $this->assertArrayHasKey('hour', $dtToArray); $this->assertSame($dt->hour, $dtToArray['hour']); $this->assertArrayHasKey('minute', $dtToArray); $this->assertSame($dt->minute, $dtToArray['minute']); $this->assertArrayHasKey('second', $dtToArray); $this->assertSame($dt->second, $dtToArray['second']); $this->assertArrayHasKey('micro', $dtToArray); $this->assertSame($dt->micro, $dtToArray['micro']); $this->assertArrayHasKey('timestamp', $dtToArray); $this->assertSame($dt->timestamp, $dtToArray['timestamp']); $this->assertArrayHasKey('timezone', $dtToArray); $this->assertEquals($dt->timezone, $dtToArray['timezone']); $this->assertArrayHasKey('formatted', $dtToArray); $this->assertSame($dt->format(Carbon::DEFAULT_TO_STRING_FORMAT), $dtToArray['formatted']); } public function testDebugInfo() { $dt = Carbon::parse('2019-04-09 11:10:10.667952'); $debug = $dt->__debugInfo(); // Ignored as not in PHP 8 if (isset($debug['timezone_type'])) { unset($debug['timezone_type']); } $this->assertSame([ 'date' => '2019-04-09 11:10:10.667952', 'timezone' => 'America/Toronto', ], $debug); $dt = Carbon::parse('2019-04-09 11:10:10.667952')->locale('fr_FR'); $debug = $dt->__debugInfo(); // Ignored as not in PHP 8 if (isset($debug['timezone_type'])) { unset($debug['timezone_type']); } $this->assertSame([ 'localTranslator' => Translator::get('fr_FR'), 'date' => '2019-04-09 11:10:10.667952', 'timezone' => 'America/Toronto', ], $debug); } public function testDebuggingWithFormatException() { $date = new DumpCarbon(); $date->breakFormat(); $this->assertIsArray($date->__debugInfo()); } public function testDebuggingUninitializedInstances() { $date = new DumpCarbon(); $this->assertStringContainsString(DumpCarbon::class, $date->getDump()); } } ================================================ FILE: tests/Carbon/ComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTime; use Tests\AbstractTestCase; class ComparisonTest extends AbstractTestCase { public function testEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->eq(Carbon::createFromDate(2000, 1, 1))); } public function testEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->eq(Carbon::createFromDate(2000, 1, 2))); } public function testEqualWithTimezoneTrue() { $this->assertTrue(Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto')->eq(Carbon::create(2000, 1, 1, 9, 0, 0, 'America/Vancouver'))); } public function testEqualWithTimezoneFalse() { $timezones = ['Europe/London', 'America/Toronto', 'America/Vancouver', 'Asia/Tokyo']; foreach ($timezones as $a) { foreach ($timezones as $b) { $from = Carbon::createFromDate(2000, 1, 1, $a); $to = Carbon::createFromDate(2000, 1, 1, $b); $diff = $from->floatDiffInHours($to, false) + Carbon::now($a)->dst - Carbon::now($b)->dst; $this->assertTrue(\in_array($diff, $a === $b ? [0.0] : [0.0, 24.0, -24.0], true)); } } Carbon::setTestNow(); foreach ($timezones as $a) { foreach ($timezones as $b) { $from = Carbon::createFromDate(2000, 1, 1, $a); $to = Carbon::createFromDate(2000, 1, 1, $b); $diff = $from->floatDiffInHours($to, false) + Carbon::now($a)->dst - Carbon::now($b)->dst; $diff = round($diff * 1800) / 1800; // 2-seconds precision $this->assertTrue(\in_array($diff, $a === $b ? [0.0] : [0.0, 24.0, -24.0], true)); } } } public function testNotEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->ne(Carbon::createFromDate(2000, 1, 2))); } public function testNotEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->ne(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->gt(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->gt(Carbon::createFromDate(2000, 1, 2))); } public function testGreaterThanWithTimezoneTrue() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 8, 59, 59, 'America/Vancouver'); $this->assertTrue($dt1->gt($dt2)); } public function testGreaterThanWithString() { Carbon::setToStringFormat('d.m.Y \a\t h:i a'); $this->assertTrue(Carbon::parse('2022-05-03')->gt('2021-05-03')); $this->assertFalse(Carbon::parse('2021-05-03')->gt('2022-05-03')); Carbon::setToStringFormat(null); } public function testGreaterThanWithTimezoneFalse() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 9, 0, 1, 'America/Vancouver'); $this->assertFalse($dt1->gt($dt2)); } public function testGreaterThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->gte(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->gte(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->gte(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lt(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lt(Carbon::createFromDate(1999, 12, 31))); } public function testLessThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lte(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lte(Carbon::createFromDate(2000, 1, 1))); } public function testLessThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lte(Carbon::createFromDate(1999, 12, 31))); } public function testBetweenEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 15), true)); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->isBetween(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 15), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(new DateTime('2000-01-01'), new DateTime('2000-01-31'), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(new DateTime('2000-01-01'), new DateTime('2000-01-31'), true)); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->between(new DateTime('2000-01-15'), new DateTime('2000-01-31'), true)); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->isBetween(new DateTime('2000-01-15'), new DateTime('2000-01-31'), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between('2000-01-01', '2000-01-31', true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween('2000-01-01', '2000-01-31', true)); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->between('2000-01-01', '2000-01-15', true)); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->isBetween('2000-01-01', '2000-01-15', true)); $this->assertTrue(Carbon::create(2000, 1, 15, 17, 20, 54)->between('2000-01-15 17:20:50', '2000-01-15 17:20:54', true)); $this->assertTrue(Carbon::create(2000, 1, 15, 17, 20, 54)->isBetween('2000-01-15 17:20:50', '2000-01-15 17:20:54', true)); $this->assertTrue(Carbon::create(2000, 1, 15, 17, 20, 54)->between('2000-01-15 17:20:54', '2000-01-15 17:20:56', true)); $this->assertTrue(Carbon::create(2000, 1, 15, 17, 20, 54)->isBetween('2000-01-15 17:20:54', '2000-01-15 17:20:56', true)); } public function testBetweenNotEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); $this->assertFalse(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 15), false)); $this->assertFalse(Carbon::createFromDate(2000, 1, 15)->isBetween(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 15), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(new DateTime('2000-01-01'), new DateTime('2000-01-31'), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(new DateTime('2000-01-01'), new DateTime('2000-01-31'), false)); $this->assertFalse(Carbon::createFromDate(2000, 1, 15)->between(new DateTime('2000-01-01'), new DateTime('2000-01-15'), false)); $this->assertFalse(Carbon::createFromDate(2000, 1, 15)->isBetween(new DateTime('2000-01-01'), new DateTime('2000-01-15'), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between('2000-01-01', '2000-01-31', false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween('2000-01-01', '2000-01-31', false)); $this->assertFalse(Carbon::createMidnightDate(2000, 1, 15)->between('2000-01-15', '2000-01-31', false)); $this->assertFalse(Carbon::createMidnightDate(2000, 1, 15)->isBetween('2000-01-15', '2000-01-31', false)); $this->assertTrue(Carbon::create(2000, 1, 15, 17, 20, 54)->between('2000-01-15 17:20:50', '2000-01-15 17:20:55', false)); $this->assertTrue(Carbon::create(2000, 1, 15, 17, 20, 54)->isBetween('2000-01-15 17:20:50', '2000-01-15 17:20:55', false)); $this->assertFalse(Carbon::create(2000, 1, 15, 17, 20, 54)->between('2000-01-15 17:20:50', '2000-01-15 17:20:54', false)); $this->assertFalse(Carbon::create(2000, 1, 15, 17, 20, 54)->isBetween('2000-01-15 17:20:50', '2000-01-15 17:20:54', false)); $this->assertFalse(Carbon::create(2000, 1, 15, 17, 20, 54)->between('2000-01-15 17:20:54', '2000-01-15 17:20:56', false)); $this->assertFalse(Carbon::create(2000, 1, 15, 17, 20, 54)->isBetween('2000-01-15 17:20:54', '2000-01-15 17:20:56', false)); } public function testBetweenExcludedTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->betweenExcluded(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31))); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->betweenExcluded(new DateTime('2000-01-01'), new DateTime('2000-01-31'))); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->betweenExcluded('2000-01-01', '2000-01-31')); } public function testBetweenIncludedTrue() { $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31))); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded(new DateTime('2000-01-01'), new DateTime('2000-01-31'))); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded('2000-01-15', '2000-01-31')); $this->assertTrue(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded('2000-01-01', '2000-01-15')); } public function testBetweenIncludedFalse() { $this->assertFalse(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded(Carbon::createFromDate(2000, 1, 16), Carbon::createFromDate(2000, 1, 31))); $this->assertFalse(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded(new DateTime('2000-01-16'), new DateTime('2000-01-31'))); $this->assertFalse(Carbon::createMidnightDate(2000, 1, 15)->betweenIncluded('2000-01-16', '2000-01-31')); } public function testBetweenEqualFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); } public function testBetweenNotEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); } public function testBetweenEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testBetweenEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testMinIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->min()); } public function testMinWithNow() { $dt = Carbon::create(2012, 1, 1, 0, 0, 0)->min(); $this->assertCarbon($dt, 2012, 1, 1, 0, 0, 0); } public function testMinWithInstance() { $dt1 = Carbon::create(2013, 12, 31, 23, 59, 59); $dt2 = Carbon::create(2012, 1, 1, 0, 0, 0)->min($dt1); $this->assertCarbon($dt2, 2012, 1, 1, 0, 0, 0); } public function testMaxIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->max()); } public function testMaxWithNow() { $dt = Carbon::create(2099, 12, 31, 23, 59, 59)->max(); $this->assertCarbon($dt, 2099, 12, 31, 23, 59, 59); } public function testMaxWithInstance() { $dt1 = Carbon::create(2012, 1, 1, 0, 0, 0); $dt2 = Carbon::create(2099, 12, 31, 23, 59, 59)->max($dt1); $this->assertCarbon($dt2, 2099, 12, 31, 23, 59, 59); } public function testIsBirthday() { $dt = Carbon::now(); // Birthday test can't work on February 29th if ($dt->format('m-d') === '02-29') { Carbon::setTestNowAndTimezone($dt->subDay()); $dt = Carbon::now(); } $aBirthday = $dt->subYear(); $this->assertTrue($aBirthday->isBirthday()); $notABirthday = $dt->subDay(); $this->assertFalse($notABirthday->isBirthday()); $alsoNotABirthday = $dt->addDays(2); $this->assertFalse($alsoNotABirthday->isBirthday()); $dt1 = Carbon::createFromDate(1987, 4, 23); $dt2 = Carbon::createFromDate(2014, 9, 26); $dt3 = Carbon::createFromDate(2014, 4, 23); $this->assertFalse($dt2->isBirthday($dt1)); $this->assertTrue($dt3->isBirthday($dt1)); } public function testClosest() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 11, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $closest = $instance->closest($dt1, $dt2); $this->assertSame($dt1, $closest); } public function testClosestWithEquals() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 12, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $closest = $instance->closest($dt1, $dt2); $this->assertSame($dt1, $closest); } public function testClosestWithMicroseconds() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('2018-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('2018-10-11 20:59:06.300000'); $this->assertSame('06.600000', $baseDate->closest($closestDate, $farthestDate)->format('s.u')); } public function testClosestWithFarDates() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('-4025-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('9995-10-11 20:59:06.300000'); $this->assertSame('06.600000', $baseDate->closest($closestDate, $farthestDate)->format('s.u')); } public function testFarthest() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 11, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $farthest = $instance->farthest($dt1, $dt2); $this->assertSame($dt2, $farthest); } public function testFarthestWithEquals() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 12, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $farthest = $instance->farthest($dt1, $dt2); $this->assertSame($dt2, $farthest); } public function testFarthestWithMicroseconds() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('2018-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('2018-10-11 20:59:06.300000'); $this->assertSame('06.300000', $baseDate->farthest($closestDate, $farthestDate)->format('s.u')); } public function testFarthestWithFarDates() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('-4025-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('9995-10-11 20:59:06.300000'); $this->assertSame('06.300000', $baseDate->farthest($closestDate, $farthestDate)->format('s.u')); } } ================================================ FILE: tests/Carbon/ConstructTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Exceptions\InvalidTimeZoneException; use DateTime; use DateTimeInterface; use DateTimeZone; use SubCarbon; use Tests\AbstractTestCase; class ConstructTest extends AbstractTestCase { public function testCreatesAnInstanceDefaultToNow() { $c = new Carbon(); $now = Carbon::now(); $this->assertInstanceOfCarbon($c); $this->assertInstanceOf(DateTime::class, $c); $this->assertInstanceOf(DateTimeInterface::class, $c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } public function testCreatesAnInstanceFromADateTime() { $c = new Carbon(Carbon::parse('2009-09-09 09:09:09')); $this->assertSame('2009-09-09 09:09:09 America/Toronto', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09')); $this->assertSame('2009-09-09 09:09:09 America/Toronto', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09', new DateTimeZone('Europe/Paris'))); $this->assertSame('2009-09-09 09:09:09 Europe/Paris', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09'), 'Europe/Paris'); $this->assertSame('2009-09-09 15:09:09 Europe/Paris', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09', new DateTimeZone('Asia/Tokyo')), 'Europe/Paris'); $this->assertSame('2009-09-09 02:09:09 Europe/Paris', $c->format('Y-m-d H:i:s e')); } public function testCreatesAnInstanceFromADateTimeException() { $this->expectException(InvalidTimeZoneException::class); Carbon::useStrictMode(false); new Carbon( new DateTime('2009-09-09 09:09:09', new DateTimeZone('Asia/Tokyo')), '¤¤ Incorrect Timezone ¤¤', ); } public function testParseWithEmptyStringCreatesAnInstanceDefaultToNow() { $c = Carbon::parse(''); $now = Carbon::now(); $this->assertInstanceOfCarbon($c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); $c = new Carbon(''); $now = Carbon::now(); $this->assertInstanceOfCarbon($c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } public function testParseZeroCreatesAnInstanceDefaultToUnixAreaStartUtc() { $c = Carbon::parse(0); $now = Carbon::createFromTimestamp(0, '+00:00'); $this->assertInstanceOfCarbon($c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); $c = new Carbon(0); $now = Carbon::createFromTimestamp(0, '+00:00'); $this->assertInstanceOfCarbon($c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } public function testWithFancyString() { Carbon::setTestNowAndTimezone(Carbon::today()); $c = new Carbon('first day of January 2008'); $this->assertCarbon($c, 2008, 1, 1, 0, 0, 0); } public function testParseWithFancyString() { Carbon::setTestNowAndTimezone(Carbon::today()); $c = Carbon::parse('first day of January 2008'); $this->assertCarbon($c, 2008, 1, 1, 0, 0, 0); } public function testParseWithYYYMMDD() { $c = Carbon::parse('20201128'); $this->assertCarbon($c, 2020, 11, 28, 0, 0, 0); } public function testParseWithYYYMMDDHHMMSS() { $c = Carbon::parse('20201128192533'); $this->assertCarbon($c, 2020, 11, 28, 19, 25, 33); } public function testDefaultTimezone() { $c = new Carbon('now'); $this->assertSame('America/Toronto', $c->tzName); } public function testParseWithDefaultTimezone() { $c = Carbon::parse('now'); $this->assertSame('America/Toronto', $c->tzName); } public function testSettingTimezone() { $timezone = 'Europe/London'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = new Carbon('now', $dtz); $this->assertSame($timezone, $c->tzName); $this->assertSame($dayLightSavingTimeOffset, $c->offsetHours); } public function testParseSettingTimezone() { $timezone = 'Europe/London'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = Carbon::parse('now', $dtz); $this->assertSame($timezone, $c->tzName); $this->assertSame($dayLightSavingTimeOffset, $c->offsetHours); } public function testSettingTimezoneWithString() { $timezone = 'Asia/Tokyo'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = new Carbon('now', $timezone); $this->assertSame($timezone, $c->tzName); $this->assertSame(9 + $dayLightSavingTimeOffset, $c->offsetHours); } public function testParseSettingTimezoneWithString() { $timezone = 'Asia/Tokyo'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = Carbon::parse('now', $timezone); $this->assertSame($timezone, $c->tzName); $this->assertSame(9 + $dayLightSavingTimeOffset, $c->offsetHours); } public function testSettingTimezoneWithInteger() { Carbon::useStrictMode(false); $timezone = 5; $c = new Carbon('2019-02-12 23:00:00', $timezone); $this->assertSame('+05:00', $c->tzName); } public function testMockingWithMicroseconds() { $c = new Carbon(Carbon::now()->toDateTimeString().'.123456'); Carbon::setTestNow($c); $mockedC = Carbon::now(); $this->assertTrue($c->eq($mockedC)); Carbon::setTestNow(); } public function testTimestamp() { $date = new Carbon(1367186296); $this->assertSame('Sunday 28 April 2013 21:58:16.000000', $date->format('l j F Y H:i:s.u')); $date = new Carbon(123); $this->assertSame('Thursday 1 January 1970 00:02:03.000000', $date->format('l j F Y H:i:s.u')); } public function testFloatTimestamp() { $date = new Carbon(1367186296.654321); $this->assertSame('Sunday 28 April 2013 21:58:16.654321', $date->format('l j F Y H:i:s.u')); $date = new Carbon(123.5); $this->assertSame('Thursday 1 January 1970 00:02:03.500000', $date->format('l j F Y H:i:s.u')); } public function testDifferentType() { require_once __DIR__.'/../Fixtures/SubCarbon.php'; $subCarbon = new SubCarbon('2024-01-24 00:00'); $carbon = new Carbon('2024-01-24 00:00'); $this->assertTrue($subCarbon->equalTo($carbon)); $this->assertTrue($carbon->equalTo($subCarbon)); } } ================================================ FILE: tests/Carbon/CopyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class CopyTest extends AbstractTestCase { public function testCopy() { $dating = Carbon::now(); $dating2 = $dating->copy(); $this->assertNotSame($dating, $dating2); } public function testClone() { $dating = Carbon::now(); $dating2 = $dating->clone(); $this->assertNotSame($dating, $dating2); } public function testCopyEnsureTzIsCopied() { $dating = Carbon::createFromDate(2000, 1, 1, 'Europe/London'); $dating2 = $dating->copy(); $this->assertSame($dating->tzName, $dating2->tzName); $this->assertSame($dating->offset, $dating2->offset); } public function testCopyEnsureMicrosAreCopied() { $micro = 254687; $dating = Carbon::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); $dating2 = $dating->copy(); $this->assertSame($micro, $dating2->micro); } } ================================================ FILE: tests/Carbon/CreateFromDateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromDateTest extends AbstractTestCase { public function testCreateFromDateWithDefaults() { $d = Carbon::createFromDate(); $this->assertSame($d->timestamp, Carbon::create(null, null, null, null, null, null)->timestamp); } public function testCreateFromDate() { $d = Carbon::createFromDate(1975, 5, 21); $this->assertCarbon($d, 1975, 5, 21); } public function testCreateFromDateWithYear() { $d = Carbon::createFromDate(1975); $this->assertSame(1975, $d->year); } public function testCreateFromDateWithMonth() { $d = Carbon::createFromDate(null, 5); $this->assertSame(5, $d->month); } public function testCreateFromDateWithDay() { $d = Carbon::createFromDate(null, null, 21); $this->assertSame(21, $d->day); } public function testCreateFromDateWithTimezone() { $d = Carbon::createFromDate(1975, 5, 21, 'Europe/London'); $this->assertCarbon($d, 1975, 5, 21); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromDateWithDateTimeZone() { $d = Carbon::createFromDate(1975, 5, 21, new DateTimeZone('Europe/London')); $this->assertCarbon($d, 1975, 5, 21); $this->assertSame('Europe/London', $d->tzName); } } ================================================ FILE: tests/Carbon/CreateFromFormatTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTime; use DateTimeZone; use PHPUnit\Framework\Attributes\RequiresPhp; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\MyCarbon; class CreateFromFormatTest extends AbstractTestCase { /** * @var array */ protected $lastErrors; /** * @var array */ protected $noErrors; protected function setUp(): void { parent::setUp(); $this->lastErrors = [ 'warning_count' => 1, 'warnings' => ['10' => 'The parsed date was invalid'], 'error_count' => 0, 'errors' => [], ]; } public function testCreateFromFormatReturnsCarbon() { $d = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertInstanceOfCarbon($d); } public function testCreateFromFormatWithNamedArguments() { $d = Carbon::createFromFormat( format: 'Y-m-d H:i:s', time: '1975-05-21 22:32:11', timezone: 'Asia/tokyo', ); $this->assertSame('1975-05-21 22:32:11 Asia/tokyo', $d->format('Y-m-d H:i:s e')); } public function testCreateFromFalseTimezone() { $d = Carbon::createFromFormat('Y-m-d H:i:s.u', '1975-05-21 22:32:11.123456', false); $this->assertInstanceOfCarbon($d); $this->assertSame('1975-05-21 22:32:11.123456 America/Toronto', $d->format('Y-m-d H:i:s.u e')); } /** * Work-around for https://bugs.php.net/bug.php?id=80141 */ public function testCFormat() { $d = Carbon::createFromFormat('c', Carbon::parse('2020-02-02')->format('c')); $this->assertCarbon($d, 2020, 2, 2, 0, 0, 0, 0); $d = Carbon::createFromFormat('c', '2020-02-02T23:45:12+09:00'); $this->assertSame('+09:00', $d->tzName); $this->assertCarbon($d, 2020, 2, 2, 23, 45, 12, 0); $d = Carbon::createFromFormat('l c', 'Sunday 2020-02-02T23:45:12+09:00'); $this->assertSame('+09:00', $d->tzName); $this->assertCarbon($d, 2020, 2, 2, 23, 45, 12, 0); $d = Carbon::createFromFormat('l \\\\c', 'Sunday \\2020-02-02T23:45:12+09:00'); $this->assertSame('+09:00', $d->tzName); $this->assertCarbon($d, 2020, 2, 2, 23, 45, 12, 0); $d = Carbon::createFromFormat('Y-m-d\\cH:i:s', '2020-02-02c23:45:12'); $this->assertCarbon($d, 2020, 2, 2, 23, 45, 12, 0); } public function testCreateFromFormatWithMillisecondsAlone() { $d = Carbon::createFromFormat('Y-m-d H:i:s.v', '1975-05-21 22:32:11.321'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11, 321000); $this->assertInstanceOfCarbon($d); } /** * Due to https://bugs.php.net/bug.php?id=75577, proper "v" format support can only work from PHP 7.3.0. */ public function testCreateFromFormatWithMillisecondsMerged() { $d = Carbon::createFromFormat('Y-m-d H:s.vi', '1975-05-21 22:11.32132'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11, 321000); $this->assertInstanceOfCarbon($d); } public function testCreateFromFormatWithTimezoneString() { $d = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11', 'Europe/London'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromFormatWithTimezone() { $d = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11', new DateTimeZone('Europe/London')); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromFormatWithMillis() { $d = Carbon::createFromFormat('Y-m-d H:i:s.u', '1975-05-21 22:32:11.254687'); $this->assertSame(254687, $d->micro); } public function testCreateFromFormatWithTestNow() { Carbon::setTestNow(); $nativeDate = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'); Carbon::setTestNow(Carbon::now()); $mockedDate = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'); $this->assertSame($mockedDate->micro === 0, $nativeDate->micro === 0); } #[RequiresPhp('>=8.2')] public function testCreateLastErrorsCanBeAccessedByExtendingClass() { $this->assertFalse(MyCarbon::getLastErrors()); } public function testCreateFromFormatHandlesLastErrors() { $carbon = Carbon::createFromFormat('d/m/Y', '41/02/1900'); $datetime = DateTime::createFromFormat('d/m/Y', '41/02/1900'); $this->assertSame($this->lastErrors, $carbon->getLastErrors()); $this->assertSame($carbon->getLastErrors(), $datetime->getLastErrors()); } #[RequiresPhp('>=8.2')] public function testCreateFromFormatResetLastErrors() { $carbon = Carbon::createFromFormat('d/m/Y', '41/02/1900'); $this->assertSame($this->lastErrors, $carbon->getLastErrors()); $carbon = Carbon::createFromFormat('d/m/Y', '11/03/2016'); $this->assertFalse($carbon->getLastErrors()); } } ================================================ FILE: tests/Carbon/CreateFromTimeStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromTimeStringTest extends AbstractTestCase { protected function setUp(): void { parent::setUp(); Carbon::setTestNow(); } public function testCreateFromTimeString() { $d = Carbon::createFromTimeString('22:45'); $this->assertSame(22, $d->hour); $this->assertSame(45, $d->minute); $this->assertSame(0, $d->second); $this->assertSame(0, $d->micro); } public function testCreateFromTimeStringWithSecond() { $d = Carbon::createFromTimeString('22:45:12'); $this->assertSame(22, $d->hour); $this->assertSame(45, $d->minute); $this->assertSame(12, $d->second); $this->assertSame(0, $d->micro); } public function testCreateFromTimeStringWithMicroSecond() { $d = Carbon::createFromTimeString('22:45:00.625341'); $this->assertSame(22, $d->hour); $this->assertSame(45, $d->minute); $this->assertSame(0, $d->second); $this->assertSame(625341, $d->micro); } public function testCreateFromTimeStringWithDateTimeZone() { $d = Carbon::createFromTimeString('12:20:30', new DateTimeZone('Europe/London')); $this->assertCarbonTime($d, 12, 20, 30, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromTimeStringWithTimeZoneString() { $d = Carbon::createFromTimeString('12:20:30', 'Europe/London'); $this->assertCarbonTime($d, 12, 20, 30, 0); $this->assertSame('Europe/London', $d->tzName); } } ================================================ FILE: tests/Carbon/CreateFromTimeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use DateTimeImmutable; use DateTimeZone; use InvalidArgumentException; use Tests\AbstractTestCase; class CreateFromTimeTest extends AbstractTestCase { public function testCreateWithTestNow() { Carbon::setTestNow($testNow = Carbon::create(2011, 1, 1, 12, 13, 14)); $dt = Carbon::create(null, null, null, null, null, null); $this->assertCarbon($dt, 2011, 1, 1, 12, 13, 14); $this->assertTrue($testNow->eq($dt)); } public function testCreateFromDateWithDefaults() { $d = Carbon::createFromTime(); $this->assertSame($d->timestamp, Carbon::create(null, null, null, 0, 0, 0)->timestamp); } public function testCreateFromDateWithNull() { $d = Carbon::createFromTime(null, null, null); $this->assertSame($d->timestamp, Carbon::create(null, null, null, null, null, null)->timestamp); } public function testCreateFromTime() { $d = Carbon::createFromTime(23, 5, 21); $this->assertCarbon($d, Carbon::now()->year, Carbon::now()->month, Carbon::now()->day, 23, 5, 21); } public function testCreateFromTimeWithTestNow() { Carbon::setTestNow(); $testTime = Carbon::createFromTime(12, 0, 0, 'GMT-25'); $today = Carbon::today('GMT-25')->modify('12:00'); $this->assertSame('12:00 -25:00', $testTime->format('H:i e')); $this->assertSame($testTime->toIso8601String(), $today->toIso8601String()); $knownDate = Carbon::instance(new DateTimeImmutable('now UTC')); Carbon::setTestNow($knownDate); $testTime = Carbon::createFromTime(12, 0, 0, 'GMT-25'); $today = Carbon::today('GMT-25')->modify('12:00'); $this->assertSame('12:00 -25:00', $testTime->format('H:i e')); $this->assertSame($testTime->toIso8601String(), $today->toIso8601String()); } public function testCreateFromTimeGreaterThan99() { $this->expectExceptionObject(new InvalidArgumentException( 'second must be between 0 and 99, 100 given', )); Carbon::createFromTime(23, 5, 100); } public function testCreateFromTimeWithHour() { $d = Carbon::createFromTime(22); $this->assertSame(22, $d->hour); $this->assertSame(0, $d->minute); $this->assertSame(0, $d->second); } public function testCreateFromTimeWithMinute() { $d = Carbon::createFromTime(null, 5); $this->assertSame(5, $d->minute); } public function testCreateFromTimeWithSecond() { $d = Carbon::createFromTime(null, null, 21); $this->assertSame(21, $d->second); } public function testCreateFromTimeWithDateTimeZone() { $d = Carbon::createFromTime(12, 0, 0, new DateTimeZone('Europe/London')); $this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromTimeWithTimeZoneString() { $d = Carbon::createFromTime(12, 0, 0, 'Europe/London'); $this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromTimeWithTimeZoneOnNow() { // disable test for now // because we need Carbon::now() in Carbon::create() to work with given TZ $test = Carbon::getTestNow(); Carbon::setTestNow(); $tz = 'Etc/GMT+12'; try { $now = Carbon::now($tz); } catch (InvalidFormatException $exception) { if ($exception->getMessage() !== 'Unknown or bad timezone (Etc/GMT+12)') { throw $exception; } $tz = 'GMT+12'; $now = Carbon::now($tz); } $dt = Carbon::createFromTime($now->hour, $now->minute, $now->second, $tz); // re-enable test Carbon::setTestNow($test); // tested without microseconds // because they appear within calls to Carbon $this->assertSame($now->format('c'), $dt->format('c')); } } ================================================ FILE: tests/Carbon/CreateFromTimestampTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromTimestampTest extends AbstractTestCase { public function testCreateReturnsDatingInstance() { $d = Carbon::createFromTimestamp(Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5); } public function testCreateFromTimestampMs() { $baseTimestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000; $timestamp = $baseTimestamp + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); $timestamp = $baseTimestamp + 321.8; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321800); $timestamp = $baseTimestamp + 321.84; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321840); $timestamp = $baseTimestamp + 321.847; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8474; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8479; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321848); } public function testCreateFromTimestampMsUTC() { // Toronto is GMT-04:00 in May $baseTimestamp = Carbon::create(1975, 5, 21, 22, 32, 5)->timestamp * 1000; $timestamp = $baseTimestamp + 321; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321000); $timestamp = $baseTimestamp + 321.8; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321800); $timestamp = $baseTimestamp + 321.84; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321840); $timestamp = $baseTimestamp + 321.847; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8474; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8479; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321848); $d = Carbon::createFromTimestampMsUTC(1); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0, 1000); $d = Carbon::createFromTimestampMsUTC(60); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0, 60000); $d = Carbon::createFromTimestampMsUTC(1000); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 1, 0); $d = Carbon::createFromTimestampMsUTC(-0.04); $this->assertCarbon($d, 1969, 12, 31, 23, 59, 59, 999960); } public function testComaDecimalSeparatorLocale() { $date = new Carbon('2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $date = Carbon::createFromFormat('Y-m-d\TH:i:s.uT', '2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $timestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000 + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); $locale = setlocale(LC_ALL, '0'); if (setlocale(LC_ALL, 'fr_FR.UTF-8', 'fr_FR.utf8', 'French_France.UTF8') === false) { $this->markTestSkipped('testComaDecimalSeparatorLocale test need fr_FR.UTF-8.'); } $timestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000 + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); $date = new Carbon('2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $date = Carbon::createFromFormat('Y-m-d\TH:i:s.uT', '2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $timestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000 + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); setlocale(LC_ALL, $locale); } public function testCreateFromTimestampWithTimezone() { $carbon = Carbon::createFromTimestamp((int) '468370800', '+0100'); $this->assertSame(468370800, $carbon->getTimestamp()); $this->assertSame('+01:00', $carbon->tzName); } public function testCreateFromTimestampUsesDefaultTimezone() { $d = Carbon::createFromTimestamp(0, 'America/Toronto'); // We know Toronto is -5 since no DST in Jan $this->assertSame(1969, $d->year); $this->assertSame(-5 * 3600, $d->offset); } public function testCreateFromTimestampWithDateTimeZone() { $d = Carbon::createFromTimestamp(0, new DateTimeZone('UTC')); $this->assertSame('UTC', $d->tzName); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); } public function testCreateFromTimestampWithString() { $d = Carbon::createFromTimestamp(0, 'UTC'); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); $this->assertSame(0, $d->offset); $this->assertSame('UTC', $d->tzName); } public function testCreateFromTimestampGMTDoesNotUseDefaultTimezone() { $d = Carbon::createFromTimestampUTC(0); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); $this->assertSame(0, $d->offset); } /** * Ensures DST php bug does not affect createFromTimestamp in DST change. * * @see https://github.com/briannesbitt/Carbon/issues/1951 */ public function testCreateFromTimestampInDstChange() { $this->assertSame( '2019-11-03T01:00:00-04:00', Carbon::createFromTimestamp(1572757200, 'America/New_York')->toIso8601String(), ); $this->assertSame( '2019-11-03T01:00:00-05:00', Carbon::createFromTimestamp(1572757200 + 3600, 'America/New_York')->toIso8601String(), ); $this->assertSame( '2019-11-03T01:00:00-04:00', Carbon::createFromTimestampMs(1572757200000, 'America/New_York')->toIso8601String(), ); $this->assertSame( '2019-11-03T01:00:00-05:00', Carbon::createFromTimestampMs(1572757200000 + 3600000, 'America/New_York')->toIso8601String(), ); } public function testCreateFromMicrotimeFloat() { $microtime = 1600887164.88952298; $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:44.889523', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889523', $d->format('U.u')); } public function testCreateFromMicrotimeStrings() { $microtime = '0.88951247 1600887164'; $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:44.889512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889512', $d->format('U.u')); $microtime = '0.88951247/1600887164/12.56'; $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:57.449512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887177.449512', $d->format('U.u')); $d = Carbon::createFromTimestamp('-10.6', 'America/Toronto'); $this->assertSame('1969-12-31 18:59:49.400000 -05:00', $d->format('Y-m-d H:i:s.u P')); $d = new Carbon('@-10.6'); $this->assertSame('1969-12-31 23:59:49.400000 +00:00', $d->format('Y-m-d H:i:s.u P')); } public function testCreateFromMicrotimeUTCFloat() { $microtime = 1600887164.88952298; $d = Carbon::createFromTimestampUTC($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.889523', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889523', $d->format('U.u')); } public function testCreateFromMicrotimeUTCStrings() { $microtime = '0.88951247 1600887164'; $d = Carbon::createFromTimestampUTC($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.889512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889512', $d->format('U.u')); $microtime = '0.88951247/1600887164/12.56'; $d = Carbon::createFromTimestampUTC($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:57.449512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887177.449512', $d->format('U.u')); } public function testNegativeIntegerTimestamp() { $this->assertSame( '1969-12-31 18:59:59.000000 -05:00', Carbon::createFromTimestamp(-1, 'America/Toronto')->format('Y-m-d H:i:s.u P'), ); } } ================================================ FILE: tests/Carbon/CreateSafeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Exceptions\InvalidDateException; use Tests\AbstractTestCase; class CreateSafeTest extends AbstractTestCase { public function testInvalidDateExceptionProperties() { $e = new InvalidDateException('day', 'foo'); $this->assertSame('day', $e->getField()); $this->assertSame('foo', $e->getValue()); } public function testCreateSafeThrowsExceptionForSecondLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('second', -1)); Carbon::createSafe(null, null, null, null, null, -1); } public function testCreateSafeThrowsExceptionForSecondLowerThanZeroInStrictMode() { Carbon::useStrictMode(false); $this->assertNull(Carbon::createSafe(null, null, null, null, null, -1)); } public function testCreateSafeThrowsExceptionForSecondGreaterThan59() { $this->expectExceptionObject(new InvalidDateException('second', 60)); Carbon::createSafe(null, null, null, null, null, 60); } public function testCreateSafeThrowsExceptionForMinuteLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('minute', -1)); Carbon::createSafe(null, null, null, null, -1); } public function testCreateSafeThrowsExceptionForMinuteGreaterThan59() { $this->expectExceptionObject(new InvalidDateException('minute', 60)); Carbon::createSafe(null, null, null, null, 60, 25); } public function testCreateSafeThrowsExceptionForHourLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('hour', -6)); Carbon::createSafe(null, null, null, -6); } public function testCreateSafeThrowsExceptionForHourGreaterThan24() { $this->expectExceptionObject(new InvalidDateException('hour', 25)); Carbon::createSafe(null, null, null, 25, 16, 15); } public function testCreateSafeThrowsExceptionForDayLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('day', -5)); Carbon::createSafe(null, null, -5); } public function testCreateSafeThrowsExceptionForDayGreaterThan31() { $this->expectExceptionObject(new InvalidDateException('day', 32)); Carbon::createSafe(null, null, 32, 17, 16, 15); } public function testCreateSafeThrowsExceptionForMonthLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('month', -4)); Carbon::createSafe(null, -4); } public function testCreateSafeThrowsExceptionForMonthGreaterThan12() { $this->expectExceptionObject(new InvalidDateException('month', 13)); Carbon::createSafe(null, 13, 5, 17, 16, 15); } public function testCreateSafeThrowsExceptionForYearEqualToZero() { $this->expectExceptionObject(new InvalidDateException('year', 0)); Carbon::createSafe(0); } public function testCreateSafeThrowsExceptionForYearLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('year', -5)); Carbon::createSafe(-5); } public function testCreateSafeThrowsExceptionForYearGreaterThan12() { $this->expectExceptionObject(new InvalidDateException('year', 10000)); Carbon::createSafe(10000, 12, 5, 17, 16, 15); } public function testCreateSafeThrowsExceptionForInvalidDayInShortMonth() { $this->expectExceptionObject(new InvalidDateException('day', 31)); // 30 days in April Carbon::createSafe(2016, 4, 31, 17, 16, 15); } public function testCreateSafeThrowsExceptionForInvalidDayForFebruaryInLeapYear() { $this->expectExceptionObject(new InvalidDateException('day', 30)); // 29 days in February for a leap year $this->assertTrue(Carbon::create(2016, 2)->isLeapYear()); Carbon::createSafe(2016, 2, 30, 17, 16, 15); } public function testCreateSafeThrowsExceptionForInvalidDayForFebruaryInLeapYearInStrictMode() { Carbon::useStrictMode(false); $this->assertNull(Carbon::createSafe(2016, 2, 30, 17, 16, 15)); } public function testCreateSafePassesForFebruaryInLeapYear() { // 29 days in February for a leap year $this->assertSame(29, Carbon::createSafe(2016, 2, 29, 17, 16, 15)->day); } public function testCreateSafeThrowsExceptionForInvalidDayForFebruaryInNonLeapYear() { $this->expectExceptionObject(new InvalidDateException('day', 29)); // 28 days in February for a non-leap year $this->assertFalse(Carbon::create(2015, 2)->isLeapYear()); Carbon::createSafe(2015, 2, 29, 17, 16, 15); } public function testCreateSafePassesForInvalidDSTTime() { $message = ''; try { // 1h jumped to 2h because of the DST, so 1h30 is not a safe date in PHP 5.4+ Carbon::createSafe(2014, 3, 30, 1, 30, 0, 'Europe/London'); } catch (InvalidDateException $exception) { $message = $exception->getMessage(); } $this->assertStringContainsString('hour : 1 is not a valid value.', $message); } public function testCreateSafePassesForValidDSTTime() { $this->assertSame(0, Carbon::createSafe(2014, 3, 30, 0, 30, 0, 'Europe/London')->hour); $this->assertSame(2, Carbon::createSafe(2014, 3, 30, 2, 30, 0, 'Europe/London')->hour); $this->assertSame(1, Carbon::createSafe(2014, 3, 30, 1, 30, 0, 'UTC')->hour); } public function testCreateSafeThrowsExceptionForWithNonIntegerValue() { $this->expectExceptionObject(new InvalidDateException('second', 15.1)); Carbon::createSafe(2015, 2, 10, 17, 16, 15.1); } public function testCreateSafePassesForFebruaryInNonLeapYear() { // 28 days in February for a non-leap year $this->assertSame(28, Carbon::createSafe(2015, 2, 28, 17, 16, 15)->day); } public function testCreateSafePasses() { $sd = Carbon::createSafe(2015, 2, 15, 17, 16, 15); $d = Carbon::create(2015, 2, 15, 17, 16, 15); $this->assertEquals($d, $sd); $this->assertCarbon($sd, 2015, 2, 15, 17, 16, 15); } } ================================================ FILE: tests/Carbon/CreateStrictTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Exceptions\OutOfRangeException; use Tests\AbstractTestCase; use TypeError; class CreateStrictTest extends AbstractTestCase { public function testCreateStrictThrowsExceptionForSecondLowerThanZero() { $this->expectExceptionObject(new OutOfRangeException('second', 0, 99, -1)); Carbon::createStrict(null, null, null, null, null, -1); } public function testCreateStrictThrowsExceptionForMonthOverRange() { $this->expectExceptionObject(new OutOfRangeException('month', 0, 99, 9001)); Carbon::createStrict(null, 9001); } public function testCreateStrictDoesNotAllowFormatString() { $this->expectException(TypeError::class); Carbon::createStrict('2021-05-25', 'Y-m-d'); } public function testCreateStrictResetsStrictModeOnSuccess() { Carbon::useStrictMode(false); $this->assertInstanceOfCarbon(Carbon::createStrict()); $this->assertFalse(Carbon::isStrictModeEnabled()); } public function testCreateStrictResetsStrictModeOnFailure() { Carbon::useStrictMode(false); $exception = null; try { Carbon::createStrict(null, -1); } catch (OutOfRangeException $e) { $exception = $e; } $this->assertInstanceOf(OutOfRangeException::class, $exception); $this->assertFalse(Carbon::isStrictModeEnabled()); } } ================================================ FILE: tests/Carbon/CreateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Exceptions\InvalidTimeZoneException; use Carbon\Exceptions\OutOfRangeException; use DateTime; use DateTimeZone; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use Tests\AbstractTestCase; class CreateTest extends AbstractTestCase { public function testCreateReturnsDatingInstance() { $d = Carbon::create(); $this->assertInstanceOfCarbon($d); } public function testCreateWithDefaults() { $d = Carbon::create(); $this->assertSame($d->getTimestamp(), Carbon::create('0000-01-01 00:00:00')->getTimestamp()); } public function testCreateWithNull() { $d = Carbon::create(null, null, null, null, null, null); $this->assertSame($d->getTimestamp(), Carbon::now()->getTimestamp()); } public function testCreateWithYear() { $d = Carbon::create(2012); $this->assertSame(2012, $d->year); } public function testCreateHandlesNegativeYear() { $c = Carbon::create(-1, 10, 12, 1, 2, 3); $this->assertCarbon($c, -1, 10, 12, 1, 2, 3); } public function testCreateHandlesFiveDigitsPositiveYears() { $c = Carbon::create(999999999, 10, 12, 1, 2, 3); $this->assertCarbon($c, 999999999, 10, 12, 1, 2, 3); } public function testCreateHandlesFiveDigitsNegativeYears() { $c = Carbon::create(-999999999, 10, 12, 1, 2, 3); $this->assertCarbon($c, -999999999, 10, 12, 1, 2, 3); } public function testCreateWithMonth() { $d = Carbon::create(null, 3); $this->assertSame(3, $d->month); } public function testCreateWithInvalidMonth() { $this->expectExceptionObject(new InvalidArgumentException( 'month must be between 0 and 99, -5 given', )); Carbon::create(null, -5); } public function testOutOfRangeException() { /** @var OutOfRangeException $error */ $error = null; try { Carbon::create(null, -5); } catch (OutOfRangeException $exception) { $error = $exception; } $this->assertInstanceOf(OutOfRangeException::class, $error); $this->assertSame('month', $error->getUnit()); $this->assertSame(-5, $error->getValue()); $this->assertSame(0, $error->getMin()); $this->assertSame(99, $error->getMax()); } public function testCreateWithInvalidMonthNonStrictMode() { Carbon::useStrictMode(false); $this->assertFalse(Carbon::isStrictModeEnabled()); $this->assertNull(Carbon::create(null, -5)); Carbon::useStrictMode(true); $this->assertTrue(Carbon::isStrictModeEnabled()); } public function testCreateMonthWraps() { $d = Carbon::create(2011, 0, 1, 0, 0, 0); $this->assertCarbon($d, 2010, 12, 1, 0, 0, 0); } public function testCreateWithDay() { $d = Carbon::create(null, null, 21); $this->assertSame(21, $d->day); } public function testCreateWithInvalidDay() { $this->expectExceptionObject(new InvalidArgumentException( 'day must be between 0 and 99, -4 given', )); Carbon::create(null, null, -4); } public function testCreateDayWraps() { $d = Carbon::create(2011, 1, 40, 0, 0, 0); $this->assertCarbon($d, 2011, 2, 9, 0, 0, 0); } public function testCreateWithHourAndDefaultMinSecToZero() { $d = Carbon::create(null, null, null, 14); $this->assertSame(14, $d->hour); $this->assertSame(0, $d->minute); $this->assertSame(0, $d->second); } public function testCreateWithInvalidHour() { $this->expectExceptionObject(new InvalidArgumentException( 'hour must be between 0 and 99, -1 given', )); Carbon::create(null, null, null, -1); } public function testCreateHourWraps() { $d = Carbon::create(2011, 1, 1, 24, 0, 0); $this->assertCarbon($d, 2011, 1, 2, 0, 0, 0); } public function testCreateWithMinute() { $d = Carbon::create(null, null, null, null, 58); $this->assertSame(58, $d->minute); } public function testCreateWithInvalidMinute() { $this->expectExceptionObject(new InvalidArgumentException( 'minute must be between 0 and 99, -2 given', )); Carbon::create(2011, 1, 1, 0, -2, 0); } public function testCreateMinuteWraps() { $d = Carbon::create(2011, 1, 1, 0, 62, 0); $this->assertCarbon($d, 2011, 1, 1, 1, 2, 0); } public function testCreateWithSecond() { $d = Carbon::create(null, null, null, null, null, 59); $this->assertSame(59, $d->second); } public function testCreateWithInvalidSecond() { $this->expectExceptionObject(new InvalidArgumentException( 'second must be between 0 and 99, -2 given', )); Carbon::create(null, null, null, null, null, -2); } public function testCreateSecondsWrap() { $d = Carbon::create(2012, 1, 1, 0, 0, 61); $this->assertCarbon($d, 2012, 1, 1, 0, 1, 1); } public function testCreateWithDateTimeZone() { $d = Carbon::create(2012, 1, 1, 0, 0, 0, new DateTimeZone('Europe/London')); $this->assertCarbon($d, 2012, 1, 1, 0, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateWithTimeZoneString() { $d = Carbon::create(2012, 1, 1, 0, 0, 0, 'Europe/London'); $this->assertCarbon($d, 2012, 1, 1, 0, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testMake() { $this->assertCarbon(Carbon::make('2017-01-05'), 2017, 1, 5, 0, 0, 0); $this->assertCarbon(Carbon::make(new DateTime('2017-01-05')), 2017, 1, 5, 0, 0, 0); $this->assertCarbon(Carbon::make(new Carbon('2017-01-05')), 2017, 1, 5, 0, 0, 0); $this->assertNull(Carbon::make(3)); } public function testCreateWithInvalidTimezoneOffset() { $this->expectExceptionObject(new InvalidTimeZoneException( 'Unknown or bad timezone (-28236)', )); Carbon::createFromDate(2000, 1, 1, -28236); } public function testCreateWithValidTimezoneOffset() { $dt = Carbon::createFromDate(2000, 1, 1, -4); $this->assertSame('America/New_York', $dt->tzName); $dt = Carbon::createFromDate(2000, 1, 1, '-4'); $this->assertSame('-04:00', $dt->tzName); } public function testParseFromLocale() { $dateToday = Carbon::parseFromLocale('now', 'en'); $dateTest = Carbon::parseFromLocale('à l\'instant', 'fr'); $this->assertSame($dateToday->format('Y-m-d H:i:s'), $dateTest->format('Y-m-d H:i:s')); $dateToday = Carbon::parseFromLocale('today', 'en'); $dateTest = Carbon::parseFromLocale('Aujourd\'hui', 'fr'); $this->assertSame($dateToday->format('Y-m-d'), $dateTest->format('Y-m-d')); $dateTest = Carbon::parseFromLocale('Aujourd\'hui à 19:34', 'fr'); $this->assertSame($dateToday->format('Y-m-d').' 19:34', $dateTest->format('Y-m-d H:i')); $dateTest = Carbon::parseFromLocale('Heute', 'de'); $this->assertSame($dateToday->format('Y-m-d'), $dateTest->format('Y-m-d')); $dateTest = Carbon::parseFromLocale('Heute um 19:34', 'de'); $this->assertSame($dateToday->format('Y-m-d').' 19:34', $dateTest->format('Y-m-d H:i')); $date = date('Y-m-d', strtotime($dateToday.' + 1 days')); $dateTest = Carbon::parseFromLocale('demain', 'fr'); $this->assertSame($date, $dateTest->format('Y-m-d')); $date = date('Y-m-d', strtotime($dateToday.' + 2 days')); $dateTest = Carbon::parseFromLocale('après-demain', 'fr'); $this->assertSame($date, $dateTest->format('Y-m-d')); $date = date('Y-m-d', strtotime($dateToday.' - 1 days')); $dateTest = Carbon::parseFromLocale('hier', 'fr'); $this->assertSame($date, $dateTest->format('Y-m-d')); $date = date('Y-m-d', strtotime($dateToday.' - 2 days')); $dateTest = Carbon::parseFromLocale('avant-hier', 'fr'); $this->assertSame($date, $dateTest->format('Y-m-d')); $date = Carbon::parseFromLocale('23 Okt 2019', 'de'); $this->assertSame('Wednesday, October 23, 2019 12:00 AM America/Toronto', $date->isoFormat('LLLL zz')); $date = Carbon::parseFromLocale('23 Okt 2019', 'de', 'Europe/Berlin')->locale('de'); $this->assertSame('Mittwoch, 23. Oktober 2019 00:00 Europe/Berlin', $date->isoFormat('LLLL zz')); $date = Carbon::parseFromLocale('23 červenec 2019', 'cs'); $this->assertSame('2019-07-23', $date->format('Y-m-d')); $date = Carbon::parseFromLocale('23 červen 2019', 'cs'); $this->assertSame('2019-06-23', $date->format('Y-m-d')); Carbon::setTestNow('2021-01-26 15:45:13'); $date = Carbon::parseFromLocale('завтра', 'ru'); $this->assertSame('2021-01-27 00:00:00', $date->format('Y-m-d H:i:s')); } #[Group('localization')] #[DataProvider('dataForLocales')] public function testParseFromLocaleForEachLocale($locale) { $expectedDate = Carbon::parse('today 4:26'); $date = Carbon::parseFromLocale($expectedDate->locale($locale)->calendar(), $locale); $this->assertSame($expectedDate->format('Y-m-d H:i'), $date->format('Y-m-d H:i')); } public function testParseFromLocaleWithDefaultLocale() { Carbon::setLocale('fr'); $date = Carbon::parseFromLocale('Dimanche'); $this->assertSame('dimanche', $date->dayName); $date = Carbon::parseFromLocale('Lundi'); $this->assertSame('lundi', $date->dayName); $date = Carbon::parseFromLocale('à l’instant'); $this->assertEquals(Carbon::now(), $date); $date = Carbon::parseFromLocale('après-demain'); $this->assertEquals(Carbon::today()->addDays(2), $date); } public function testCreateFromLocaleFormat() { $date = Carbon::createFromLocaleFormat('Y M d H,i,s', 'zh_CN', '2019 四月 4 12,04,21'); $this->assertSame('Thursday, April 4, 2019 12:04 PM America/Toronto', $date->isoFormat('LLLL zz')); $date = Carbon::createFromLocaleFormat('Y M d H,i,s', 'zh_TW', '2019 四月 4 12,04,21', 'Asia/Shanghai')->locale('zh'); $this->assertSame('2019年4月4日星期四 中午 12点04分 Asia/Shanghai', $date->isoFormat('LLLL zz')); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d * F * Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \of F \of Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \o\f F \o\f Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \d\e F \d\e Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \n\o\t F \n\o\t Y', 'es', '05 not diciembre not 2022', 'America/Mexico_City') ->format('Y-m-d e') ); } public function testCreateFromIsoFormat() { $date = Carbon::createFromIsoFormat('!YYYYY MMMM D', '2019 April 4'); $this->assertSame('Thursday, April 4, 2019 12:00 AM America/Toronto', $date->isoFormat('LLLL zz')); } public function testCreateFromIsoFormatException() { $this->expectExceptionObject(new InvalidArgumentException( 'Format wo not supported for creation.', )); Carbon::createFromIsoFormat('YY D wo', '2019 April 4'); } public function testCreateFromLocaleIsoFormat() { $date = Carbon::createFromLocaleIsoFormat('YYYY MMMM D HH,mm,ss', 'zh_TW', '2019 四月 4 12,04,21'); $this->assertSame('Thursday, April 4, 2019 12:04 PM America/Toronto', $date->isoFormat('LLLL zz')); $date = Carbon::createFromLocaleIsoFormat('LLL zz', 'zh', '2019年4月4日 下午 2点04分 Asia/Shanghai'); $this->assertSame('Thursday, April 4, 2019 2:04 PM Asia/Shanghai', $date->isoFormat('LLLL zz')); $this->assertSame('2019年4月4日星期四 下午 2点04分 Asia/Shanghai', $date->locale('zh')->isoFormat('LLLL zz')); $date = Carbon::createFromLocaleIsoFormat('llll', 'fr_CA', 'mar. 24 juil. 2018 08:34'); $this->assertSame('2018-07-24 08:34', $date->format('Y-m-d H:i')); } public static function dataForLocales(): array { $locales = [ 'aa_ER', 'aa_ER@saaho', 'aa_ET', 'af', 'af_NA', 'af_ZA', 'agq', 'agr', 'agr_PE', 'ak', 'ak_GH', 'am', 'am_ET', 'an', 'an_ES', 'anp', 'anp_IN', 'ar', 'ar_AE', 'ar_BH', 'ar_DJ', 'ar_DZ', 'ar_EG', 'ar_EH', 'ar_ER', 'ar_IL', 'ar_IN', 'ar_IQ', 'ar_JO', 'ar_KM', 'ar_KW', 'ar_LB', 'ar_LY', 'ar_MA', 'ar_MR', 'ar_OM', 'ar_PS', 'ar_QA', 'ar_SA', 'ar_SD', 'ar_SO', 'ar_SS', 'ar_SY', 'ar_Shakl', 'ar_TD', 'ar_TN', 'ar_YE', 'as', 'as_IN', 'asa', 'ast', 'ast_ES', 'ayc', 'ayc_PE', 'az', 'az_AZ', 'az_Cyrl', 'az_Latn', 'bas', 'be', 'be_BY', 'bem', 'bem_ZM', 'ber', 'ber_DZ', 'ber_MA', 'bez', 'bg', 'bg_BG', 'bhb', 'bhb_IN', 'bho', 'bho_IN', 'bi', 'bi_VU', 'bm', 'bo_IN', 'br', 'br_FR', 'brx', 'brx_IN', 'bs', 'bs_BA', 'bs_Cyrl', 'bs_Latn', 'ca', 'ca_AD', 'ca_ES', 'ca_ES_Valencia', 'ca_FR', 'ca_IT', 'ccp', 'ccp_IN', 'ce', 'ce_RU', 'cgg', 'chr', 'chr_US', 'cmn', 'cmn_TW', 'crh', 'crh_UA', 'cu', 'cy', 'cy_GB', 'da', 'da_DK', 'da_GL', 'dav', 'dje', 'doi', 'doi_IN', 'dsb', 'dsb_DE', 'dua', 'dv', 'dv_MV', 'dyo', 'dz', 'dz_BT', 'ebu', 'ee_TG', 'el', 'el_CY', 'el_GR', 'en', 'en_001', 'en_150', 'en_AG', 'en_AI', 'en_AS', 'en_AT', 'en_AU', 'en_BB', 'en_BE', 'en_BI', 'en_BM', 'en_BS', 'en_BW', 'en_BZ', 'en_CA', 'en_CC', 'en_CH', 'en_CK', 'en_CM', 'en_CX', 'en_CY', 'en_DE', 'en_DG', 'en_DK', 'en_DM', 'en_ER', 'en_FI', 'en_FJ', 'en_FK', 'en_FM', 'en_GB', 'en_GD', 'en_GG', 'en_GH', 'en_GI', 'en_GM', 'en_GU', 'en_GY', 'en_HK', 'en_IE', 'en_IL', 'en_IM', 'en_IN', 'en_IO', 'en_ISO', 'en_JE', 'en_JM', 'en_KE', 'en_KI', 'en_KN', 'en_KY', 'en_LC', 'en_LR', 'en_LS', 'en_MG', 'en_MH', 'en_MO', 'en_MP', 'en_MS', 'en_MT', 'en_MU', 'en_MW', 'en_MY', 'en_NA', 'en_NF', 'en_NG', 'en_NL', 'en_NR', 'en_NU', 'en_NZ', 'en_PG', 'en_PH', 'en_PK', 'en_PN', 'en_PR', 'en_PW', 'en_RW', 'en_SB', 'en_SC', 'en_SD', 'en_SE', 'en_SG', 'en_SH', 'en_SI', 'en_SL', 'en_SS', 'en_SX', 'en_SZ', 'en_TC', 'en_TK', 'en_TO', 'en_TT', 'en_TV', 'en_TZ', 'en_UG', 'en_UM', 'en_US', 'en_US_Posix', 'en_VC', 'en_VG', 'en_VI', 'en_VU', 'en_WS', 'en_ZA', 'en_ZM', 'en_ZW', 'eo', 'es', 'es_419', 'es_AR', 'es_BO', 'es_BR', 'es_BZ', 'es_CL', 'es_CO', 'es_CR', 'es_CU', 'es_DO', 'es_EA', 'es_EC', 'es_ES', 'es_GQ', 'es_GT', 'es_HN', 'es_IC', 'es_MX', 'es_NI', 'es_PA', 'es_PE', 'es_PH', 'es_PR', 'es_PY', 'es_SV', 'es_US', 'es_UY', 'es_VE', 'et', 'et_EE', 'ewo', 'ff', 'ff_CM', 'ff_GN', 'ff_MR', 'ff_SN', 'fil', 'fil_PH', 'fo', 'fo_DK', 'fo_FO', 'fr', 'fr_BE', 'fr_BF', 'fr_BI', 'fr_BJ', 'fr_BL', 'fr_CA', 'fr_CD', 'fr_CF', 'fr_CG', 'fr_CH', 'fr_CI', 'fr_CM', 'fr_DJ', 'fr_DZ', 'fr_FR', 'fr_GA', 'fr_GF', 'fr_GN', 'fr_GP', 'fr_GQ', 'fr_HT', 'fr_KM', 'fr_LU', 'fr_MA', 'fr_MC', 'fr_MF', 'fr_MG', 'fr_ML', 'fr_MQ', 'fr_MR', 'fr_MU', 'fr_NC', 'fr_NE', 'fr_PF', 'fr_PM', 'fr_RE', 'fr_RW', 'fr_SC', 'fr_SN', 'fr_SY', 'fr_TD', 'fr_TG', 'fr_TN', 'fr_VU', 'fr_WF', 'fr_YT', 'fy', 'fy_NL', 'ga', 'ga_IE', 'gd', 'gd_GB', 'gez', 'gez_ER', 'gez_ET', 'gl', 'gl_ES', 'guz', 'gv', 'gv_GB', 'ha', 'ha_GH', 'ha_NE', 'ha_NG', 'hak', 'hak_TW', 'haw', 'he', 'he_IL', 'hif', 'hif_FJ', 'hne', 'hne_IN', 'hr', 'hr_BA', 'hr_HR', 'hsb', 'hsb_DE', 'ht', 'ht_HT', 'hy', 'hy_AM', 'ia', 'ia_FR', 'id', 'id_ID', 'ig', 'ig_NG', 'ii', 'ik', 'ik_CA', 'in', 'it', 'it_CH', 'it_IT', 'it_SM', 'it_VA', 'iu', 'iu_CA', 'iw', 'ja', 'ja_JP', 'jgo', 'jmc', 'jv', 'kab', 'kab_DZ', 'kam', 'kde', 'kea', 'khq', 'ki', 'kk', 'kk_KZ', 'kkj', 'kl', 'kl_GL', 'kln', 'km', 'km_KH', 'kok', 'kok_IN', 'ks', 'ks_IN', 'ks_IN@devanagari', 'ksb', 'ksf', 'ksh', 'kw', 'kw_GB', 'ky', 'ky_KG', 'lag', 'lg', 'lg_UG', 'li', 'li_NL', 'lij', 'lij_IT', 'lkt', 'ln', 'ln_AO', 'ln_CD', 'ln_CF', 'ln_CG', 'lo', 'lo_LA', 'lrc', 'lrc_IQ', 'lt', 'lt_LT', 'lu', 'luo', 'luy', 'lzh', 'lzh_TW', 'mag', 'mag_IN', 'mai', 'mai_IN', 'mas', 'mas_TZ', 'mer', 'mfe', 'mfe_MU', 'mg', 'mg_MG', 'mgh', 'mgo', 'mhr', 'mhr_RU', 'mi', 'mi_NZ', 'miq', 'miq_NI', 'mjw', 'mjw_IN', 'mk', 'mk_MK', 'mni', 'mni_IN', 'mo', 'ms', 'ms_BN', 'ms_MY', 'ms_SG', 'mt', 'mt_MT', 'mua', 'mzn', 'nan', 'nan_TW', 'nan_TW@latin', 'naq', 'nb', 'nb_NO', 'nb_SJ', 'nd', 'nds', 'nds_DE', 'nds_NL', 'ne_IN', 'nhn', 'nhn_MX', 'niu', 'niu_NU', 'nl', 'nl_AW', 'nl_BE', 'nl_BQ', 'nl_CW', 'nl_NL', 'nl_SR', 'nl_SX', 'nmg', 'nn', 'nn_NO', 'nnh', 'no', 'nr', 'nr_ZA', 'nso', 'nso_ZA', 'nus', 'nyn', 'oc', 'oc_FR', 'om', 'om_ET', 'om_KE', 'os', 'os_RU', 'pa_Arab', 'pa_Guru', 'pl', 'pl_PL', 'prg', 'pt', 'pt_AO', 'pt_BR', 'pt_CH', 'pt_CV', 'pt_GQ', 'pt_GW', 'pt_LU', 'pt_MO', 'pt_MZ', 'pt_PT', 'pt_ST', 'pt_TL', 'qu', 'qu_BO', 'qu_EC', 'quz', 'quz_PE', 'raj', 'raj_IN', 'rm', 'rn', 'ro', 'ro_MD', 'ro_RO', 'rof', 'ru', 'ru_BY', 'ru_KG', 'ru_KZ', 'ru_MD', 'ru_RU', 'ru_UA', 'rw', 'rw_RW', 'rwk', 'sa', 'sa_IN', 'sah', 'sah_RU', 'saq', 'sat', 'sat_IN', 'sbp', 'sd', 'sd_IN', 'sd_IN@devanagari', 'se', 'se_FI', 'se_NO', 'se_SE', 'seh', 'ses', 'sg', 'sgs', 'sgs_LT', 'shi', 'shi_Latn', 'shi_Tfng', 'shn', 'shn_MM', 'shs', 'shs_CA', 'sid', 'sid_ET', 'sl', 'sl_SI', 'sm', 'sm_WS', 'smn', 'sn', 'so', 'so_DJ', 'so_ET', 'so_KE', 'so_SO', 'sq', 'sq_AL', 'sq_MK', 'sq_XK', 'sr', 'sr_Cyrl', 'sr_Cyrl_BA', 'sr_Cyrl_ME', 'sr_Cyrl_XK', 'sr_Latn', 'sr_Latn_BA', 'sr_Latn_ME', 'sr_Latn_XK', 'sr_ME', 'sr_RS', 'sr_RS@latin', 'ss', 'ss_ZA', 'st', 'st_ZA', 'sv', 'sv_AX', 'sv_FI', 'sv_SE', 'sw', 'sw_CD', 'sw_KE', 'sw_TZ', 'sw_UG', 'szl', 'szl_PL', 'ta', 'ta_IN', 'ta_LK', 'tcy', 'tcy_IN', 'teo', 'teo_KE', 'tet', 'tg', 'tg_TJ', 'th', 'th_TH', 'the', 'the_NP', 'ti', 'ti_ER', 'ti_ET', 'tk', 'tk_TM', 'tlh', 'tn', 'tn_ZA', 'to', 'to_TO', 'tpi', 'tpi_PG', 'tr', 'tr_TR', 'ts', 'ts_ZA', 'tt_RU@iqtelif', 'twq', 'tzl', 'tzm', 'tzm_Latn', 'ug', 'ug_CN', 'uk', 'uk_UA', 'unm', 'unm_US', 'ur', 'ur_IN', 'ur_PK', 'uz_Arab', 'vai', 'vai_Vaii', 've', 've_ZA', 'vi', 'vi_VN', 'vo', 'vun', 'wa', 'wa_BE', 'wae', 'wae_CH', 'wal', 'wal_ET', 'xh', 'xh_ZA', 'xog', 'yav', 'yi', 'yi_US', 'yo', 'yo_BJ', 'yo_NG', 'yue', 'yue_HK', 'yue_Hans', 'yue_Hant', 'yuw', 'yuw_PG', 'zh', 'zh_CN', 'zh_HK', 'zh_Hans', 'zh_Hans_HK', 'zh_Hans_MO', 'zh_Hans_SG', 'zh_Hant', 'zh_Hant_HK', 'zh_Hant_MO', 'zh_Hant_TW', 'zh_MO', 'zh_SG', 'zh_TW', 'zh_YUE', 'zu', 'zu_ZA', ]; return array_combine( $locales, array_map( static fn (string $locale) => [$locale], $locales, ), ); } } ================================================ FILE: tests/Carbon/DayOfWeekModifiersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class DayOfWeekModifiersTest extends AbstractTestCase { public function testGetWeekendDays() { $this->assertSame([Carbon::SATURDAY, Carbon::SUNDAY], Carbon::getWeekendDays()); } public function testSetWeekendDays() { Carbon::setWeekendDays([Carbon::THURSDAY, Carbon::FRIDAY]); $this->assertSame([Carbon::THURSDAY, Carbon::FRIDAY], Carbon::getWeekendDays()); $this->assertTrue(Carbon::createFromDate(2018, 2, 16)->isWeekend()); Carbon::setWeekendDays([Carbon::SATURDAY, Carbon::SUNDAY]); $this->assertSame([Carbon::SATURDAY, Carbon::SUNDAY], Carbon::getWeekendDays()); $this->assertFalse(Carbon::createFromDate(2018, 2, 16)->isWeekend()); } public function testStartOfWeek() { $d = Carbon::create(1980, 8, 7, 12, 11, 9)->startOfWeek(); $this->assertCarbon($d, 1980, 8, 4, 0, 0, 0); Carbon::setLocale('en_UM'); $this->assertSame('Sunday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en'); $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('es_US'); $this->assertSame('domingo', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_GB'); $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); } public function testStartOfWeekFromWeekStart() { $d = Carbon::createFromDate(1980, 8, 4)->startOfWeek(); $this->assertCarbon($d, 1980, 8, 4, 0, 0, 0); } public function testStartOfWeekCrossingYearBoundary() { $d = Carbon::createFromDate(2013, 12, 31, 'GMT'); $d->startOfWeek(); $this->assertCarbon($d, 2013, 12, 30, 0, 0, 0); } public function testEndOfWeek() { $d = Carbon::create(1980, 8, 7, 11, 12, 13)->endOfWeek(); $this->assertCarbon($d, 1980, 8, 10, 23, 59, 59); } public function testEndOfWeekFromWeekEnd() { $d = Carbon::createFromDate(1980, 8, 9)->endOfWeek(); $this->assertCarbon($d, 1980, 8, 10, 23, 59, 59); } public function testEndOfWeekCrossingYearBoundary() { $d = Carbon::createFromDate(2013, 12, 31, 'GMT'); $d->endOfWeek(); $this->assertCarbon($d, 2014, 1, 5, 23, 59, 59); } /** * @see https://github.com/briannesbitt/Carbon/issues/735 */ public function testStartOrEndOfWeekFromWeekWithUTC() { $d = Carbon::create(2016, 7, 27, 17, 13, 7, 'UTC'); $this->assertCarbon($d->copy()->startOfWeek(), 2016, 7, 25, 0, 0, 0); $this->assertCarbon($d->copy()->endOfWeek(), 2016, 7, 31, 23, 59, 59); } /** * @see https://github.com/briannesbitt/Carbon/issues/735 */ public function testStartOrEndOfWeekFromWeekWithOtherTimezone() { $d = Carbon::create(2016, 7, 27, 17, 13, 7, 'America/New_York'); $this->assertCarbon($d->copy()->startOfWeek(), 2016, 7, 25, 0, 0, 0); $this->assertCarbon($d->copy()->endOfWeek(), 2016, 7, 31, 23, 59, 59); } public function testNext() { $d = Carbon::createFromDate(1975, 5, 21)->next(); $this->assertCarbon($d, 1975, 5, 28, 0, 0, 0); } public function testNextMonday() { $d = Carbon::createFromDate(1975, 5, 21)->next(Carbon::MONDAY); $this->assertCarbon($d, 1975, 5, 26, 0, 0, 0); $d = Carbon::createFromDate(1975, 5, 21)->next('Monday'); $this->assertCarbon($d, 1975, 5, 26, 0, 0, 0); } public function testNextSaturday() { $d = Carbon::createFromDate(1975, 5, 21)->next(6); $this->assertCarbon($d, 1975, 5, 24, 0, 0, 0); } public function testNextTimestamp() { $d = Carbon::createFromDate(1975, 11, 14)->next(); $this->assertCarbon($d, 1975, 11, 21, 0, 0, 0); } public function testPrevious() { $d = Carbon::createFromDate(1975, 5, 21)->previous(); $this->assertCarbon($d, 1975, 5, 14, 0, 0, 0); } public function testPreviousMonday() { $d = Carbon::createFromDate(1975, 5, 21)->previous(Carbon::MONDAY); $this->assertCarbon($d, 1975, 5, 19, 0, 0, 0); } public function testPreviousSaturday() { $d = Carbon::createFromDate(1975, 5, 21)->previous(6); $this->assertCarbon($d, 1975, 5, 17, 0, 0, 0); } public function testPreviousTimestamp() { $d = Carbon::createFromDate(1975, 11, 28)->previous(); $this->assertCarbon($d, 1975, 11, 21, 0, 0, 0); } public function testFirstDayOfMonth() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(); $this->assertCarbon($d, 1975, 11, 1, 0, 0, 0); } public function testFirstWednesdayOfMonth() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(Carbon::WEDNESDAY); $this->assertCarbon($d, 1975, 11, 5, 0, 0, 0); } public function testFirstFridayOfMonth() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(5); $this->assertCarbon($d, 1975, 11, 7, 0, 0, 0); } public function testLastDayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->lastOfMonth(); $this->assertCarbon($d, 1975, 12, 31, 0, 0, 0); } public function testLastTuesdayOfMonth() { $d = Carbon::createFromDate(1975, 12, 1)->lastOfMonth(Carbon::TUESDAY); $this->assertCarbon($d, 1975, 12, 30, 0, 0, 0); } public function testLastFridayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->lastOfMonth(5); $this->assertCarbon($d, 1975, 12, 26, 0, 0, 0); } public function testNthOfMonthOutsideScope() { $this->assertFalse(Carbon::createFromDate(1975, 12, 5)->nthOfMonth(6, Carbon::MONDAY)); } public function testNthOfMonthOutsideYear() { $this->assertFalse(Carbon::createFromDate(1975, 12, 5)->nthOfMonth(55, Carbon::MONDAY)); } public function test2ndMondayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->nthOfMonth(2, Carbon::MONDAY); $this->assertCarbon($d, 1975, 12, 8, 0, 0, 0); } public function test3rdWednesdayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->nthOfMonth(3, 3); $this->assertCarbon($d, 1975, 12, 17, 0, 0, 0); } public function testFirstDayOfQuarter() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(); $this->assertCarbon($d, 1975, 10, 1, 0, 0, 0); } public function testFirstWednesdayOfQuarter() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(Carbon::WEDNESDAY); $this->assertCarbon($d, 1975, 10, 1, 0, 0, 0); } public function testFirstFridayOfQuarter() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(5); $this->assertCarbon($d, 1975, 10, 3, 0, 0, 0); } public function testFirstOfQuarterFromADayThatWillNotExistInTheFirstMonth() { $d = Carbon::createFromDate(2014, 5, 31)->firstOfQuarter(); $this->assertCarbon($d, 2014, 4, 1, 0, 0, 0); } public function testLastDayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 5)->lastOfQuarter(); $this->assertCarbon($d, 1975, 9, 30, 0, 0, 0); } public function testLastTuesdayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 1)->lastOfQuarter(Carbon::TUESDAY); $this->assertCarbon($d, 1975, 9, 30, 0, 0, 0); } public function testLastFridayOfQuarter() { $d = Carbon::createFromDate(1975, 7, 5)->lastOfQuarter(5); $this->assertCarbon($d, 1975, 9, 26, 0, 0, 0); } public function testLastOfQuarterFromADayThatWillNotExistInTheLastMonth() { $d = Carbon::createFromDate(2014, 5, 31)->lastOfQuarter(); $this->assertCarbon($d, 2014, 6, 30, 0, 0, 0); } public function testNthOfQuarterOutsideScope() { $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfQuarter(20, Carbon::MONDAY)); } public function testNthOfQuarterOutsideYear() { $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfQuarter(55, Carbon::MONDAY)); } public function testNthOfQuarterFromADayThatWillNotExistInTheFirstMonth() { $d = Carbon::createFromDate(2014, 5, 31)->nthOfQuarter(2, Carbon::MONDAY); $this->assertCarbon($d, 2014, 4, 14, 0, 0, 0); } public function test2ndMondayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfQuarter(2, Carbon::MONDAY); $this->assertCarbon($d, 1975, 7, 14, 0, 0, 0); } public function test3rdWednesdayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfQuarter(3, 3); $this->assertCarbon($d, 1975, 7, 16, 0, 0, 0); } public function testFirstDayOfYear() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(); $this->assertCarbon($d, 1975, 1, 1, 0, 0, 0); } public function testFirstWednesdayOfYear() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(Carbon::WEDNESDAY); $this->assertCarbon($d, 1975, 1, 1, 0, 0, 0); } public function testFirstFridayOfYear() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(5); $this->assertCarbon($d, 1975, 1, 3, 0, 0, 0); } public function testLastDayOfYear() { $d = Carbon::createFromDate(1975, 8, 5)->lastOfYear(); $this->assertCarbon($d, 1975, 12, 31, 0, 0, 0); } public function testLastTuesdayOfYear() { $d = Carbon::createFromDate(1975, 8, 1)->lastOfYear(Carbon::TUESDAY); $this->assertCarbon($d, 1975, 12, 30, 0, 0, 0); } public function testLastFridayOfYear() { $d = Carbon::createFromDate(1975, 7, 5)->lastOfYear(5); $this->assertCarbon($d, 1975, 12, 26, 0, 0, 0); } public function testNthOfYearOutsideScope() { $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfYear(55, Carbon::MONDAY)); } public function test2ndMondayOfYear() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfYear(2, Carbon::MONDAY); $this->assertCarbon($d, 1975, 1, 13, 0, 0, 0); } public function test3rdWednesdayOfYear() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfYear(3, 3); $this->assertCarbon($d, 1975, 1, 15, 0, 0, 0); } public function testNextWeekday() { // Friday to Monday $d = Carbon::create(2016, 7, 15)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Saturday to Monday $d = Carbon::create(2016, 7, 16)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Sunday to Monday $d = Carbon::create(2016, 7, 16)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Monday to Tuesday $d = Carbon::create(2016, 7, 17)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); } public function testPreviousWeekday() { // Tuesday to Monday $d = Carbon::create(2016, 7, 19)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Monday to Friday $d = Carbon::create(2016, 7, 18)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 15); // Sunday to Friday $d = Carbon::create(2016, 7, 17)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 15); // Saturday to Friday $d = Carbon::create(2016, 7, 16)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 15); } public function testNextWeekendDay() { // Thursday to Saturday $d = Carbon::create(2016, 7, 14)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 16); // Friday to Saturday $d = Carbon::create(2016, 7, 15)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 16); // Saturday to Sunday $d = Carbon::create(2016, 7, 16)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 17); // Sunday to Saturday $d = Carbon::create(2016, 7, 17)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 23); } public function testPreviousWeekendDay() { // Thursday to Sunday $d = Carbon::create(2016, 7, 14)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 10); // Friday to Sunday $d = Carbon::create(2016, 7, 15)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 10); // Saturday to Sunday $d = Carbon::create(2016, 7, 16)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 10); // Sunday to Saturday $d = Carbon::create(2016, 7, 17)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 16); } public function testWeekStartAndEndWithAutoMode() { $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_UM'); $this->assertSame('Sunday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_US'); $this->assertSame('Sunday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en'); $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('es_US'); $this->assertSame('domingo', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_GB'); $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_UM'); $this->assertSame('Saturday', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('en_US'); $this->assertSame('Saturday', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('en'); $this->assertSame('Sunday', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('es_US'); $this->assertSame('sábado', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('en_GB'); $this->assertSame('Sunday', Carbon::now()->endOfWeek()->dayName); } } ================================================ FILE: tests/Carbon/DiffTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\UnknownUnitException; use Carbon\Unit; use Closure; use DateTime; use DateTimeImmutable; use Tests\AbstractTestCase; use TypeError; class DiffTest extends AbstractTestCase { public function wrapWithTestNow(Closure $func, ?CarbonInterface $dt = null): void { parent::wrapWithTestNow($func, $dt ?: Carbon::createMidnightDate(2012, 1, 1)); } public function testDiffAsCarbonInterval() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertCarbonInterval($dt->diff($dt->copy()->addYear()), 1, 0, 0, 0, 0, 0); $this->assertTrue($dt->diff($dt)->isEmpty()); } public function testDiffInYearsPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInYears($dt->copy()->addYear())); } public function testDiffInYearsNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-1, (int) $dt->diffInYears($dt->copy()->subYear())); } public function testDiffInYearsNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInYears($dt->copy()->subYear(), true)); } public function testDiffInYearsVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(1, (int) Carbon::now()->subYear()->diffInYears()); }); } public function testDiffInYearsEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInYears($dt->copy()->addYear()->addMonths(7))); } public function testDiffInQuartersPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInQuarters($dt->copy()->addQuarter()->addDay())); } public function testDiffInQuartersNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-4, (int) $dt->diffInQuarters($dt->copy()->subQuarters(4))); } public function testDiffInQuartersNegativeWithNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(4, (int) $dt->diffInQuarters($dt->copy()->subQuarters(4), true)); } public function testDiffInQuartersVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(4, (int) Carbon::now()->subYear()->diffInQuarters()); }); } public function testDiffInQuartersEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInQuarters($dt->copy()->addQuarter()->addDays(12))); } public function testDiffInMonthsPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(13, (int) $dt->diffInMonths($dt->copy()->addYear()->addMonth())); } public function testDiffInMonthsNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-11, (int) $dt->diffInMonths($dt->copy()->subYear()->addMonth())); } public function testDiffInMonthsWithTimezone() { $first = new Carbon('2022-12-01 00:00:00.0 Africa/Nairobi'); $second = new Carbon('2022-11-01 00:00:00.0 Africa/Nairobi'); $this->assertSame(-1, (int) $first->diffInMonths($second, false)); $this->assertSame(1, (int) $second->diffInMonths($first, false)); $this->assertSame(-1.0, $first->diffInMonths($second)); $this->assertSame(1.0, $second->diffInMonths($first)); $first = new Carbon('2022-02-01 16:00 America/Toronto'); $second = new Carbon('2022-01-01 20:00 Europe/Berlin'); $this->assertSame(-1, (int) $first->diffInMonths($second, false)); $this->assertSame(1, (int) $second->diffInMonths($first, false)); $this->assertVeryClose(-1.002976190476190, $first->diffInMonths($second)); $this->assertVeryClose(1.002976190476190, $second->diffInMonths($first)); $first = new Carbon('2022-02-01 01:00 America/Toronto'); $second = new Carbon('2022-01-01 00:00 Europe/Berlin'); $this->assertSame(-1, (int) $first->diffInMonths($second, false)); $this->assertSame(1, (int) $second->diffInMonths($first, false)); $this->assertSame($first->copy()->utc()->diffInMonths($second->copy()->utc()), $first->diffInMonths($second)); $this->assertSame($second->copy()->utc()->diffInMonths($first->copy()->utc()), $second->diffInMonths($first)); $this->assertVeryClose(-(1 + 7 / 24 / 31), $first->diffInMonths($second)); // $second date in Toronto is 2021-12-31 18:00, so we have 6 hours in December (a 31 days month), and 1 hour in February (28 days month) $this->assertVeryClose(1 + 7 / 24 / 31, $second->diffInMonths($first)); // Considered in Berlin timezone, the 7 extra hours are in February (28 days month) $first = new Carbon('2022-02-01 01:00 Europe/Berlin'); $second = new Carbon('2022-01-01 00:00 America/Toronto'); $this->assertSame(0, (int) $first->diffInMonths($second, false)); $this->assertSame(0, (int) $second->diffInMonths($first, false)); $this->assertSame($first->copy()->utc()->diffInMonths($second->copy()->utc()), $first->diffInMonths($second)); $this->assertSame($second->copy()->utc()->diffInMonths($first->copy()->utc()), $second->diffInMonths($first)); $this->assertVeryClose(-(1 - 5 / 24 / 31), $first->diffInMonths($second)); $this->assertVeryClose(1 - 5 / 24 / 31, $second->diffInMonths($first)); } public function testDiffInMonthsNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(11, (int) $dt->diffInMonths($dt->copy()->subYear()->addMonth(), true)); } public function testDiffInMonthsVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(12, (int) Carbon::now()->subYear()->diffInMonths()); }); } public function testDiffInMonthsEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInMonths($dt->copy()->addMonth()->addDays(16))); } public function testDiffInDaysPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(366, (int) $dt->diffInDays($dt->copy()->addYear())); } public function testDiffInDaysNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-365, (int) $dt->diffInDays($dt->copy()->subYear(), false)); } public function testDiffInDaysNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-365, (int) $dt->diffInDays($dt->copy()->subYear())); } public function testDiffInDaysVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(7, (int) Carbon::now()->subWeek()->diffInDays()); }); } public function testDiffInDaysEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInDays($dt->copy()->addDay()->addHours(13))); } public function testDiffInDaysFilteredPositiveWithMutated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(5, (int) $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === 1; }, $dt->copy()->endOfMonth())); } public function testDiffInDaysFilteredPositiveWithSecondObject() { $dt1 = Carbon::createFromDate(2000, 1, 1); $dt2 = Carbon::createFromDate(2000, 1, 31); $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2)); } public function testDiffInDaysFilteredNegativeNoSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt->copy()->startOfMonth())); } public function testDiffInDaysFilteredNegativeNoSignWithSecondObject() { $dt1 = Carbon::createFromDate(2000, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2, true)); } public function testDiffInDaysFilteredNegativeWithSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === 1; }, $dt->copy()->startOfMonth())); } public function testDiffInDaysFilteredNegativeWithSignWithSecondObject() { $dt1 = Carbon::createFromDate(2000, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2)); } public function testDiffInHoursFiltered() { $dt1 = Carbon::createFromDate(2000, 1, 31)->endOfDay(); $dt2 = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(-31, $dt1->diffInHoursFiltered(function (Carbon $date) { return $date->hour === 9; }, $dt2)); } public function testDiffInHoursFilteredNegative() { $dt1 = Carbon::createFromDate(2000, 1, 31)->endOfDay(); $dt2 = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(-31, $dt1->diffInHoursFiltered(function (Carbon $date) { return $date->hour === 9; }, $dt2)); } public function testDiffInHoursFilteredWorkHoursPerWeek() { $dt1 = Carbon::createFromDate(2000, 1, 5)->endOfDay(); $dt2 = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(-40, $dt1->diffInHoursFiltered(function (Carbon $date) { return $date->hour > 8 && $date->hour < 17; }, $dt2)); } public function testDiffFilteredUsingMinutesPositiveWithMutated() { $dt = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(60, $dt->diffFiltered(CarbonInterval::minute(), function (Carbon $date) { return $date->hour === 12; }, Carbon::createFromDate(2000, 1, 1)->endOfDay())); } public function testDiffFilteredPositiveWithSecondObject() { $dt1 = Carbon::create(2000, 1, 1); $dt2 = $dt1->copy()->addSeconds(80); $this->assertSame(40, $dt1->diffFiltered(CarbonInterval::second(), function (Carbon $date) { return $date->second % 2 === 0; }, $dt2)); } public function testDiffFilteredNegativeNoSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-2, $dt->diffFiltered(CarbonInterval::days(2), function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt->copy()->startOfMonth())); } public function testDiffFilteredNegativeNoSignWithSecondObject() { $dt1 = Carbon::createFromDate(2006, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-7, $dt1->diffFiltered(CarbonInterval::year(), function (Carbon $date) { return $date->month === 1; }, $dt2)); } public function testDiffFilteredNegativeWithSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-4, $dt->diffFiltered(CarbonInterval::week(), function (Carbon $date) { return $date->month === 12; }, $dt->copy()->subMonths(3), false)); } public function testDiffFilteredNegativeWithSignWithSecondObject() { $dt1 = Carbon::createFromDate(2001, 1, 31); $dt2 = Carbon::createFromDate(1999, 1, 1); $this->assertSame(-12, $dt1->diffFiltered(CarbonInterval::month(), function (Carbon $date) { return $date->year === 2000; }, $dt2, false)); } public function testBug188DiffWithSameDates() { $start = Carbon::create(2014, 10, 8, 15, 20, 0); $end = $start->copy(); $this->assertSame(0.0, $start->diffInDays($end)); $this->assertSame(0, $start->diffInWeekdays($end)); } public function testBug188DiffWithDatesOnlyHoursApart() { $start = Carbon::create(2014, 10, 8, 15, 20, 0); $end = $start->copy(); $this->assertSame(0, (int) $start->diffInDays($end)); $this->assertSame(0, $start->diffInWeekdays($end)); } public function testBug188DiffWithSameDates1DayApart() { $start = Carbon::create(2014, 10, 8, 15, 20, 0); $end = $start->copy()->addDay(); $this->assertSame(1, (int) $start->diffInDays($end)); $this->assertSame(1, $start->diffInWeekdays($end)); } public function testBug188DiffWithDatesOnTheWeekend() { $start = Carbon::create(2014, 1, 1, 0, 0, 0); $start->next(Carbon::SATURDAY); $end = $start->copy()->addDay(); $this->assertSame(1, (int) $start->diffInDays($end)); $this->assertSame(0, $start->diffInWeekdays($end)); } public function testNearlyOneDayDiff() { $this->assertVeryClose( -0.9999999999884258, Carbon::parse('2020-09-15 23:29:59.123456')->diffInDays('2020-09-14 23:29:59.123457'), ); $this->assertVeryClose( 0.9999999999884258, Carbon::parse('2020-09-14 23:29:59.123457')->diffInDays('2020-09-15 23:29:59.123456'), ); } public function testBug2798ConsistencyWithDiffInDays() { // 0 hour diff $s1 = Carbon::create(2023, 6, 6, 15, 0, 0); $e1 = Carbon::create(2023, 6, 6, 15, 0, 0); $this->assertSame(0, $s1->diffInWeekdays($e1)); $this->assertSame(0, (int) $s1->diffInDays($e1)); // 1 hour diff $s2 = Carbon::create(2023, 6, 6, 15, 0, 0); $e2 = Carbon::create(2023, 6, 6, 16, 0, 0); $this->assertSame(0, $s2->diffInWeekdays($e2)); $this->assertSame(0, $e2->diffInWeekdays($s2)); $this->assertSame('2023-06-06 15:00:00', $s2->format('Y-m-d H:i:s')); $this->assertSame('2023-06-06 16:00:00', $e2->format('Y-m-d H:i:s')); $this->assertSame(0, (int) $s2->diffInDays($e2)); // 23 hour diff $s3 = Carbon::create(2023, 6, 6, 15, 0, 0); $e3 = Carbon::create(2023, 6, 7, 14, 0, 0); $this->assertSame(1, $s3->diffInWeekdays($e3)); $this->assertSame(-1, $e3->diffInWeekdays($s3)); $this->assertSame('2023-06-06 15:00:00', $s3->format('Y-m-d H:i:s')); $this->assertSame('2023-06-07 14:00:00', $e3->format('Y-m-d H:i:s')); $this->assertSame(0, (int) $s3->diffInDays($e3)); // 24 hour diff $s4 = Carbon::create(2023, 6, 6, 15, 0, 0); $e4 = Carbon::create(2023, 6, 7, 15, 0, 0); $this->assertSame(1, $s4->diffInWeekdays($e4)); $this->assertSame(-1, $e4->diffInWeekdays($s4)); $this->assertSame(1, (int) $s4->diffInDays($e4)); // 25 hour diff $s5 = Carbon::create(2023, 6, 6, 15, 0, 0); $e5 = Carbon::create(2023, 6, 7, 16, 0, 0); $this->assertSame(1, $s5->diffInWeekdays($e5)); $this->assertSame(-1, $e5->diffInWeekdays($s5)); $this->assertSame('2023-06-06 15:00:00', $s5->format('Y-m-d H:i:s')); $this->assertSame('2023-06-07 16:00:00', $e5->format('Y-m-d H:i:s')); $this->assertSame(1, (int) $s5->diffInDays($e5)); } public function testDiffInWeekdaysPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(21, $dt->diffInWeekdays($dt->copy()->addMonth())); } public function testDiffInWeekdaysNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(20, $dt->diffInWeekdays($dt->copy()->startOfMonth(), true)); } public function testDiffInWeekdaysNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-20, $dt->diffInWeekdays($dt->copy()->startOfMonth())); } public function testDiffInWeekendDaysPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(10, $dt->diffInWeekendDays($dt->copy()->addMonth())); } public function testDiffInWeekendDaysNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(10, $dt->diffInWeekendDays($dt->copy()->startOfMonth(), true)); } public function testDiffInWeekendDaysNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-10, $dt->diffInWeekendDays($dt->copy()->startOfMonth())); } public function testDiffInWeeksPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(52, (int) $dt->diffInWeeks($dt->copy()->addYear())); } public function testDiffInWeeksNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-52, (int) $dt->diffInWeeks($dt->copy()->subYear())); } public function testDiffInWeeksNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(52, (int) $dt->diffInWeeks($dt->copy()->subYear(), true)); } public function testDiffInWeeksVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(1, (int) Carbon::now()->subWeek()->diffInWeeks()); }); } public function testDiffInWeeksEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(0, (int) $dt->diffInWeeks($dt->copy()->addWeek()->subDay())); } public function testDiffInHoursPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(26, (int) $dt->diffInHours($dt->copy()->addDay()->addHours(2))); } public function testDiffInHoursNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-22.0, $dt->diffInHours($dt->copy()->subDay()->addHours(2))); } public function testDiffInHoursNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(22.0, $dt->diffInHours($dt->copy()->subDay()->addHours(2), true)); } public function testDiffInHoursVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(48, (int) Carbon::now()->subDays(2)->diffInHours()); }, Carbon::create(2012, 1, 15)); } public function testDiffInHoursEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInHours($dt->copy()->addHour()->addMinutes(31))); } public function testDiffInHoursWithTimezones() { date_default_timezone_set('Africa/Algiers'); Carbon::setTestNow(); $dtToronto = Carbon::create(2012, 1, 1, 0, 0, 0, 'America/Toronto'); $dtVancouver = Carbon::create(2012, 1, 1, 0, 0, 0, 'America/Vancouver'); $this->assertSame(-3.0, $dtVancouver->diffInHours($dtToronto), 'Midnight in Toronto is 3 hours from midnight in Vancouver'); $dtToronto = Carbon::createFromDate(2012, 1, 1, 'America/Toronto'); usleep(2); $dtVancouver = Carbon::createFromDate(2012, 1, 1, 'America/Vancouver'); $this->assertSame(0, ((int) round($dtVancouver->diffInHours($dtToronto))) % 24); $dtToronto = Carbon::createMidnightDate(2012, 1, 1, 'America/Toronto'); $dtVancouver = Carbon::createMidnightDate(2012, 1, 1, 'America/Vancouver'); $this->assertSame(-3.0, $dtVancouver->diffInHours($dtToronto), 'Midnight in Toronto is 3 hours from midnight in Vancouver'); } public function testDiffInMinutesPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(62, (int) $dt->diffInMinutes($dt->copy()->addHour()->addMinutes(2))); } public function testDiffInMinutesPositiveALot() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1502, (int) $dt->diffInMinutes($dt->copy()->addHours(25)->addMinutes(2))); } public function testDiffInMinutesNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-58.0, $dt->diffInMinutes($dt->copy()->subHour()->addMinutes(2))); } public function testDiffInMinutesNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(58.0, $dt->diffInMinutes($dt->copy()->subHour()->addMinutes(2), true)); } public function testDiffInMinutesVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(60, (int) Carbon::now()->subHour()->diffInMinutes()); }); } public function testDiffInMinutesEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInMinutes($dt->copy()->addMinute()->addSeconds(31))); } public function testDiffInSecondsPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(62, (int) $dt->diffInSeconds($dt->copy()->addMinute()->addSeconds(2))); } public function testDiffInSecondsPositiveALot() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(7202, (int) $dt->diffInSeconds($dt->copy()->addHours(2)->addSeconds(2))); } public function testDiffInSecondsNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-58.0, $dt->diffInSeconds($dt->copy()->subMinute()->addSeconds(2))); } public function testDiffInSecondsNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(58.0, $dt->diffInSeconds($dt->copy()->subMinute()->addSeconds(2), true)); } public function testDiffInSecondsVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(3600, (int) Carbon::now()->subHour()->diffInSeconds()); }); } public function testDiffInSecondsEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1.0, $dt->diffInSeconds($dt->copy()->addSeconds((int) 1.9))); } public function testDiffInSecondsWithTimezones() { $dtOttawa = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $dtVancouver = Carbon::createFromDate(2000, 1, 1, 'America/Vancouver'); $this->assertSame(0, $dtOttawa->diffInSeconds($dtVancouver) % (24 * 3600)); $dtOttawa = Carbon::createMidnightDate(2000, 1, 1, 'America/Toronto'); $dtVancouver = Carbon::createMidnightDate(2000, 1, 1, 'America/Vancouver'); $this->assertSame(3 * 60 * 60, (int) $dtOttawa->diffInSeconds($dtVancouver)); } public function testDiffInSecondsWithTimezonesAndVsDefault() { $vanNow = Carbon::now('America/Vancouver'); $hereNow = $vanNow->copy()->setTimezone(Carbon::now()->tz); $this->wrapWithTestNow(function () use ($vanNow) { $this->assertSame(0, (int) $vanNow->diffInSeconds()); }, $hereNow); } public function testDiffForHumansNowAndSecond() { $this->wrapWithTestNow(function () { $this->assertSame('0 seconds ago', Carbon::now()->diffForHumans()); }); } /** * @see https://github.com/briannesbitt/Carbon/issues/2136 */ public function testDiffInTheFuture() { Carbon::setTestNow('2020-07-22 09:15'); $this->assertSame( '1 week from now', Carbon::parse('2020-07-30 13:51:15') ->diffForHumans(['options' => CarbonInterface::ROUND]), ); } public function testDiffWithSkippedUnits() { Carbon::setTestNow('2021-11-04 15:42'); $this->assertSame( '28 weeks from now', Carbon::parse('2022-05-25') ->diffForHumans(['skip' => ['y', 'm']]) ); $this->assertSame( '201 days from now', Carbon::parse('2022-05-25') ->diffForHumans(['skip' => ['y', 'm', 'w']]) ); $this->assertSame( '4 hours from now', Carbon::parse('2021-11-04 20:00') ->diffForHumans(['skip' => ['y', 'm', 'w']]) ); $this->assertSame( '6 hours ago', Carbon::parse('2021-11-04 09:00') ->diffForHumans(['skip' => ['y', 'm', 'w']]) ); $this->assertSame( '528 days ago', Carbon::parse('2020-05-25') ->diffForHumans(['skip' => ['y', 'm', 'w']]) ); Carbon::setTestNow('2023-01-02 16:57'); $this->assertSame( '1 day 16 hours 57 minutes', Carbon::yesterday()->diffForHumans([ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'parts' => 3, 'skip' => 's', ]) ); $this->assertSame( '2 days 190 minutes ago', Carbon::parse('-2 days -3 hours -10 minutes')->diffForHumans(['parts' => 3, 'skip' => [Unit::Hour]]), ); } public function testDiffForHumansNowAndSecondWithTimezone() { $vanNow = Carbon::now('America/Vancouver'); $hereNow = $vanNow->copy()->setTimezone(Carbon::now()->tz); $this->wrapWithTestNow(function () use ($vanNow) { $this->assertSame('0 seconds ago', $vanNow->diffForHumans()); }, $hereNow); } public function testDiffForHumansNowAndSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds ago', Carbon::now()->subSeconds(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds ago', Carbon::now()->subSeconds(59)->diffForHumans()); }); } public function testDiffForHumansNowAndMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute ago', Carbon::now()->subMinute()->diffForHumans()); }); } public function testDiffForHumansNowAndMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes ago', Carbon::now()->subMinutes(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes ago', Carbon::now()->subMinutes(59)->diffForHumans()); }); } public function testDiffForHumansNowAndHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour ago', Carbon::now()->subHour()->diffForHumans()); }); } public function testDiffForHumansNowAndHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours ago', Carbon::now()->subHours(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours ago', Carbon::now()->subHours(23)->diffForHumans()); }); } public function testDiffForHumansNowAndDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day ago', Carbon::now()->subDay()->diffForHumans()); }); } public function testDiffForHumansNowAndDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days ago', Carbon::now()->subDays(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days ago', Carbon::now()->subDays(6)->diffForHumans()); }); } public function testDiffForHumansNowAndWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week ago', Carbon::now()->subWeek()->diffForHumans()); }); } public function testDiffForHumansNowAndWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks ago', Carbon::now()->subWeeks(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks ago', Carbon::now()->subWeeks(3)->diffForHumans()); }); } public function testDiffForHumansNowAndMonth() { Carbon::setTestNow('2018-12-01'); $this->assertSame('4 weeks ago', Carbon::now()->subWeeks(4)->diffForHumans()); $this->assertSame('1 month ago', Carbon::now()->subMonth()->diffForHumans()); } public function testDiffForHumansNowAndMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months ago', Carbon::now()->subMonthsNoOverflow(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months ago', Carbon::now()->subMonthsNoOverflow(11)->diffForHumans()); }); } public function testDiffForHumansNowAndYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year ago', Carbon::now()->subYear()->diffForHumans()); }); } public function testDiffForHumansNowAndYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years ago', Carbon::now()->subYears(2)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureSecond() { $this->wrapWithTestNow(function () { $this->assertSame('1 second from now', Carbon::now()->addSecond()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds from now', Carbon::now()->addSeconds(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds from now', Carbon::now()->addSeconds(59)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute from now', Carbon::now()->addMinute()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes from now', Carbon::now()->addMinutes(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes from now', Carbon::now()->addMinutes(59)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour from now', Carbon::now()->addHour()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours from now', Carbon::now()->addHours(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours from now', Carbon::now()->addHours(23)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day from now', Carbon::now()->addDay()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days from now', Carbon::now()->addDays(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days from now', Carbon::now()->addDays(6)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week from now', Carbon::now()->addWeek()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks from now', Carbon::now()->addWeeks(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks from now', Carbon::now()->addWeeks(3)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMonth() { $this->wrapWithTestNow(function () { $this->assertSame('4 weeks from now', Carbon::now()->addWeeks(4)->diffForHumans()); $this->assertSame('1 month from now', Carbon::now()->addMonth()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months from now', Carbon::now()->addMonths(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months from now', Carbon::now()->addMonths(11)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year from now', Carbon::now()->addYear()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years from now', Carbon::now()->addYears(2)->diffForHumans()); }); } public function testDiffForHumansOtherAndSecond() { $this->wrapWithTestNow(function () { $this->assertSame('1 second before', Carbon::now()->diffForHumans(Carbon::now()->addSecond())); }); } public function testDiffForHumansOtherAndSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds before', Carbon::now()->diffForHumans(Carbon::now()->addSeconds(2))); }); } public function testDiffForHumansOtherAndNearlyMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds before', Carbon::now()->diffForHumans(Carbon::now()->addSeconds(59))); }); } public function testDiffForHumansOtherAndMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute before', Carbon::now()->diffForHumans(Carbon::now()->addMinute())); }); } public function testDiffForHumansOtherAndMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes before', Carbon::now()->diffForHumans(Carbon::now()->addMinutes(2))); }); } public function testDiffForHumansOtherAndNearlyHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes before', Carbon::now()->diffForHumans(Carbon::now()->addMinutes(59))); }); } public function testDiffForHumansOtherAndHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour before', Carbon::now()->diffForHumans(Carbon::now()->addHour())); }); } public function testDiffForHumansOtherAndHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours before', Carbon::now()->diffForHumans(Carbon::now()->addHours(2))); }); } public function testDiffForHumansOtherAndNearlyDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours before', Carbon::now()->diffForHumans(Carbon::now()->addHours(23))); }); } public function testDiffForHumansOtherAndDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day before', Carbon::now()->diffForHumans(Carbon::now()->addDay())); }); } public function testDiffForHumansOtherAndDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days before', Carbon::now()->diffForHumans(Carbon::now()->addDays(2))); }); } public function testDiffForHumansOtherAndNearlyWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days before', Carbon::now()->diffForHumans(Carbon::now()->addDays(6))); }); } public function testDiffForHumansOverWeekWithDefaultPartsCount() { $this->wrapWithTestNow(function () { $this->assertSame('1 week ago', Carbon::now()->subDays(8)->diffForHumans()); }); } public function testDiffForHumansOverWeekWithPartsCount1() { $this->wrapWithTestNow(function () { $this->assertSame( '1 week ago', Carbon::now()->subDays(8)->diffForHumans(null, false, false, 1) ); }); } public function testDiffForHumansOverWeekWithPartsCount2() { $this->wrapWithTestNow(function () { $this->assertSame( '1 week 1 day ago', Carbon::now()->subDays(8)->diffForHumans(null, false, false, 2) ); }); } public function testDiffForHumansOverWeekWithMicrosecondsBuggyGap() { $this->wrapWithTestNow(function () { $this->assertSame( '23 hours 59 minutes 59 seconds after', Carbon::parse('2018-12-03 12:34:45.123456') ->diffForHumans('2018-12-02 12:34:45.123476', ['parts' => 3]) ); }); } public function testDiffForHumansOtherAndWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week before', Carbon::now()->diffForHumans(Carbon::now()->addWeek())); }); } public function testDiffForHumansOtherAndWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks before', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(2))); }); } public function testDiffForHumansOtherAndNearlyMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks before', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(3))); }); } public function testDiffForHumansOtherAndMonth() { $this->wrapWithTestNow(function () { $this->assertSame('4 weeks before', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(4))); $this->assertSame('1 month before', Carbon::now()->diffForHumans(Carbon::now()->addMonth())); }); } public function testDiffForHumansOtherAndMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months before', Carbon::now()->diffForHumans(Carbon::now()->addMonths(2))); }); } public function testDiffForHumansOtherAndNearlyYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months before', Carbon::now()->diffForHumans(Carbon::now()->addMonths(11))); }); } public function testDiffForHumansOtherAndYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year before', Carbon::now()->diffForHumans(Carbon::now()->addYear())); }); } public function testDiffForHumansOtherAndYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years before', Carbon::now()->diffForHumans(Carbon::now()->addYears(2))); }); } public function testDiffForHumansOtherAndFutureSecond() { $this->wrapWithTestNow(function () { $this->assertSame('1 second after', Carbon::now()->diffForHumans(Carbon::now()->subSecond())); }); } public function testDiffForHumansOtherAndFutureSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds after', Carbon::now()->diffForHumans(Carbon::now()->subSeconds(2))); }); } public function testDiffForHumansOtherAndNearlyFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds after', Carbon::now()->diffForHumans(Carbon::now()->subSeconds(59))); }); } public function testDiffForHumansOtherAndFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute after', Carbon::now()->diffForHumans(Carbon::now()->subMinute())); }); } public function testDiffForHumansOtherAndFutureMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes after', Carbon::now()->diffForHumans(Carbon::now()->subMinutes(2))); }); } public function testDiffForHumansOtherAndNearlyFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes after', Carbon::now()->diffForHumans(Carbon::now()->subMinutes(59))); }); } public function testDiffForHumansOtherAndFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour after', Carbon::now()->diffForHumans(Carbon::now()->subHour())); }); } public function testDiffForHumansOtherAndFutureHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours after', Carbon::now()->diffForHumans(Carbon::now()->subHours(2))); }); } public function testDiffForHumansOtherAndNearlyFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours after', Carbon::now()->diffForHumans(Carbon::now()->subHours(23))); }); } public function testDiffForHumansOtherAndFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day after', Carbon::now()->diffForHumans(Carbon::now()->subDay())); }); } public function testDiffForHumansOtherAndFutureDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days after', Carbon::now()->diffForHumans(Carbon::now()->subDays(2))); }); } public function testDiffForHumansOtherAndNearlyFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days after', Carbon::now()->diffForHumans(Carbon::now()->subDays(6))); }); } public function testDiffForHumansOtherAndFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week after', Carbon::now()->diffForHumans(Carbon::now()->subWeek())); }); } public function testDiffForHumansOtherAndFutureWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks after', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(2))); }); } public function testDiffForHumansOtherAndNearlyFutureMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks after', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(3))); }); } public function testDiffForHumansOtherAndFutureMonth() { Carbon::setTestNow('2018-12-01'); $this->assertSame('4 weeks after', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(4))); $this->assertSame('1 month after', Carbon::now()->diffForHumans(Carbon::now()->subMonth())); } public function testDiffForHumansOtherAndFutureMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months after', Carbon::now()->diffForHumans(Carbon::now()->subMonthsNoOverflow(2))); }); } public function testDiffForHumansOtherAndNearlyFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months after', Carbon::now()->diffForHumans(Carbon::now()->subMonthsNoOverflow(11))); }); } public function testDiffForHumansOtherAndFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year after', Carbon::now()->diffForHumans(Carbon::now()->subYear())); }); } public function testDiffForHumansOtherAndFutureYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years after', Carbon::now()->diffForHumans(Carbon::now()->subYears(2))); }); } public function testDiffForHumansAbsoluteSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds', Carbon::now()->diffForHumans(Carbon::now()->subSeconds(59), true)); $this->assertSame('59 seconds', Carbon::now()->diffForHumans(Carbon::now()->addSeconds(59), true)); }); } public function testDiffForHumansAbsoluteMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('30 minutes', Carbon::now()->diffForHumans(Carbon::now()->subMinutes(30), true)); $this->assertSame('30 minutes', Carbon::now()->diffForHumans(Carbon::now()->addMinutes(30), true)); }); } public function testDiffForHumansAbsoluteHours() { $this->wrapWithTestNow(function () { $this->assertSame('3 hours', Carbon::now()->diffForHumans(Carbon::now()->subHours(3), true)); $this->assertSame('3 hours', Carbon::now()->diffForHumans(Carbon::now()->addHours(3), true)); }); } public function testDiffForHumansAbsoluteDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days', Carbon::now()->diffForHumans(Carbon::now()->subDays(2), true)); $this->assertSame('2 days', Carbon::now()->diffForHumans(Carbon::now()->addDays(2), true)); }); } public function testDiffForHumansAbsoluteWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(2), true)); $this->assertSame('2 weeks', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(2), true)); }); } public function testDiffForHumansAbsoluteMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months', Carbon::now()->diffForHumans(Carbon::now()->subMonthsNoOverflow(2), true)); $this->assertSame('2 months', Carbon::now()->diffForHumans(Carbon::now()->addMonthsNoOverflow(2), true)); }); } public function testDiffForHumansAbsoluteYears() { $this->wrapWithTestNow(function () { $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), true)); $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), true)); }); } public function testDiffForHumansWithOptions() { $this->wrapWithTestNow(function () { $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year after', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year before', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year from now', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year ago', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year after', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('1 year before', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('1 year', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year before', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('1 year after', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_OTHER)); }); } public function testDiffForHumansWithMagicMethods() { $this->wrapWithTestNow(function () { $this->assertSame('1 year', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->subYears(1)->subMonth())); $this->assertSame('1 year 1 month', Carbon::now()->longAbsoluteDiffForHumans(2, Carbon::now()->subYears(1)->subMonth())); $this->assertSame('1 year 1 month', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->subYears(1)->subMonth(), 2)); $this->assertSame('1 year', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr', Carbon::now()->shortAbsoluteDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr', Carbon::now()->shortAbsoluteDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year after', Carbon::now()->longRelativeDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year before', Carbon::now()->longRelativeDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr after', Carbon::now()->shortRelativeDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr before', Carbon::now()->shortRelativeDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year from now', Carbon::now()->longRelativeToNowDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year ago', Carbon::now()->longRelativeToNowDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr from now', Carbon::now()->shortRelativeToNowDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr ago', Carbon::now()->shortRelativeToNowDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year after', Carbon::now()->longRelativeToOtherDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year before', Carbon::now()->longRelativeToOtherDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr after', Carbon::now()->shortRelativeToOtherDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr before', Carbon::now()->shortRelativeToOtherDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year', Carbon::now()->subYears(1)->longAbsoluteDiffForHumans()); $this->assertSame('1 year', Carbon::now()->addYears(1)->longAbsoluteDiffForHumans()); $this->assertSame('1yr', Carbon::now()->subYears(1)->shortAbsoluteDiffForHumans()); $this->assertSame('1yr', Carbon::now()->addYears(1)->shortAbsoluteDiffForHumans()); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->longRelativeDiffForHumans()); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->longRelativeDiffForHumans()); $this->assertSame('1yr ago', Carbon::now()->subYears(1)->shortRelativeDiffForHumans()); $this->assertSame('1yr from now', Carbon::now()->addYears(1)->shortRelativeDiffForHumans()); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->longRelativeToNowDiffForHumans()); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->longRelativeToNowDiffForHumans()); $this->assertSame('1yr ago', Carbon::now()->subYears(1)->shortRelativeToNowDiffForHumans()); $this->assertSame('1yr from now', Carbon::now()->addYears(1)->shortRelativeToNowDiffForHumans()); $this->assertSame('1 year before', Carbon::now()->subYears(1)->longRelativeToOtherDiffForHumans()); $this->assertSame('1 year after', Carbon::now()->addYears(1)->longRelativeToOtherDiffForHumans()); $this->assertSame('1yr before', Carbon::now()->subYears(1)->shortRelativeToOtherDiffForHumans()); $this->assertSame('1yr after', Carbon::now()->addYears(1)->shortRelativeToOtherDiffForHumans()); }); } public function testDiffForHumansWithShorterMonthShouldStillBeAMonth() { $feb15 = Carbon::parse('2015-02-15'); $mar15 = Carbon::parse('2015-03-15'); $this->assertSame('1 month after', $mar15->diffForHumans($feb15)); } public function testDiffForHumansWithDateTimeInstance() { $feb15 = new DateTime('2015-02-15'); $mar15 = Carbon::parse('2015-03-15'); $this->assertSame('1 month after', $mar15->diffForHumans($feb15)); } public function testDiffForHumansWithDateString() { $mar13 = Carbon::parse('2018-03-13'); $this->assertSame('1 month before', $mar13->diffForHumans('2018-04-13')); } public function testDiffForHumansWithDateTimeString() { $mar13 = Carbon::parse('2018-03-13'); $this->assertSame('1 month before', $mar13->diffForHumans('2018-04-13 08:00:00')); } public function testDiffWithString() { $dt1 = Carbon::createFromDate(2000, 1, 25)->endOfDay(); $this->assertSame(384.0, round($dt1->diffInHours('2000-01-10', true))); $this->assertSame(383.0, floor($dt1->diffInHours('2000-01-10', true))); } public function testDiffWithDateTime() { $dt1 = Carbon::createFromDate(2000, 1, 25)->endOfDay(); $dt2 = new DateTime('2000-01-10'); $this->assertSame(-384.0, round($dt1->diffInHours($dt2))); } public function testDiffOptions() { $this->assertSame(1, Carbon::NO_ZERO_DIFF); $this->assertSame(2, Carbon::JUST_NOW); $this->assertSame(4, Carbon::ONE_DAY_WORDS); $this->assertSame(8, Carbon::TWO_DAY_WORDS); $this->assertSame(16, Carbon::SEQUENTIAL_PARTS_ONLY); $options = Carbon::getHumanDiffOptions(); $this->assertSame(0, $options); $date = Carbon::create(2018, 3, 12, 2, 5, 6, 'UTC'); $this->assertSame('0 seconds before', $date->diffForHumans($date)); Carbon::setHumanDiffOptions(0); $this->assertSame(0, Carbon::getHumanDiffOptions()); $this->assertSame('0 seconds before', $date->diffForHumans($date)); Carbon::setLocale('fr'); $this->assertSame('0 seconde avant', $date->diffForHumans($date)); Carbon::setLocale('en'); Carbon::setHumanDiffOptions(Carbon::JUST_NOW); $this->assertSame(2, Carbon::getHumanDiffOptions()); $this->assertSame('0 seconds before', $date->diffForHumans($date)); $this->assertSame('just now', Carbon::now()->diffForHumans()); Carbon::setHumanDiffOptions(Carbon::ONE_DAY_WORDS | Carbon::TWO_DAY_WORDS | Carbon::NO_ZERO_DIFF | Carbon::SEQUENTIAL_PARTS_ONLY); $this->assertSame(29, Carbon::getHumanDiffOptions()); Carbon::disableHumanDiffOption(Carbon::SEQUENTIAL_PARTS_ONLY); $oneDayAfter = Carbon::create(2018, 3, 13, 2, 5, 6, 'UTC'); $oneDayBefore = Carbon::create(2018, 3, 11, 2, 5, 6, 'UTC'); $twoDayAfter = Carbon::create(2018, 3, 14, 2, 5, 6, 'UTC'); $twoDayBefore = Carbon::create(2018, 3, 10, 2, 5, 6, 'UTC'); $this->assertSame('1 day after', $oneDayAfter->diffForHumans($date)); $this->assertSame('1 day before', $oneDayBefore->diffForHumans($date)); $this->assertSame('2 days after', $twoDayAfter->diffForHumans($date)); $this->assertSame('2 days before', $twoDayBefore->diffForHumans($date)); $this->assertSame('tomorrow', Carbon::now()->addDay()->diffForHumans()); $this->assertSame('yesterday', Carbon::now()->subDay()->diffForHumans()); $this->assertSame('after tomorrow', Carbon::now()->addDays(2)->diffForHumans()); $this->assertSame('before yesterday', Carbon::now()->subDays(2)->diffForHumans()); Carbon::disableHumanDiffOption(Carbon::TWO_DAY_WORDS); $this->assertSame(5, Carbon::getHumanDiffOptions()); Carbon::disableHumanDiffOption(Carbon::TWO_DAY_WORDS); $this->assertSame(5, Carbon::getHumanDiffOptions()); $this->assertSame('tomorrow', Carbon::now()->addDay()->diffForHumans()); $this->assertSame('yesterday', Carbon::now()->subDay()->diffForHumans()); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->diffForHumans()); $this->assertSame('2 days ago', Carbon::now()->subDays(2)->diffForHumans()); Carbon::enableHumanDiffOption(Carbon::JUST_NOW); $this->assertSame(7, Carbon::getHumanDiffOptions()); Carbon::enableHumanDiffOption(Carbon::JUST_NOW); $this->assertSame(7, Carbon::getHumanDiffOptions()); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 4, 0, 0, 0, 'UTC'); $this->assertSame('1 month before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 11, 0, 0, 0, 'UTC'); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 12, 0, 0, 0, 'UTC'); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $this->assertSame('1 month 1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 3, ])); $this->assertSame('1 month 1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 3, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2020, 1, 11, 0, 0, 0, 'UTC'); $this->assertSame('1 year 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 year before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 5, 0, 0, 0, 'UTC'); $this->assertSame('1 month 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 1, 12, 0, 1, 0, 'UTC'); $this->assertSame('1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $this->assertSame('1 week 1 day 1 minute before', $origin->diffForHumans($comparison, [ 'parts' => 3, ])); $this->assertSame('1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 3, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); Carbon::setHumanDiffOptions($options); } public function testDiffForHumansArrayParameter() { Carbon::setTestNow('2000-01-01 00:00:00'); $date = Carbon::now()->subtract('2 days, 3 hours and 40 minutes'); $this->assertSame('2 days ago', $date->diffForHumans([ 'parts' => 1, 'join' => true, ])); $this->assertSame('2 days and 3 hours ago', $date->diffForHumans([ 'parts' => 2, 'join' => true, ])); $this->assertSame('hace 2 días y 3 horas', $date->copy()->locale('es')->diffForHumans([ 'parts' => 2, 'join' => true, ])); $this->assertSame('2 days, 3 hours and 40 minutes ago', $date->diffForHumans([ 'parts' => -1, 'join' => true, ])); $this->assertSame('3 days, 3 hours and 40 minutes before', $date->diffForHumans(Carbon::now()->addDay(), [ 'parts' => -1, 'join' => true, ])); $this->assertSame('3 days, 3 hours and 40 minutes before', $date->diffForHumans([ 'other' => Carbon::now()->addDay(), 'parts' => -1, 'join' => true, ])); $this->assertSame('2 days, 3 hours ago', $date->diffForHumans([ 'parts' => 2, 'join' => ', ', ])); $this->assertSame('2d, 3h ago', $date->diffForHumans([ 'parts' => 2, 'join' => ', ', 'short' => true, ])); $this->assertSame('2 days, 3 hours before', $date->diffForHumans([ 'parts' => 2, 'join' => ', ', 'syntax' => CarbonInterface::DIFF_RELATIVE_TO_OTHER, ])); $this->assertSame('yesterday', Carbon::yesterday()->diffForHumans([ 'options' => CarbonInterface::ONE_DAY_WORDS, ])); $this->assertSame('1 day ago', Carbon::yesterday()->diffForHumans([ 'options' => 0, ])); } public function testFromNow() { Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now('UTC')->addDays(2)->fromNow()); Carbon::setLocale('fr'); $this->assertSame('dans 2 jours', Carbon::now('UTC')->addDays(2)->fromNow()); Carbon::setLocale('en'); $this->assertSame('2 days after', Carbon::now('UTC')->addDays(2)->fromNow(CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('2d from now', Carbon::now('UTC')->addDays(2)->addHours(5)->fromNow(null, true)); $this->assertSame('2 days 5 hours', Carbon::now('UTC')->addDays(2)->addHours(5)->fromNow(true, false, 2)); } public function testFromNowBackwardCompatibleSyntax() { $date = Carbon::parse('-5 days'); $this->assertSame('5 days', $date->fromNow(Carbon::now(), true)); $date = Carbon::parse('+5 days'); $this->assertSame('5 days', $date->fromNow(Carbon::now(), true)); } public function testFrom() { Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->from()); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->from(null)); $this->assertSame('2 days after', Carbon::now()->addDay()->from(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours après', Carbon::now()->addDay()->from(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDay()->from(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d after', Carbon::now()->addDay()->addHours(5)->from(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->from(Carbon::now()->subDay(), true, false, 2)); } public function testSince() { Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->since()); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->since(null)); $this->assertSame('2 days after', Carbon::now()->addDay()->since(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours après', Carbon::now()->addDay()->since(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDay()->since(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d after', Carbon::now()->addDay()->addHours(5)->since(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->since(Carbon::now()->subDay(), true, false, 2)); } public function testToNow() { Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now('UTC')->addDays(2)->toNow()); Carbon::setLocale('fr'); $this->assertSame('il y a 2 jours', Carbon::now('UTC')->addDays(2)->toNow()); Carbon::setLocale('en'); $this->assertSame('2 days before', Carbon::now('UTC')->addDays(2)->toNow(CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('2d ago', Carbon::now('UTC')->addDays(2)->addHours(5)->toNow(null, true)); $this->assertSame('2 days 5 hours', Carbon::now('UTC')->addDays(2)->addHours(5)->toNow(true, false, 2)); } public function testTo() { Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->to()); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->to(null)); $this->assertSame('2 days before', Carbon::now()->addDay()->to(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours avant', Carbon::now()->addDay()->to(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDay()->to(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d before', Carbon::now()->addDay()->addHours(5)->to(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->to(Carbon::now()->subDay(), true, false, 2)); } public function testUntil() { Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->until()); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->until(null)); $this->assertSame('2 days before', Carbon::now()->addDay()->until(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours avant', Carbon::now()->addDay()->until(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDay()->until(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d before', Carbon::now()->addDay()->addHours(5)->until(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->until(Carbon::now()->subDay(), true, false, 2)); } public function testDiffWithInvalidType() { $this->expectException(TypeError::class); Carbon::createFromDate(2000, 1, 25)->diffInHours(10); } public function testDiffWithInvalidObject() { $this->expectException(TypeError::class); Carbon::createFromDate(2000, 1, 25)->diffInHours(new CarbonInterval()); } public function testDiffForHumansWithIncorrectDateTimeStringWhichIsNotACarbonInstance() { $this->expectException(InvalidFormatException::class); $this->expectExceptionMessage('Failed to parse time string (2018-04-13---08:00:00) at position 10'); $mar13 = Carbon::parse('2018-03-13'); $mar13->diffForHumans('2018-04-13---08:00:00'); } public function testFloatDiff() { date_default_timezone_set('UTC'); $this->assertSame(8986.665965, Carbon::parse('2018-03-31 23:55:12.321456')->floatDiffInSeconds(Carbon::parse('2018-04-01 02:24:58.987421'))); $this->assertVeryClose( 1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInDays(Carbon::parse('2018-12-02 00:01')), ); $this->assertVeryClose( 1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInWeeks(Carbon::parse('2018-12-02 00:01')), ); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2018-04-12 14:24:58.987421'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-03-13 20:55:12.321456'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2018-04-12 14:24:58.987421'))); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-03-13 20:55:12.321456'))); $this->assertVeryClose(16.557633744585264, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(15.959000397985738, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(15.959000397985738, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(15.959000397985738, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-15.959000397985738, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3746000338015283, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(0.9609014036645421, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-01-30 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2023-06-12 14:24:58.987421'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2023-06-12 14:24:58.987421'))); $this->assertVeryClose(-5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00')->floatDiffInMonths(Carbon::parse('2018-11-28 00:00:00'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris'), true)); $this->assertVeryClose(-0.9999999999884258, Carbon::parse('2020-12-17 00:00:00.000001')->floatDiffInDays('2020-12-16 00:00:00.000002')); $this->assertSame(-1.0, Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00')->floatDiffInMonths(Carbon::parse('2018-10-28 00:00:00'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris'))); } public function testDiffDayMinusOneMicrosecond() { $now = new Carbon('2019-07-29 14:02:54.000000 UTC'); $then1 = new Carbon('2019-07-28 14:02:54.000001 UTC'); $then2 = new Carbon('2019-07-27 14:02:54.000001 UTC'); $this->assertVeryClose(-0.9999999999884258, $now->floatDiffInDays($then1, false)); $this->assertVeryClose(-1.9999999999884257, $now->floatDiffInDays($then2, false)); $this->assertVeryClose(-0.9999999999884258, $now->diffInDays($then1, false)); $this->assertVeryClose(-1.9999999999884257, $now->diffInDays($then2, false)); $this->assertVeryClose( 6.99999273113426, Carbon::parse('2022-01-04 13:32:30.628030')->floatDiffInDays('2022-01-11 13:32:30.000000'), ); $this->assertVeryClose( 6.999734949884259, Carbon::parse('2022-01-04 13:32:52.900330')->floatDiffInDays('2022-01-11 13:32:30.000000'), ); } public function testFloatDiffWithRealUnits() { $from = Carbon::parse('2021-03-27 20:00 Europe/Warsaw'); $to = Carbon::parse('2021-03-27 20:00 Europe/London'); $from->floatDiffInRealDays($to); $this->assertSame('2021-03-27 20:00:00 Europe/Warsaw', $from->format('Y-m-d H:i:s e')); $this->assertSame('2021-03-27 20:00:00 Europe/London', $to->format('Y-m-d H:i:s e')); date_default_timezone_set('UTC'); $this->assertVeryClose(1.0006944444444446, Carbon::parse('2018-12-01 00:00')->floatDiffInRealDays(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-26 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-03-29 20:00')); $this->assertVeryClose(1.0416666666666667, Carbon::parse('2021-10-30 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-10-31 20:00')); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInRealDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInRealDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInRealWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2018-04-12 14:24:58.987421'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-03-13 20:55:12.321456'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2018-04-12 14:24:58.987421'), false)); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-03-13 20:55:12.321456'), false)); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInRealWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInRealWeeks(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2018-04-12 14:24:58.987421'))); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-03-13 20:55:12.321456'))); $this->assertVeryClose(16.557633744585264, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3746000338015283, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(0.9609014036645421, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-01-30 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2023-06-12 14:24:58.987421'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2023-06-12 14:24:58.987421'))); $this->assertVeryClose(-5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(1.0336021505376345, Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00')->floatDiffInRealMonths(Carbon::parse('2018-11-28 00:00:00'), true)); $this->assertVeryClose(1.0013888888888889, Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris'), true)); $this->assertVeryClose(-1.0336021505376345, Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00')->floatDiffInRealMonths(Carbon::parse('2018-10-28 00:00:00'))); $this->assertVeryClose(-1.0013888888888889, Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris'))); Carbon::setTestNow('2021-03-28 20:00 Europe/Warsaw'); $this->assertSame(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInRealDays()); } public function testFloatDiffWithUTCUnits() { $from = Carbon::parse('2021-03-27 20:00 Europe/Warsaw'); $to = Carbon::parse('2021-03-27 20:00 Europe/London'); $from->floatDiffInUtcDays($to); $this->assertSame('2021-03-27 20:00:00 Europe/Warsaw', $from->format('Y-m-d H:i:s e')); $this->assertSame('2021-03-27 20:00:00 Europe/London', $to->format('Y-m-d H:i:s e')); date_default_timezone_set('UTC'); $this->assertVeryClose(1.0006944444444446, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcDays(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-26 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-03-29 20:00')); $this->assertVeryClose(1.0416666666666667, Carbon::parse('2021-10-30 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-10-31 20:00')); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2018-04-12 14:24:58.987421'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-03-13 20:55:12.321456'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2018-04-12 14:24:58.987421'), false)); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-03-13 20:55:12.321456'), false)); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcWeeks(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2018-04-12 14:24:58.987421'))); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-03-13 20:55:12.321456'))); $this->assertVeryClose(16.557633744585264, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3746000338015283, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(0.9609014036645421, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-01-30 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2023-06-12 14:24:58.987421'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2023-06-12 14:24:58.987421'))); $this->assertVeryClose(-5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(1.0336021505376345, Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00')->floatDiffInUtcMonths(Carbon::parse('2018-11-28 00:00:00'), true)); $this->assertVeryClose(1.0013888888888889, Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris'), true)); $this->assertVeryClose(-1.0336021505376345, Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00')->floatDiffInUtcMonths(Carbon::parse('2018-10-28 00:00:00'))); $this->assertVeryClose(-1.0013888888888889, Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris'))); Carbon::setTestNow('2021-03-28 20:00 Europe/Warsaw'); $this->assertSame(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInUtcDays()); } /** * https://bugs.php.net/bug.php?id=77007 * https://github.com/briannesbitt/Carbon/issues/1503 */ public function testPhpBug77007() { $this->assertSame(-3.0, Carbon::now()->addMinutes(3)->diffInMinutes()); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:07.237419'); $this->assertSame(0.322766, $startDate->diffInSeconds($endDate)); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:07.237419'); $this->assertSame('+ 00-00-00 00:00:00.322766', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(0.322766, $startDate->diffInSeconds($endDate)); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:05.237419'); $this->assertSame('+ 00-00-00 00:00:01.677234', $startDate->diff($endDate, true)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(1.677234, $startDate->diffInSeconds($endDate, true)); $this->assertSame('- 00-00-00 00:00:01.677234', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(-1.677234, $startDate->diffInSeconds($endDate, false)); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:06.237419'); $this->assertSame('+ 00-00-00 00:00:00.677234', $startDate->diff($endDate, true)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(0.677234, $startDate->diffInSeconds($endDate, true)); $this->assertSame('- 00-00-00 00:00:00.677234', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(-0.677234, $startDate->diffInSeconds($endDate, false)); $startDate = Carbon::parse('2017-12-31 23:59:59.914653'); $endDate = Carbon::parse('2018-01-01 00:00:00.237419'); $this->assertSame('+ 00-00-00 00:00:00.322766', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(0.322766, $startDate->diffInSeconds($endDate)); } public function testPHPBug80974() { $this->assertSame(3, Carbon::parse('2018-07-01 America/Toronto')->diffAsDateInterval('2018-07-02 America/Vancouver')->h); $this->assertSame(0, Carbon::parse('2018-07-01')->utc()->diffAsDateInterval('2018-07-02')->days); $this->assertSame(1, Carbon::parse('2018-07-01')->utc()->diffAsDateInterval(Carbon::parse('2018-07-02'))->days); $this->assertSame(1, Carbon::parse('2018-07-01')->diffAsDateInterval(Carbon::parse('2018-07-02')->utc())->days); } public function testThreeMonthMinusOneDay() { $start = new Carbon('2022-11-11 22:29:50.000000'); $end = $start->copy()->addMonths(3); $now = $start->copy()->addDay(); $this->assertSame(3.0, $start->diffInMonths($end)); $this->assertSame(3 - 1 / 31, $now->diffInMonths($end)); $start = new Carbon('2022-04-11 22:29:50.000000'); $end = $start->copy()->addMonths(3); $now = $start->copy()->addDay(); $this->assertSame(3.0, $start->diffInMonths($end)); $this->assertSame(3 - 1 / 30, $now->diffInMonths($end)); } public function testDiffWithZeroAndNonZeroMicroseconds() { $requestTime = new Carbon('2018-11-14 18:23:12.0 +00:00'); $serverTime = new Carbon('2018-11-14 18:23:12.307628 +00:00'); $this->assertSame(-0.307628, $serverTime->diffInSeconds($requestTime)); $requestTime = new Carbon('2019-02-10 18:23:12.0 +00:00'); $serverTime = new Carbon('2019-02-10 18:23:12.307628 +00:00'); $this->assertSame(-0.307628, $serverTime->diffInSeconds($requestTime)); } public function testNearlyFullDayDiffInSeconds() { $d1 = Carbon::parse('2019-06-15 12:34:56.123456'); $d2 = Carbon::parse('2019-06-16 12:34:56.123455'); $this->assertVeryClose(-86399.99999899999, $d2->diffInSeconds($d1)); } public function testNearlyFullDayDiffInMicroseconds() { $d1 = Carbon::parse('2019-06-15 12:34:56.123456'); $d2 = Carbon::parse('2019-06-16 12:34:56.123455'); $this->assertVeryClose(-86399999999.0, $d2->diffInMicroseconds($d1)); } public function testExactMonthDiffInSeconds() { $d1 = Carbon::make('2019-01-23 12:00:00'); $d2 = Carbon::make('2019-02-23 12:00:00'); $this->assertSame(-2678400.0, $d2->diffInSeconds($d1)); } public function testDiffInUnit() { $this->assertSame(5.5, Carbon::make('2020-08-13 05:00')->diffInUnit('hour', '2020-08-13 10:30')); $this->assertSame(4.5, Carbon::make('2020-08-13 06:00')->diffInUnit(Unit::Hour, '2020-08-13 10:30')); } public function testDiffInUnitException() { $this->expectException(UnknownUnitException::class); $this->expectExceptionMessage("Unknown unit 'moons'."); $this->assertSame(5.5, Carbon::make('2020-08-13 05:00')->diffInUnit('moon', '2020-08-13 10:30')); } public function testDaysDiffPreservation() { $deletedDate = Carbon::now()->startOfDay()->addDays(31); $this->assertSame('31 days', $deletedDate->diffForHumans(Carbon::now()->startOfDay(), [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'skip' => ['m', 'w'], 'minimumUnit' => 'd', ])); $this->assertSame('31 days', $deletedDate->diffForHumans(Carbon::now()->startOfDay()->subHours(5), [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'skip' => ['m', 'w'], 'minimumUnit' => 'd', ])); $this->assertSame('30 days', $deletedDate->diffForHumans(Carbon::now()->startOfDay()->addHours(5), [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'skip' => ['m', 'w'], 'minimumUnit' => 'd', ])); } /** * DST will be ignored (i.e. a day will be considered 23 hours/25 hours if it has a DST) * only if the date the object is compared to is on the exact same timezone (or is a string * with no timezone specified). * * Same cities being currently on the same offset (Europe/Rome and Europe/Berlin for * instance) are not considered the same timezone because they may potentially become * different in the future. */ public function testDiffWithTimezones() { $this->assertSame( -132.0, Carbon::parse('2024-02-06', 'Europe/Rome')->diffInDays('2023-09-27'), ); $this->assertSame( -132.0, Carbon::parse('2024-02-06 Europe/Rome')->diffInDays('2023-09-27 Europe/Rome'), ); $this->assertSame( -132.0, Carbon::parse('2024-02-06 22:12', 'Europe/Rome')->diffInDays('2023-09-27 22:12'), ); $this->assertSame( -132.0, Carbon::parse('2024-02-06', 'Europe/Rome')->diffInDays(Carbon::parse('2023-09-27', 'Europe/Rome')), ); $this->assertSame( -132.0, Carbon::parse('2024-02-06 Europe/Rome')->diffInDays(new DateTimeImmutable('2023-09-27 Europe/Rome')), ); $this->assertVeryClose( -132.04166666666666, Carbon::parse('2024-02-06', 'Europe/Rome')->diffInDays('2023-09-27 Europe/Berlin'), ); $this->assertVeryClose( -132.04166666666666, Carbon::parse('2024-02-06', 'Europe/Rome')->diffInDays(Carbon::parse('2023-09-27', 'Europe/Berlin')), ); $this->assertVeryClose( -132.04166666666666, Carbon::parse('2024-02-06 Europe/Rome')->diffInDays(Carbon::parse('2023-09-27 Europe/Berlin')), ); $this->assertSame( -10.0, Carbon::parse('2024-03-01', 'America/New_York')->addDays(10) ->diffInDays(Carbon::parse('2024-03-01', 'America/New_York')), ); $this->assertSame( -10.0, Carbon::parse('2024-04-01', 'America/New_York')->addDays(10) ->diffInDays(Carbon::parse('2024-04-01', 'America/New_York')), ); } public function testBigGapInDays() { $start = Carbon::parse('2030-11-03 01:24:22.848816', 'UTC'); $end = Carbon::parse('2027-05-02 01:24:22.848816', 'UTC'); $this->assertSame(-1281.0, $start->diffInDays($end)); $start = Carbon::parse('2030-11-03 01:24:22.848816', 'America/Toronto'); $end = Carbon::parse('2027-05-02 01:24:22.848816', 'America/Toronto'); $this->assertSame(-1281.0, $start->diffInDays($end)); $start = Carbon::parse('2030-11-03 01:24:22.848811', 'America/Toronto'); $end = Carbon::parse('2027-05-02 01:24:22.848816', 'America/Toronto'); $this->assertVeryClose(-1280.999999999942, $start->diffInDays($end)); $start = Carbon::parse('2024-11-03 00:24:22.848816', 'America/Toronto'); $end = Carbon::parse('2024-11-03 23:24:22.848816', 'America/Toronto'); // November 3rd is a 25-hours day in Toronto because of the DST $this->assertVeryClose(24 / 25, $start->diffInDays($end)); } public function testAFormat() { $past = new Carbon('-3 Days'); $today = new Carbon('today'); $interval = $today->diff($past); $this->assertSame('2', $interval->format('%a')); } } ================================================ FILE: tests/Carbon/Exceptions/BadComparisonUnitExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\BadComparisonUnitException; use Tests\AbstractTestCase; class BadComparisonUnitExceptionTest extends AbstractTestCase { public function testComparisonUnitException(): void { $exception = new BadComparisonUnitException($unit = 'foo'); $this->assertSame($unit, $exception->getUnit()); $this->assertSame("Bad comparison unit: 'foo'", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/BadFluentConstructorExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\BadFluentConstructorException; use Tests\AbstractTestCase; class BadFluentConstructorExceptionTest extends AbstractTestCase { public function testBadFluentConstructorException(): void { $exception = new BadFluentConstructorException($method = 'foo'); $this->assertSame($method, $exception->getMethod()); $this->assertSame("Unknown fluent constructor 'foo'.", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/BadFluentSetterExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\BadFluentSetterException; use Tests\AbstractTestCase; class BadFluentSetterExceptionTest extends AbstractTestCase { public function testBadFluentSetterException(): void { $exception = new BadFluentSetterException($setter = 'foo'); $this->assertSame($setter, $exception->getSetter()); $this->assertSame("Unknown fluent setter 'foo'", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/ImmutableExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\ImmutableException; use Tests\AbstractTestCase; class ImmutableExceptionTest extends AbstractTestCase { public function testImmutableException(): void { $exception = new ImmutableException($value = 'foo'); $this->assertSame($value, $exception->getValue()); $this->assertSame('foo is immutable.', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidCastExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidCastException; use Tests\AbstractTestCase; class InvalidCastExceptionTest extends AbstractTestCase { public function testInvalidCastException(): void { $exception = new InvalidCastException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidDateExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidDateException; use Tests\AbstractTestCase; class InvalidDateExceptionTest extends AbstractTestCase { public function testInvalidCastException(): void { $exception = new InvalidDateException('month', 13); $this->assertSame('month', $exception->getField()); $this->assertSame(13, $exception->getValue()); $this->assertSame('month : 13 is not a valid value.', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidFormatExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidFormatException; use Tests\AbstractTestCase; class InvalidFormatExceptionTest extends AbstractTestCase { public function testInvalidFormatException(): void { $exception = new InvalidFormatException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidIntervalExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidIntervalException; use Tests\AbstractTestCase; class InvalidIntervalExceptionTest extends AbstractTestCase { public function testInvalidIntervalException(): void { $exception = new InvalidIntervalException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidPeriodDateExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidPeriodDateException; use Tests\AbstractTestCase; class InvalidPeriodDateExceptionTest extends AbstractTestCase { public function testInvalidPeriodDateException(): void { $exception = new InvalidPeriodDateException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidPeriodParameterExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidPeriodParameterException; use Tests\AbstractTestCase; class InvalidPeriodParameterExceptionTest extends AbstractTestCase { public function testInvalidPeriodParameterException(): void { $exception = new InvalidPeriodParameterException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidTimeZoneExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidTimeZoneException; use Tests\AbstractTestCase; class InvalidTimeZoneExceptionTest extends AbstractTestCase { public function testInvalidTimeZoneException(): void { $exception = new InvalidTimeZoneException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/InvalidTypeExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\InvalidTypeException; use Tests\AbstractTestCase; class InvalidTypeExceptionTest extends AbstractTestCase { public function testInvalidTypeException(): void { $exception = new InvalidTypeException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/NotACarbonClassExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\NotACarbonClassException; use Tests\AbstractTestCase; class NotACarbonClassExceptionTest extends AbstractTestCase { public function testNotACarbonClassException(): void { $exception = new NotACarbonClassException($className = 'foo'); $this->assertSame($className, $exception->getClassName()); $this->assertSame('Given class does not implement Carbon\CarbonInterface: foo', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/NotAPeriodExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\NotAPeriodException; use Tests\AbstractTestCase; class NotAPeriodExceptionTest extends AbstractTestCase { public function testNotAPeriodException(): void { $exception = new NotAPeriodException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/NotLocaleAwareExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\NotLocaleAwareException; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use Tests\AbstractTestCase; class NotLocaleAwareExceptionTest extends AbstractTestCase { public static function dataForTestNotAPeriodException(): Generator { yield [ new stdClass(), 'stdClass does neither implements Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.', ]; yield [ 'foo', 'string does neither implements Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.', ]; } #[DataProvider('dataForTestNotAPeriodException')] public function testNotAPeriodException(mixed $object, string $message): void { $exception = new NotLocaleAwareException($object); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/OutOfRangeExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\OutOfRangeException; use Tests\AbstractTestCase; class OutOfRangeExceptionTest extends AbstractTestCase { public function testOutOfRangeException(): void { $exception = new OutOfRangeException('month', 1, 12, -1); $this->assertSame('month', $exception->getUnit()); $this->assertSame(1, $exception->getMin()); $this->assertSame(12, $exception->getMax()); $this->assertSame(-1, $exception->getValue()); $this->assertSame('month must be between 1 and 12, -1 given', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/ParseErrorExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\ParseErrorException; use Tests\AbstractTestCase; class ParseErrorExceptionTest extends AbstractTestCase { public function testParseErrorException(): void { $exception = new ParseErrorException($expected = 'string', $actual = ''); $this->assertSame($expected, $exception->getExpected()); $this->assertSame($actual, $exception->getActual()); $this->assertSame('', $exception->getHelp()); $this->assertSame('Format expected string but data is missing', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } public function testParseErrorExceptionWithActualAndHelp(): void { $exception = new ParseErrorException($expected = 'string', $actual = 'int', $help = 'help message'); $this->assertSame($expected, $exception->getExpected()); $this->assertSame($actual, $exception->getActual()); $this->assertSame($help, $exception->getHelp()); $this->assertSame("Format expected string but get 'int'\nhelp message", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnitExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnitException; use Tests\AbstractTestCase; class UnitExceptionTest extends AbstractTestCase { public function testUnitException(): void { $exception = new UnitException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnitNotConfiguredExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnitNotConfiguredException; use Tests\AbstractTestCase; class UnitNotConfiguredExceptionTest extends AbstractTestCase { public function testUnitNotConfiguredException(): void { $exception = new UnitNotConfiguredException($unit = 'foo'); $this->assertSame($unit, $exception->getUnit()); $this->assertSame('Unit foo have no configuration to get total from other units.', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnknownGetterExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnknownGetterException; use Tests\AbstractTestCase; class UnknownGetterExceptionTest extends AbstractTestCase { public function testUnknownGetterException(): void { $exception = new UnknownGetterException($getter = 'foo'); $this->assertSame($getter, $exception->getGetter()); $this->assertSame("Unknown getter 'foo'", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnknownMethodExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnknownMethodException; use Tests\AbstractTestCase; class UnknownMethodExceptionTest extends AbstractTestCase { public function testUnknownMethodException(): void { $exception = new UnknownMethodException($method = 'foo'); $this->assertSame($method, $exception->getMethod()); $this->assertSame('Method foo does not exist.', $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnknownSetterExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnknownSetterException; use Tests\AbstractTestCase; class UnknownSetterExceptionTest extends AbstractTestCase { public function testUnknownSetterException(): void { $exception = new UnknownSetterException($setter = 'foo'); $this->assertSame($setter, $exception->getSetter()); $this->assertSame("Unknown setter 'foo'", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnknownUnitExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnknownUnitException; use Tests\AbstractTestCase; class UnknownUnitExceptionTest extends AbstractTestCase { public function testUnknownUnitException(): void { $exception = new UnknownUnitException($unit = 'foo'); $this->assertSame($unit, $exception->getUnit()); $this->assertSame("Unknown unit 'foo'.", $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/Exceptions/UnreachableExceptionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Exceptions; use Carbon\Exceptions\UnreachableException; use Tests\AbstractTestCase; class UnreachableExceptionTest extends AbstractTestCase { public function testUnreachableException(): void { $exception = new UnreachableException($message = 'message'); $this->assertSame($message, $exception->getMessage()); $this->assertSame(0, $exception->getCode()); $this->assertNull($exception->getPrevious()); } } ================================================ FILE: tests/Carbon/ExpressiveComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class ExpressiveComparisonTest extends AbstractTestCase { public function testEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->equalTo(Carbon::createFromDate(2000, 1, 1))); } public function testEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->equalTo(Carbon::createFromDate(2000, 1, 2))); } public function testEqualWithTimezoneTrue() { $this->assertTrue(Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto')->equalTo(Carbon::create(2000, 1, 1, 9, 0, 0, 'America/Vancouver'))); } public function testNotEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->notEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testNotEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->notEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThan(Carbon::createFromDate(1999, 12, 31))); $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->isAfter(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->greaterThan(Carbon::createFromDate(2000, 1, 2))); $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->isAfter(Carbon::createFromDate(2000, 1, 2))); } public function testGreaterThanWithTimezoneTrue() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 8, 59, 59, 'America/Vancouver'); $this->assertTrue($dt1->greaterThan($dt2)); } public function testGreaterThanWithTimezoneFalse() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 9, 0, 1, 'America/Vancouver'); $this->assertFalse($dt1->greaterThan($dt2)); } public function testGreaterThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThan(Carbon::createFromDate(2000, 1, 2))); $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->isBefore(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lessThan(Carbon::createFromDate(1999, 12, 31))); $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->isBefore(Carbon::createFromDate(1999, 12, 31))); } public function testLessThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testLessThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(1999, 12, 31))); } public function testBetweenEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); } public function testBetweenNotEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); } public function testBetweenEqualFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); } public function testBetweenNotEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); } public function testBetweenEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testBetweenEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testMinIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->minimum()); } public function testMinWithNow() { $dt = Carbon::create(2012, 1, 1, 0, 0, 0)->minimum(); $this->assertCarbon($dt, 2012, 1, 1, 0, 0, 0); } public function testMinWithInstance() { $dt1 = Carbon::create(2013, 12, 31, 23, 59, 59); $dt2 = Carbon::create(2012, 1, 1, 0, 0, 0)->minimum($dt1); $this->assertCarbon($dt2, 2012, 1, 1, 0, 0, 0); } public function testMaxIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->maximum()); } public function testMaxWithNow() { $dt = Carbon::create(2099, 12, 31, 23, 59, 59)->maximum(); $this->assertCarbon($dt, 2099, 12, 31, 23, 59, 59); } public function testMaxWithInstance() { $dt1 = Carbon::create(2012, 1, 1, 0, 0, 0); $dt2 = Carbon::create(2099, 12, 31, 23, 59, 59)->maximum($dt1); $this->assertCarbon($dt2, 2099, 12, 31, 23, 59, 59); } public function testIsBirthday() { $dt1 = Carbon::createFromDate(1987, 4, 23); $dt2 = Carbon::createFromDate(2014, 9, 26); $dt3 = Carbon::createFromDate(2014, 4, 23); $this->assertFalse($dt2->isBirthday($dt1)); $this->assertTrue($dt3->isBirthday($dt1)); } public function testIsLastOfMonth() { $dt1 = Carbon::createFromDate(2017, 1, 31); $dt2 = Carbon::createFromDate(2016, 2, 28); $dt3 = Carbon::createFromDate(2016, 2, 29); $dt4 = Carbon::createFromDate(2018, 5, 5); $this->assertTrue($dt1->isLastOfMonth()); $this->assertFalse($dt2->isLastOfMonth()); $this->assertTrue($dt3->isLastOfMonth()); $this->assertFalse($dt4->isLastOfMonth()); } } ================================================ FILE: tests/Carbon/Fixtures/BadIsoCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Fixtures; use Carbon\Carbon; class BadIsoCarbon extends Carbon { public static function getIsoUnits(): array { return [ 'MMM' => ['fooxyz', ['barxyz']], ]; } } ================================================ FILE: tests/Carbon/Fixtures/DumpCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Fixtures; use Carbon\Carbon; use Exception; final class DumpCarbon extends Carbon { private $dump; private $formatBroken = false; /** * @SuppressWarnings(DevelopmentCodeFragment) */ public function __construct($time = null, $timezone = null) { ob_start(); var_dump($this); $this->dump = ob_get_contents() ?: ''; ob_end_clean(); parent::__construct($time, $timezone); } public function getDump(): string { return $this->dump; } public function breakFormat(): void { $this->formatBroken = true; } public function format(string $format): string { if ($this->formatBroken) { throw new Exception('Broken'); } return parent::format($format); } } ================================================ FILE: tests/Carbon/Fixtures/FooBar.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Fixtures; trait FooBar { public function super($string) { return 'super'.$string.' / '.$this->format('l').' / '.($this->isMutable() ? 'mutable' : 'immutable'); } public function me() { return $this; } public static function noThis() { return isset(${'this'}); } } ================================================ FILE: tests/Carbon/Fixtures/Mixin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Fixtures; use Carbon\CarbonInterface; class Mixin { public $timezone; public function __construct($timezone) { $this->timezone = $timezone; } public function setUserTimezone() { $mixin = $this; return function ($timezone) use ($mixin) { $mixin->timezone = $timezone; }; } public function userFormat() { $mixin = $this; return function ($format) use ($mixin) { /** @var CarbonInterface $date */ $date = $this; if ($mixin->timezone) { $date->setTimezone($mixin->timezone); } return $date->format($format); }; } } ================================================ FILE: tests/Carbon/Fixtures/MyCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Fixtures; use Carbon\Carbon; class MyCarbon extends Carbon { public function addTwoHours(): static { return $this->addHours(2); } } ================================================ FILE: tests/Carbon/Fixtures/NoLocaleTranslator.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon\Fixtures; use Carbon\Exceptions\NotLocaleAwareException; use ReflectionMethod; use Symfony\Component\Translation; use Symfony\Contracts\Translation\TranslatorInterface; $transMethod = new ReflectionMethod( class_exists(TranslatorInterface::class) ? TranslatorInterface::class : Translation\Translator::class, 'trans', ); if ($transMethod->hasReturnType()) { class NoLocaleTranslator implements TranslatorInterface { public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { return $id; } public function getLocale(): string { throw new NotLocaleAwareException($this); } } return; } class NoLocaleTranslator implements TranslatorInterface { public function trans($id, array $parameters = [], $domain = null, $locale = null) { return $id; } } ================================================ FILE: tests/Carbon/FluidSettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class FluidSettersTest extends AbstractTestCase { public function testFluidYearSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->year(1995)); $this->assertSame(1995, $d->year); } public function testFluidMonthSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->month(3)); $this->assertSame(3, $d->month); // Can go to september 1 to 30 (but if it's the 31, it will overflow) $this->assertInstanceOfCarbon($d->startOfMonth()->setMonth(9)); $this->assertSame(9, $d->month); $this->assertInstanceOfCarbon($d->months(3)); $this->assertSame(3, $d->month); $this->assertInstanceOfCarbon($d->setMonths(9)); $this->assertSame(9, $d->month); } public function testFluidMonthSetterWithWrap() { $d = Carbon::createFromDate(2012, 8, 21); $this->assertInstanceOfCarbon($d->month(13)); $this->assertSame(1, $d->month); } public function testFluidDaySetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->day(2)); $this->assertSame(2, $d->day); } public function testFluidDaySetterWithWrap() { $d = Carbon::createFromDate(2000, 1, 1); $this->assertInstanceOfCarbon($d->day(32)); $this->assertSame(1, $d->day); } public function testFluidSetDate() { $d = Carbon::createFromDate(2000, 1, 1); $this->assertInstanceOfCarbon($d->setDate(1995, 13, 32)); $this->assertCarbon($d, 1996, 2, 1); } public function testFluidHourSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->hour(2)); $this->assertSame(2, $d->hour); } public function testFluidHourSetterWithWrap() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->hour(25)); $this->assertSame(1, $d->hour); } public function testFluidMinuteSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->minute(2)); $this->assertSame(2, $d->minute); } public function testFluidMinuteSetterWithWrap() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->minute(61)); $this->assertSame(1, $d->minute); } public function testFluidSecondSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->second(2)); $this->assertSame(2, $d->second); } public function testFluidSecondSetterWithWrap() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->second(62)); $this->assertSame(2, $d->second); } public function testFluidSetTime() { $d = Carbon::createFromDate(2000, 1, 1); $this->assertInstanceOfCarbon($d->setTime(25, 61, 61)); $this->assertCarbon($d, 2000, 1, 2, 2, 2, 1); } public function testFluidTimestampSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d->timestamp(10)); $this->assertSame(10, $d->timestamp); $this->assertInstanceOfCarbon($d->timestamp(1600887164.88952298)); $this->assertSame('2020-09-23 14:52:44.889523', $d->format('Y-m-d H:i:s.u')); $this->assertInstanceOfCarbon($d->timestamp('0.88951247 1600887164')); $this->assertSame('2020-09-23 14:52:44.889512', $d->format('Y-m-d H:i:s.u')); $this->assertInstanceOfCarbon($d->timestamp('0.88951247/1600887164/12.56')); $this->assertSame('2020-09-23 14:52:57.449512', $d->format('Y-m-d H:i:s.u')); } } ================================================ FILE: tests/Carbon/GenericMacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use BadMethodCallException; use Carbon\Carbon; use Tests\AbstractTestCaseWithOldNow; use Throwable; class GenericMacroTest extends AbstractTestCaseWithOldNow { public function testGenericMacro() { Carbon::genericMacro(function ($method) { $time = preg_replace('/[A-Z]/', ' $0', $method); try { return self::this()->modify($time); } catch (Throwable $exception) { if (preg_match('(Could not modify with|Failed to parse)', $exception->getMessage())) { throw new BadMethodCallException('Try next macro', 0, $exception); } throw $exception; } }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('2017-07-02', $now->nextSunday()->format('Y-m-d')); $this->assertSame('2017-06-26', Carbon::lastMonday()->format('Y-m-d')); $message = null; try { Carbon::fooBar(); } catch (BadMethodCallException $exception) { $message = $exception->getMessage(); } $this->assertSame('Method '.Carbon::class.'::fooBar does not exist.', $message); $message = null; try { $now->barBiz(); } catch (BadMethodCallException $exception) { $message = $exception->getMessage(); } $this->assertSame('Method barBiz does not exist.', $message); } public function testGenericMacroPriority() { Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'myPrefix')) { throw new BadMethodCallException('Try next macro', 0); } return 'first'; }); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'myPrefix')) { throw new BadMethodCallException('Try next macro', 0); } return 'second'; }, 1); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'myPrefix')) { throw new BadMethodCallException('Try next macro', 0); } return 'third'; }, -1); Carbon::macro('myPrefixFooBar', function () { return 'myPrefixFooBar'; }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('second', $now->myPrefixSomething()); $this->assertSame('second', Carbon::myPrefixSomething()); $this->assertSame('myPrefixFooBar', $now->myPrefixFooBar()); $this->assertSame('myPrefixFooBar', Carbon::myPrefixFooBar()); } public function testLocalGenericMacroPriority() { Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'first'; }); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'second'; }, 1); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'third'; }, -1); Carbon::macro('mlpFooBar', function () { return 'mlpFooBar'; }); /** @var mixed $date */ $date = Carbon::now()->settings([ 'genericMacros' => [ function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'local-first'; }, function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'local-second'; }, ], ]); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('local-first', $date->mlpSomething()); $this->assertSame('second', $now->mlpSomething()); $this->assertSame('second', Carbon::mlpSomething()); $this->assertSame('mlpFooBar', $date->mlpFooBar()); $this->assertSame('mlpFooBar', $now->mlpFooBar()); $this->assertSame('mlpFooBar', Carbon::mlpFooBar()); } } ================================================ FILE: tests/Carbon/GettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class GettersTest extends AbstractTestCase { public function testGettersThrowExceptionOnUnknownGetter() { $this->expectExceptionObject(new InvalidArgumentException( "Unknown getter 'doesNotExit'", )); /** @var mixed $d */ $d = Carbon::create(1234, 5, 6, 7, 8, 9); $d->doesNotExit; } public function testGet() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(5, $d->get('month')); } public function testMillenniumGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(2, $d->millennium); $d = Carbon::create(2000, 5, 6, 7, 8, 9); $this->assertSame(2, $d->millennium); $d = Carbon::create(2001, 5, 6, 7, 8, 9); $this->assertSame(3, $d->millennium); $d = Carbon::create(1, 5, 6, 7, 8, 9); $this->assertSame(1, $d->millennium); $d = Carbon::create(-1, 5, 6, 7, 8, 9); $this->assertSame(-1, $d->millennium); $d = Carbon::create(-100, 5, 6, 7, 8, 9); $this->assertSame(-1, $d->millennium); $d = Carbon::create(-101, 5, 6, 7, 8, 9); $this->assertSame(-1, $d->millennium); $d = Carbon::create(-1000, 5, 6, 7, 8, 9); $this->assertSame(-1, $d->millennium); $d = Carbon::create(-1001, 5, 6, 7, 8, 9); $this->assertSame(-2, $d->millennium); } public function testCenturyGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(13, $d->century); $d = Carbon::create(2000, 5, 6, 7, 8, 9); $this->assertSame(20, $d->century); $d = Carbon::create(2001, 5, 6, 7, 8, 9); $this->assertSame(21, $d->century); $d = Carbon::create(1, 5, 6, 7, 8, 9); $this->assertSame(1, $d->century); $d = Carbon::create(-1, 5, 6, 7, 8, 9); $this->assertSame(-1, $d->century); $d = Carbon::create(-100, 5, 6, 7, 8, 9); $this->assertSame(-1, $d->century); $d = Carbon::create(-101, 5, 6, 7, 8, 9); $this->assertSame(-2, $d->century); } public function testDecadeGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(124, $d->decade); } public function testYearGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(1234, $d->year); } public function testYearIsoGetter() { $d = Carbon::createFromDate(2012, 12, 31); $this->assertSame(2013, $d->yearIso); } public function testMonthGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(5, $d->month); } public function testDayGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(6, $d->day); } public function testHourGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(7, $d->hour); } public function testMinuteGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(8, $d->minute); } public function testSecondGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(9, $d->second); } public function testMicroGetter() { $micro = 345678; $d = Carbon::parse('2014-01-05 12:34:11.'.$micro); $this->assertSame($micro, $d->micro); } public function testMicroGetterWithDefaultNow() { $now = Carbon::getTestNow(); Carbon::setTestNow(null); $start = microtime(true); usleep(10000); $d = Carbon::now(); usleep(10000); $end = microtime(true); $microTime = $d->getTimestamp() + $d->micro / 1000000; $this->assertGreaterThan($start, $microTime); $this->assertLessThan($end, $microTime); Carbon::setTestNow($now); } public function testDayOfWeekGetter() { $d = Carbon::create(2012, 5, 7, 7, 8, 9); $this->assertSame(Carbon::MONDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 8, 7, 8, 9); $this->assertSame(Carbon::TUESDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 9, 7, 8, 9); $this->assertSame(Carbon::WEDNESDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 10, 0, 0, 0); $this->assertSame(Carbon::THURSDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 11, 23, 59, 59); $this->assertSame(Carbon::FRIDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 12, 12, 0, 0); $this->assertSame(Carbon::SATURDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 13, 12, 0, 0); $this->assertSame(Carbon::SUNDAY, $d->dayOfWeek); } public function testDayOfWeekIsoGetter() { $d = Carbon::create(2012, 5, 7, 7, 8, 9); $this->assertSame(1, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 8, 7, 8, 9); $this->assertSame(2, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 9, 7, 8, 9); $this->assertSame(3, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 10, 0, 0, 0); $this->assertSame(4, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 11, 23, 59, 59); $this->assertSame(5, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 12, 12, 0, 0); $this->assertSame(6, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 13, 12, 0, 0); $this->assertSame(7, $d->dayOfWeekIso); } public function testStringGetters() { $d = Carbon::create(2012, 1, 9, 7, 8, 9); $this->assertSame('Monday', $d->englishDayOfWeek); $this->assertSame('Mon', $d->shortEnglishDayOfWeek); $this->assertSame('January', $d->englishMonth); $this->assertSame('Jan', $d->shortEnglishMonth); } public function testLocalizedGetters() { Carbon::setLocale('fr'); $d = Carbon::create(2019, 7, 15, 7, 8, 9); $this->assertSame('lundi', $d->localeDayOfWeek); $this->assertSame('lun.', $d->shortLocaleDayOfWeek); $this->assertSame('juillet', $d->localeMonth); $this->assertSame('juil.', $d->shortLocaleMonth); } public function testDayOfYearGetter() { $d = Carbon::createFromDate(2012, 5, 7); $this->assertSame(128, $d->dayOfYear); } public function testDaysInMonthGetter() { $d = Carbon::createFromDate(2012, 5, 7); $this->assertSame(31, $d->daysInMonth); } public function testTimestampGetter() { $d = Carbon::create(); $d->setTimezone('GMT'); $this->assertSame(0, $d->setDateTime(1970, 1, 1, 0, 0, 0)->timestamp); } public function testGetAge() { $d = Carbon::now(); $this->assertSame(0, $d->age); } public function testGetAgeWithRealAge() { $d = Carbon::createFromDate(1975, 5, 21); $age = (int) (substr((string) ((int) (date('Ymd')) - (int) (date('Ymd', $d->timestamp))), 0, -4)); $this->assertSame($age, $d->age); } public function testAgeWithBirthdayTomorrowAndLeapYear() { Carbon::setTestNow('2024-07-15 22:15'); $this->assertSame(3, Carbon::parse('2020-07-16')->age); } public static function dataForTestQuarter(): array { return [ [1, 1], [2, 1], [3, 1], [4, 2], [5, 2], [6, 2], [7, 3], [8, 3], [9, 3], [10, 4], [11, 4], [12, 4], ]; } #[DataProvider('dataForTestQuarter')] public function testQuarterFirstOfMonth(int $month, int $quarter) { $c = Carbon::create(2015, $month, 1)->startOfMonth(); $this->assertSame($quarter, $c->quarter); } #[DataProvider('dataForTestQuarter')] public function testQuarterMiddleOfMonth(int $month, int $quarter) { $c = Carbon::create(2015, $month, 15, 12, 13, 14); $this->assertSame($quarter, $c->quarter); } #[DataProvider('dataForTestQuarter')] public function testQuarterLastOfMonth(int $month, int $quarter) { $c = Carbon::create(2015, $month, 1)->endOfMonth(); $this->assertSame($quarter, $c->quarter); } public function testGetLocalTrue() { // Default timezone has been set to America/Toronto in AbstractTestCase.php // @see : https://en.wikipedia.org/wiki/List_of_UTC_time_offsets $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->local); $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->isLocal()); $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/New_York')->local); $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/New_York')->isLocal()); } public function testGetLocalFalse() { $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'UTC')->local); $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'UTC')->isLocal()); $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'Europe/London')->local); $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'Europe/London')->isLocal()); } public function testGetUtcFalse() { $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'America/Toronto')->utc); $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'America/Toronto')->isUtc()); /** @var object $date */ $date = Carbon::createFromDate(2013, 1, 1, 'America/Toronto'); $this->assertFalse($date->isUTC()); $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'Europe/Paris')->utc); $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'Europe/Paris')->isUtc()); /** @var object $date */ $date = Carbon::createFromDate(2013, 1, 1, 'Europe/Paris'); $this->assertFalse($date->isUTC()); } public function testGetUtcTrue() { $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Atlantic/Reykjavik')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Atlantic/Reykjavik')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Lisbon')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Lisbon')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Casablanca')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Casablanca')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Dakar')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Dakar')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Dublin')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Dublin')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/London')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/London')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'UTC')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'UTC')->isUtc()); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'GMT')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'GMT')->isUtc()); } public function testGetDstFalse() { $this->assertFalse(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->dst); $this->assertFalse(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->isDST()); } public function testGetDstTrue() { $this->assertTrue(Carbon::createFromDate(2012, 7, 1, 'America/Toronto')->dst); $this->assertTrue(Carbon::createFromDate(2012, 7, 1, 'America/Toronto')->isDST()); } public function testGetMidDayAt() { $d = Carbon::now(); $this->assertSame(12, $d->getMidDayAt()); } public function testOffsetForTorontoWithDST() { $this->assertSame(-18000, Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->offset); } public function testOffsetForTorontoNoDST() { $this->assertSame(-14400, Carbon::createFromDate(2012, 6, 1, 'America/Toronto')->offset); } public function testOffsetForGMT() { $this->assertSame(0, Carbon::createFromDate(2012, 6, 1, 'GMT')->offset); } public function testOffsetHoursForTorontoWithDST() { $this->assertSame(-5, Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->offsetHours); } public function testOffsetHoursForTorontoNoDST() { $this->assertSame(-4, Carbon::createFromDate(2012, 6, 1, 'America/Toronto')->offsetHours); } public function testOffsetHoursForGMT() { $this->assertSame(0, Carbon::createFromDate(2012, 6, 1, 'GMT')->offsetHours); } public function testIsLeapYearTrue() { $this->assertTrue(Carbon::createFromDate(2012, 1, 1)->isLeapYear()); } public function testIsLeapYearFalse() { $this->assertFalse(Carbon::createFromDate(2011, 1, 1)->isLeapYear()); } public function testIsLongYearTrue() { $this->assertTrue(Carbon::createFromDate(2015, 1, 1)->isLongYear()); $this->assertTrue(Carbon::createFromDate(2020, 1, 1)->isLongYear()); } public function testIsLongIsoYearTrue() { $this->assertTrue(Carbon::createFromDate(2015, 1, 1)->isLongIsoYear()); $this->assertTrue(Carbon::createFromDate(2016, 1, 1)->isLongIsoYear()); $this->assertTrue(Carbon::createFromDate(2019, 12, 30)->isLongIsoYear()); } public function testIsLongYearFalse() { $this->assertFalse(Carbon::createFromDate(2016, 1, 1)->isLongYear()); $this->assertFalse(Carbon::createFromDate(2019, 12, 29)->isLongYear()); $this->assertFalse(Carbon::createFromDate(2019, 12, 30)->isLongYear()); } public function testIsLongIsoYearFalse() { $this->assertTrue(Carbon::createFromDate(2016, 1, 3)->isLongIsoYear()); $this->assertFalse(Carbon::createFromDate(2019, 12, 29)->isLongIsoYear()); $this->assertFalse(Carbon::createFromDate(2018, 12, 31)->isLongIsoYear()); } public function testWeekOfMonth() { $this->assertSame(5, Carbon::createFromDate(2012, 9, 30)->weekOfMonth); $this->assertSame(4, Carbon::createFromDate(2012, 9, 28)->weekOfMonth); $this->assertSame(3, Carbon::createFromDate(2012, 9, 20)->weekOfMonth); $this->assertSame(2, Carbon::createFromDate(2012, 9, 8)->weekOfMonth); $this->assertSame(1, Carbon::createFromDate(2012, 9, 1)->weekOfMonth); } public function testWeekNumberInMonthIsNotFromTheBeginning() { $this->assertSame(5, Carbon::createFromDate(2017, 2, 28)->weekNumberInMonth); $this->assertSame(5, Carbon::createFromDate(2017, 2, 27)->weekNumberInMonth); $this->assertSame(4, Carbon::createFromDate(2017, 2, 26)->weekNumberInMonth); $this->assertSame(4, Carbon::createFromDate(2017, 2, 20)->weekNumberInMonth); $this->assertSame(3, Carbon::createFromDate(2017, 2, 19)->weekNumberInMonth); $this->assertSame(3, Carbon::createFromDate(2017, 2, 13)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2017, 2, 12)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2017, 2, 6)->weekNumberInMonth); $this->assertSame(1, Carbon::createFromDate(2017, 2, 1)->weekNumberInMonth); $this->assertSame(1, Carbon::createFromDate(2018, 7, 1)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2018, 7, 2)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2018, 7, 5)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2018, 7, 8)->weekNumberInMonth); $this->assertSame(3, Carbon::createFromDate(2018, 7, 9)->weekNumberInMonth); $this->assertSame(5, Carbon::createFromDate(2018, 7, 29)->weekNumberInMonth); $this->assertSame(6, Carbon::createFromDate(2018, 7, 30)->weekNumberInMonth); } public function testWeekOfYearFirstWeek() { $this->assertSame(52, Carbon::createFromDate(2012, 1, 1)->weekOfYear); $this->assertSame(1, Carbon::createFromDate(2012, 1, 2)->weekOfYear); } public function testWeekOfYearLastWeek() { $this->assertSame(52, Carbon::createFromDate(2012, 12, 30)->weekOfYear); $this->assertSame(1, Carbon::createFromDate(2012, 12, 31)->weekOfYear); } public function testGetTimezone() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->timezone->getName()); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->timezone->getName()); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->timezone->getName()); } public function testGetTz() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->tz->getName()); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->tz->getName()); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->tz->getName()); } public function testGetTimezoneName() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->timezoneName); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->timezoneName); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->timezoneName); } public function testGetTzName() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->tzName); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->timezoneName); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->timezoneName); } public function testShortDayName() { $dt = Carbon::createFromDate(2018, 8, 6); $this->assertSame('Mon', $dt->shortDayName); $this->assertSame('lun.', $dt->locale('fr')->shortDayName); } public function testMinDayName() { $dt = Carbon::createFromDate(2018, 8, 6); $this->assertSame('Mo', $dt->minDayName); $this->assertSame('lu', $dt->locale('fr')->minDayName); } public function testShortMonthName() { $dt = Carbon::createFromDate(2018, 7, 6); $this->assertSame('Jul', $dt->shortMonthName); $this->assertSame('juil.', $dt->locale('fr')->shortMonthName); } public function testGetDays() { $days = [ Carbon::SUNDAY => 'Sunday', Carbon::MONDAY => 'Monday', Carbon::TUESDAY => 'Tuesday', Carbon::WEDNESDAY => 'Wednesday', Carbon::THURSDAY => 'Thursday', Carbon::FRIDAY => 'Friday', Carbon::SATURDAY => 'Saturday', ]; $this->assertSame($days, Carbon::getDays()); } } ================================================ FILE: tests/Carbon/InstanceTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use DateTime; use DateTimeZone; use InvalidArgumentException; use Tests\AbstractTestCase; class InstanceTest extends AbstractTestCase { public function testInstanceFromDateTime() { $dating = Carbon::instance(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')); $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); $dating = Carbon::parse(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')); $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); } public function testInstanceFromCarbon() { $dating = Carbon::instance(Carbon::create(1975, 5, 21, 22, 32, 11)); $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); } public function testInstanceFromDateTimeKeepsTimezoneName() { $dating = Carbon::instance(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')->setTimezone(new DateTimeZone('America/Vancouver'))); $this->assertSame('America/Vancouver', $dating->tzName); } public function testInstanceFromCarbonKeepsTimezoneName() { $dating = Carbon::instance(Carbon::create(1975, 5, 21, 22, 32, 11)->setTimezone(new DateTimeZone('America/Vancouver'))); $this->assertSame('America/Vancouver', $dating->tzName); } public function testInstanceFromDateTimeKeepsMicros() { $micro = 254687; $datetime = DateTime::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); $carbon = Carbon::instance($datetime); $this->assertSame($micro, $carbon->micro); } public function testInstanceFromCarbonKeepsMicros() { $micro = 254687; $carbon = Carbon::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); $carbon = Carbon::instance($carbon); $this->assertSame($micro, $carbon->micro); } public function testTimezoneCopy() { $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); $carbon = CarbonImmutable::instance($carbon); $this->assertSame('2017-06-27 13:14:15.123456 Europe/Paris', $carbon->format('Y-m-d H:i:s.u e')); } public function testInstanceStateSetBySetStateMethod() { $carbon = Carbon::__set_state([ 'date' => '2017-05-18 13:02:15.273420', 'timezone_type' => 3, 'timezone' => 'UTC', ]); $this->assertInstanceOf(Carbon::class, $carbon); $this->assertSame('2017-05-18 13:02:15.273420', $carbon->format('Y-m-d H:i:s.u')); } public function testInstanceStateSetBySetStateString() { $carbon = Carbon::__set_state('2017-05-18 13:02:15.273420'); $this->assertInstanceOf(Carbon::class, $carbon); $this->assertSame('2017-05-18 13:02:15.273420', $carbon->format('Y-m-d H:i:s.u')); } public function testDeserializationOccursCorrectly() { $carbon = new Carbon('2017-06-27 13:14:15.000000'); $serialized = 'return '.var_export($carbon, true).';'; $deserialized = eval($serialized); $this->assertInstanceOf(Carbon::class, $deserialized); } public function testMutableConversions() { $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); $carbon = $carbon->locale('en_CA'); $copy = $carbon->toImmutable(); $this->assertEquals($copy, $carbon); $this->assertNotSame($copy, $carbon); $this->assertSame('en_CA', $copy->locale()); $this->assertInstanceOf(CarbonImmutable::class, $copy); $this->assertTrue($copy->isImmutable()); $this->assertFalse($copy->isMutable()); $this->assertSame('2017-06-27 13:14:15.123456', $copy->format(CarbonInterface::MOCK_DATETIME_FORMAT)); $this->assertSame('Europe/Paris', $copy->tzName); $this->assertNotSame($copy, $copy->modify('+1 day')); $copy = $carbon->toMutable(); $this->assertEquals($copy, $carbon); $this->assertNotSame($copy, $carbon); $this->assertSame('en_CA', $copy->locale()); $this->assertInstanceOf(Carbon::class, $copy); $this->assertFalse($copy->isImmutable()); $this->assertTrue($copy->isMutable()); $this->assertSame('2017-06-27 13:14:15.123456', $copy->format(CarbonInterface::MOCK_DATETIME_FORMAT)); $this->assertSame('Europe/Paris', $copy->tzName); $this->assertSame($copy, $copy->modify('+1 day')); } public function testInvalidCast() { $this->expectExceptionObject(new InvalidArgumentException( 'DateTimeZone has not the instance() method needed to cast the date.', )); $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); $carbon->cast(DateTimeZone::class); } public function testChildCast() { $class = \get_class(new class() extends Carbon { public function foo() { return 42; } }); $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); /** @var object $casted */ $casted = $carbon->cast($class); $this->assertInstanceOf($class, $casted); $this->assertInstanceOf(Carbon::class, $casted); $this->assertSame(42, $casted->foo()); $this->assertSame('2017-06-27', $casted->format('Y-m-d')); } public function testSiblingCast() { $class = \get_class(new class() extends DateTime { public function foo() { return 42; } }); $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); /** @var object $casted */ $casted = $carbon->cast($class); $this->assertInstanceOf($class, $casted); $this->assertInstanceOf(DateTime::class, $casted); $this->assertSame(42, $casted->foo()); $this->assertSame('2017-06-27', $casted->format('Y-m-d')); } } ================================================ FILE: tests/Carbon/IsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\Month; use Carbon\Unit; use Carbon\WeekDay; use DateInterval; use DateTime; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\TestWith; use stdClass; use Tests\AbstractTestCase; use TypeError; class IsTest extends AbstractTestCase { public function testIsWeekdayTrue() { $this->assertTrue(Carbon::createFromDate(2012, 1, 2)->isWeekday()); } public function testIsWeekdayFalse() { $this->assertFalse(Carbon::createFromDate(2012, 1, 1)->isWeekday()); } public function testIsWeekendTrue() { $this->assertTrue(Carbon::createFromDate(2012, 1, 1)->isWeekend()); } public function testIsWeekendFalse() { $this->assertFalse(Carbon::createFromDate(2012, 1, 2)->isWeekend()); } public function testIsYesterdayTrue() { $this->assertTrue(Carbon::now()->subDay()->isYesterday()); } public function testIsYesterdayFalseWithToday() { $this->assertFalse(Carbon::now()->endOfDay()->isYesterday()); } public function testIsYesterdayFalseWith2Days() { $this->assertFalse(Carbon::now()->subDays(2)->startOfDay()->isYesterday()); } public function testIsTodayTrue() { $this->assertTrue(Carbon::now()->isToday()); } public function testIsCurrentWeek() { $this->assertFalse(Carbon::now()->subWeek()->isCurrentWeek()); $this->assertFalse(Carbon::now()->addWeek()->isCurrentWeek()); $this->assertTrue(Carbon::now()->isCurrentWeek()); $this->assertTrue(Carbon::now()->startOfWeek()->isCurrentWeek()); $this->assertTrue(Carbon::now()->endOfWeek()->isCurrentWeek()); } public function testIsSameWeek() { $this->assertFalse(Carbon::now()->subWeek()->isSameWeek(Carbon::now())); $this->assertFalse(Carbon::now()->addWeek()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::now()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::now()->startOfWeek()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::now()->endOfWeek()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::parse('2019-01-01')->isSameWeek(Carbon::parse('2018-12-31'))); } public function testIsNextWeekTrue() { $this->assertTrue(Carbon::now()->addWeek()->isNextWeek()); } public function testIsLastWeekTrue() { $this->assertTrue(Carbon::now()->subWeek()->isLastWeek()); } public function testIsNextWeekFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->addWeek(2)->isNextWeek()); } public function testIsLastWeekFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->subWeek(2)->isLastWeek()); } public function testIsNextQuarterTrue() { $this->assertTrue(Carbon::now()->addQuarterNoOverflow()->isNextQuarter()); } public function testIsLastQuarterTrue() { $this->assertTrue(Carbon::now()->subQuarterNoOverflow()->isLastQuarter()); } public function testIsNextQuarterFalse() { $this->assertFalse(Carbon::now()->addQuartersNoOverflow(2)->isNextQuarter()); $this->assertFalse(Carbon::now()->addQuartersNoOverflow(5)->isNextQuarter()); } public function testIsLastQuarterFalse() { $this->assertFalse(Carbon::now()->subQuartersNoOverflow(2)->isLastQuarter()); $this->assertFalse(Carbon::now()->subQuartersNoOverflow(5)->isLastQuarter()); } public function testIsNextMonthTrue() { $this->assertTrue(Carbon::now()->addMonthNoOverflow()->isNextMonth()); } public function testIsLastMonthTrue() { $this->assertTrue(Carbon::now()->subMonthNoOverflow()->isLastMonth()); } public function testIsNextMonthFalse() { $this->assertFalse(Carbon::now()->addMonthsNoOverflow(2)->isNextMonth()); $this->assertFalse(Carbon::now()->addMonthsNoOverflow(13)->isNextMonth()); } public function testIsLastMonthFalse() { Carbon::setTestNow(Carbon::create(2018, 5, 31)); $this->assertFalse(Carbon::now()->subMonthsNoOverflow(2)->isLastMonth()); $this->assertFalse(Carbon::now()->subMonthsNoOverflow(13)->isLastMonth()); } public function testIsNextYearTrue() { $this->assertTrue(Carbon::now()->addYear()->isNextYear()); } public function testIsLastYearTrue() { $this->assertTrue(Carbon::now()->subYear()->isLastYear()); } public function testIsNextYearFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->addYear(2)->isNextYear()); } public function testIsLastYearFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->subYear(2)->isLastYear()); } public function testIsTodayFalseWithYesterday() { $this->assertFalse(Carbon::now()->subDay()->endOfDay()->isToday()); } public function testIsTodayFalseWithTomorrow() { $this->assertFalse(Carbon::now()->addDay()->startOfDay()->isToday()); } public function testIsTodayWithTimezone() { $this->assertTrue(Carbon::now('Asia/Tokyo')->isToday()); } public function testIsTomorrowTrue() { $this->assertTrue(Carbon::now()->addDay()->isTomorrow()); } public function testIsTomorrowFalseWithToday() { $this->assertFalse(Carbon::now()->endOfDay()->isTomorrow()); } public function testIsTomorrowFalseWith2Days() { $this->assertFalse(Carbon::now()->addDays(2)->startOfDay()->isTomorrow()); } public function testIsFutureTrue() { $this->assertTrue(Carbon::now()->addSecond()->isFuture()); } public function testIsFutureFalse() { $this->assertFalse(Carbon::now()->isFuture()); } public function testIsFutureFalseInThePast() { $this->assertFalse(Carbon::now()->subSecond()->isFuture()); } public function testIsPastTrue() { $this->assertTrue(Carbon::now()->subSecond()->isPast()); } public function testIsPastFalse() { $this->assertFalse(Carbon::now()->addSecond()->isPast()); } public function testNowIsPastFalse() { $this->assertFalse(Carbon::now()->isPast()); } public function testIsNowOrFutureTrue() { $this->assertTrue(Carbon::now()->addSecond()->isNowOrFuture()); } public function testIsNowOrFutureFalse() { $this->assertFalse(Carbon::now()->subSecond()->isNowOrFuture()); } public function testNowIsNowOrFutureTrue() { $this->assertTrue(Carbon::now()->isNowOrFuture()); } public function testIsNowOrPastTrue() { $this->assertTrue(Carbon::now()->subSecond()->isNowOrPast()); } public function testIsNowOrPastFalse() { $this->assertFalse(Carbon::now()->addSecond()->isNowOrPast()); } public function testNowIsNowOrPastTrue() { $this->assertTrue(Carbon::now()->isNowOrPast()); } public function testIsLeapYearTrue() { $this->assertTrue(Carbon::createFromDate(2016, 1, 1)->isLeapYear()); } public function testIsLeapYearFalse() { $this->assertFalse(Carbon::createFromDate(2014, 1, 1)->isLeapYear()); } public function testIsCurrentYearTrue() { $this->assertTrue(Carbon::now()->isCurrentYear()); } public function testIsCurrentYearFalse() { $this->assertFalse(Carbon::now()->subYear()->isCurrentYear()); } public function testIsSameYearTrue() { $this->assertTrue(Carbon::now()->isSameYear(Carbon::now())); } public function testIsSameYearFalse() { $this->assertFalse(Carbon::now()->isSameYear(Carbon::now()->subYear())); } public function testIsCurrentQuarterTrue() { $this->assertTrue(Carbon::now()->isCurrentQuarter()); } public function testIsCurrentQuarterFalse() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::now()->subQuarter()->isCurrentQuarter()); Carbon::resetMonthsOverflow(); } public function testIsSameQuarterTrue() { $this->assertTrue(Carbon::now()->isSameQuarter(Carbon::now())); } public function testIsSameQuarterTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameQuarter(new DateTime())); } public function testIsSameQuarterFalse() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::now()->isSameQuarter(Carbon::now()->subQuarter())); Carbon::resetMonthsOverflow(); } public function testIsSameQuarterFalseWithDateTime() { $now = Carbon::now(); $dt = new DateTime(); $dt->modify((Carbon::MONTHS_PER_QUARTER * -1).' month'); if ($dt->format('d') !== $now->format('d')) { $dt->modify('last day of previous month'); } $this->assertFalse($now->isSameQuarter($dt)); } public function testIsSameQuarterAndYearTrue() { $this->assertTrue(Carbon::now()->isSameQuarter(Carbon::now(), true)); } public function testIsSameQuarterAndYearTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameQuarter(new DateTime(), true)); } public function testIsSameQuarterAndYearFalse() { $this->assertFalse(Carbon::now()->isSameQuarter(Carbon::now()->subYear(), true)); } public function testIsSameQuarterAndYearFalseWithDateTime() { $dt = new DateTime(); $dt->modify('-1 year'); $this->assertFalse(Carbon::now()->isSameQuarter($dt, true)); } public function testIsCurrentMonth() { $this->assertTrue(Carbon::now()->isCurrentMonth()); $dt = Carbon::now(); $dt->modify(Carbon::now()->year.$dt->format('-m-').'01'); $this->assertTrue($dt->isCurrentMonth()); $dt->modify((Carbon::now()->year + 1).$dt->format('-m-').'28'); $this->assertFalse($dt->isCurrentMonth()); } public function testIsCurrentMonthFalse() { $this->assertFalse(Carbon::now()->day(15)->subMonth()->isCurrentMonth()); $this->assertFalse(Carbon::now()->day(15)->addYear()->isCurrentMonth()); } public function testIsSameMonth() { $this->assertTrue(Carbon::now()->isSameMonth(Carbon::now())); $dt = Carbon::now(); for ($year = 1990; $year < Carbon::now()->year; $year++) { $dt->modify($year.$dt->format('-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); } } public function testIsSameMonthTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameMonth(new DateTime())); $dt = new DateTime(); for ($year = 1990; $year < 2200; $year++) { $dt->modify($year.$dt->format('-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); } } public function testIsSameMonthOfSameYear() { $this->assertFalse(Carbon::now()->isSameMonth(Carbon::now()->day(15)->subMonth())); $this->assertTrue(Carbon::now()->isSameMonth(Carbon::now())); $dt = Carbon::now(); for ($year = 1990; $year < Carbon::now()->year; $year++) { $dt->modify($year.$dt->format('-m-').'01'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); } $year = Carbon::now()->year; $dt->modify($year.$dt->format('-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); for ($year = Carbon::now()->year + 1; $year < 2200; $year++) { $dt->modify($year.$dt->format('-m-').'01'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); } } public function testIsSameMonthFalseWithDateTime() { $dt = new DateTime(); $dt->modify('-2 months'); $this->assertFalse(Carbon::now()->isSameMonth($dt)); } public function testIsSameMonthAndYearTrue() { $this->assertTrue(Carbon::now()->isSameMonth(Carbon::now(), true)); $dt = Carbon::now(); $dt->modify($dt->format('Y-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); $dt->modify($dt->format('Y-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); } public function testIsSameMonthAndYearTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameMonth(new DateTime(), true)); $dt = new DateTime(); $dt->modify($dt->format('Y-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); $dt->modify($dt->format('Y-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); } public function testIsSameMonthAndYearFalse() { $this->assertFalse(Carbon::now()->isSameMonth(Carbon::now()->subYear(), true)); } public function testIsSameMonthAndYearFalseWithDateTime() { $dt = new DateTime(); $dt->modify('-1 year'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); } public function testIsSameDayTrue() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameDay(Carbon::createFromDate(2012, 1, 2))); $this->assertTrue($current->isSameDay(Carbon::create(2012, 1, 2, 23, 59, 59))); } public function testIsSameDayWithString() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameDay('2012-01-02 15:00:25')); $this->assertTrue($current->isSameDay('2012-01-02')); } public function testIsSameDayTrueWithDateTime() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameDay(new DateTime('2012-01-02'))); $this->assertTrue($current->isSameDay(new DateTime('2012-01-02 23:59:59'))); } public function testIsSameDayFalse() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertFalse($current->isSameDay(Carbon::createFromDate(2012, 1, 3))); $this->assertFalse($current->isSameDay(Carbon::createFromDate(2012, 6, 2))); } public function testIsSameDayFalseWithDateTime() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertFalse($current->isSameDay(new DateTime('2012-01-03'))); $this->assertFalse($current->isSameDay(new DateTime('2012-05-02'))); } public function testIsCurrentDayTrue() { $this->assertTrue(Carbon::now()->isCurrentDay()); $this->assertTrue(Carbon::now()->hour(0)->isCurrentDay()); $this->assertTrue(Carbon::now()->hour(23)->isCurrentDay()); } public function testIsCurrentDayFalse() { $this->assertFalse(Carbon::now()->subDay()->isCurrentDay()); $this->assertFalse(Carbon::now()->subMonth()->isCurrentDay()); } public function testIsSameHourTrue() { $current = Carbon::create(2018, 5, 6, 12); $this->assertTrue($current->isSameHour(Carbon::create(2018, 5, 6, 12))); $this->assertTrue($current->isSameHour(Carbon::create(2018, 5, 6, 12, 59, 59))); } public function testIsSameHourTrueWithDateTime() { $current = Carbon::create(2018, 5, 6, 12); $this->assertTrue($current->isSameHour(new DateTime('2018-05-06T12:00:00'))); $this->assertTrue($current->isSameHour(new DateTime('2018-05-06T12:59:59'))); } public function testIsSameHourFalse() { $current = Carbon::create(2018, 5, 6, 12); $this->assertFalse($current->isSameHour(Carbon::create(2018, 5, 6, 13))); $this->assertFalse($current->isSameHour(Carbon::create(2018, 5, 5, 12))); } public function testIsSameHourFalseWithDateTime() { $current = Carbon::create(2018, 5, 6, 12); $this->assertFalse($current->isSameHour(new DateTime('2018-05-06T13:00:00'))); $this->assertFalse($current->isSameHour(new DateTime('2018-06-06T12:00:00'))); } public function testIsCurrentHourTrue() { $this->assertTrue(Carbon::now()->isCurrentHour()); $this->assertTrue(Carbon::now()->second(1)->isCurrentHour()); $this->assertTrue(Carbon::now()->second(12)->isCurrentHour()); $this->assertTrue(Carbon::now()->minute(0)->isCurrentHour()); $this->assertTrue(Carbon::now()->minute(59)->second(59)->isCurrentHour()); } public function testIsCurrentHourFalse() { $this->assertFalse(Carbon::now()->subHour()->isCurrentHour()); $this->assertFalse(Carbon::now()->subDay()->isCurrentHour()); } public function testIsSameMinuteTrue() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertTrue($current->isSameMinute(Carbon::create(2018, 5, 6, 12, 30))); $current = Carbon::create(2018, 5, 6, 12, 30, 15); $this->assertTrue($current->isSameMinute(Carbon::create(2018, 5, 6, 12, 30, 45))); } public function testIsSameMinuteTrueWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertTrue($current->isSameMinute(new DateTime('2018-05-06T12:30:00'))); $current = Carbon::create(2018, 5, 6, 12, 30, 20); $this->assertTrue($current->isSameMinute(new DateTime('2018-05-06T12:30:40'))); } public function testIsSameMinuteFalse() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertFalse($current->isSameMinute(Carbon::create(2018, 5, 6, 13, 31))); $this->assertFalse($current->isSameMinute(Carbon::create(2019, 5, 6, 13, 30))); } public function testIsSameMinuteFalseWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertFalse($current->isSameMinute(new DateTime('2018-05-06T13:31:00'))); $this->assertFalse($current->isSameMinute(new DateTime('2018-05-06T17:30:00'))); } public function testIsCurrentMinuteTrue() { $this->assertTrue(Carbon::now()->isCurrentMinute()); $this->assertTrue(Carbon::now()->second(0)->isCurrentMinute()); $this->assertTrue(Carbon::now()->second(59)->isCurrentMinute()); } public function testIsCurrentMinuteFalse() { $this->assertFalse(Carbon::now()->subMinute()->isCurrentMinute()); $this->assertFalse(Carbon::now()->subHour()->isCurrentMinute()); } public function testIsSameSecondTrue() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $other = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertTrue($current->isSameSecond($other)); $this->assertTrue($current->modify($current->hour.':'.$current->minute.':'.$current->second.'.0')->isSameSecond($other)); $this->assertTrue($current->modify($current->hour.':'.$current->minute.':'.$current->second.'.999999')->isSameSecond($other)); } public function testIsSameSecondTrueWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertTrue($current->isSameSecond(new DateTime('2018-05-06T12:30:13'))); } public function testIsSameSecondFalse() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertFalse($current->isSameSecond(Carbon::create(2018, 5, 6, 12, 30, 55))); $this->assertFalse($current->isSameSecond(Carbon::create(2018, 5, 6, 14, 30, 13))); } public function testIsSameSecondFalseWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertFalse($current->isSameSecond(new DateTime('2018-05-06T13:30:54'))); $this->assertFalse($current->isSameSecond(new DateTime('2018-05-06T13:36:13'))); } public function testIsCurrentSecondTrue() { $this->assertTrue(Carbon::now()->isCurrentSecond()); $now = Carbon::now(); $this->assertTrue($now->modify($now->hour.':'.$now->minute.':'.$now->second.'.0')->isCurrentSecond()); $this->assertTrue($now->modify($now->hour.':'.$now->minute.':'.$now->second.'.999999')->isCurrentSecond()); } public function testIsCurrentSecondFalse() { $this->assertFalse(Carbon::now()->subSecond()->isCurrentSecond()); $this->assertFalse(Carbon::now()->subDay()->isCurrentSecond()); } public function testIsSameMicrosecond() { $current = new Carbon('2018-05-06T13:30:54.123456'); $this->assertTrue($current->isSameMicrosecond(new DateTime('2018-05-06T13:30:54.123456'))); $this->assertFalse($current->isSameMicrosecond(new DateTime('2018-05-06T13:30:54.123457'))); $this->assertFalse($current->isSameMicrosecond(new DateTime('2019-05-06T13:30:54.123456'))); $this->assertFalse($current->isSameMicrosecond(new DateTime('2018-05-06T13:30:55.123456'))); $this->assertTrue($current->isSameSecond($current->copy())); $this->assertTrue(Carbon::now()->isCurrentMicrosecond()); $this->assertFalse(Carbon::now()->subMicrosecond()->isCurrentMicrosecond()); $this->assertFalse(Carbon::now()->isLastMicrosecond()); $this->assertTrue(Carbon::now()->subMicrosecond()->isLastMicrosecond()); $this->assertFalse(Carbon::now()->isNextMicrosecond()); $this->assertTrue(Carbon::now()->addMicrosecond()->isNextMicrosecond()); $this->assertTrue(Carbon::now()->subMicroseconds(Carbon::MICROSECONDS_PER_SECOND)->isLastSecond()); $this->assertSame(4.0, Carbon::now()->subMicroseconds(4 * Carbon::MICROSECONDS_PER_SECOND)->diffInSeconds(Carbon::now())); } public function testIsDayOfWeek() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 5, 31)->isDayOfWeek(0)); $this->assertTrue(Carbon::createFromDate(2015, 6, 21)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isDayOfWeek('sunday')); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isDayOfWeek('SUNDAY')); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::SUNDAY)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('sunday')); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('SUNDAY')); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('monday')); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('MONDAY')); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isDayOfWeek('sunday')); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isDayOfWeek('SUNDAY')); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('monday')); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('MONDAY')); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('sunday')); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('SUNDAY')); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('monday')); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('MONDAY')); } public function testIsSameAs() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameAs('c', $current)); } public function testIsSameAsWithInvalidArgument() { $this->expectException(TypeError::class); $current = Carbon::createFromDate(2012, 1, 2); $current->isSameAs('Y-m-d', new stdClass()); } public function testIsSunday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 5, 31)->isSunday()); $this->assertTrue(Carbon::createFromDate(2015, 6, 21)->isSunday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isSunday()); $this->assertTrue(Carbon::now()->subWeek()->previous('Sunday')->isSunday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::SUNDAY)->isSunday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isSunday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::MONDAY)->isSunday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isSunday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::MONDAY)->isSunday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isSunday()); } public function testIsMonday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 1)->isMonday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::MONDAY)->isMonday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::MONDAY)->isMonday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isMonday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::TUESDAY)->isMonday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::TUESDAY)->isMonday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::TUESDAY)->isMonday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::TUESDAY)->isMonday()); } public function testIsTuesday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 2)->isTuesday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::TUESDAY)->isTuesday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::TUESDAY)->isTuesday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::TUESDAY)->isTuesday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::WEDNESDAY)->isTuesday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::WEDNESDAY)->isTuesday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::WEDNESDAY)->isTuesday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::WEDNESDAY)->isTuesday()); } public function testIsWednesday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 3)->isWednesday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::WEDNESDAY)->isWednesday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::WEDNESDAY)->isWednesday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::WEDNESDAY)->isWednesday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::THURSDAY)->isWednesday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::THURSDAY)->isWednesday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::THURSDAY)->isWednesday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::THURSDAY)->isWednesday()); } public function testIsThursday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 4)->isThursday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::THURSDAY)->isThursday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::THURSDAY)->isThursday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::THURSDAY)->isThursday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::FRIDAY)->isThursday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::FRIDAY)->isThursday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::FRIDAY)->isThursday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::FRIDAY)->isThursday()); } public function testIsFriday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 5)->isFriday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::FRIDAY)->isFriday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::FRIDAY)->isFriday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::FRIDAY)->isFriday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::SATURDAY)->isFriday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SATURDAY)->isFriday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::SATURDAY)->isFriday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SATURDAY)->isFriday()); } public function testIsSaturday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 6)->isSaturday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SATURDAY)->isSaturday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::SATURDAY)->isSaturday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SATURDAY)->isSaturday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isSaturday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SUNDAY)->isSaturday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::SUNDAY)->isSaturday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isSaturday()); } public function testIsStartOfMillisecond() { $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.999999')->isStartOfMillisecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45')->isStartOfMillisecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.123')->isStartOfMillisecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.000001')->isStartOfMillisecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.999999')->isStartOfMillisecond()); } public function testIsEndOfMillisecond() { $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.999999')->isEndOfMillisecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45')->isEndOfMillisecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.999999')->isEndOfMillisecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.999998')->isEndOfMillisecond()); } public function testIsStartOfSecond() { $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.999999')->isStartOfSecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45')->isStartOfSecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.000001')->isStartOfSecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.999999')->isStartOfSecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45')->isStartOfSecond(Unit::Millisecond)); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.000999')->isStartOfSecond(Unit::Millisecond)); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.001')->isStartOfSecond(Unit::Millisecond)); } public function testIsEndOfSecond() { $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.999999')->isEndOfSecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45')->isEndOfSecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.999999')->isEndOfSecond()); $this->assertFalse(Carbon::parse('2025-01-30 21:33:45.999998')->isEndOfSecond()); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.999998')->isEndOfSecond(Unit::Second)); $this->assertTrue(Carbon::parse('2025-01-30 21:33:45.123456')->isEndOfSecond(Unit::Second)); } public function testIsStartOfMinute() { $this->assertFalse(Carbon::parse('2025-01-30 21:33:59.999999')->isStartOfMinute()); $this->assertTrue(Carbon::parse('2025-01-01 22:34:00')->isStartOfMinute()); $this->assertFalse(Carbon::parse('2025-01-01 22:34:00.000001')->isStartOfMinute()); $this->assertFalse(Carbon::parse('2025-01-01 21:33:59.999999')->isStartOfMinute()); $this->assertTrue(Carbon::parse('2025-01-31 22:34:00')->isStartOfMinute(Unit::Second)); $this->assertTrue(Carbon::parse('2025-01-31 22:34:00.999999')->isStartOfMinute(Unit::Second)); $this->assertFalse(Carbon::parse('2025-02-01 22:34:01')->isStartOfMinute(Unit::Second)); $this->assertFalse(Carbon::parse('2025-01-02 21:33:59.999999')->isStartOfMinute()); $this->assertFalse(Carbon::parse('2025-12-31 21:33:59.999999')->isStartOfMinute()); } public function testIsEndOfMinute() { $this->assertTrue(Carbon::parse('2024-05-16 12:34:59.999999')->isEndOfMinute()); $this->assertFalse(Carbon::parse('2024-05-16 12:35:00')->isEndOfMinute()); $this->assertTrue(Carbon::parse('2024-05-16 12:34:59.999999')->isEndOfMinute()); $this->assertFalse(Carbon::parse('2024-05-16 12:34:59.999998')->isEndOfMinute()); $this->assertTrue(Carbon::parse('2024-05-16 12:34:59.999998')->isEndOfMinute(Unit::Second)); $this->assertTrue(Carbon::parse('2024-05-16 12:34:59.123456')->isEndOfMinute(Unit::Second)); } public function testIsStartOfHour() { $this->assertFalse(Carbon::parse('2025-01-30 21:59:59.999999')->isStartOfHour()); $this->assertTrue(Carbon::parse('2025-01-01 22:00:00')->isStartOfHour()); $this->assertFalse(Carbon::parse('2025-01-01 22:00:00.000001')->isStartOfHour()); $this->assertFalse(Carbon::parse('2025-01-01 21:59:59.999999')->isStartOfHour()); $this->assertTrue(Carbon::parse('2025-01-31 22:00:00')->isStartOfHour(Unit::Second)); $this->assertTrue(Carbon::parse('2025-01-31 22:00:00.999999')->isStartOfHour(Unit::Second)); $this->assertFalse(Carbon::parse('2025-02-01 22:00:01')->isStartOfHour(Unit::Second)); $this->assertFalse(Carbon::parse('2025-01-02 21:59:59.999999')->isStartOfHour()); $this->assertFalse(Carbon::parse('2025-12-31 21:59:59.999999')->isStartOfHour()); } public function testIsEndOfHour() { $this->assertTrue(Carbon::parse('2024-05-16 23:59:59.999999')->isEndOfHour()); $this->assertFalse(Carbon::parse('2024-05-16 00:00:00')->isEndOfHour()); $this->assertTrue(Carbon::parse('2024-05-16 23:59:59.999999')->isEndOfHour()); $this->assertFalse(Carbon::parse('2024-05-16 23:59:59.999998')->isEndOfHour()); $this->assertTrue(Carbon::parse('2024-05-16 23:59:59.999998')->isEndOfHour(Unit::Second)); $this->assertTrue(Carbon::parse('2024-05-16 23:59:59.123456')->isEndOfHour(Unit::Second)); } public function testIsStartOfDay() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay(false)); $this->assertTrue(Carbon::parse('00:00:00.999999')->isStartOfDay(false)); $this->assertTrue(Carbon::now()->startOfDay()->isStartOfDay(false)); $this->assertFalse(Carbon::parse('15:30:45')->isStartOfDay(false)); $this->assertFalse(Carbon::now()->endOfDay()->isStartOfDay(false)); $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay()); $this->assertTrue(Carbon::parse('00:00:00.999999')->isStartOfDay()); $this->assertTrue(Carbon::now()->startOfDay()->isStartOfDay()); $this->assertFalse(Carbon::parse('15:30:45')->isStartOfDay()); $this->assertFalse(Carbon::now()->endOfDay()->isStartOfDay()); } public function testIsStartOfDayWithMicroseconds() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay(true)); $this->assertTrue(Carbon::now()->startOfDay()->isStartOfDay(true)); $this->assertFalse(Carbon::parse('00:00:00.000001')->isStartOfDay(true)); } public function testIsStartOfDayInterval() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay('15 minutes')); $this->assertTrue(Carbon::parse('00:14:59.999999')->isStartOfDay('15 minutes')); $this->assertFalse(Carbon::parse('00:15:00')->isStartOfDay('15 minutes')); $this->assertTrue(Carbon::parse('00:59:59.999999')->isStartOfDay(Unit::Hour)); $this->assertFalse(Carbon::parse('01:00:00')->isStartOfDay(Unit::Hour)); $this->assertTrue(Carbon::parse('00:00:59.999999')->isStartOfDay(new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('00:01:00')->isStartOfDay(new DateInterval('PT1M'))); $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('00:14:59.999999')->isStartOfDay(interval: '15 minutes')); $this->assertFalse(Carbon::parse('00:15:00')->isStartOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('00:59:59.999999')->isStartOfDay(interval: Unit::Hour)); $this->assertFalse(Carbon::parse('01:00:00')->isStartOfDay(interval: Unit::Hour)); $this->assertTrue(Carbon::parse('00:00:59.999999')->isStartOfDay(interval: new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('00:01:00')->isStartOfDay(interval: new DateInterval('PT1M'))); $this->assertTrue(Carbon::parse('00:01:59.999999')->isStartOfDay(interval: CarbonInterval::minutes(2))); $this->assertFalse(Carbon::parse('00:02:00')->isStartOfDay(interval: CarbonInterval::minutes(2))); // Always false with negative interval $this->assertFalse(Carbon::parse('00:00:00')->isStartOfDay(interval: CarbonInterval::minutes(-2))); // Always true with interval bigger than 1 day $this->assertTrue(Carbon::parse('23:59:59.999999')->isStartOfDay(interval: CarbonInterval::hours(36))); } public function testIsStartOfUnit() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('00:00:00.000001')->isStartOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('00:00:01')->isStartOfUnit(Unit::Hour)); $this->assertTrue(Carbon::parse('00:00:00')->isStartOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('00:04:59.999999')->isStartOfUnit(Unit::Hour, '5 minutes')); $this->assertFalse(Carbon::parse('00:05:00')->isStartOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('Monday')->isStartOfUnit(Unit::Week)); $this->assertTrue(Carbon::parse('Monday 23:59:59.999999')->isStartOfUnit(Unit::Week)); $this->assertFalse(Carbon::parse('Tuesday')->isStartOfUnit(Unit::Week)); $this->assertFalse(Carbon::parse('Monday')->isStartOfUnit(Unit::Week, CarbonInterval::day(-1))); } public function testIsEndOfDay() { $this->assertTrue(Carbon::parse('23:59:59')->isEndOfDay(false)); $this->assertTrue(Carbon::parse('23:59:59.000000')->isEndOfDay(false)); $this->assertTrue(Carbon::now()->endOfDay()->isEndOfDay(false)); $this->assertFalse(Carbon::parse('15:30:45')->isEndOfDay(false)); $this->assertFalse(Carbon::now()->startOfDay()->isEndOfDay(false)); $this->assertTrue(Carbon::parse('23:59:59')->isEndOfDay()); $this->assertTrue(Carbon::parse('23:59:59.000000')->isEndOfDay()); $this->assertTrue(Carbon::now()->endOfDay()->isEndOfDay()); $this->assertFalse(Carbon::parse('15:30:45')->isEndOfDay()); $this->assertFalse(Carbon::now()->startOfDay()->isEndOfDay()); } public function testIsEndOfDayWithMicroseconds() { $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay(true)); $this->assertTrue(Carbon::now()->endOfDay()->isEndOfDay(true)); $this->assertFalse(Carbon::parse('23:59:59')->isEndOfDay(true)); $this->assertFalse(Carbon::parse('23:59:59.999998')->isEndOfDay(true)); } public function testIsEndOfDayInterval() { $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay('15 minutes')); $this->assertTrue(Carbon::parse('23:45:00')->isEndOfDay('15 minutes')); $this->assertFalse(Carbon::parse('23:44:59.999999')->isEndOfDay('15 minutes')); $this->assertTrue(Carbon::parse('23:00:00')->isEndOfDay(Unit::Hour)); $this->assertFalse(Carbon::parse('22:59:59.999999')->isEndOfDay(Unit::Hour)); $this->assertTrue(Carbon::parse('23:59:00')->isEndOfDay(new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('23:58:59.999999')->isEndOfDay(new DateInterval('PT1M'))); $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('23:45:00')->isEndOfDay(interval: '15 minutes')); $this->assertFalse(Carbon::parse('23:44:59.999999')->isEndOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('23:00:00')->isEndOfDay(interval: Unit::Hour)); $this->assertFalse(Carbon::parse('22:59:59.999999')->isEndOfDay(interval: Unit::Hour)); $this->assertTrue(Carbon::parse('23:59:00')->isEndOfDay(interval: new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('23:58:59.999999')->isEndOfDay(interval: new DateInterval('PT1M'))); // Always false with negative interval $this->assertFalse(Carbon::parse('00:00:00')->isEndOfDay(interval: CarbonInterval::minutes(-2))); // Always true with interval bigger than 1 day $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay(interval: CarbonInterval::hours(36))); } public function testIsEndOfUnit() { $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('23:59:59.999998')->isEndOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('23:59:59')->isEndOfUnit(Unit::Hour)); $this->assertTrue(Carbon::parse('23:55:00.000001')->isEndOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('23:55:00')->isEndOfUnit(Unit::Hour, '5 minutes')); $this->assertFalse(Carbon::parse('23:54:59.999999')->isEndOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('Sunday 23:59:59')->isEndOfUnit(Unit::Week, '2 days')); $this->assertTrue(Carbon::parse('Saturday 00:00')->isEndOfUnit(Unit::Week, '2 days')); $this->assertFalse(Carbon::parse('Saturday 00:00')->isEndOfUnit(Unit::Week)); $this->assertFalse(Carbon::parse('Friday 23:59:59.999999')->isEndOfUnit(Unit::Week, '2 days')); $this->assertFalse(Carbon::parse('Sunday 23:59:59.999999')->isEndOfUnit(Unit::Week, CarbonInterval::day(-1))); } public function testIsStartOfWeek() { $this->assertTrue(Carbon::parse('Monday 01:06:12')->isStartOfWeek()); $this->assertFalse(Carbon::parse('Saturday 01:06:12')->isStartOfWeek()); Carbon::setLocale('ar'); $this->assertTrue(Carbon::parse('Saturday 01:06:12')->isStartOfWeek()); $this->assertFalse(Carbon::parse('Monday 01:06:12')->isStartOfWeek()); $this->assertTrue(Carbon::parse('Sunday 01:06:12')->isStartOfWeek(weekStartsAt: WeekDay::Sunday)); $this->assertFalse(Carbon::parse('Saturday 01:06:12')->isStartOfWeek(weekStartsAt: WeekDay::Sunday)); $this->assertTrue(Carbon::parse('Saturday 01:06:12')->isStartOfWeek('2 hours')); $this->assertFalse(Carbon::parse('Saturday 01:06:12')->isStartOfWeek('1 hour')); } public function testIsEndOfWeek() { $this->assertTrue(Carbon::parse('Sunday 01:06:12')->isEndOfWeek()); $this->assertFalse(Carbon::parse('Friday 01:06:12')->isEndOfWeek()); Carbon::setLocale('ar'); $this->assertTrue(Carbon::parse('Friday 01:06:12')->isEndOfWeek()); $this->assertFalse(Carbon::parse('Sunday 01:06:12')->isEndOfWeek()); $this->assertTrue(Carbon::parse('Saturday 01:06:12')->isEndOfWeek(weekEndsAt: WeekDay::Saturday)); $this->assertFalse(Carbon::parse('Friday 01:06:12')->isEndOfWeek(weekEndsAt: WeekDay::Saturday)); $this->assertTrue(Carbon::parse('Friday 22:06:12')->isEndOfWeek('2 hours')); $this->assertFalse(Carbon::parse('Saturday 22:06:12')->isEndOfWeek('1 hour')); } public function testIsStartOfMonth() { $this->assertFalse(Carbon::parse('2024-01-31 23:59:59.999999')->isStartOfMonth()); $this->assertTrue(Carbon::parse('2024-02-01 00:00:00')->isStartOfMonth()); $this->assertTrue(Carbon::parse('2024-02-01 23:59:59.999999')->isStartOfMonth()); $this->assertTrue(Carbon::parse('2024-02-01 00:00:00')->isStartOfMonth(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2024-02-01 00:00:00.000001')->isStartOfMonth(Unit::Microsecond)); $this->assertTrue(Carbon::parse('2024-02-01 00:00:59')->isStartOfMonth(Unit::Minute)); $this->assertFalse(Carbon::parse('2024-02-01 00:01:00')->isStartOfMonth(Unit::Minute)); $this->assertFalse(Carbon::parse('2024-02-02 23:59:59.999999')->isStartOfMonth()); $this->assertFalse(Carbon::parse('2024-02-29 23:59:59.999999')->isStartOfMonth()); } public function testIsEndOfMonth() { $this->assertTrue(Carbon::parse('2024-01-31 23:59:59.999999')->isEndOfMonth()); $this->assertFalse(Carbon::parse('2024-02-01 00:00:00')->isEndOfMonth()); $this->assertFalse(Carbon::parse('2024-02-28 23:59:59.999999')->isEndOfMonth()); $this->assertTrue(Carbon::parse('2024-02-29 00:00:00')->isEndOfMonth()); $this->assertTrue(Carbon::parse('2024-02-29 23:59:59.999999')->isEndOfMonth()); $this->assertTrue(Carbon::parse('2024-02-29 23:59:59.999999')->isEndOfMonth(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2024-02-29 23:59:59.999998')->isEndOfMonth(Unit::Microsecond)); } public function testIsStartOfQuarter() { $this->assertFalse(Carbon::parse('2024-01-31 23:59:59.999999')->isStartOfQuarter()); $this->assertTrue(Carbon::parse('2024-01-01 00:00:00')->isStartOfQuarter()); $this->assertTrue(Carbon::parse('2024-01-01 23:59:59.999999')->isStartOfQuarter()); $this->assertTrue(Carbon::parse('2024-01-01 00:00:00')->isStartOfQuarter(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2024-01-01 00:00:00.000001')->isStartOfQuarter(Unit::Microsecond)); $this->assertTrue(Carbon::parse('2024-01-01 00:00:59')->isStartOfQuarter(Unit::Minute)); $this->assertFalse(Carbon::parse('2024-01-01 00:01:00')->isStartOfQuarter(Unit::Minute)); $this->assertFalse(Carbon::parse('2024-01-02 23:59:59.999999')->isStartOfQuarter()); $this->assertFalse(Carbon::parse('2024-03-31 23:59:59.999999')->isStartOfQuarter()); } public function testIsEndOfQuarter() { $this->assertTrue(Carbon::parse('2024-12-31 23:59:59.999999')->isEndOfQuarter()); $this->assertFalse(Carbon::parse('2024-03-01 00:00:00')->isEndOfQuarter()); $this->assertFalse(Carbon::parse('2024-03-30 23:59:59.999999')->isEndOfQuarter()); $this->assertTrue(Carbon::parse('2024-03-31 00:00:00')->isEndOfQuarter()); $this->assertTrue(Carbon::parse('2024-03-31 23:59:59.999999')->isEndOfQuarter()); $this->assertTrue(Carbon::parse('2024-03-31 23:59:59.999999')->isEndOfQuarter(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2024-03-31 23:59:59.999998')->isEndOfQuarter(Unit::Microsecond)); } public function testIsStartOfYear() { $this->assertFalse(Carbon::parse('2024-01-31 23:59:59.999999')->isStartOfYear()); $this->assertTrue(Carbon::parse('2024-01-01 00:00:00')->isStartOfYear()); $this->assertTrue(Carbon::parse('2024-01-01 23:59:59.999999')->isStartOfYear()); $this->assertTrue(Carbon::parse('2024-01-31 00:00:00')->isStartOfYear(Unit::Month)); $this->assertFalse(Carbon::parse('2024-02-01 00:00:00')->isStartOfYear(Unit::Month)); $this->assertFalse(Carbon::parse('2024-01-02 23:59:59.999999')->isStartOfYear()); $this->assertFalse(Carbon::parse('2024-12-31 23:59:59.999999')->isStartOfYear()); } public function testIsEndOfYear() { $this->assertTrue(Carbon::parse('2024-12-31 23:59:59.999999')->isEndOfYear()); $this->assertFalse(Carbon::parse('2024-03-01 00:00:00')->isEndOfYear()); $this->assertFalse(Carbon::parse('2024-03-30 23:59:59.999999')->isEndOfYear()); $this->assertTrue(Carbon::parse('2024-12-31 00:00:00')->isEndOfYear()); $this->assertTrue(Carbon::parse('2024-12-31 23:59:59.999999')->isEndOfYear()); $this->assertTrue(Carbon::parse('2024-12-31 23:59:59.999999')->isEndOfYear(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2024-12-31 23:59:59.999998')->isEndOfYear(Unit::Microsecond)); } public function testIsStartOfDecade() { $this->assertFalse(Carbon::parse('2019-01-31 23:59:59.999999')->isStartOfDecade()); $this->assertTrue(Carbon::parse('2020-01-01 00:00:00')->isStartOfDecade()); $this->assertTrue(Carbon::parse('2020-01-01 23:59:59.999999')->isStartOfDecade()); $this->assertTrue(Carbon::parse('2020-01-31 00:00:00')->isStartOfDecade(Unit::Month)); $this->assertFalse(Carbon::parse('2020-02-01 00:00:00')->isStartOfDecade(Unit::Month)); $this->assertFalse(Carbon::parse('2020-01-02 23:59:59.999999')->isStartOfDecade()); $this->assertFalse(Carbon::parse('2029-12-31 23:59:59.999999')->isStartOfDecade()); } public function testIsEndOfDecade() { $this->assertTrue(Carbon::parse('2019-12-31 23:59:59.999999')->isEndOfDecade()); $this->assertFalse(Carbon::parse('2020-01-01 00:00:00')->isEndOfDecade()); $this->assertFalse(Carbon::parse('2020-01-30 23:59:59.999999')->isEndOfDecade()); $this->assertTrue(Carbon::parse('2029-12-31 00:00:00')->isEndOfDecade()); $this->assertTrue(Carbon::parse('2029-12-31 23:59:59.999999')->isEndOfDecade()); $this->assertTrue(Carbon::parse('2029-12-31 23:59:59.999999')->isEndOfDecade(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2029-12-31 23:59:59.999998')->isEndOfDecade(Unit::Microsecond)); } public function testIsStartOfCentury() { $this->assertFalse(Carbon::parse('2000-01-31 23:59:59.999999')->isStartOfCentury()); $this->assertTrue(Carbon::parse('2001-01-01 00:00:00')->isStartOfCentury()); $this->assertTrue(Carbon::parse('2001-01-01 23:59:59.999999')->isStartOfCentury()); $this->assertTrue(Carbon::parse('2001-01-31 00:00:00')->isStartOfCentury(Unit::Month)); $this->assertFalse(Carbon::parse('2001-02-01 00:00:00')->isStartOfCentury(Unit::Month)); $this->assertFalse(Carbon::parse('2001-01-02 23:59:59.999999')->isStartOfCentury()); $this->assertFalse(Carbon::parse('2100-12-31 23:59:59.999999')->isStartOfCentury()); } public function testIsEndOfCentury() { $this->assertTrue(Carbon::parse('2000-12-31 23:59:59.999999')->isEndOfCentury()); $this->assertFalse(Carbon::parse('2001-01-01 00:00:00')->isEndOfCentury()); $this->assertFalse(Carbon::parse('2001-01-30 23:59:59.999999')->isEndOfCentury()); $this->assertTrue(Carbon::parse('2100-12-31 00:00:00')->isEndOfCentury()); $this->assertTrue(Carbon::parse('2100-12-31 23:59:59.999999')->isEndOfCentury()); $this->assertTrue(Carbon::parse('2100-12-31 23:59:59.999999')->isEndOfCentury(Unit::Microsecond)); $this->assertFalse(Carbon::parse('2100-12-31 23:59:59.999998')->isEndOfCentury(Unit::Microsecond)); } public function testIsStartOfMillennium() { $this->assertFalse(Carbon::parse('2000-01-31 23:59:59.999999')->isStartOfMillennium()); $this->assertTrue(Carbon::parse('2001-01-01 00:00:00')->isStartOfMillennium()); $this->assertTrue(Carbon::parse('2001-01-01 23:59:59.999999')->isStartOfMillennium()); $this->assertTrue(Carbon::parse('2001-01-31 00:00:00')->isStartOfMillennium(Unit::Month)); $this->assertFalse(Carbon::parse('2001-02-01 00:00:00')->isStartOfMillennium(Unit::Month)); $this->assertFalse(Carbon::parse('2001-01-02 23:59:59.999999')->isStartOfMillennium()); $this->assertFalse(Carbon::parse('3000-12-31 23:59:59.999999')->isStartOfMillennium()); } public function testIsEndOfMillennium() { $this->assertTrue(Carbon::parse('2000-12-31 23:59:59.999999')->isEndOfMillennium()); $this->assertFalse(Carbon::parse('2001-01-01 00:00:00')->isEndOfMillennium()); $this->assertFalse(Carbon::parse('2001-01-30 23:59:59.999999')->isEndOfMillennium()); $this->assertTrue(Carbon::parse('3000-12-31 00:00:00')->isEndOfMillennium()); $this->assertTrue(Carbon::parse('3000-12-31 23:59:59.999999')->isEndOfMillennium()); $this->assertTrue(Carbon::parse('3000-12-31 23:59:59.999999')->isEndOfMillennium(Unit::Microsecond)); $this->assertFalse(Carbon::parse('3000-12-31 23:59:59.999998')->isEndOfMillennium(Unit::Microsecond)); } public function testIsMidnight() { $this->assertTrue(Carbon::parse('00:00:00')->isMidnight()); $this->assertFalse(Carbon::parse('15:30:45')->isMidnight()); } public function testIsMidday() { $this->assertTrue(Carbon::parse('12:00:00')->isMidday()); $this->assertFalse(Carbon::parse('15:30:45')->isMidday()); } public function testHasFormat() { $this->assertTrue(Carbon::hasFormat('1975-05-01', 'Y-m-d')); $this->assertTrue(Carbon::hasFormat('12/30/2019', 'm/d/Y')); $this->assertTrue(Carbon::hasFormat('30/12/2019', 'd/m/Y')); $this->assertTrue(Carbon::hasFormat('Sun 21st', 'D jS')); $this->assertTrue(Carbon::hasFormat('2000-07-01T00:00:00+00:00', Carbon::ATOM)); $this->assertTrue(Carbon::hasFormat('Y-01-30\\', '\\Y-m-d\\\\')); // @see https://github.com/briannesbitt/Carbon/issues/2180 $this->assertTrue(Carbon::hasFormat('2020-09-01 12:00:00Europe/Moscow', 'Y-m-d H:i:se')); $this->assertTrue(Carbon::hasFormat('2012-12-04 22:59.32130', 'Y-m-d H:s.vi')); // Format failure $this->assertFalse(Carbon::hasFormat('', 'd m Y')); $this->assertFalse(Carbon::hasFormat('1975-05-01', 'd m Y')); $this->assertFalse(Carbon::hasFormat('1975-01-30\\', '\\Y-m-d\\\\')); $this->assertFalse(Carbon::hasFormat('Foo 21st', 'D jS')); $this->assertFalse(Carbon::hasFormat('Sun 51st', 'D jS')); $this->assertFalse(Carbon::hasFormat('Sun 21xx', 'D jS')); // Regex failure $this->assertFalse(Carbon::hasFormat('1975-5-1', 'Y-m-d')); $this->assertFalse(Carbon::hasFormat('19-05-01', 'Y-m-d')); $this->assertFalse(Carbon::hasFormat('30/12/2019', 'm/d/Y')); $this->assertFalse(Carbon::hasFormat('12/30/2019', 'd/m/Y')); $this->assertFalse(Carbon::hasFormat('1975-05-01', 'Y-m-d!')); $this->assertFalse(Carbon::hasFormat('1975-05-01', 'Y-m-d|')); $this->assertFalse(Carbon::hasFormat('1975-05-01', 'Y-*-d')); $this->assertTrue(Carbon::hasFormat('2012-12-04 22:59.32130', 'Y-m-d H:s.vi')); // New Zealand Daylight time $this->assertTrue(Carbon::hasFormat('2024-03-02T00:00:00+13:00', 'Y-m-d\TH:i:sP')); } public function testHasFormatWithModifiers() { $this->assertTrue(Carbon::hasFormatWithModifiers('2021-05-03T00:00:00+02:00', 'Y-m-d\TH:i:sp')); $this->assertTrue(Carbon::hasFormatWithModifiers('2021-05-03T00:00:00+02:00', 'Y-m-d\TH:i:sP')); $this->assertTrue(Carbon::hasFormatWithModifiers('2021-05-03T00:00:00Z', 'Y-m-d\TH:i:sp')); $this->assertTrue(Carbon::hasFormatWithModifiers('1975-05-01', 'Y-m-d!')); $this->assertTrue(Carbon::hasFormatWithModifiers('1975-05-01', 'Y-m-d|')); $this->assertTrue(Carbon::hasFormatWithModifiers('1975-05-01', 'Y-*-d')); $this->assertTrue(Carbon::hasFormatWithModifiers('1975-05-01', 'Y-??-d!')); $this->assertTrue(Carbon::hasFormatWithModifiers('1975-05-01', 'Y#m#d')); $this->assertTrue(Carbon::hasFormatWithModifiers('1975/05/31', 'Y#m#d')); $this->assertFalse(Carbon::hasFormatWithModifiers('2021-05-03T00:00:00Z', 'Y-m-d\TH:i:sP')); $this->assertFalse(Carbon::hasFormatWithModifiers('1975/31/05', 'Y#m#d')); $this->assertFalse(Carbon::hasFormatWithModifiers('1975-05-01', 'Y-?-d|')); $this->assertFalse(Carbon::hasFormatWithModifiers('1975--01', 'Y-*-d')); $this->assertFalse(Carbon::hasFormatWithModifiers('1975705-01', 'Y#m#d')); } public static function dataForFormatLetters(): array { return [ 'd' => ['d'], 'D' => ['D'], 'j' => ['j'], 'l' => ['l'], 'N' => ['N'], 'S' => ['S'], 'w' => ['w'], 'z' => ['z'], 'W' => ['W'], 'F' => ['F'], 'm' => ['m'], 'M' => ['M'], 'n' => ['n'], 't' => ['t'], 'L' => ['L'], 'o' => ['o'], 'Y' => ['Y'], 'y' => ['y'], 'a' => ['a'], 'A' => ['A'], 'B' => ['B'], 'g' => ['g'], 'G' => ['G'], 'h' => ['h'], 'H' => ['H'], 'i' => ['i'], 's' => ['s'], 'u' => ['u'], 'v' => ['v'], 'e' => ['e'], 'I' => ['I'], 'O' => ['O'], 'P' => ['P'], 'T' => ['T'], 'Z' => ['Z'], 'U' => ['U'], 'c' => ['c'], 'r' => ['r'], ]; } #[DataProvider('dataForFormatLetters')] public function testHasFormatWithSingleLetter($letter) { $output = Carbon::now()->format($letter); $this->assertTrue(Carbon::hasFormat($output, $letter), "'$letter' format should match '$output'"); } public function testCanBeCreatedFromFormat() { $this->assertTrue(Carbon::canBeCreatedFromFormat('1975-05-01', 'Y-m-d')); $this->assertTrue(Carbon::canBeCreatedFromFormat('12/30/2019', 'm/d/Y')); $this->assertFalse(Carbon::canBeCreatedFromFormat(null, 'Y-m-d')); $this->assertFalse(Carbon::canBeCreatedFromFormat('1975-05-01', 'd m Y')); $this->assertFalse(Carbon::canBeCreatedFromFormat('1975-5-1', 'Y-m-d')); $this->assertFalse(Carbon::canBeCreatedFromFormat('19-05-01', 'Y-m-d')); $this->assertFalse(Carbon::canBeCreatedFromFormat('30/12/2019', 'm/d/Y')); $this->assertFalse(Carbon::canBeCreatedFromFormat('12/30/2019', 'd/m/Y')); $this->assertFalse(Carbon::canBeCreatedFromFormat('5', 'N')); } public function testIsSameFoobar() { $this->expectExceptionObject(new BadMethodCallException( 'Method isSameFoobar does not exist.', )); /** @var mixed $date */ $date = Carbon::parse('12:00:00'); $date->isSameFoobar(Carbon::parse('15:30:45')); } public function testIsCurrentFoobar() { $this->expectExceptionObject(new BadMethodCallException( 'Method isCurrentFoobar does not exist.', )); /** @var mixed $date */ $date = Carbon::parse('12:00:00'); $date->isCurrentFoobar(); } #[TestWith([null])] #[TestWith(['2025-03-31 12:00'])] public function testIs(?string $testNow) { Carbon::setTestNow($testNow); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2018')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2018-06')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-07')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('06-03')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('05-02')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-03')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-05-02')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2020-06-02')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('Monday')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is(WeekDay::Sunday)); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is(WeekDay::Monday)); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('June')); $this->assertTrue(Carbon::parse('2019-05-31 12:23:45')->is('May')); $this->assertTrue(Carbon::parse('2019-05-31 12:23:45')->is('mAy')); $this->assertFalse(Carbon::parse('2019-05-31 12:23:45')->is('April')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('May')); $this->assertTrue(Carbon::parse('2019-05-31 12:23:45')->is(Month::May)); $this->assertFalse(Carbon::parse('2019-05-31 12:23:45')->is(Month::April)); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('12:26')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('12h')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('15h')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('12:00')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('15:00')); $this->assertTrue(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); $this->assertFalse(Carbon::parse('2019-06-02 15:23:45')->is('4pm')); $this->assertFalse(Carbon::parse('2019-06-02 15:23:45')->is('3am')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); $this->assertTrue(Carbon::parse('2019-05-31 12:23:45')->is('2019-05')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02 12:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-03 12:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02 15:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02 12:33')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2 June 2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('1 June 2019')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('June 2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('August 2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('June 2018')); } #[TestWith([null])] #[TestWith(['2024-02-29 12:00'])] #[TestWith(['2024-03-01 12:00'])] #[TestWith(['2025-02-28 12:00'])] #[TestWith(['2025-03-01 12:00'])] public function testIsFebruary29(?string $testNow) { Carbon::setTestNow($testNow); $this->assertTrue(Carbon::parse('2024-02-29 12:23:45')->is('02-29')); $this->assertFalse(Carbon::parse('2025-02-29 12:23:45')->is('02-29')); $this->assertFalse(Carbon::parse('2025-03-01 12:23:45')->is('02-29')); $this->assertFalse(Carbon::parse('2024-02-29 12:23:45')->is('03-01')); $this->assertTrue(Carbon::parse('2025-02-29 12:23:45')->is('03-01')); // overflow $this->assertTrue(Carbon::parse('2025-03-01 12:23:45')->is('03-01')); } public function testHasFormatWithDots() { $this->assertTrue(Carbon::hasFormat('2020.09.09', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020009009', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020-09-09', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020*09*09', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020k09d09', 'Y.m.d')); } } ================================================ FILE: tests/Carbon/IssetTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class IssetTest extends AbstractTestCase { public function testIssetReturnFalseForUnknownProperty(): void { $this->assertFalse(isset($this->now->sdfsdfss)); } public static function dataForTestIssetReturnTrueForProperties(): Generator { yield ['age']; yield ['century']; yield ['day']; yield ['dayName']; yield ['dayOfWeek']; yield ['dayOfWeekIso']; yield ['dayOfYear']; yield ['daysInMonth']; yield ['daysInYear']; yield ['decade']; yield ['dst']; yield ['englishDayOfWeek']; yield ['englishMonth']; yield ['firstWeekDay']; yield ['hour']; yield ['isoWeek']; yield ['isoWeekYear']; yield ['isoWeeksInYear']; yield ['lastWeekDay']; yield ['latinMeridiem']; yield ['latinUpperMeridiem']; yield ['local']; yield ['locale']; yield ['localeDayOfWeek']; yield ['localeMonth']; yield ['meridiem']; yield ['micro']; yield ['microsecond']; yield ['millennium']; yield ['milli']; yield ['millisecond']; yield ['milliseconds']; yield ['minDayName']; yield ['minute']; yield ['month']; yield ['monthName']; yield ['noZeroHour']; yield ['offset']; yield ['offsetHours']; yield ['offsetMinutes']; yield ['quarter']; yield ['second']; yield ['shortDayName']; yield ['shortEnglishDayOfWeek']; yield ['shortEnglishMonth']; yield ['shortLocaleDayOfWeek']; yield ['shortLocaleMonth']; yield ['shortMonthName']; yield ['timestamp']; yield ['timezone']; yield ['timezoneAbbreviatedName']; yield ['timezoneName']; yield ['tz']; yield ['tzAbbrName']; yield ['tzName']; yield ['upperMeridiem']; yield ['utc']; yield ['week']; yield ['weekNumberInMonth']; yield ['weekOfMonth']; yield ['weekOfYear']; yield ['weekYear']; yield ['weeksInYear']; yield ['year']; yield ['yearIso']; } #[DataProvider('dataForTestIssetReturnTrueForProperties')] public function testIssetReturnTrueForProperties(string $property): void { Carbon::useStrictMode(false); $this->assertTrue(isset($this->now->{$property})); } } ================================================ FILE: tests/Carbon/JsonSerializationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCaseWithOldNow; class JsonSerializationTest extends AbstractTestCaseWithOldNow { public function testCarbonAllowsCustomSerializer() { Carbon::serializeUsing(function (Carbon $carbon) { return $carbon->getTimestamp(); }); $result = json_decode(json_encode(Carbon::now()), true); $this->assertSame(1498569255, $result); } public function testCarbonAllowsCustomSerializerString() { Carbon::serializeUsing('Y-m-d'); $this->assertSame('"2017-06-27"', json_encode(Carbon::now())); } public function testCarbonAllowsCustomSerializerViaSettings() { $date = Carbon::now()->settings([ 'toJsonFormat' => 'H:i:s', ]); $this->assertSame('"13:14:15"', json_encode($date)); } public function testCarbonCanSerializeToJson() { $this->assertSame('2017-06-27T13:14:15.000000Z', Carbon::now()->jsonSerialize()); } } ================================================ FILE: tests/Carbon/LastErrorTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Traits\Creator; use DateTime; use PHPUnit\Framework\Attributes\RequiresPhp; use Tests\AbstractTestCase; class LastErrorTest extends AbstractTestCase { /** * @var array */ protected $lastErrors; /** * @var array */ protected $noErrors; protected function setUp(): void { parent::setUp(); $this->lastErrors = [ 'warning_count' => 1, 'warnings' => ['11' => 'The parsed date was invalid'], 'error_count' => 0, 'errors' => [], ]; } #[RequiresPhp('>=8.2')] public function testCreateHandlesLastErrors() { $carbon = new Carbon('2017-02-30'); $datetime = new DateTime('2017-02-30'); $this->assertSame($this->lastErrors, $carbon->getLastErrors()); $this->assertSame($carbon->getLastErrors(), $datetime->getLastErrors()); $carbon = new Carbon('2017-02-15'); $this->assertFalse($carbon->getLastErrors()); } public function testLastErrorsInitialization() { $obj = new class() { use Creator; /** @phpstan-ignore-next-line */ public function __construct($time = null, $tz = null) { } public function triggerError() { self::setLastErrors([ 'warning_count' => 1, 'warnings' => ['11' => 'The parsed date was invalid'], 'error_count' => 0, 'errors' => [], ]); } }; $this->assertFalse($obj::getLastErrors()); $obj->triggerError(); $this->assertSame($this->lastErrors, $obj::getLastErrors()); } } ================================================ FILE: tests/Carbon/LocalizationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\Language; use Carbon\Translator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\TestWith; use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Translation\Loader\ArrayLoader; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\Translator as SymfonyTranslator; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\MyCarbon; use Tests\Carbon\Fixtures\NoLocaleTranslator; #[Group('localization')] class LocalizationTest extends AbstractTestCase { public function testGetTranslator() { /** @var Translator $t */ $t = Carbon::getTranslator(); $this->assertNotNull($t); $this->assertSame('en', $t->getLocale()); } public function testResetTranslator() { /** @var Translator $t */ $t = MyCarbon::getTranslator(); $this->assertNotNull($t); $this->assertSame('en', $t->getLocale()); } #[TestWith([ 'fr', ['fr_FR.UTF-8', 'fr_FR.utf8', 'fr_FR', 'fr'], 'il y a 2 secondes', ])] #[TestWith([ 'sr', ['sr_ME.UTF-8', 'sr_ME.utf8', 'sr_ME', 'sr'], ['pre 2 sekunde' /* sr */, 'prije 2 sekunde' /* sr_ME */], ])] #[TestWith([ 'zh', ['zh_TW.UTF-8', 'zh_TW.utf8', 'zh_TW', 'zh'], '2秒前', ])] public function testSetLocaleToAutoFromSupportedLocale(string $language, array $locales, array|string $twoSecondsAgo) { $currentLocale = setlocale(LC_ALL, '0'); $this->setLocaleOrSkip(...$locales); try { Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); } finally { setlocale(LC_ALL, $currentLocale); } $this->assertStringStartsWith($language, $locale); $this->assertContains($diff, (array) $twoSecondsAgo); } public function testSetLocaleToAutoFromUnsupportedLocale() { $currentLocale = setlocale(LC_ALL, '0'); $this->setLocaleOrSkip('ar_AE.UTF-8', 'ar_AE.utf8', 'ar_AE', 'ar'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); $translator->setLocale('en'); $directories = $translator->getDirectories(); $directory = sys_get_temp_dir().'/carbon'.mt_rand(0, 9999999); mkdir($directory); foreach (glob(__DIR__.'/../../src/Carbon/Lang/*.php') as $file) { copy($file, "$directory/".basename($file)); } try { $translator->setDirectories([$directory]); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); } finally { $translator->setDirectories([$directory]); setlocale(LC_ALL, $currentLocale); $this->remove($directory); $translator->setDirectories($directories); } $this->assertStringStartsWith('ar', $locale); $this->assertSame('منذ ثانيتين', $diff); } public function testSetLocaleToAutoFallback() { $currentLocale = setlocale(LC_ALL, '0'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); $translator->setLocale('en'); $directories = $translator->getDirectories(); $directory = sys_get_temp_dir().'/carbon'.mt_rand(0, 9999999); try { $this->setLocaleOrSkip('fr_FR.UTF-8', 'fr_FR.utf8', 'fr_FR', 'fr'); mkdir($directory); $files = [ 'en', 'zh_Hans', 'zh', 'fr', 'fr_CA', ]; foreach ($files as $file) { copy(__DIR__."/../../src/Carbon/Lang/$file.php", "$directory/$file.php"); } $translator->setDirectories([$directory]); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); setlocale(LC_ALL, $currentLocale); $this->assertSame('fr', $locale); $this->assertSame('il y a 2 secondes', $diff); $this->setLocaleOrSkip('zh_CN.UTF-8', 'zh_CN.utf8', 'zh_CN', 'zh'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); setlocale(LC_ALL, $currentLocale); $this->assertSame('zh', $locale); $this->assertSame('2秒前', $diff); $this->setLocaleOrSkip('yo_NG.UTF-8', 'yo_NG.utf8', 'yo_NG', 'yo'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); Carbon::setLocale('en'); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); setlocale(LC_ALL, $currentLocale); $this->assertSame('en', $locale); $this->assertSame('2 seconds ago', $diff); } finally { setlocale(LC_ALL, $currentLocale); $translator->setDirectories($directories); $this->remove($directory); } } /** * @see \Tests\Carbon\LocalizationTest::testSetLocale * @see \Tests\Carbon\LocalizationTest::testSetTranslator */ public static function dataForLocales(): array { return [ 'af' => ['af'], 'ar' => ['ar'], 'ar_DZ' => ['ar_DZ'], 'ar_KW' => ['ar_KW'], 'ar_LY' => ['ar_LY'], 'ar_MA' => ['ar_MA'], 'ar_SA' => ['ar_SA'], 'ar_Shakl' => ['ar_Shakl'], 'ar_TN' => ['ar_TN'], 'az' => ['az'], 'be' => ['be'], 'bg' => ['bg'], 'bm' => ['bm'], 'bn' => ['bn'], 'bo' => ['bo'], 'br' => ['br'], 'bs' => ['bs'], 'bs_BA' => ['bs_BA'], 'ca' => ['ca'], 'cs' => ['cs'], 'cv' => ['cv'], 'cy' => ['cy'], 'da' => ['da'], 'de' => ['de'], 'de_AT' => ['de_AT'], 'de_CH' => ['de_CH'], 'dv' => ['dv'], 'dv_MV' => ['dv_MV'], 'el' => ['el'], 'en' => ['en'], 'en_AU' => ['en_AU'], 'en_CA' => ['en_CA'], 'en_GB' => ['en_GB'], 'en_IE' => ['en_IE'], 'en_IL' => ['en_IL'], 'en_NZ' => ['en_NZ'], 'eo' => ['eo'], 'es' => ['es'], 'es_DO' => ['es_DO'], 'es_US' => ['es_US'], 'et' => ['et'], 'eu' => ['eu'], 'fa' => ['fa'], 'fi' => ['fi'], 'fo' => ['fo'], 'fr' => ['fr'], 'fr_CA' => ['fr_CA'], 'fr_CH' => ['fr_CH'], 'fy' => ['fy'], 'gd' => ['gd'], 'gl' => ['gl'], 'gom_Latn' => ['gom_Latn'], 'gu' => ['gu'], 'he' => ['he'], 'hi' => ['hi'], 'hr' => ['hr'], 'hu' => ['hu'], 'hy' => ['hy'], 'hy_AM' => ['hy_AM'], 'id' => ['id'], 'is' => ['is'], 'it' => ['it'], 'ja' => ['ja'], 'jv' => ['jv'], 'ka' => ['ka'], 'kk' => ['kk'], 'km' => ['km'], 'kn' => ['kn'], 'ko' => ['ko'], 'ku' => ['ku'], 'ky' => ['ky'], 'lb' => ['lb'], 'lo' => ['lo'], 'lt' => ['lt'], 'lv' => ['lv'], 'me' => ['me'], 'mi' => ['mi'], 'mk' => ['mk'], 'ml' => ['ml'], 'mn' => ['mn'], 'mr' => ['mr'], 'ms' => ['ms'], 'ms_MY' => ['ms_MY'], 'mt' => ['mt'], 'my' => ['my'], 'nb' => ['nb'], 'ne' => ['ne'], 'nl' => ['nl'], 'nl_BE' => ['nl_BE'], 'nn' => ['nn'], 'no' => ['no'], 'oc' => ['oc'], 'pa_IN' => ['pa_IN'], 'pl' => ['pl'], 'ps' => ['ps'], 'pt' => ['pt'], 'pt_BR' => ['pt_BR'], 'ro' => ['ro'], 'ru' => ['ru'], 'sd' => ['sd'], 'se' => ['se'], 'sh' => ['sh'], 'si' => ['si'], 'sk' => ['sk'], 'sl' => ['sl'], 'sq' => ['sq'], 'sr' => ['sr'], 'sr_Cyrl' => ['sr_Cyrl'], 'sr_Cyrl_ME' => ['sr_Cyrl_ME'], 'sr_Latn_ME' => ['sr_Latn_ME'], 'sr_ME' => ['sr_ME'], 'ss' => ['ss'], 'sv' => ['sv'], 'sw' => ['sw'], 'ta' => ['ta'], 'te' => ['te'], 'tet' => ['tet'], 'tg' => ['tg'], 'th' => ['th'], 'tl_PH' => ['tl_PH'], 'tlh' => ['tlh'], 'tr' => ['tr'], 'tzl' => ['tzl'], 'tzm' => ['tzm'], 'tzm_Latn' => ['tzm_Latn'], 'ug_CN' => ['ug_CN'], 'uk' => ['uk'], 'ur' => ['ur'], 'uz' => ['uz'], 'uz_Latn' => ['uz_Latn'], 'vi' => ['vi'], 'yo' => ['yo'], 'zh' => ['zh'], 'zh_CN' => ['zh_CN'], 'zh_HK' => ['zh_HK'], 'zh_TW' => ['zh_TW'], ]; } #[DataProvider('dataForLocales')] public function testSetLocale(string $locale) { Carbon::setLocale($locale); $this->assertTrue($this->areSameLocales($locale, Carbon::getLocale())); } #[DataProvider('dataForLocales')] public function testSetTranslator(string $locale) { $ori = Carbon::getTranslator(); $t = new Translator($locale); $t->addLoader('array', new ArrayLoader()); Carbon::setTranslator($t); /** @var Translator $t */ $t = Carbon::getTranslator(); $this->assertNotNull($t); $this->assertTrue($this->areSameLocales($locale, $t->getLocale())); $this->assertTrue($this->areSameLocales($locale, Carbon::now()->locale())); Carbon::setTranslator($ori); } public function testSetLocaleWithKnownLocale() { Carbon::setLocale('fr'); $this->assertSame('fr', Carbon::getLocale()); } #[TestWith(['DE'])] #[TestWith(['pt-BR'])] #[TestWith(['pt-br'])] #[TestWith(['PT-br'])] #[TestWith(['PT-BR'])] #[TestWith(['pt_br'])] #[TestWith(['PT_br'])] #[TestWith(['PT_BR'])] public function testSetLocaleWithMalformedLocale(string $malformedLocale) { Carbon::setLocale($malformedLocale); $split = preg_split('/[-_]/', $malformedLocale); $this->assertSame( strtolower($split[0]).(\count($split) === 1 ? '' : '_'.strtoupper($split[1])), Carbon::getLocale(), ); } public function testSetLocaleWithNonExistingLocale() { Carbon::setLocale('pt-XX'); $this->assertSame('pt', Carbon::getLocale()); } public function testSetLocaleWithUnknownLocale() { Carbon::setLocale('zz'); $this->assertSame('en', Carbon::getLocale()); } public function testCustomTranslation() { Carbon::setLocale('en'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); /** @var MessageCatalogue $messages */ $messages = $translator->getCatalogue('en'); $resources = $messages->all('messages'); $resources['day'] = '1 boring day|%count% boring days'; $translator->addResource('array', $resources, 'en'); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); $this->assertSame('3 boring days 4 hours', $diff); Carbon::setLocale('en'); } public function testCustomLocalTranslation() { $boringLanguage = 'en_Overboring'; $translator = Translator::get($boringLanguage); $translator->setTranslations([ 'day' => ':count boring day|:count boring days', ]); $date1 = Carbon::create(2018, 1, 1, 0, 0, 0); $date2 = Carbon::create(2018, 1, 4, 4, 0, 0); $this->assertSame('3 boring days before', $date1->locale($boringLanguage)->diffForHumans($date2)); $translator->setTranslations([ 'before' => function ($time) { return '['.strtoupper($time).']'; }, ]); $this->assertSame('[3 BORING DAYS]', $date1->locale($boringLanguage)->diffForHumans($date2)); $meridiem = Translator::get('ru')->trans('meridiem', [ 'hours' => 9, 'minutes' => 30, 'seconds' => 0, ]); $this->assertSame('утра', $meridiem); } public function testAddCustomTranslation() { $enBoring = [ 'day' => '1 boring day|%count% boring days', ]; Carbon::setLocale('en'); $this->assertSame('en', Carbon::getLocale()); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages('en', $enBoring); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); $this->assertSame('3 boring days 4 hours', $diff); $translator->resetMessages('en'); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); $this->assertSame('3 days 4 hours', $diff); $translator->setMessages('en_Boring', $enBoring); $this->assertSame($enBoring, $translator->getMessages('en_Boring')); $messages = $translator->getMessages(); $this->assertArrayHasKey('en', $messages); $this->assertArrayHasKey('en_Boring', $messages); $this->assertSame($enBoring, $messages['en_Boring']); Carbon::setLocale('en_Boring'); $this->assertSame('en_Boring', Carbon::getLocale()); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); // en_Boring inherit en because it starts with "en", see symfony-translation behavior $this->assertSame('3 boring days 4 hours', $diff); Carbon::setLocale('en'); $diff = Carbon::parse('2018-01-01') ->diffForHumans('2018-01-04 04:00', [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'parts' => 2, 'locale' => 'de', ]); $this->assertSame('3 Tage 4 Stunden', $diff); $translator->resetMessages(); $diff = Carbon::parse('2018-01-01') ->diffForHumans('2018-01-04 04:00', [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'parts' => 2, 'locale' => 'de', ]); $this->assertSame('3 Tage 4 Stunden', $diff); $this->assertSame([], $translator->getMessages()); $this->assertSame('en', Carbon::getLocale()); } public function testLocaleOption() { $translator = Translator::get('en_Boring'); $translator->setTranslations([ 'day' => ':count boring day|:count boring days', ]); $diff = Carbon::parse('2018-01-01') ->diffForHumans('2018-01-04 04:00', [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'parts' => 2, 'locale' => 'en_Boring', ]); $translator->setLocale('en'); $translator->resetMessages(); $this->assertSame('3 boring days 4 hours', $diff); } public function testCustomWeekStart() { Carbon::setLocale('ru'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages('ru', [ 'first_day_of_week' => 1, ]); $calendar = Carbon::parse('2018-07-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-07 00:00:00')); $this->assertSame('В следующий вторник, в 0:00', $calendar); $calendar = Carbon::parse('2018-07-12 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-12 00:00:00')); $this->assertSame('В воскресенье, в 0:00', $calendar); $translator->setMessages('ru', [ 'first_day_of_week' => 5, ]); $calendar = Carbon::parse('2018-07-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-07 00:00:00')); $this->assertSame('Во вторник, в 0:00', $calendar); $calendar = Carbon::parse('2018-07-12 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-12 00:00:00')); $this->assertSame('В следующее воскресенье, в 0:00', $calendar); $translator->resetMessages('ru'); Carbon::setLocale('en'); } public function testAddAndRemoveDirectory() { $directory = sys_get_temp_dir().'/carbon'.mt_rand(0, 9999999); mkdir($directory); copy(__DIR__.'/../../src/Carbon/Lang/fr.php', "$directory/foo.php"); copy(__DIR__.'/../../src/Carbon/Lang/fr.php', "$directory/bar.php"); /** @var Translator $translator */ $translator = Carbon::getTranslator(); Carbon::setLocale('en'); Carbon::setLocale('foo'); $this->assertSame('Saturday', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); $translator->addDirectory($directory); Carbon::setLocale('foo'); $this->assertSame('samedi', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); Carbon::setLocale('en'); $translator->removeDirectory($directory); Carbon::setLocale('bar'); $this->assertSame('Saturday', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); Carbon::setLocale('foo'); $this->assertSame('samedi', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); Carbon::setLocale('en'); } public function testLocaleHasShortUnits() { $withShortUnit = [ 'year' => 'foo', 'y' => 'bar', ]; $withShortHourOnly = [ 'year' => 'foo', 'y' => 'foo', 'day' => 'foo', 'd' => 'foo', 'hour' => 'foo', 'h' => 'bar', ]; $withoutShortUnit = [ 'year' => 'foo', ]; $withSameShortUnit = [ 'year' => 'foo', 'y' => 'foo', ]; $withShortHourOnlyLocale = 'zz_'.ucfirst(strtolower('withShortHourOnly')); $withShortUnitLocale = 'zz_'.ucfirst(strtolower('withShortUnit')); $withoutShortUnitLocale = 'zz_'.ucfirst(strtolower('withoutShortUnit')); $withSameShortUnitLocale = 'zz_'.ucfirst(strtolower('withSameShortUnit')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withShortUnitLocale, $withShortUnit); $translator->setMessages($withShortHourOnlyLocale, $withShortHourOnly); $translator->setMessages($withoutShortUnitLocale, $withoutShortUnit); $translator->setMessages($withSameShortUnitLocale, $withSameShortUnit); $this->assertTrue(Carbon::localeHasShortUnits($withShortUnitLocale)); $this->assertTrue(Carbon::localeHasShortUnits($withShortHourOnlyLocale)); $this->assertFalse(Carbon::localeHasShortUnits($withoutShortUnitLocale)); $this->assertFalse(Carbon::localeHasShortUnits($withSameShortUnitLocale)); } public function testLocaleHasDiffSyntax() { $withDiffSyntax = [ 'year' => 'foo', 'ago' => ':time ago', 'from_now' => ':time from now', 'after' => ':time after', 'before' => ':time before', ]; $withoutDiffSyntax = [ 'year' => 'foo', ]; $withDiffSyntaxLocale = 'zz_'.ucfirst(strtolower('withDiffSyntax')); $withoutDiffSyntaxLocale = 'zz_'.ucfirst(strtolower('withoutDiffSyntax')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withDiffSyntaxLocale, $withDiffSyntax); $translator->setMessages($withoutDiffSyntaxLocale, $withoutDiffSyntax); $this->assertTrue(Carbon::localeHasDiffSyntax($withDiffSyntaxLocale)); $this->assertFalse(Carbon::localeHasDiffSyntax($withoutDiffSyntaxLocale)); $this->assertTrue(Carbon::localeHasDiffSyntax('ka')); $this->assertFalse(Carbon::localeHasDiffSyntax('foobar')); } public function testLocaleHasDiffOneDayWords() { $withOneDayWords = [ 'year' => 'foo', 'diff_now' => 'just now', 'diff_yesterday' => 'yesterday', 'diff_tomorrow' => 'tomorrow', ]; $withoutOneDayWords = [ 'year' => 'foo', ]; $withOneDayWordsLocale = 'zz_'.ucfirst(strtolower('withOneDayWords')); $withoutOneDayWordsLocale = 'zz_'.ucfirst(strtolower('withoutOneDayWords')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withOneDayWordsLocale, $withOneDayWords); $translator->setMessages($withoutOneDayWordsLocale, $withoutOneDayWords); $this->assertTrue(Carbon::localeHasDiffOneDayWords($withOneDayWordsLocale)); $this->assertFalse(Carbon::localeHasDiffOneDayWords($withoutOneDayWordsLocale)); } public function testLocaleHasDiffTwoDayWords() { $withTwoDayWords = [ 'year' => 'foo', 'diff_before_yesterday' => 'before yesterday', 'diff_after_tomorrow' => 'after tomorrow', ]; $withoutTwoDayWords = [ 'year' => 'foo', ]; $withTwoDayWordsLocale = 'zz_'.ucfirst(strtolower('withTwoDayWords')); $withoutTwoDayWordsLocale = 'zz_'.ucfirst(strtolower('withoutTwoDayWords')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withTwoDayWordsLocale, $withTwoDayWords); $translator->setMessages($withoutTwoDayWordsLocale, $withoutTwoDayWords); $this->assertTrue(Carbon::localeHasDiffTwoDayWords($withTwoDayWordsLocale)); $this->assertFalse(Carbon::localeHasDiffTwoDayWords($withoutTwoDayWordsLocale)); } public function testLocaleHasPeriodSyntax() { $withPeriodSyntax = [ 'year' => 'foo', 'period_recurrences' => 'once|%count% times', 'period_interval' => 'every :interval', 'period_start_date' => 'from :date', 'period_end_date' => 'to :date', ]; $withoutPeriodSyntax = [ 'year' => 'foo', ]; $withPeriodSyntaxLocale = 'zz_'.ucfirst(strtolower('withPeriodSyntax')); $withoutPeriodSyntaxLocale = 'zz_'.ucfirst(strtolower('withoutPeriodSyntax')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withPeriodSyntaxLocale, $withPeriodSyntax); $translator->setMessages($withoutPeriodSyntaxLocale, $withoutPeriodSyntax); $this->assertTrue(Carbon::localeHasPeriodSyntax($withPeriodSyntaxLocale)); $this->assertFalse(Carbon::localeHasPeriodSyntax($withoutPeriodSyntaxLocale)); $this->assertTrue(Carbon::localeHasPeriodSyntax('nl')); } public function testGetAvailableLocales() { $this->assertCount(\count(glob(__DIR__.'/../../src/Carbon/Lang/*.php')), Carbon::getAvailableLocales()); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages('zz_ZZ', []); $this->assertContains('zz_ZZ', Carbon::getAvailableLocales()); Carbon::setTranslator(new SymfonyTranslator('en')); $this->assertSame(['en'], Carbon::getAvailableLocales()); } public function testGetAvailableLocalesInfo() { $infos = Carbon::getAvailableLocalesInfo(); $this->assertCount(\count(Carbon::getAvailableLocales()), Carbon::getAvailableLocalesInfo()); $this->assertArrayHasKey('en', $infos); $this->assertInstanceOf(Language::class, $infos['en']); $this->assertSame('English', $infos['en']->getIsoName()); } public function testGeorgianSpecialFromNowTranslation() { $diff = Carbon::now()->locale('ka')->addWeeks(3)->diffForHumans(); $this->assertSame('3 კვირაში', $diff); } public function testSinhaleseSpecialAfterTranslation() { $diff = Carbon::now()->locale('si')->addDays(3)->diffForHumans(Carbon::now()); $this->assertSame('දින 3 න්', $diff); } public function testWeekDayMultipleForms() { $date = Carbon::parse('2018-10-10')->locale('ru'); $this->assertSame('в среду', $date->isoFormat('[в] dddd')); $this->assertSame('среда, 10 октября 2018', $date->isoFormat('dddd, D MMMM YYYY')); $this->assertSame('среда', $date->dayName); $this->assertSame('ср', $date->isoFormat('dd')); $date = Carbon::parse('2018-10-10')->locale('uk'); $this->assertSame('середа, 10', $date->isoFormat('dddd, D')); $this->assertSame('в середу', $date->isoFormat('[в] dddd')); $this->assertSame('минулої середи', $date->isoFormat('[минулої] dddd')); } public function testTranslationCustomWithCustomTranslator() { $this->expectExceptionObject(new InvalidArgumentException( 'Translator does not implement Symfony\Contracts\Translation\TranslatorInterface '. 'and Symfony\Component\Translation\TranslatorBagInterface. '. 'Symfony\Component\Translation\IdentityTranslator has been given.', )); $date = Carbon::create(2018, 1, 1, 0, 0, 0); $date->setLocalTranslator(new IdentityTranslator()); $date->getTranslationMessage('foo'); } public function testNoLocaleTranslator() { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( 'Tests\Carbon\Fixtures\NoLocaleTranslator does neither implements '. 'Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.', ); $date = Carbon::create(2018, 1, 1, 0, 0, 0); $date->setLocalTranslator(new NoLocaleTranslator()); $date->locale; } public function testTranslateTimeStringTo() { $date = Carbon::parse('2019-07-05')->locale('de'); $baseString = $date->isoFormat('LLLL'); $this->assertSame('Freitag, 5. Juli 2019 00:00', $baseString); $this->assertSame('Friday, 5. July 2019 00:00', $date->translateTimeStringTo($baseString)); $this->assertSame('vendredi, 5. juillet 2019 00:00', $date->translateTimeStringTo($baseString, 'fr')); } public function testFallbackLocales() { // /!\ Used for backward compatibility, please avoid this method // @see testMultiLocales() as preferred method $myDialect = 'xx_MY_Dialect'; $secondChoice = 'xy_MY_Dialect'; $thirdChoice = 'it_CH'; /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($myDialect, [ 'day' => ':count yub yub', ]); $translator->setMessages($secondChoice, [ 'day' => ':count buza', 'hour' => ':count ohto', ]); Carbon::setLocale($myDialect); $this->assertNull(Carbon::getFallbackLocale()); Carbon::setFallbackLocale($thirdChoice); $this->assertSame($thirdChoice, Carbon::getFallbackLocale()); $this->assertSame('3 yub yub e 5 ora fa', Carbon::now()->subDays(3)->subHours(5)->ago([ 'parts' => 2, 'join' => true, ])); Carbon::setTranslator(new Translator('en')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($myDialect, [ 'day' => ':count yub yub', ]); $translator->setMessages($secondChoice, [ 'day' => ':count buza', 'hour' => ':count ohto', ]); Carbon::setLocale($myDialect); Carbon::setFallbackLocale($secondChoice); Carbon::setFallbackLocale($thirdChoice); $this->assertSame($thirdChoice, Carbon::getFallbackLocale()); $this->assertSame('3 yub yub e 5 ohto fa', Carbon::now()->subDays(3)->subHours(5)->ago([ 'parts' => 2, 'join' => true, ])); Carbon::setTranslator(new IdentityTranslator()); $this->assertNull(Carbon::getFallbackLocale()); Carbon::setTranslator(new Translator('en')); } public function testMultiLocales() { $myDialect = 'xx_MY_Dialect'; $secondChoice = 'xy_MY_Dialect'; $thirdChoice = 'it_CH'; Translator::get($myDialect)->setTranslations([ 'day' => ':count yub yub', ]); Translator::get($secondChoice)->setTranslations([ 'day' => ':count buza', 'hour' => ':count ohto', ]); $date = Carbon::now()->subDays(3)->subHours(5)->locale($myDialect, $secondChoice, $thirdChoice); $this->assertSame('3 yub yub e 5 ohto fa', $date->ago([ 'parts' => 2, 'join' => true, ])); } public function testStandAloneMonthsInLLLFormat() { $this->assertSame( '29 февраля 2020 г., 12:24', Carbon::parse('2020-02-29 12:24:00')->locale('ru_RU')->isoFormat('LLL'), 'Use "months" for date formatting', ); } public function testStandAloneMonthName() { $this->assertSame( 'февраль', Carbon::parse('2020-02-29 12:24:00')->locale('ru_RU')->monthName, 'Use "months_standalone" the month alone', ); } public function testShortMonthNameInFormat() { $this->assertSame( '29. мая', Carbon::parse('2020-05-29 12:24:00')->locale('ru_RU')->isoFormat('D. MMM'), 'Use "months_short" for date formatting', ); $this->assertSame( 'май', Carbon::parse('2020-05-29 12:24:00')->locale('ru_RU')->isoFormat('MMM'), 'Use "months_short" for date formatting', ); } public function testStandAloneShortMonthName() { $this->assertSame( 'май', Carbon::parse('2020-05-29 12:24:00')->locale('ru_RU')->shortMonthName, 'Use "months_short_standalone" the month alone', ); } public function testAgoDeclension() { $this->assertSame( 'година', CarbonInterval::hour()->locale('uk')->forHumans(['aUnit' => true]), ); $this->assertSame( 'годину тому', Carbon::now()->subHour()->locale('uk')->diffForHumans(['aUnit' => true]), ); } public function testAustriaGermanJanuary() { $this->assertSame( 'Jänner', Carbon::parse('2020-01-15')->locale('de_AT')->monthName, ); $this->assertSame( 'Januar', Carbon::parse('2020-01-15')->locale('de')->monthName, ); $this->assertSame( 'Februar', Carbon::parse('2020-02-15')->locale('de_AT')->monthName, ); $this->assertSame( 'Februar', Carbon::parse('2020-02-15')->locale('de')->monthName, ); } public function testDeclensionModes() { Carbon::setTestNow('2022-12-30'); $this->assertSame( '2 жил 3 сар 1 өдөр 1с өмнө', Carbon::now() ->subYears(2) ->subMonths(3) ->subDay() ->subSecond() ->locale('mn') ->diffForHumans(null, null, true, 4) ); $this->assertSame( '2 жил 3 сар 1 өдөр 1 секундын өмнө', Carbon::now() ->subYears(2) ->subMonths(3) ->subDay() ->subSecond() ->locale('mn') ->diffForHumans(null, null, false, 4) ); } /** @see https://github.com/CarbonPHP/carbon/issues/57 */ public function testResetMessagesMemoryConsumption() { Carbon::getTranslator()->resetMessages('en'); $start = memory_get_usage(); for ($i = 0; $i < 100; $i++) { Carbon::getTranslator()->resetMessages('en'); } $consumedMemory = memory_get_usage() - $start; $this->assertLessThan(100_000, $consumedMemory); } #[TestWith(['мая', 'May'])] #[TestWith(['май', 'May'])] #[TestWith(['февраль', 'February'])] #[TestWith(['февраля', 'February'])] public function testTranslateMonthsEitherStandaloneOrNot(string $ru, string $en) { $this->assertSame($en, Carbon::translateTimeString($ru, 'ru', 'en')); } } ================================================ FILE: tests/Carbon/MacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterface; use CarbonTimezoneTrait; use DateTime; use SubCarbon; use Tests\AbstractTestCaseWithOldNow; use Tests\Carbon\Fixtures\FooBar; use Tests\Carbon\Fixtures\Mixin; class MacroTest extends AbstractTestCaseWithOldNow { public function testInstance() { $this->assertInstanceOf(DateTime::class, $this->now); $this->assertInstanceOf(Carbon::class, $this->now); } public function testCarbonIsMacroableWhenNotCalledDynamically() { if (!\function_exists('easter_days')) { $this->markTestSkipped('This test requires ext-calendar to be enabled.'); } Carbon::macro('easterDays', function ($year = 2019) { return easter_days($year); }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame(22, $now->easterDays(2020)); $this->assertSame(31, $now->easterDays()); Carbon::macro('otherParameterName', function ($other = true) { return $other; }); $this->assertTrue($now->otherParameterName()); } public function testCarbonIsMacroableWhenNotCalledDynamicallyUsingThis() { if (!\function_exists('easter_days')) { $this->markTestSkipped('This test requires ext-calendar to be enabled.'); } Carbon::macro('diffFromEaster', function ($year) { /** @var CarbonInterface $date */ $date = $this; return $date->toDateTime()->diff( Carbon::create($year, 3, 21) ->setTimezone($date->getTimezone()) ->addDays(easter_days($year)) ->endOfDay(), ); }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame(1020, $now->diffFromEaster(2020)->days); } public function testCarbonIsMacroableWhenCalledStatically() { if (!\function_exists('easter_days')) { $this->markTestSkipped('This test requires ext-calendar to be enabled.'); } Carbon::macro('easterDate', function ($year) { return Carbon::create($year, 3, 21)->addDays(easter_days($year)); }); $this->assertSame('05/04', Carbon::easterDate(2015)->format('d/m')); } public function testCarbonIsMacroableWithNonClosureCallables() { Carbon::macro('lower', 'strtolower'); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('abc', $now->lower('ABC')); $this->assertSame('abc', Carbon::lower('ABC')); } public function testCarbonIsMixinable() { include_once __DIR__.'/Fixtures/Mixin.php'; $mixin = new Mixin('America/New_York'); Carbon::mixin($mixin); Carbon::setUserTimezone('America/Belize'); /** @var mixed $date */ $date = Carbon::parse('2000-01-01 12:00:00', 'UTC'); $this->assertSame('06:00 America/Belize', $date->userFormat('H:i e')); } public function testMacroProperties() { // Let say a school year start 5 months before, so school year 2018 is august 2017 to july 2018, // Then you can create get/set method this way: Carbon::macro('setSchoolYear', function ($schoolYear) { /** @var CarbonInterface $date */ $date = $this; $date->year = $schoolYear; if ($date->month > 7) { $date->year--; } }); Carbon::macro('getSchoolYear', function () { /** @var CarbonInterface $date */ $date = $this; $schoolYear = $date->year; if ($date->month > 7) { $schoolYear++; } return $schoolYear; }); // This will make getSchoolYear/setSchoolYear as usual, but get/set prefix will also enable // getter and setter for the ->schoolYear property /** @var mixed $date */ $date = Carbon::parse('2016-06-01'); $this->assertSame(2016, $date->schoolYear); $date->addMonths(3); $this->assertSame(2017, $date->schoolYear); $date->schoolYear++; $this->assertSame(2018, $date->schoolYear); $this->assertSame('2017-09-01', $date->format('Y-m-d')); $date->schoolYear = 2020; $this->assertSame('2019-09-01', $date->format('Y-m-d')); } public function testLocalMacroProperties() { /** @var mixed $date */ $date = Carbon::parse('2016-06-01')->settings([ 'macros' => [ 'setSchoolYear' => function ($schoolYear) { /** @var CarbonInterface $date */ $date = $this; $date->year = $schoolYear; if ($date->month > 7) { $date->year--; } }, 'getSchoolYear' => function () { /** @var CarbonInterface $date */ $date = $this; $schoolYear = $date->year; if ($date->month > 7) { $schoolYear++; } return $schoolYear; }, ], ]); $this->assertTrue($date->hasLocalMacro('getSchoolYear')); $this->assertFalse(Carbon::now()->hasLocalMacro('getSchoolYear')); $this->assertFalse(Carbon::hasMacro('getSchoolYear')); $this->assertSame(2016, $date->schoolYear); $date->addMonths(3); $this->assertSame(2017, $date->schoolYear); $date->schoolYear++; $this->assertSame(2018, $date->schoolYear); $this->assertSame('2017-09-01', $date->format('Y-m-d')); $date->schoolYear = 2020; $this->assertSame('2019-09-01', $date->format('Y-m-d')); } public function testMacroOverridingMethod() { Carbon::macro('setDate', function ($dateString) { /** @var CarbonInterface $date */ $date = $this; $date->modify($dateString); }); /** @var mixed $date */ $date = Carbon::parse('2016-06-01 11:25:36'); $date->date = '1997-08-26 04:13:56'; $this->assertSame('1997-08-26 04:13:56', $date->format('Y-m-d H:i:s')); $date->setDate(2001, 4, 13); $this->assertSame('2001-04-13 04:13:56', $date->format('Y-m-d H:i:s')); } public function testCarbonRaisesExceptionWhenStaticMacroIsNotFound() { $this->expectExceptionObject(new BadMethodCallException( 'Method Carbon\Carbon::nonExistingStaticMacro does not exist.', )); Carbon::nonExistingStaticMacro(); } public function testCarbonRaisesExceptionWhenMacroIsNotFound() { $this->expectExceptionObject(new BadMethodCallException( 'Method nonExistingMacro does not exist.', )); /** @var mixed $date */ $date = Carbon::now(); $date->nonExistingMacro(); } public function testTraitMixin() { Carbon::mixin(FooBar::class); Carbon::setTestNow('2019-07-19 00:00:00'); $this->assertSame('supergirl / Friday / mutable', Carbon::super('girl')); $this->assertSame('superboy / Thursday / mutable', Carbon::parse('2019-07-18')->super('boy')); $this->assertInstanceOf(Carbon::class, Carbon::me()); $this->assertFalse(Carbon::noThis()); $this->assertFalse(Carbon::now()->noThis()); } public function testTraitWithNamedParameters() { require_once __DIR__.'/../Fixtures/CarbonTimezoneTrait.php'; Carbon::mixin(CarbonTimezoneTrait::class); $now = Carbon::now(); $now = eval("return \$now->toAppTz(tz: 'Europe/Paris');"); $this->assertSame('Europe/Paris', $now->format('e')); } public function testSerializationAfterTraitChaining() { require_once __DIR__.'/../Fixtures/CarbonTimezoneTrait.php'; Carbon::mixin(CarbonTimezoneTrait::class); Carbon::setTestNow('2023-05-24 14:49'); $date = Carbon::toAppTz(false, 'Europe/Paris'); $this->assertSame('2023-05-24 16:49 Europe/Paris', unserialize(serialize($date))->format('Y-m-d H:i e')); $date = Carbon::parse('2023-06-12 11:49')->toAppTz(false, 'Europe/Paris'); $this->assertSame('2023-06-12 13:49 Europe/Paris', unserialize(serialize($date))->format('Y-m-d H:i e')); } public function testMutabilityOfMixinMethodReturnedValue() { require_once __DIR__.'/../Fixtures/CarbonTimezoneTrait.php'; Carbon::mixin(CarbonTimezoneTrait::class); Carbon::setTestNow('2023-05-24 14:49'); $now = Carbon::now(); $this->assertSame('Monday', $now->copy()->startOfWeek()->dayName); $copy = $now->copyWithAppTz(false, 'Europe/Paris'); $this->assertSame('Monday', $copy->copy()->startOfWeek()->dayName); $this->assertSame('Europe/Paris', $copy->format('e')); $this->assertSame('UTC', $now->format('e')); $mutated = $now->toAppTz(false, 'America/Toronto'); $this->assertSame('America/Toronto', $mutated->format('e')); $this->assertSame('America/Toronto', $now->format('e')); $this->assertSame(Carbon::class, \get_class($mutated)); $this->assertSame(Carbon::class, \get_class($copy)); $this->assertSame($mutated, $now); $this->assertEquals($mutated, $copy); $this->assertNotSame($mutated, $copy); } public function testSubClassMacro() { require_once __DIR__.'/../Fixtures/SubCarbon.php'; $subCarbon = new SubCarbon('2024-01-24 00:00'); SubCarbon::macro('diffInDecades', function (SubCarbon|string|null $dt = null, $abs = true) { return (int) ($this->diffInYears($dt, $abs) / 10); }); $this->assertSame(2, $subCarbon->diffInDecades(new SubCarbon('2049-01-24 00:00'))); $this->assertSame(2, $subCarbon->diffInDecades('2049-01-24 00:00')); SubCarbon::resetMacros(); } public function testMacroNameCanStartWithDiff() { Carbon::macro('diffInBusinessDays', static fn () => 2); $this->assertSame(2, Carbon::now()->diffInBusinessDays()); } } ================================================ FILE: tests/Carbon/ModifyNearDSTChangeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use Tests\AbstractTestCase; class ModifyNearDSTChangeTest extends AbstractTestCase { /** * Tests transition through DST change hour in non default timezone. */ #[Group('dst')] #[DataProvider('dataForTransitionTests')] public function testTransitionInNonDefaultTimezone(string $dateString, int $addHours, string $expected) { date_default_timezone_set('Europe/london'); $date = Carbon::parse($dateString, 'America/New_York'); $date->addHours($addHours); $this->assertSame($expected, $date->format('c')); } /** * Tests transition through DST change hour in default timezone. */ #[Group('dst')] #[DataProvider('dataForTransitionTests')] public function testTransitionInDefaultTimezone(string $dateString, int $addHours, string $expected) { date_default_timezone_set('America/New_York'); $date = Carbon::parse($dateString, 'America/New_York'); $date->addHours($addHours); $this->assertSame($expected, $date->format('c')); } public static function dataForTransitionTests(): Generator { // arguments: // - Date string to Carbon::parse in America/New_York. // - Hours to add // - Resulting string in 'c' format // testForwardTransition // When standard time was about to reach 2010-03-14T02:00:00-05:00 clocks were turned forward 1 hour to // 2010-03-14T03:00:00-04:00 local daylight time instead yield [ '2010-03-14T00:00:00', 24, '2010-03-15T01:00:00-04:00', ]; // testBackwardTransition // When local daylight time was about to reach 2010-11-07T02:00:00-04:00 clocks were turned backward 1 hour // to 2010-11-07T01:00:00-05:00 local standard time instead yield ['2010-11-07T00:00:00', 24, '2010-11-07T23:00:00-05:00']; } } ================================================ FILE: tests/Carbon/ModifyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use Closure; use DateMalformedStringException; use InvalidArgumentException; use Tests\AbstractTestCase; class ModifyTest extends AbstractTestCase { public function testSimpleModify() { $a = new Carbon('2014-03-30 00:00:00'); $b = $a->copy(); $b->addHours(24); $this->assertSame(24.0, $a->diffInHours($b)); } public function testTimezoneModify() { $php81Fix = 1.0; // For daylight saving time reason 2014-03-30 0h59 is immediately followed by 2h00 $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addHours(24); $this->assertSame(23.0 + $php81Fix, $a->diffInRealHours($b)); $this->assertSame(23.0 + $php81Fix, $b->diffInRealHours($a, true)); $this->assertSame(-(23.0 + $php81Fix), $b->diffInRealHours($a)); $this->assertSame(-(23.0 + $php81Fix) * 60, $b->diffInRealMinutes($a)); $this->assertSame(-(23.0 + $php81Fix) * 60 * 60, $b->diffInRealSeconds($a)); $this->assertSame(-(23.0 + $php81Fix) * 60 * 60 * 1000, $b->diffInRealMilliseconds($a)); $this->assertSame(-(23.0 + $php81Fix) * 60 * 60 * 1000000, $b->diffInRealMicroseconds($a)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addUTCHours(24); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $b->subRealHours(24); $this->assertSame(0.0, $b->diffInHours($a, false)); $this->assertSame(0.0, $b->diffInHours($a, false)); $a = new Carbon('2014-03-30 00:59:00', 'Europe/London'); $a->addRealHour(); $this->assertSame('02:59', $a->format('H:i')); $a->subRealHour(); $this->assertSame('00:59', $a->format('H:i')); $a = new Carbon('2014-03-30 00:59:00', 'Europe/London'); $a->addRealMinutes(2); $this->assertSame('02:01', $a->format('H:i')); $a->subRealMinutes(2); $this->assertSame('00:59', $a->format('H:i')); $a = new Carbon('2014-03-30 00:59:30', 'Europe/London'); $a->addRealMinute(); $this->assertSame('02:00:30', $a->format('H:i:s')); $a->subRealMinute(); $this->assertSame('00:59:30', $a->format('H:i:s')); $a = new Carbon('2014-03-30 00:59:30', 'Europe/London'); $a->addRealSeconds(40); $this->assertSame('02:00:10', $a->format('H:i:s')); $a->subRealSeconds(40); $this->assertSame('00:59:30', $a->format('H:i:s')); $a = new Carbon('2014-03-30 00:59:59', 'Europe/London'); $a->addRealSecond(); $this->assertSame('02:00:00', $a->format('H:i:s')); $a->subRealSecond(); $this->assertSame('00:59:59', $a->format('H:i:s')); $a = new Carbon('2014-03-30 00:59:59.990000', 'Europe/London'); $a->addRealMilliseconds(20); $this->assertSame('02:00:00.010000', $a->format('H:i:s.u')); $a->subRealMilliseconds(20); $this->assertSame('00:59:59.990000', $a->format('H:i:s.u')); $a = new Carbon('2014-03-30 00:59:59.999990', 'Europe/London'); $a->addRealMicroseconds(20); $this->assertSame('02:00:00.000010', $a->format('H:i:s.u')); $a->subRealMicroseconds(20); $this->assertSame('00:59:59.999990', $a->format('H:i:s.u')); $a = new Carbon('2014-03-30 00:59:59.999999', 'Europe/London'); $a->addRealMicrosecond(); $this->assertSame('02:00:00.000000', $a->format('H:i:s.u')); $a->subRealMicrosecond(); $this->assertSame('00:59:59.999999', $a->format('H:i:s.u')); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealDay(); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addUTCDay(); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealWeeks(1 / 7); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealMonths(1 / 30); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealQuarters(1 / 90); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealYears(1 / 365); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealDecades(1 / 3650); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealCenturies(1 / 36500); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->copy(); $b->addRealMillennia(1 / 365000); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); } public function testAddRealUnitException() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid unit for real timestamp add/sub: \'foobar\'', )); (new Carbon('2014-03-30 00:00:00'))->addRealUnit('foobar'); } public function testAddRealMicrosecondWithLowFloatPrecision() { $precision = ini_set('precision', '9'); $a = new Carbon('2014-03-30 00:59:59.999999', 'Europe/London'); $a->addRealMicrosecond(); $this->assertSame('02:00:00.000000', $a->format('H:i:s.u')); ini_set('precision', $precision); } public function testNextAndPrevious() { Carbon::setTestNow('2019-06-02 13:27:09.816752'); $this->assertSame('2019-06-02 14:00:00', Carbon::now()->next('2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::now()->previous('2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 14:00:00', Carbon::now()->next('14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::now()->previous('14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-03 09:00:00', Carbon::now()->next('9am')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 09:00:00', Carbon::now()->previous('9am')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 14:00:00', Carbon::parse('next 2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::parse('previous 2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 14:00:00', Carbon::parse('next 14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::parse('previous 14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-03 09:00:00', Carbon::parse('next 9am')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 09:00:00', Carbon::parse('previous 9am')->format('Y-m-d H:i:s')); $this->assertSame( '2019-06-04 00:00:00', Carbon::parse('after tomorrow')->format('Y-m-d H:i:s'), ); $this->assertSame( '2000-01-27 00:00:00', Carbon::parse('2000-01-25')->change('after tomorrow')->format('Y-m-d H:i:s'), ); $this->assertSame( '2019-05-31 00:00:00', Carbon::parse('before yesterday')->format('Y-m-d H:i:s'), ); $this->assertSame( '2000-01-23 00:00:00', Carbon::parse('2000-01-25')->change('before yesterday')->format('Y-m-d H:i:s'), ); } public function testInvalidModifier(): void { $this->checkInvalid('invalid', static function () { return @Carbon::parse('2000-01-25')->change('invalid'); }); $this->checkInvalid('next invalid', static function () { return @Carbon::now()->next('invalid'); }); $this->checkInvalid('last invalid', static function () { return @Carbon::now()->previous('invalid'); }); } private function checkInvalid(string $message, Closure $callback): void { $this->expectExceptionObject( PHP_VERSION < 8.3 ? new InvalidFormatException('Could not modify with: '.var_export($message, true)) : new DateMalformedStringException("Failed to parse time string ($message)"), ); $callback(); } public function testImplicitCast(): void { $this->assertSame( '2000-01-25 06:00:00.000000', Carbon::parse('2000-01-25')->addRealHours('6')->format('Y-m-d H:i:s.u') ); $this->assertSame( '2000-01-25 07:00:00.000000', Carbon::parse('2000-01-25')->addRealUnit('hour', '7')->format('Y-m-d H:i:s.u') ); $this->assertSame( '2000-01-24 17:00:00.000000', Carbon::parse('2000-01-25')->subRealUnit('hour', '7')->format('Y-m-d H:i:s.u') ); $this->assertSame( '2000-01-25 00:08:00.000000', Carbon::parse('2000-01-25')->addRealUnit('minute', '8')->format('Y-m-d H:i:s.u') ); $this->assertSame( '2000-01-25 00:00:00.007000', Carbon::parse('2000-01-25')->addRealUnit('millisecond', '7')->format('Y-m-d H:i:s.u') ); } } ================================================ FILE: tests/Carbon/NowAndOtherStaticHelpersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTime; use DateTimeZone; use Tests\AbstractTestCase; class NowAndOtherStaticHelpersTest extends AbstractTestCase { public function testNow() { $dt = Carbon::now(); $this->assertSame($this->now->getTimestamp(), $dt->timestamp); $this->assertSame($this->now->unix(), $dt->timestamp); Carbon::setTestNow(); $before = $this->getTimestamp(); $dt = Carbon::now(); $after = $this->getTimestamp(); $this->assertGreaterThanOrEqual($before, $dt->timestamp); $this->assertLessThanOrEqual($after, $dt->timestamp); } public function testGetPreciseTimestamp() { $dt = Carbon::parse('2018-01-06 12:34:10.987126'); $this->assertSame(1515260.0, $dt->getPreciseTimestamp(-3)); $this->assertSame(151526005.0, $dt->getPreciseTimestamp(-1)); $this->assertSame(1515260051.0, $dt->getPreciseTimestamp(0)); $this->assertSame(15152600510.0, $dt->getPreciseTimestamp(1)); $this->assertSame(151526005099.0, $dt->getPreciseTimestamp(2)); $this->assertSame(1515260050987.0, $dt->valueOf()); $this->assertSame(15152600509871.0, $dt->getPreciseTimestamp(4)); $this->assertSame(151526005098713.0, $dt->getPreciseTimestamp(5)); $this->assertSame(1515260050987126.0, $dt->getPreciseTimestamp(6)); $this->assertSame(151526005098712600.0, $dt->getPreciseTimestamp(8)); $this->assertSame(1515260050987126000.0, $dt->getPreciseTimestamp(9)); } public function testGetTimestampMs() { $dt = Carbon::parse('2018-01-06 12:34:10.987126'); $this->assertSame(1515260050987, $dt->getTimestampMs()); } public function testNowWithTimezone() { $dt = Carbon::now('Europe/London'); $this->assertSame($this->now->getTimestamp(), $dt->timestamp); Carbon::setTestNow(); $before = $this->getTimestamp(); $dt = Carbon::now('Europe/London'); $after = $this->getTimestamp(); $this->assertGreaterThanOrEqual($before, $dt->timestamp); $this->assertLessThanOrEqual($after, $dt->timestamp); $this->assertSame('Europe/London', $dt->tzName); } public function testToday() { $dt = Carbon::today(); $this->assertSame(date('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testTodayWithTimezone() { $dt = Carbon::today('Europe/London'); $dt2 = new DateTime('now', new DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testTomorrow() { $dt = Carbon::tomorrow(); $dt2 = new DateTime('tomorrow'); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testTomorrowWithTimezone() { $dt = Carbon::tomorrow('Europe/London'); $dt2 = new DateTime('tomorrow', new DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testYesterday() { $dt = Carbon::yesterday(); $dt2 = new DateTime('yesterday'); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testYesterdayWithTimezone() { $dt = Carbon::yesterday('Europe/London'); $dt2 = new DateTime('yesterday', new DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } } ================================================ FILE: tests/Carbon/NowDerivativesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class NowDerivativesTest extends AbstractTestCase { public function testNowWithSameTimezone() { $dt = Carbon::now('Europe/London'); $dt2 = $dt->nowWithSameTz(); $this->assertSame($dt2->toDateTimeString(), $dt->toDateTimeString()); $this->assertSame($dt2->tzName, $dt->tzName); Carbon::setTestNow(new Carbon('2017-07-29T07:57:27.123456Z')); $dt = Carbon::createFromTime(13, 40, 00, 'Africa/Asmara'); $dt2 = $dt->nowWithSameTz(); Carbon::setTestNow(); $this->assertSame($dt->format('H:i'), '13:40'); $this->assertSame($dt2->format('H:i'), '10:57'); $this->assertSame($dt2->tzName, $dt->tzName); } } ================================================ FILE: tests/Carbon/ObjectsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterface; use DateTime; use DateTimeImmutable; use stdClass; use Tests\AbstractTestCase; class ObjectsTest extends AbstractTestCase { public function testToObject() { $dt = Carbon::now(); $dtToObject = $dt->toObject(); $this->assertInstanceOf(stdClass::class, $dtToObject); $this->assertObjectHasProperty('year', $dtToObject); $this->assertSame($dt->year, $dtToObject->year); $this->assertObjectHasProperty('month', $dtToObject); $this->assertSame($dt->month, $dtToObject->month); $this->assertObjectHasProperty('day', $dtToObject); $this->assertSame($dt->day, $dtToObject->day); $this->assertObjectHasProperty('dayOfWeek', $dtToObject); $this->assertSame($dt->dayOfWeek, $dtToObject->dayOfWeek); $this->assertObjectHasProperty('dayOfYear', $dtToObject); $this->assertSame($dt->dayOfYear, $dtToObject->dayOfYear); $this->assertObjectHasProperty('hour', $dtToObject); $this->assertSame($dt->hour, $dtToObject->hour); $this->assertObjectHasProperty('minute', $dtToObject); $this->assertSame($dt->minute, $dtToObject->minute); $this->assertObjectHasProperty('second', $dtToObject); $this->assertSame($dt->second, $dtToObject->second); $this->assertObjectHasProperty('micro', $dtToObject); $this->assertSame($dt->micro, $dtToObject->micro); $this->assertObjectHasProperty('timestamp', $dtToObject); $this->assertSame($dt->timestamp, $dtToObject->timestamp); $this->assertObjectHasProperty('timezone', $dtToObject); $this->assertEquals($dt->timezone, $dtToObject->timezone); $this->assertObjectHasProperty('formatted', $dtToObject); $this->assertSame($dt->format(Carbon::DEFAULT_TO_STRING_FORMAT), $dtToObject->formatted); } public function testToDateTime() { $dt = Carbon::create(2000, 3, 26); $date = $dt->toDateTime(); $this->assertInstanceOf(DateTime::class, $date); $this->assertNotInstanceOf(Carbon::class, $date); $this->assertNotInstanceOf(CarbonInterface::class, $date); $this->assertSame('2000-03-26', $date->format('Y-m-d')); $date = $dt->toDate(); $this->assertInstanceOf(DateTime::class, $date); $this->assertNotInstanceOf(Carbon::class, $date); $this->assertNotInstanceOf(CarbonInterface::class, $date); $this->assertSame('2000-03-26', $date->format('Y-m-d')); // Check it keeps timezone offset during DST $date = Carbon::create(2290, 11, 2, 1, 10, 10 + 888480 / 1000000, 'America/Toronto'); $this->assertSame( '2290-11-02 01:10:10.888480 America/Toronto -0400', $date->toDateTime()->format('Y-m-d H:i:s.u e O'), ); $this->assertSame( '2290-11-02 01:10:10.888480 America/Toronto -0500', $date->copy()->addHour()->toDateTime()->format('Y-m-d H:i:s.u e O'), ); } public function testToDateTimeImmutable() { $dt = Carbon::create(2000, 3, 26); $date = $dt->toDateTimeImmutable(); $this->assertInstanceOf(DateTimeImmutable::class, $date); $this->assertSame('2000-03-26', $date->format('Y-m-d')); } } ================================================ FILE: tests/Carbon/PhpBug72338Test.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; /** * The problem is, that $date->setTimezone($tz) with $tz in 'HH:MM' notation (["timezone_type"]=>int(1)) put DateTime object * on inconsistent state. It looks like internal timestamp becomes changed and it affects to such functions: * * * $date->modify() uses changed timestamp and result is wrong * * * $date->setTimezone($tz) settle this changed timestamp, even in case if $tz is not in 'HH:MM' format * * * $date->format('U') returns changed timestamp * * @link https://bugs.php.net/bug.php?id=72338 This bug on bugs.php.net * * @internal I use days changing in tests because using seconds|minute|hours may run setTimezone within. */ class PhpBug72338Test extends AbstractTestCase { /** * Ensures that modify don't use changed timestamp */ public function testModify() { $date = Carbon::createFromTimestamp(0); $date->setTimezone('+02:00'); $date->modify('+1 day'); $this->assertSame('86400', $date->format('U')); } /** * Ensures that $date->format('U') returns unchanged timestamp */ public function testTimestamp() { $date = Carbon::createFromTimestamp(0); $date->setTimezone('+02:00'); $this->assertSame('0', $date->format('U')); } /** * Ensures that date created from string with timezone and with same timezone set by setTimezone() is equal */ public function testEqualSetAndCreate() { $date = Carbon::createFromTimestamp(0); $date->setTimezone('+02:00'); $date1 = new Carbon('1970-01-01T02:00:00+02:00'); $this->assertSame($date->format('U'), $date1->format('U')); } /** * Ensures that second call to setTimezone() don't changing timestamp */ public function testSecondSetTimezone() { $date = Carbon::createFromTimestamp(0); $date->setTimezone('+02:00'); $date->setTimezone('Europe/Moscow'); $this->assertSame('0', $date->format('U')); } } ================================================ FILE: tests/Carbon/RelativeDateStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class RelativeDateStringTest extends AbstractTestCase { public $scenarios = [ // ensure regular timestamps are flagged as relative '2018-01-02 03:04:05' => ['date' => '2018-01-02', 'is_relative' => false], '1500-01-02 12:00:00' => ['date' => '1500-01-02', 'is_relative' => false], '1985-12-10' => ['date' => '1985-12-10', 'is_relative' => false], 'Dec 2017' => ['date' => '2017-12-01', 'is_relative' => false], '25-Dec-2017' => ['date' => '2017-12-25', 'is_relative' => false], '25 December 2017' => ['date' => '2017-12-25', 'is_relative' => false], '25 Dec 2017' => ['date' => '2017-12-25', 'is_relative' => false], 'Dec 25 2017' => ['date' => '2017-12-25', 'is_relative' => false], // dates not relative now 'first day of January 2008' => ['date' => '2008-01-01', 'is_relative' => false], 'first day of January 1999' => ['date' => '1999-01-01', 'is_relative' => false], 'last day of January 1999' => ['date' => '1999-01-31', 'is_relative' => false], 'last monday of January 1999' => ['date' => '1999-01-25', 'is_relative' => false], 'first day of January 0001' => ['date' => '0001-01-01', 'is_relative' => false], 'monday december 1750' => ['date' => '1750-12-07', 'is_relative' => false], 'december 1750' => ['date' => '1750-12-01', 'is_relative' => false], 'last sunday of January 2005' => ['date' => '2005-01-30', 'is_relative' => false], 'January 2008' => ['date' => '2008-01-01', 'is_relative' => false], // dates relative to now 'first day of next month' => ['date' => '2017-02-01', 'is_relative' => true], 'sunday noon' => ['date' => '2017-01-01', 'is_relative' => true], 'sunday midnight' => ['date' => '2017-01-01', 'is_relative' => true], 'monday december' => ['date' => '2017-12-04', 'is_relative' => true], 'next saturday' => ['date' => '2017-01-07', 'is_relative' => true], 'april' => ['date' => '2017-04-01', 'is_relative' => true], ]; public function testKeywordMatching() { foreach ($this->scenarios as $string => $expected) { $actual = Carbon::hasRelativeKeywords($string); $this->assertSame( $expected['is_relative'], $actual, "Failed relative keyword matching for scenario: {$string} (expected: {$expected['is_relative']})", ); } } public function testRelativeInputStrings() { Carbon::setTestNow('2017-01-01 12:00:00'); foreach ($this->scenarios as $string => $expected) { $actual = Carbon::parse($string)->format('Y-m-d'); $this->assertSame( $expected['date'], $actual, "Failed relative date scenario: {$string}", ); } } } ================================================ FILE: tests/Carbon/RelativeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class RelativeTest extends AbstractTestCase { public function testSecondsSinceMidnight() { $d = Carbon::today()->addSeconds(30); $this->assertSame(30.0, $d->secondsSinceMidnight()); $d = Carbon::today()->addDays(1); $this->assertSame(0.0, $d->secondsSinceMidnight()); $d = Carbon::today()->addDays(1)->addSeconds(120); $this->assertSame(120.0, $d->secondsSinceMidnight()); $d = Carbon::today()->addMonths(3)->addSeconds(42); $this->assertSame(42.0, $d->secondsSinceMidnight()); } public function testSecondsUntilEndOfDay() { $d = Carbon::today()->endOfDay(); $this->assertSame(0.0, $d->secondsUntilEndOfDay()); $d = Carbon::today()->endOfDay()->subSeconds(60); $this->assertSame(60.0, $d->secondsUntilEndOfDay()); $d = Carbon::create(2014, 10, 24, 12, 34, 56); $this->assertVeryClose(41103.999999, $d->secondsUntilEndOfDay()); $d = Carbon::create(2014, 10, 24, 0, 0, 0); $this->assertVeryClose(86399.99999899999, $d->secondsUntilEndOfDay()); } } ================================================ FILE: tests/Carbon/RoundTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterval; use DateInterval; use InvalidArgumentException; use Tests\AbstractTestCase; class RoundTest extends AbstractTestCase { public function testRoundWithDefaultUnit() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->round(); $this->assertSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->round(5), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->floor()->round(5), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->round(3), 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->round(4), 2315, 7, 18, 22, 42, 16, 0); $this->assertCarbon($dt->copy()->round(10), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->round(0.5), 2315, 7, 18, 22, 42, 17, 500000); $this->assertCarbon($dt->copy()->round(0.25), 2315, 7, 18, 22, 42, 17, 750000); $this->assertCarbon($dt->copy()->round(3.8), 2315, 7, 18, 22, 42, 19, 800000); $this->assertCarbon($dt->copy()->floor(5), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->floor()->floor(5), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->floor(3), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->floor(4), 2315, 7, 18, 22, 42, 16, 0); $this->assertCarbon($dt->copy()->floor(10), 2315, 7, 18, 22, 42, 10, 0); $this->assertCarbon($dt->copy()->floor(0.5), 2315, 7, 18, 22, 42, 17, 500000); $this->assertCarbon($dt->copy()->floor(0.25), 2315, 7, 18, 22, 42, 17, 500000); $this->assertCarbon($dt->copy()->floor(3.8), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->ceil(5), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->floor()->ceil(5), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->ceil(3), 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->ceil(4), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->ceil(10), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->ceil(0.5), 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->ceil(0.25), 2315, 7, 18, 22, 42, 17, 750000); $this->assertCarbon($dt->copy()->ceil(3.8), 2315, 7, 18, 22, 42, 19, 800000); } public function testRoundWithStrings() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $this->assertCarbon($dt->copy()->round('minute'), 2315, 7, 18, 22, 42, 0, 0); $this->assertCarbon($dt->copy()->floor('5 minutes'), 2315, 7, 18, 22, 40, 0, 0); $this->assertCarbon($dt->copy()->ceil('5 minutes'), 2315, 7, 18, 22, 45, 0, 0); } public function testRoundWithStringsException() { $this->expectExceptionObject(new InvalidArgumentException( 'Rounding is only possible with single unit intervals.', )); Carbon::create(2315, 7, 18, 22, 42, 17.643971)->round('2 hours 5 minutes'); } public function testRoundWithInterval() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $this->assertCarbon($dt->copy()->round(CarbonInterval::minute()), 2315, 7, 18, 22, 42, 0, 0); $this->assertCarbon($dt->copy()->floor(CarbonInterval::minutes(5)), 2315, 7, 18, 22, 40, 0, 0); $this->assertCarbon($dt->copy()->ceil(new DateInterval('PT5M')), 2315, 7, 18, 22, 45, 0, 0); } public function testRoundWithIntervalException() { $this->expectExceptionObject(new InvalidArgumentException( 'Rounding is only possible with single unit intervals.', )); Carbon::create(2315, 7, 18, 22, 42, 17.643971)->round(CarbonInterval::day()->minutes(5)); } public function testRoundWithBaseUnit() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->roundSecond(); $this->assertSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->roundDay(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundDay(5), 2315, 7, 21, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilDay(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorDay(), 2315, 7, 18, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundYear(), 2316, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->subMonths(2)->roundYear(), 2315, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundYear(2), 2315, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorYear(2), 2315, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilYear(2), 2317, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundMonth(), 2315, 8, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorMonth(), 2315, 7, 1, 0, 0, 0, 0); for ($i = 1; $i <= Carbon::MONTHS_PER_YEAR; $i++) { $dt = Carbon::parse("2021-$i-01")->endOfMonth()->floorMonth(); $this->assertCarbon($dt, 2021, $i, 1, 0, 0, 0, 0); } } public function testFloorYear() { $date = Carbon::create(2022)->endOfYear()->floorYear(); $this->assertCarbon($date, 2022, 1, 1, 0, 0, 0, 0); $date = Carbon::create(2022)->endOfYear()->floorDay()->floorYear(); $this->assertCarbon($date, 2022, 1, 1, 0, 0, 0, 0); $date = Carbon::create(2022)->endOfYear()->floorYear(); $this->assertCarbon($date, 2022, 1, 1, 0, 0, 0, 0); $date = Carbon::create(2022)->addMonths(6)->floorYear(); $this->assertCarbon($date, 2022, 1, 1, 0, 0, 0, 0); } public function testCeilYear() { $date = Carbon::create(2022)->addMonths(6)->ceilYear(); $this->assertCarbon($date, 2023, 1, 1, 0, 0, 0, 0); $date = Carbon::create(2022)->endOfYear()->ceilYear(); $this->assertCarbon($date, 2023, 1, 1, 0, 0, 0, 0); $date = Carbon::create(2022)->ceilYear(); $this->assertCarbon($date, 2022, 1, 1, 0, 0, 0, 0); $date = Carbon::create(2022)->addMicrosecond()->ceilYear(); $this->assertCarbon($date, 2023, 1, 1, 0, 0, 0, 0); } public function testRoundWithMetaUnit() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->roundSecond(); $this->assertSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->roundMillisecond(), 2315, 7, 18, 22, 42, 17, 644000); $this->assertCarbon($dt->copy()->roundMillennium(), 2001, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundQuarter(), 2315, 7, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundQuarters(2), 2315, 7, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->subMonth()->floorQuarter(), 2315, 4, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->subMonth()->floorQuarters(2), 2315, 1, 1, 0, 0, 0, 0); } public function testRoundWeek() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->roundSecond(); $this->assertSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->floorWeek(), 2315, 7, 12, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilWeek(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundWeek(), 2315, 7, 19, 0, 0, 0, 0); $dt = Carbon::create(2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorWeek(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilWeek(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundWeek(), 2315, 7, 19, 0, 0, 0, 0); } public function testCeilMonth() { $this->assertCarbon(Carbon::parse('2021-01-29')->ceilMonth(), 2021, 2, 1, 0, 0, 0); $this->assertCarbon(Carbon::parse('2021-01-31')->ceilMonth(), 2021, 2, 1, 0, 0, 0); $this->assertCarbon(Carbon::parse('2021-12-17')->ceilMonth(), 2022, 1, 1, 0, 0, 0); } public function testFloorMonth() { $this->assertCarbon(Carbon::parse('2021-05-31')->floorMonth(3), 2021, 4, 1, 0, 0, 0); } public function testRoundInvalidArgument() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'foobar\'.', )); Carbon::now()->roundUnit('foobar'); } } ================================================ FILE: tests/Carbon/SerializationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use DateTime; use Generator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ReflectionClass; use ReflectionObject; use ReflectionProperty; use Tests\AbstractTestCase; use Throwable; class SerializationTest extends AbstractTestCase { protected string $serialized; protected function setUp(): void { parent::setUp(); $this->serialized = \extension_loaded('msgpack') ? 'O:13:"Carbon\Carbon":4:{s:4:"date";s:26:"2016-02-01 13:20:25.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";s:18:"dumpDateProperties";a:2:{s:4:"date";s:26:"2016-02-01 13:20:25.000000";s:8:"timezone";s:15:"America/Toronto";}}' : 'O:13:"Carbon\Carbon":3:{s:4:"date";s:26:"2016-02-01 13:20:25.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}'; } protected function cleanSerialization(string $serialization): string { return preg_replace('/s:\d+:\"[^"]*dumpDateProperties\"/', 's:18:"dumpDateProperties"', $serialization); } public function testSerialize() { $dt = Carbon::create(2016, 2, 1, 13, 20, 25); $this->assertSame($this->serialized, $this->cleanSerialization($dt->serialize())); $this->assertSame($this->serialized, $this->cleanSerialization(serialize($dt))); } public function testFromUnserialized() { $dt = Carbon::fromSerialized($this->serialized); $this->assertCarbon($dt, 2016, 2, 1, 13, 20, 25); $dt = unserialize($this->serialized); $this->assertCarbon($dt, 2016, 2, 1, 13, 20, 25); } public function testSerialization() { $this->assertEquals(Carbon::now(), unserialize(serialize(Carbon::now()))); $dt = Carbon::parse('2018-07-11 18:30:11.654321', 'Europe/Paris')->locale('fr_FR'); $copy = unserialize(serialize($dt)); $this->assertSame('fr_FR', $copy->locale); $this->assertSame('mercredi 18:30:11.654321', $copy->tz('Europe/Paris')->isoFormat('dddd HH:mm:ss.SSSSSS')); } public static function dataForTestFromUnserializedWithInvalidValue(): Generator { yield [null]; yield [true]; yield [false]; yield [123]; yield ['foobar']; } #[DataProvider('dataForTestFromUnserializedWithInvalidValue')] public function testFromUnserializedWithInvalidValue(mixed $value) { $this->expectExceptionObject(new InvalidArgumentException( "Invalid serialized value: $value", )); Carbon::fromSerialized($value); } public function testDateSerializationReflectionCompatibility() { $tz = $this->firstValidTimezoneAmong(['America/Los_Angeles', 'US/Pacific'])->getName(); try { $reflection = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor(); @$reflection->date = '1990-01-17 10:28:07'; @$reflection->timezone_type = 3; @$reflection->timezone = $tz; $date = unserialize(serialize($reflection)); } catch (Throwable $exception) { $this->markTestSkipped( "It fails on DateTime so Carbon can't support it, error was:\n".$exception->getMessage() ); } $this->assertSame('1990-01-17 10:28:07', $date->format('Y-m-d h:i:s')); $reflection = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); @$reflection->date = '1990-01-17 10:28:07'; @$reflection->timezone_type = 3; @$reflection->timezone = $tz; $date = unserialize(serialize($reflection)); $this->assertSame('1990-01-17 10:28:07', $date->format('Y-m-d h:i:s')); $reflection = new ReflectionObject(Carbon::parse('1990-01-17 10:28:07')); $target = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); /** @var ReflectionProperty[] $properties */ $properties = []; foreach ($reflection->getProperties() as $property) { $properties[$property->getName()] = $property; } $setValue = function ($key, $value) use (&$properties, &$target) { if (isset($properties[$key])) { $properties[$key]->setValue($target, $value); return; } @$target->$key = $value; }; $setValue('date', '1990-01-17 10:28:07'); $setValue('timezone_type', 3); $setValue('timezone', $tz); $date = unserialize(serialize($target)); $this->assertSame('1990-01-17 10:28:07', $date->format('Y-m-d h:i:s')); } #[RequiresPhpExtension('msgpack')] public function testMsgPackExtension(): void { $string = '2018-06-01 21:25:13.321654 Europe/Vilnius'; $date = Carbon::parse('2018-06-01 21:25:13.321654 Europe/Vilnius'); $message = @msgpack_pack($date); $copy = msgpack_unpack($message); $this->assertSame($string, $copy->format('Y-m-d H:i:s.u e')); } } ================================================ FILE: tests/Carbon/SetDateAndTimeFromTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class SetDateAndTimeFromTest extends AbstractTestCase { public function testSetDateFrom() { $source = Carbon::now(); $target = $source->copy() ->addDays(rand(1, 6)) ->addHours(rand(1, 23)) ->addMinutes(rand(1, 59)) ->addSeconds(rand(1, 59)); $this->assertCarbon( $target->copy()->setDateFrom($source), $source->year, $source->month, $source->day, $target->hour, $target->minute, $target->second, ); } public function testSetTimeFrom() { $source = Carbon::now(); $target = $source->copy() ->addDays(rand(1, 6)) ->addHours(rand(1, 23)) ->addMinutes(rand(1, 59)) ->addSeconds(rand(1, 59)); $this->assertCarbon( $target->copy()->setTimeFrom($source), $target->year, $target->month, $target->day, $source->hour, $source->minute, $source->second, ); } public function testSetDateTimeFrom() { $source = Carbon::now(); $target = $source->copy() ->addDays(rand(1, 6)) ->addHours(rand(1, 23)) ->addMinutes(rand(1, 59)) ->addSeconds(rand(1, 59)); $this->assertCarbon( $target->copy()->setDateTimeFrom($source), $source->year, $source->month, $source->day, $source->hour, $source->minute, $source->second, ); } } ================================================ FILE: tests/Carbon/SettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use BadMethodCallException; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidIntervalException; use Carbon\Exceptions\UnitException; use Carbon\Exceptions\UnsupportedUnitException; use Carbon\Month; use Carbon\Unit; use DateInterval; use DateTimeZone; use Exception; use InvalidArgumentException; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class SettersTest extends AbstractTestCase { public const SET_UNIT_NO_OVERFLOW_SAMPLE = 200; public function testMonthEnum() { $d = Carbon::parse('2023-10-25 21:14:51'); $d->month = Month::February; $this->assertSame('2023-02-25 21:14:51', $d->format('Y-m-d H:i:s')); $d->setMonth(Month::July); $this->assertSame('2023-07-25 21:14:51', $d->format('Y-m-d H:i:s')); } public function testSetMonthUnit() { $d = Carbon::parse('2023-10-25 21:14:51'); $d->set(Unit::Month, Month::February); $this->assertSame(2, $d->get(Unit::Month)); $this->assertSame('2023-02-25 21:14:51', $d->format('Y-m-d H:i:s')); } public function testMonthEnumOnWrongUnit() { $this->expectExceptionObject(new UnitException( 'Month enum cannot be used to set year', )); $d = Carbon::now(); // @phpstan-ignore-next-line $d->year = Month::February; } public function testSingularUnit() { $this->assertSame('year', Carbon::singularUnit('year')); $this->assertSame('year', Carbon::singularUnit('Years')); $this->assertSame('century', Carbon::singularUnit('centuries')); $this->assertSame('millennium', Carbon::singularUnit('Millennia')); $this->assertSame('millennium', Carbon::singularUnit('millenniums')); } public function testPluralUnit() { $this->assertSame('years', Carbon::pluralUnit('year')); $this->assertSame('years', Carbon::pluralUnit('Years')); $this->assertSame('centuries', Carbon::pluralUnit('century')); $this->assertSame('centuries', Carbon::pluralUnit('centuries')); $this->assertSame('millennia', Carbon::pluralUnit('Millennia')); $this->assertSame('millennia', Carbon::pluralUnit('millenniums')); $this->assertSame('millennia', Carbon::pluralUnit('millennium')); } public function testSet() { $d = Carbon::create(2000, 1, 12); $d->set([ 'year' => 1995, 'month' => 4, ]); $this->assertSame(1995, $d->year); $this->assertSame(4, $d->month); $this->assertSame(12, $d->day); } public function testYearSetter() { $d = Carbon::now(); $d->year = 1995; $this->assertSame(1995, $d->year); } public function testMonthSetter() { $d = Carbon::now(); $d->month = 3; $this->assertSame(3, $d->month); } public function testMonthSetterWithWrap() { $d = Carbon::now(); $d->month = 13; $this->assertSame(1, $d->month); } public function testDaySetter() { $d = Carbon::now(); $d->day = 2; $this->assertSame(2, $d->day); } public function testDaySetterWithWrap() { $d = Carbon::createFromDate(2012, 8, 5); $d->day = 32; $this->assertSame(1, $d->day); } public function testHourSetter() { $d = Carbon::now(); $d->hour = 2; $this->assertSame(2, $d->hour); } public function testHourSetterWithWrap() { $d = Carbon::now(); $d->hour = 25; $this->assertSame(1, $d->hour); } public function testMinuteSetter() { $d = Carbon::now(); $d->minute = 2; $this->assertSame(2, $d->minute); } public function testMinuteSetterWithWrap() { $d = Carbon::now(); $d->minute = 65; $this->assertSame(5, $d->minute); } public function testSecondSetter() { $d = Carbon::now(); $d->second = 2; $this->assertSame(2, $d->second); } public function testUnitOfUnit() { $date = Carbon::create(2023, 1, 27, 20, 12, 42, 'America/Toronto'); $date->minuteOfYear = (95 * 24 + 3) * 60 + 50; $this->assertSame('2023-04-06 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); $date->dayOfWeek = 2; $this->assertSame('2023-04-04 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); $date->dayOfWeek = 6; $this->assertSame('2023-04-08 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); $date->dayOfWeek = 0; $this->assertSame('2023-04-02 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); $date->dayOfWeekIso = 7; $this->assertSame('2023-04-02 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); $date->dayOfWeek = 4; $this->assertSame('2023-04-06 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); $date->dayOfWeekIso = 7; $this->assertSame('2023-04-09 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); } public function testUnitOfUnitMethod() { $date = Carbon::create(2023, 1, 27, 20, 12, 42, 'America/Toronto'); $date->minuteOfYear((95 * 24 + 3) * 60 + 50); $this->assertSame('2023-04-06 04:50:42 America/Toronto', $date->format('Y-m-d H:i:s e')); } public function testUnitOfUnitUnknownMethod() { $this->expectExceptionObject(new BadMethodCallException( 'Method fooOfBar does not exist.', )); $date = Carbon::create(2023, 1, 27, 20, 12, 42, 'America/Toronto'); $date->fooOfBar((95 * 24 + 3) * 60 + 50); } public function testUnitOfUnitFloat() { $this->expectExceptionObject(new UnitException( '->minuteOfYear expects integer value', )); $date = Carbon::create(2018, 1, 27, 20, 12, 42, 'America/Toronto'); $date->minuteOfYear = (float) ((95 * 24 + 3) * 60 + 50); } public function testTimeSetter() { $d = Carbon::now(); $d->setTime(1, 1, 1); $this->assertSame(1, $d->second); $d->setTime(1, 1); $this->assertSame(0, $d->second); } public function testTimeSetterWithChaining() { $d = Carbon::now(); $d->setTime(2, 2, 2)->setTime(1, 1, 1); $this->assertInstanceOfCarbon($d); $this->assertSame(1, $d->second); $d->setTime(2, 2, 2)->setTime(1, 1); $this->assertInstanceOfCarbon($d); $this->assertSame(0, $d->second); } public function testTimeSetterWithZero() { $d = Carbon::now(); $d->setTime(1, 1); $this->assertSame(0, $d->second); } public function testDateTimeSetter() { $d = Carbon::now(); $d->setDateTime($d->year, $d->month, $d->day, 1, 1, 1); $this->assertSame(1, $d->second); } public function testDateTimeSetterWithZero() { $d = Carbon::now(); $d->setDateTime($d->year, $d->month, $d->day, 1, 1); $this->assertSame(0, $d->second); } public function testDateTimeSetterWithChaining() { $d = Carbon::now(); $d->setDateTime(2013, 9, 24, 17, 4, 29); $this->assertInstanceOfCarbon($d); $d->setDateTime(2014, 10, 25, 18, 5, 30); $this->assertInstanceOfCarbon($d); $this->assertCarbon($d, 2014, 10, 25, 18, 5, 30); } /** * @link https://github.com/briannesbitt/Carbon/issues/539 */ public function testSetDateAfterStringCreation() { $d = new Carbon('first day of this month'); $this->assertSame(1, $d->day); $d->setDate($d->year, $d->month, 12); $this->assertSame(12, $d->day); } public function testSecondSetterWithWrap() { $d = Carbon::now(); $d->second = 65; $this->assertSame(5, $d->second); } public function testMicrosecondSetterWithWrap() { $d = Carbon::now(); $d->micro = -4; $this->assertSame(999996, $d->micro); $this->assertSame((Carbon::now()->second + 59) % 60, $d->second); $d->microsecond = 3123456; $this->assertSame(123456, $d->micro); $this->assertSame((Carbon::now()->second + 2) % 60, $d->second); $d->micro -= 12123400; $this->assertSame(56, $d->micro); $this->assertSame((Carbon::now()->second + 50) % 60, $d->second); $d->micro = -12600000; $this->assertSame(400000, $d->micro); $this->assertSame((Carbon::now()->second + 37) % 60, $d->second); $d->millisecond = 123; $this->assertSame(123, $d->milli); $this->assertSame(123000, $d->micro); $d->milli = 456; $this->assertSame(456, $d->millisecond); $this->assertSame(456000, $d->microsecond); $d->microseconds(567); $this->assertSame(567, $d->microsecond); $d->setMicroseconds(678); $this->assertSame(678, $d->microsecond); $d->milliseconds(567); $this->assertSame(567, $d->millisecond); $this->assertSame(567000, $d->microsecond); $d->setMilliseconds(678); $this->assertSame(678, $d->millisecond); $this->assertSame(678000, $d->microsecond); } public function testTimestampSetter() { $d = Carbon::now(); $d->timestamp = 10; $this->assertSame(10, $d->timestamp); $d->setTimestamp(11); $this->assertSame(11, $d->timestamp); $d->timestamp = 1600887164.88952298; $this->assertSame('2020-09-23 14:52:44.889523', $d->format('Y-m-d H:i:s.u')); $d->setTimestamp( // See https://github.com/php/php-src/issues/14332 PHP_VERSION < 8.4 ? 1599828571.23561248 : 1599828571.2356121, ); $this->assertSame('2020-09-11 08:49:31.235612', $d->format('Y-m-d H:i:s.u')); $d->timestamp = '0.88951247 1600887164'; $this->assertSame('2020-09-23 14:52:44.889512', $d->format('Y-m-d H:i:s.u')); $d->setTimestamp('0.23561248 1599828571'); $this->assertSame('2020-09-11 08:49:31.235612', $d->format('Y-m-d H:i:s.u')); $d->timestamp = '0.88951247/1600887164/12.56'; $this->assertSame('2020-09-23 14:52:57.449512', $d->format('Y-m-d H:i:s.u')); $d->setTimestamp('0.00561248/1599828570--1.23'); $this->assertSame('2020-09-11 08:49:31.235612', $d->format('Y-m-d H:i:s.u')); } public function testSetTimezoneWithInvalidTimezone() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); $d = Carbon::now(); $d->setTimezone('sdf'); } public function testTimezoneWithInvalidTimezone() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); /** @var mixed $d */ $d = Carbon::now(); $d->timezone = 'sdf'; } public function testTimeZoneOfUnserialized() { $date = new Carbon('2020-01-01', 'America/Vancouver'); $new = unserialize(serialize($date)); $this->assertSame('America/Vancouver', $date->getTimezone()->getName()); $date->cleanupDumpProperties()->timezone = 'UTC'; $this->assertSame('UTC', $date->getTimezone()->getName()); $this->assertSame('America/Vancouver', $new->getTimezone()->getName()); @$new->timezone = 'UTC'; $this->assertSame('UTC', $new->getTimezone()->getName()); /** @var mixed $date */ $date = new Carbon('2020-01-01', 'America/Vancouver'); $new = clone $date; $this->assertSame('America/Vancouver', $date->getTimezone()->getName()); @$date->timezone = 'UTC'; $this->assertSame('UTC', $date->getTimezone()->getName()); $this->assertSame('America/Vancouver', $new->getTimezone()->getName()); @$new->timezone = 'UTC'; $this->assertSame('UTC', $new->getTimezone()->getName()); $date = new Carbon('2020-01-01', 'America/Vancouver'); $this->assertSame('America/Vancouver', $date->getTimezone()->getName()); var_export($date, true); $date->cleanupDumpProperties()->timezone = 'UTC'; $this->assertSame('UTC', $date->getTimezone()->getName()); $date = new Carbon('2020-01-01', 'America/Vancouver'); $this->assertSame('America/Vancouver', $date->getTimezone()->getName()); /** @var array $array */ $array = $date; foreach ($array as $item) { } $date->cleanupDumpProperties()->timezone = 'UTC'; $this->assertSame('UTC', $date->getTimezone()->getName()); $date = new Carbon('2020-01-01', 'America/Vancouver'); $this->assertSame('America/Vancouver', $date->getTimezone()->getName()); get_object_vars($date); $date->cleanupDumpProperties()->timezone = 'UTC'; $this->assertSame('UTC', $date->getTimezone()->getName()); } public function testTimezoneWithInvalidTimezoneSetter() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); $d = Carbon::now(); $d->timezone('sdf'); } public function testTzWithInvalidTimezone() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); /** @var mixed $d */ $d = Carbon::now(); $d->tz = 'sdf'; } public function testTzWithInvalidTimezoneSetter() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); $d = Carbon::now(); $d->tz('sdf'); } public function testSetTimezoneUsingString() { $d = Carbon::now(); $d->setTimezone('America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); } public function testShiftTimezone() { $d = Carbon::parse('2018-08-13 10:53:12', 'Europe/Paris'); $d2 = $d->copy()->setTimezone('America/Toronto'); $this->assertSame(0, $d2->getTimestamp() - $d->getTimestamp()); $this->assertSame('04:53:12', $d2->format('H:i:s')); $d = Carbon::parse('2018-08-13 10:53:12.321654', 'Europe/Paris'); $d2 = $d->copy()->shiftTimezone('America/Toronto'); $this->assertSame(21600, $d2->getTimestamp() - $d->getTimestamp()); $this->assertSame('America/Toronto', $d2->tzName); $this->assertSame('10:53:12.321654', $d2->format('H:i:s.u')); $d = Carbon::parse('2018-03-25 00:53:12.321654 America/Toronto')->shiftTimezone('Europe/Oslo'); $this->assertSame('2018-03-25 00:53:12.321654 Europe/Oslo', $d->format('Y-m-d H:i:s.u e')); } public function testTimezoneUsingString() { /** @var mixed $d */ $d = Carbon::now(); $d->timezone = 'America/Toronto'; $this->assertSame('America/Toronto', $d->tzName); $d->timezone('America/Vancouver'); $this->assertSame('America/Vancouver', $d->tzName); } public function testTzUsingString() { /** @var mixed $d */ $d = Carbon::now(); $d->tz = 'America/Toronto'; $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('America/Toronto', $d->tz()); $d->tz('America/Vancouver'); $this->assertSame('America/Vancouver', $d->tzName); $this->assertSame('America/Vancouver', $d->tz()); } public function testTzUsingOffset() { $d = Carbon::create(2000, 8, 1, 0, 0, 0); $d->offset = 7200; $this->assertSame(7200, $d->offset); $this->assertSame(120, $d->offsetMinutes); $this->assertSame(2, $d->offsetHours); $this->assertSame(120, $d->utcOffset()); $d->utcOffset(-180); $this->assertSame(-10800, $d->offset); $this->assertSame(-180, $d->offsetMinutes); $this->assertSame(-3, $d->offsetHours); $this->assertSame(-180, $d->utcOffset()); $d->offsetMinutes = -240; $this->assertSame(-14400, $d->offset); $this->assertSame(-240, $d->offsetMinutes); $this->assertSame(-4, $d->offsetHours); $this->assertSame(-240, $d->utcOffset()); $d->offsetHours = 1; $this->assertSame(3600, $d->offset); $this->assertSame(60, $d->offsetMinutes); $this->assertSame(1, $d->offsetHours); $this->assertSame(60, $d->utcOffset()); $d->utcOffset(330); $this->assertSame(330, $d->utcOffset()); } public function testSetTimezoneUsingDateTimeZone() { $d = Carbon::now(); $d->setTimezone(new DateTimeZone('America/Toronto')); $this->assertSame('America/Toronto', $d->tzName); } public function testTimezoneUsingDateTimeZone() { /** @var mixed $d */ $d = Carbon::now(); $d->timezone = new DateTimeZone('America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $d->timezone(new DateTimeZone('America/Vancouver')); $this->assertSame('America/Vancouver', $d->tzName); } public function testTzUsingDateTimeZone() { /** @var mixed $d */ $d = Carbon::now(); $d->tz = new DateTimeZone('America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $d->tz(new DateTimeZone('America/Vancouver')); $this->assertSame('America/Vancouver', $d->tzName); } public function testInvalidSetter() { $this->expectExceptionObject(new InvalidArgumentException( "Unknown setter 'doesNotExit'", )); /** @var mixed $date */ $date = Carbon::now(); $date->doesNotExit = 'bb'; } #[TestWith([9, 15, 30, '09:15:30'])] #[TestWith([9, 15, 0, '09:15'])] #[TestWith([9, 0, 0, '09'])] #[TestWith([9, 5, 3, '9:5:3'])] #[TestWith([9, 5, 0, '9:5'])] #[TestWith([9, 0, 0, '9'])] public function testSetTimeFromTimeString(int $hour, int $minute, int $second, string $time) { Carbon::setTestNow(Carbon::create(2016, 2, 12, 1, 2, 3)); $d = Carbon::now()->setTimeFromTimeString($time); $this->assertCarbon($d, 2016, 2, 12, $hour, $minute, $second); } public function testWeekendDaysSetter() { $weekendDays = [Carbon::FRIDAY,Carbon::SATURDAY]; $d = Carbon::now(); $d->setWeekendDays($weekendDays); $this->assertSame($weekendDays, $d->getWeekendDays()); Carbon::setWeekendDays([Carbon::SATURDAY, Carbon::SUNDAY]); } public function testMidDayAtSetter() { $d = Carbon::now(); $d->setMidDayAt(11); $this->assertSame(11, $d->getMidDayAt()); $d->setMidDayAt(12); $this->assertSame(12, $d->getMidDayAt()); } public function testSetUnitNoOverflowFebruary() { $d = Carbon::parse('2024-02-29')->setUnitNoOverFlow('day', 31, 'month'); $this->assertInstanceOf(Carbon::class, $d); $this->assertSame('2024-02-29 23:59:59.999999', $d->format('Y-m-d H:i:s.u')); } public function testSetUnitNoOverflow() { $results = [ 'current' => 0, 'start' => 0, 'end' => 0, 'failure' => [], ]; for ($i = 0; $i < static::SET_UNIT_NO_OVERFLOW_SAMPLE; $i++) { $year = mt_rand(2000, 2500); $month = mt_rand(1, 12); $day = mt_rand(1, 28); $hour = mt_rand(0, 23); $minute = mt_rand(0, 59); $second = mt_rand(0, 59); $microsecond = mt_rand(0, 999999); $units = ['millennium', 'century', 'decade', 'year', 'quarter', 'month', 'day', 'hour', 'minute', 'second', 'week']; $overflowUnit = $units[mt_rand(0, \count($units) - 1)]; $units = [ 'year' => 10, 'month' => 12, 'day' => 9999, 'hour' => 24, 'minute' => 60, 'second' => 60, 'microsecond' => 1000000, ]; $valueUnit = array_keys($units)[mt_rand(0, \count($units) - 1)]; $value = mt_rand(0, 1) === 1 ? mt_rand(-9999, 9999) : mt_rand(-60, 60); $date = Carbon::create($year, $month, $day, $hour, $minute, $second + $microsecond / 1000000, 'UTC'); $original = $date->copy(); $date->setUnitNoOverflow($valueUnit, $value, $overflowUnit); $start = $original->copy()->startOf($overflowUnit); $end = $original->copy()->endOf($overflowUnit); if ($date->lessThan($start) || $date->greaterThan($end)) { $results['failure'][] = [ 'year' => $year, 'month' => $month, 'day' => $day, 'hour' => $hour, 'minute' => $minute, 'second' => $second, 'microsecond' => $microsecond, 'valueUnit' => $valueUnit, 'value' => $value, 'overflowUnit' => $overflowUnit, 'date' => $date->format('Y-m-d H:i:s'), 'start' => $start->format('Y-m-d H:i:s'), 'end' => $end->format('Y-m-d H:i:s'), ]; continue; } $unit = ucfirst(Carbon::pluralUnit($valueUnit)); $modulo = $value % $units[$valueUnit]; if ($modulo < 0) { $modulo += $units[$valueUnit]; } if ($value === $date->$valueUnit || $modulo === $date->$valueUnit || $$valueUnit - ((int) $date->{"diffIn$unit"}($original, false)) === $value || ($valueUnit === 'day' && $date->format('Y-m-d H:i:s.u') === $original->copy() ->modify(($original->day + $value).' days') ->format('Y-m-d H:i:s.u')) ) { $results['current']++; continue; } if ($date->$valueUnit === $start->$valueUnit) { $results['start']++; continue; } if ($date->$valueUnit === $end->$valueUnit) { $results['end']++; continue; } $this->failOperation( $original, $date, $start, $end, 'setUnitNoOverflow', $valueUnit, $value, $overflowUnit, $unit, $modulo, $$valueUnit, ); } $minimum = static::SET_UNIT_NO_OVERFLOW_SAMPLE / 100; $this->assertSame([], $results['failure']); $this->assertGreaterThan($minimum, $results['start']); $this->assertGreaterThan($minimum, $results['end']); $this->assertGreaterThan($minimum, $results['current']); $this->assertSame(static::SET_UNIT_NO_OVERFLOW_SAMPLE, $results['end'] + $results['start'] + $results['current']); } public function testSetUnitNoOverflowInputUnitException() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'anyUnit\'', )); Carbon::now()->setUnitNoOverflow('anyUnit', 1, 'year'); } public function testSetUnitNoOverflowOverflowUnitException() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'anyUnit\'', )); Carbon::now()->setUnitNoOverflow('minute', 1, 'anyUnit'); } public function testAddUnitError() { $this->expectExceptionObject(new UnitException(implode("\n", [ 'Unable to add unit array (', " 0 => 'foobar',", ' 1 => 1,', ')', ]))); $date = Carbon::parse('2021-09-13'); @$date->addUnit('foobar', 1); } public function testUnsupportedUnitException() { $date = new class('2021-09-13') extends Carbon { public function rawAdd(DateInterval $interval): static { throw new InvalidIntervalException('InvalidIntervalException'); } public function modify($modifier): static { throw new InvalidFormatException('InvalidFormatException'); } }; $exception = null; try { $date->addUnit('year', 999); } catch (UnitException $error) { $exception = $error; } $this->assertSame( 'Unable to add unit '.var_export(['year', 999], true), $exception?->getMessage(), ); $previous = $exception->getPrevious(); $this->assertInstanceOf(UnsupportedUnitException::class, $previous); $this->assertSame("Unsupported unit 'year'", $previous->getMessage()); $previous = $previous->getPrevious(); $this->assertInstanceOf(InvalidIntervalException::class, $previous); $this->assertSame('InvalidIntervalException', $previous->getMessage()); $this->assertNull($previous->getPrevious()); } public function testAddUnitNoOverflow() { $results = [ 'current' => 0, 'start' => 0, 'end' => 0, 'failure' => [], ]; for ($i = 0; $i < static::SET_UNIT_NO_OVERFLOW_SAMPLE; $i++) { $year = mt_rand(2000, 2500); $month = mt_rand(1, 12); $day = mt_rand(1, 28); $hour = mt_rand(0, 23); $minute = mt_rand(0, 59); $second = mt_rand(0, 59); $microsecond = mt_rand(0, 999999); $units = ['millennium', 'century', 'decade', 'year', 'quarter', 'month', 'day', 'hour', 'minute', 'second', 'week']; $overflowUnit = $units[mt_rand(0, \count($units) - 1)]; $units = [ 'year' => 10, 'month' => 12, 'day' => 9999, 'hour' => 24, 'minute' => 60, 'second' => 60, 'microsecond' => 1000000, ]; $valueUnit = array_keys($units)[mt_rand(0, \count($units) - 1)]; $value = mt_rand(0, 1) === 1 ? mt_rand(-9999, 9999) : mt_rand(-60, 60); $date = Carbon::create($year, $month, $day, $hour, $minute, $second + $microsecond / 1000000); $original = $date->copy(); $date->addUnitNoOverflow($valueUnit, $value, $overflowUnit); $start = $original->copy()->startOf($overflowUnit); $end = $original->copy()->endOf($overflowUnit); if ($date->lessThan($start) || $date->greaterThan($end)) { $results['failure'][] = [ 'year' => $year, 'month' => $month, 'day' => $day, 'hour' => $hour, 'minute' => $minute, 'second' => $second, 'microsecond' => $microsecond, 'valueUnit' => $valueUnit, 'value' => $value, 'overflowUnit' => $overflowUnit, 'date' => $date->format('Y-m-d H:i:s.u e O'), 'start' => $start->format('Y-m-d H:i:s.u e O'), 'end' => $end->format('Y-m-d H:i:s.u e O'), ]; continue; } $unit = ucfirst(Carbon::pluralUnit($valueUnit)); $modulo = ($$valueUnit + $value) % $units[$valueUnit]; if ($modulo < 0) { $modulo += $units[$valueUnit]; } if ($value === $date->$valueUnit || $modulo === $date->$valueUnit || (method_exists($date, "diffInReal$unit") && -$date->{"diffInReal$unit"}($original, false) === $value) ) { $results['current']++; continue; } if ($date->$valueUnit === $start->$valueUnit) { $results['start']++; continue; } if ($date->$valueUnit === $end->$valueUnit) { $results['end']++; continue; } $currentDiff = -((int) round($date->{"diffIn$unit"}($original, false))); if ($currentDiff === $value) { $results['current']++; continue; } $delta = ($currentDiff - $value); if ($valueUnit === 'hour') { $diff = $this->getOffsetChangeOfTheDay($date) ?: $this->getOffsetChangeOfTheDay($original); if ($diff !== 0) { $sign = $diff < 0 ? -1 : 1; $diff = abs($diff); $minutes = $diff % 100; $hours = (int) ($sign * (floor($diff / 100) + $minutes / 60)); if ($delta === -$hours) { $results['current']++; continue; } } } $this->failOperation( $original, $date, $start, $end, 'addUnitNoOverflow', $valueUnit, $value, $overflowUnit, $unit, $modulo, $value, ); } $minimum = static::SET_UNIT_NO_OVERFLOW_SAMPLE / 100; $this->assertSame([], $results['failure']); $this->assertGreaterThan($minimum, $results['start']); $this->assertGreaterThan($minimum, $results['end']); $this->assertGreaterThan($minimum, $results['current']); $this->assertSame(static::SET_UNIT_NO_OVERFLOW_SAMPLE, $results['end'] + $results['start'] + $results['current']); } public function testSubUnitNoOverflow() { $results = [ 'current' => 0, 'start' => 0, 'end' => 0, 'failure' => [], ]; for ($i = 0; $i < static::SET_UNIT_NO_OVERFLOW_SAMPLE; $i++) { $year = mt_rand(2000, 2500); $month = mt_rand(1, 12); $day = mt_rand(1, 28); $hour = mt_rand(0, 23); $minute = mt_rand(0, 59); $second = mt_rand(0, 59); $microsecond = mt_rand(0, 999999); $units = ['millennium', 'century', 'decade', 'year', 'quarter', 'month', 'day', 'hour', 'minute', 'second', 'week']; $overflowUnit = $units[mt_rand(0, \count($units) - 1)]; $units = [ 'year' => 10, 'month' => 12, 'day' => 9999, 'hour' => 24, 'minute' => 60, 'second' => 60, 'microsecond' => 1000000, ]; $valueUnit = array_keys($units)[mt_rand(0, \count($units) - 1)]; $value = mt_rand(0, 1) === 1 ? mt_rand(-9999, 9999) : mt_rand(-60, 60); $date = Carbon::create($year, $month, $day, $hour, $minute, $second + $microsecond / 1000000); $original = $date->copy(); $date->subUnitNoOverflow($valueUnit, $value, $overflowUnit); $start = $original->copy()->startOf($overflowUnit); $end = $original->copy()->endOf($overflowUnit); if ($date->lessThan($start) || $date->greaterThan($end)) { $results['failure'][] = [ 'year' => $year, 'month' => $month, 'day' => $day, 'hour' => $hour, 'minute' => $minute, 'second' => $second, 'microsecond' => $microsecond, 'valueUnit' => $valueUnit, 'value' => $value, 'overflowUnit' => $overflowUnit, 'date' => $date->format('Y-m-d H:i:s.u e O'), 'start' => $start->format('Y-m-d H:i:s.u e O'), 'end' => $end->format('Y-m-d H:i:s.u e O'), ]; continue; } $unit = ucfirst(Carbon::pluralUnit($valueUnit)); $modulo = ($$valueUnit - $value) % $units[$valueUnit]; if ($modulo < 0) { $modulo += $units[$valueUnit]; } if ($value === $date->$valueUnit || $modulo === $date->$valueUnit || (method_exists($date, "diffInReal$unit") && $value === $date->{"diffInReal$unit"}($original, false)) ) { $results['current']++; continue; } if ($valueUnit === 'day') { $dateInterval = $date->diffAsDateInterval($original); $days = $dateInterval->days; if ($days !== false) { $days *= $dateInterval->invert ? -1 : 1; if ($value === $days) { $results['current']++; continue; } } } if ($date->$valueUnit === $start->$valueUnit) { $results['start']++; continue; } if ($date->$valueUnit === $end->$valueUnit) { $results['end']++; continue; } $currentDiff = (int) round($date->{"diffIn$unit"}($original, false)); if ($currentDiff === $value) { $results['current']++; continue; } $delta = ($currentDiff - $value); if ($valueUnit === 'hour') { $diff = $this->getOffsetChangeOfTheDay($date) ?: $this->getOffsetChangeOfTheDay($original); if ($diff !== 0) { $sign = $diff < 0 ? -1 : 1; $diff = abs($diff); $minutes = $diff % 100; $hours = (int) ($sign * (floor($diff / 100) + $minutes / 60)); if ($delta === $hours) { $results['current']++; continue; } } } $this->failOperation( $original, $date, $start, $end, 'subUnitNoOverflow', $valueUnit, $value, $overflowUnit, $unit, $modulo, $value, $hours ?? null, $delta, ); } $minimum = static::SET_UNIT_NO_OVERFLOW_SAMPLE / 100; $this->assertSame([], $results['failure']); $this->assertGreaterThan($minimum, $results['start']); $this->assertGreaterThan($minimum, $results['end']); $this->assertGreaterThan($minimum, $results['current']); $this->assertSame(static::SET_UNIT_NO_OVERFLOW_SAMPLE, $results['end'] + $results['start'] + $results['current']); } public function testOverflowInDst() { $date = Carbon::create(2335, 11, 3, 1, 30, 50.138159) ->subUnitNoOverflow('year', 5668, 'second'); $this->assertSame( '2335-11-03 01:30:50.000000 America/Toronto -0400', $date->format('Y-m-d H:i:s.u e O'), ); $date = Carbon::parse('2020-10-15 03:22:57.442989', 'America/Toronto')->hours(-5302); $diff = (int) ($date->copy()->startOfDay()->format('O') - $date->copy()->endOfDay()->format('O')); $sign = $diff < 0 ? -1 : 1; $diff = abs($diff); $minutes = $diff % 100; $hours = $sign * (floor($diff / 100) + $minutes / 60); $diffInHours = $date->diffInHours( Carbon::parse('2020-10-15 03:22:57.442989', 'America/Toronto'), ); $this->assertSame(5305.0 + $hours, $diffInHours); } private function getOffsetChangeOfTheDay(Carbon $date): int { return (int) ($date->copy()->startOfDay()->format('O') - $date->copy()->endOfDay()->format('O')); } /** * @SuppressWarnings(TooManyFields) */ private function failOperation( Carbon $original, Carbon $date, Carbon $start, Carbon $end, string $method, string $valueUnit, int $value, string $overflowUnit, string $unit, int $modulo, int $variableValue, ?int $hours = null, ?int $delta = null, ): void { throw new Exception(implode("\n", [ 'Unhandled result for: '. 'Carbon::parse('.var_export($original->format('Y-m-d H:i:s.u'), true).', '. var_export($original->timezoneName, true). ")->$method(".implode(', ', array_map(function ($value) { return var_export($value, true); }, [$valueUnit, $value, $overflowUnit])).');', 'Getting: '.$date->format('Y-m-d H:i:s.u e O'), "Current $valueUnit: ".$date->$valueUnit, 'Is neither '.$start->$valueUnit." (from $start)", 'Nor '.$end->$valueUnit." (from $end)", "Nor $value (from value)", "Nor $modulo (from modulo)", ...($hours !== null ? [ "Not matching diff (hours = $hours vs delta = ".($delta ?? 'null').')', ] : []), method_exists($date, "diffInReal$unit") ? "diffInReal$unit() exists and returns ".$date->{"diffInReal$unit"}($original, false) ." while expecting $variableValue" : "diffInReal$unit() does not exist", "diffIn$unit() exists and returns ".$date->{"diffIn$unit"}($original, false) ." while expecting $variableValue", ])); } } ================================================ FILE: tests/Carbon/SettingsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Tests\AbstractTestCase; class SettingsTest extends AbstractTestCase { public function testSettings() { $paris = Carbon::parse('2018-01-31 00:00:00')->settings([ 'timezone' => 'Europe/Paris', 'locale' => 'fr_FR', 'monthOverflow' => true, 'yearOverflow' => true, ]); $this->assertEquals([ 'timezone' => 'Europe/Paris', 'locale' => 'fr_FR', 'monthOverflow' => true, 'yearOverflow' => true, ], $paris->getSettings()); $saoPaulo = Carbon::parse('2018-01-31 00:00:00')->settings([ 'timezone' => 'America/Sao_Paulo', 'locale' => 'pt', 'monthOverflow' => false, 'yearOverflow' => false, ]); $this->assertEquals([ 'timezone' => 'America/Sao_Paulo', 'locale' => 'pt', 'monthOverflow' => false, 'yearOverflow' => false, ], $saoPaulo->getSettings()); $this->assertSame('2 jours 1 heure avant', $paris->addMonth()->from(Carbon::parse('2018-03-05', 'UTC'), null, false, 3)); $this->assertSame('4 dias 21 horas antes', $saoPaulo->addMonth()->from(Carbon::parse('2018-03-05', 'UTC'), null, false, 3)); $this->assertSame('2 jours et une heure avant', $paris->from(Carbon::parse('2018-03-05', 'UTC'), ['parts' => 3, 'join' => true, 'aUnit' => true])); } } ================================================ FILE: tests/Carbon/StartEndOfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\Unit; use InvalidArgumentException; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class StartEndOfTest extends AbstractTestCase { public function testStartOfDay() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfDay()); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 0, 0, 0, 0); } public function testEndOfDay() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfDay()); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 23, 59, 59, 999999); } public function testStartOfMonthIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfMonth()); } public function testStartOfMonthFromNow() { $dt = Carbon::now()->startOfMonth(); $this->assertCarbon($dt, $dt->year, $dt->month, 1, 0, 0, 0); } public function testStartOfMonthFromLastDay() { $dt = Carbon::create(2000, 1, 31, 2, 3, 4)->startOfMonth(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testStartOfYearIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfYear()); } public function testStartOfYearFromNow() { $dt = Carbon::now()->startOfYear(); $this->assertCarbon($dt, $dt->year, 1, 1, 0, 0, 0); } public function testStartOfYearFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfYear(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testStartOfYearFromLastDay() { $dt = Carbon::create(2000, 12, 31, 23, 59, 59)->startOfYear(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testEndOfMonthIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfMonth()); } public function testEndOfMonth() { $dt = Carbon::create(2000, 1, 1, 2, 3, 4)->endOfMonth(); $this->assertCarbon($dt, 2000, 1, 31, 23, 59, 59, 999999); } public function testEndOfMonthFromLastDay() { $dt = Carbon::create(2000, 1, 31, 2, 3, 4)->endOfMonth(); $this->assertCarbon($dt, 2000, 1, 31, 23, 59, 59, 999999); } public function testEndOfYearIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfYear()); } public function testEndOfYearFromNow() { $dt = Carbon::now()->endOfYear(); $this->assertCarbon($dt, $dt->year, 12, 31, 23, 59, 59, 999999); } public function testEndOfYearFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfYear(); $this->assertCarbon($dt, 2000, 12, 31, 23, 59, 59, 999999); } public function testEndOfYearFromLastDay() { $dt = Carbon::create(2000, 12, 31, 23, 59, 59)->endOfYear(); $this->assertCarbon($dt, 2000, 12, 31, 23, 59, 59, 999999); } public function testStartOfDecadeIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfDecade()); } public function testStartOfDecadeFromNow() { $dt = Carbon::now()->startOfDecade(); $this->assertCarbon($dt, $dt->year - $dt->year % 10, 1, 1, 0, 0, 0); } public function testStartOfDecadeFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfDecade(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testStartOfDecadeFromLastDay() { $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->startOfDecade(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testEndOfDecadeIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfDecade()); } public function testEndOfDecadeFromNow() { $dt = Carbon::now()->endOfDecade(); $this->assertCarbon($dt, $dt->year - $dt->year % 10 + 9, 12, 31, 23, 59, 59, 999999); } public function testEndOfDecadeFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfDecade(); $this->assertCarbon($dt, 2009, 12, 31, 23, 59, 59, 999999); } public function testEndOfDecadeFromLastDay() { $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->endOfDecade(); $this->assertCarbon($dt, 2009, 12, 31, 23, 59, 59, 999999); } public function testStartOfCenturyIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfCentury()); } public function testStartOfCenturyFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfCentury(); $this->assertCarbon($dt, $now->year - $now->year % 100 + 1, 1, 1, 0, 0, 0); } public function testStartOfCenturyFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfCentury(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfCenturyFromLastDay() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfCentury(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfMillenniumIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfMillennium()); } public function testStartOfMillenniumFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfMillennium(); $this->assertCarbon($dt, $now->year - $now->year % 1000 + 1, 1, 1, 0, 0, 0); } public function testStartOfMillenniumFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfMillennium(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfMillenniumFromLastDay() { $dt = Carbon::create(3000, 12, 31, 23, 59, 59)->startOfMillennium(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfHourIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfHour()); } public function testStartOfHourFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfHour(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, 0, 0); } public function testStartOfHourFromFirstMinute() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 0, 0); } public function testStartOfHourFromLastMinute() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 0, 0); } public function testEndOfHourIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfHour()); } public function testEndOfHourFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfHour(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, 59, 59, 999999); } public function testEndOfHourFromFirstMinute() { $dt = Carbon::create(2001, 1, 1, 1, 1, rand(0, 59))->endOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 59, 59, 999999); } public function testEndOfHourFromLastMinute() { $dt = Carbon::create(2100, 12, 31, 23, 59, rand(0, 59))->endOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 59, 59, 999999); } public function testStartOfMinuteIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfMinute()); } public function testStartOfMinuteFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfMinute(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, $now->minute, 0); } public function testStartOfMinuteFromFirstSecond() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 0); } public function testStartOfMinuteFromLastSecond() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 0); } public function testEndOfMinuteIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfMinute()); } public function testEndOfMinuteFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfMinute(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, $now->minute, 59, 999999); } public function testEndOfMinuteFromFirstSecond() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->endOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 59, 999999); } public function testEndOfMinuteFromLastSecond() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->endOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 59, 999999); } public function testStartOfSecondIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfSecond()); } public function testStartOfSecondFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfSecond(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second, 0); } public function testStartOfSecondFromFirstSecond() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfSecond(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, $dt->second, 0); } public function testStartOfSecondFromLastSecond() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfSecond(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, $dt->second, 0); } public function testEndOfSecondIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfSecond()); } public function testEndOfSecondFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfSecond(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second, 999999); } public function testEndOfSecondFromFirstSecond() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->modify('01:01:01.1')->endOfSecond(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, $dt->second, 999999); } public function testEndOfSecondFromLastSecond() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->modify('23:59:59.1')->endOfSecond(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, $dt->second, 999999); } public function testStartOfSecond() { $dt = new Carbon('2000-06-15 23:10:10.123456'); $this->assertCarbon($dt->startOfSecond(), 2000, 6, 15, 23, 10, 10, 0); $this->assertCarbon($dt->endOfSecond(), 2000, 6, 15, 23, 10, 10, 999999); } public function testMidDayIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->midDay()); } public function testMidDayFromNow() { $now = Carbon::now(); $dt = Carbon::now()->midDay(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, 12, 0, 0); } public function testEndOfCenturyIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfCentury()); } public function testEndOfCenturyFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfCentury(); $this->assertCarbon($dt, $now->year - $now->year % 100 + 100, 12, 31, 23, 59, 59, 999999); } public function testEndOfCenturyFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->endOfCentury(); $this->assertCarbon($dt, 2100, 12, 31, 23, 59, 59, 999999); } public function testEndOfCenturyFromLastDay() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->endOfCentury(); $this->assertCarbon($dt, 2100, 12, 31, 23, 59, 59, 999999); } public function testEndOfMillenniumIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfMillennium()); } public function testEndOfMillenniumFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfMillennium(); $this->assertCarbon($dt, $now->year - $now->year % 1000 + 1000, 12, 31, 23, 59, 59); } public function testEndOfMillenniumFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->endOfMillennium(); $this->assertCarbon($dt, 3000, 12, 31, 23, 59, 59); } public function testEndOfMillenniumFromLastDay() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->endOfMillennium(); $this->assertCarbon($dt, 3000, 12, 31, 23, 59, 59); } public function testStartOfQuarterIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfQuarter()); } #[TestWith([1, 1])] #[TestWith([2, 1])] #[TestWith([3, 1])] #[TestWith([4, 4])] #[TestWith([5, 4])] #[TestWith([6, 4])] #[TestWith([7, 7])] #[TestWith([8, 7])] #[TestWith([9, 7])] #[TestWith([10, 10])] #[TestWith([11, 10])] #[TestWith([12, 10])] public function testStartOfQuarter(int $month, int $startOfQuarterMonth) { $dt = Carbon::create(2015, $month, 15, 1, 2, 3); $this->assertCarbon($dt->startOfQuarter(), 2015, $startOfQuarterMonth, 1, 0, 0, 0); } public function testEndOfQuarterIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfQuarter()); } #[TestWith([1, 3, 31])] #[TestWith([2, 3, 31])] #[TestWith([3, 3, 31])] #[TestWith([4, 6, 30])] #[TestWith([5, 6, 30])] #[TestWith([6, 6, 30])] #[TestWith([7, 9, 30])] #[TestWith([8, 9, 30])] #[TestWith([9, 9, 30])] #[TestWith([10, 12, 31])] #[TestWith([11, 12, 31])] #[TestWith([12, 12, 31])] public function testEndOfQuarter(int $month, int $endOfQuarterMonth, int $endOfQuarterDay) { $dt = Carbon::create(2015, $month, 15, 1, 2, 3); $this->assertCarbon($dt->endOfQuarter(), 2015, $endOfQuarterMonth, $endOfQuarterDay, 23, 59, 59, 999999); } public function testAverageIsFluid() { $dt = Carbon::now()->average(); $this->assertInstanceOfCarbon($dt); } public function testAverageFromSame() { $dt1 = Carbon::create(2000, 1, 31, 2, 3, 4); $dt2 = Carbon::create(2000, 1, 31, 2, 3, 4)->average($dt1); $this->assertCarbon($dt2, 2000, 1, 31, 2, 3, 4); } public function testAverageFromGreater() { $dt1 = Carbon::create(2000, 1, 1, 1, 1, 1); $dt2 = Carbon::create(2009, 12, 31, 23, 59, 59)->average($dt1); $this->assertCarbon($dt2, 2004, 12, 31, 12, 30, 30); } public function testAverageFromLower() { $dt1 = Carbon::create(2009, 12, 31, 23, 59, 59); $dt2 = Carbon::create(2000, 1, 1, 1, 1, 1)->average($dt1); $this->assertCarbon($dt2, 2004, 12, 31, 12, 30, 30); } public function testAverageWithCloseDates() { $dt1 = Carbon::parse('2004-01-24 09:46:56.500000'); $dt2 = Carbon::parse('2004-01-24 09:46:56.600000'); $this->assertSame('2004-01-24 09:46:56.550000', $dt1->average($dt2)->format('Y-m-d H:i:s.u')); } public function testAverageWithFarDates() { $dt1 = Carbon::parse('-2018-05-07 12:34:46.500000', 'UTC'); $dt2 = Carbon::parse('6025-10-11 20:59:06.600000', 'UTC'); $this->assertSame('2004-01-24 04:46:56.550000', $dt1->average($dt2)->format('Y-m-d H:i:s.u')); } public function testStartOf() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOf('day')); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 0, 0, 0, 0); $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOf(Unit::Day)); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 0, 0, 0, 0); $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOf('Months')); $this->assertCarbon($dt, $dt->year, $dt->month, 1, 0, 0, 0, 0); } public function testEndOf() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOf('day')); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 23, 59, 59, 999999); $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOf(Unit::Day)); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 23, 59, 59, 999999); $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOf('Months')); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->daysInMonth, 23, 59, 59, 999999); } public function testStartOfInvalidUnit() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'microsecond\'', )); Carbon::now()->startOf('microsecond'); } public function testEndOfInvalidUnit() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'microsecond\'', )); Carbon::now()->endOf('microsecond'); } } ================================================ FILE: tests/Carbon/StrictModeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use BadMethodCallException; use Carbon\Carbon; use InvalidArgumentException; use Tests\AbstractTestCase; class StrictModeTest extends AbstractTestCase { public function testSafeCreateDateTimeZoneWithStrictMode1() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid offset timezone -15', )); Carbon::createFromDate(2001, 1, 1, -15); } public function testSafeCreateDateTimeZoneWithStrictMode2() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (foobar)', )); Carbon::createFromDate(2001, 1, 1, 'foobar'); } public function testSetWithStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown setter \'foobar\'', )); /** @var mixed $date */ $date = Carbon::now(); $date->foobar = 'biz'; } public function testGetWithStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown getter \'foobar\'', )); /** @var mixed $date */ $date = Carbon::now(); $date->foobar; } public function testSetAndGetWithoutStrictMode() { Carbon::useStrictMode(false); /** @var mixed $date */ $date = Carbon::now(); @$date->foobar = 'biz'; $this->assertSame('biz', $date->foobar); } public function testIsSameUnitWithStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Bad comparison unit: \'foobar\'', )); Carbon::now()->isSameUnit('foobar', 'now'); } public function testIsSameUnitWithoutStrictMode() { Carbon::useStrictMode(false); $this->assertFalse(Carbon::now()->isSameUnit('foobar', 'now')); } public function testAddRealUnitWithStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid unit for real timestamp add/sub: \'foobar\'', )); Carbon::now()->addRealUnit('foobar'); } public function testAddRealUnitWithoutStrictMode() { Carbon::useStrictMode(false); $d = Carbon::create(2000, 1, 2, 3, 4, 5)->addRealUnit('foobar'); $this->assertCarbon($d, 2000, 1, 2, 3, 4, 5); } public function testCallWithStrictMode() { $this->expectExceptionObject(new BadMethodCallException( 'Method foobar does not exist.', )); /** @var mixed $date */ $date = Carbon::now(); $date->foobar(); } public function testCallWithoutStrictMode() { Carbon::useStrictMode(false); /** @var mixed $date */ $date = Carbon::now(); $this->assertNull($date->foobar()); } public function testStaticCallWithStrictMode() { $this->expectExceptionObject(new BadMethodCallException( 'Method Carbon\Carbon::foobar does not exist.', )); Carbon::foobar(); } public function testStaticCallWithoutStrictMode() { Carbon::useStrictMode(false); $this->assertNull(Carbon::foobar()); } } ================================================ FILE: tests/Carbon/StringsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterface; use Carbon\Factory; use DateTime; use InvalidArgumentException; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\BadIsoCarbon; use Tests\Carbon\Fixtures\MyCarbon; class StringsTest extends AbstractTestCase { public function testToStringCast() { $d = Carbon::now(); $this->assertSame(Carbon::now()->toDateTimeString(), ''.$d); } public function testToString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu Dec 25 1975 14:15:16 GMT-0500', $d->toString()); } public function testToISOString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T19:15:16.000000Z', $d->toISOString()); $d = Carbon::create(21975, 12, 25, 14, 15, 16); $this->assertSame('+021975-12-25T19:15:16.000000Z', $d->toISOString()); $d = Carbon::create(-75, 12, 25, 14, 15, 16); $this->assertStringStartsWith('-000075-', $d->toISOString()); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16.000000-05:00', $d->toISOString(true)); $d = Carbon::create(21975, 12, 25, 14, 15, 16); $this->assertSame('+021975-12-25T14:15:16.000000-05:00', $d->toISOString(true)); $d = Carbon::create(-75, 12, 25, 14, 15, 16); $this->assertStringStartsWith('-000075-', $d->toISOString(true)); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T19:15:16.000000Z', $d->toJSON()); $d = Carbon::create(21975, 12, 25, 14, 15, 16); $this->assertSame('+021975-12-25T19:15:16.000000Z', $d->toJSON()); $d = Carbon::create(-75, 12, 25, 14, 15, 16); $this->assertStringStartsWith('-000075-', $d->toJSON()); $d = Carbon::create(0); $this->assertNull($d->toISOString()); } public function testSetToStringFormatString() { Carbon::setToStringFormat('jS \o\f F, Y g:i:s a'); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('25th of December, 1975 2:15:16 pm', ''.$d); } public function testSetToStringFormatClosure() { Carbon::setToStringFormat(function (CarbonInterface $d) { $format = $d->year === 1976 ? 'jS \o\f F g:i:s a' : 'jS \o\f F, Y g:i:s a'; return $d->format($format); }); $d = Carbon::create(1976, 12, 25, 14, 15, 16); $this->assertSame('25th of December 2:15:16 pm', ''.$d); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('25th of December, 1975 2:15:16 pm', ''.$d); } public function testSetToStringFormatViaSettings() { $factory = new Factory([ 'toStringFormat' => function (CarbonInterface $d) { return $d->isoFormat('dddd'); }, ]); $d = $factory->create(1976, 12, 25, 14, 15, 16); $this->assertSame('Saturday', ''.$d); } public function testResetToStringFormat() { $d = Carbon::now(); Carbon::setToStringFormat('123'); Carbon::resetToStringFormat(); $this->assertSame($d->toDateTimeString(), ''.$d); } public function testExtendedClassToString() { $d = MyCarbon::now(); $this->assertSame($d->toDateTimeString(), ''.$d); } public function testToDateString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25', $d->toDateString()); } public function testToDateTimeLocalString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16.615342); $this->assertSame('1975-12-25T14:15:16', $d->toDateTimeLocalString()); $this->assertSame('1975-12-25T14:15', $d->toDateTimeLocalString('minute')); $this->assertSame('1975-12-25T14:15:16', $d->toDateTimeLocalString('second')); $this->assertSame('1975-12-25T14:15:16.615', $d->toDateTimeLocalString('millisecond')); $this->assertSame('1975-12-25T14:15:16.615342', $d->toDateTimeLocalString('µs')); $message = null; try { $d->toDateTimeLocalString('hour'); } catch (InvalidArgumentException $exception) { $message = $exception->getMessage(); } $this->assertSame('Precision unit expected among: minute, second, millisecond and microsecond.', $message); } public function testToFormattedDateString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Dec 25, 1975', $d->toFormattedDateString()); } public function testToTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('14:15:16', $d->toTimeString()); } public function testToDateTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25 14:15:16', $d->toDateTimeString()); } public function testToDateTimeStringWithPaddedZeroes() { $d = Carbon::create(2000, 5, 2, 4, 3, 4); $this->assertSame('2000-05-02 04:03:04', $d->toDateTimeString()); } public function testToDayDateTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, Dec 25, 1975 2:15 PM', $d->toDayDateTimeString()); } public function testToDayDateString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, Dec 25, 1975', $d->toFormattedDayDateString()); } public function testToAtomString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toAtomString()); } public function testToCOOKIEString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame( DateTime::COOKIE === 'l, d-M-y H:i:s T' ? 'Thursday, 25-Dec-75 14:15:16 EST' : 'Thursday, 25-Dec-1975 14:15:16 EST', $d->toCookieString(), ); } public function testToIso8601String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toIso8601String()); } public function testToIso8601ZuluString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T19:15:16Z', $d->toIso8601ZuluString()); } public function testToRC822String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 75 14:15:16 -0500', $d->toRfc822String()); } public function testToRfc850String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thursday, 25-Dec-75 14:15:16 EST', $d->toRfc850String()); } public function testToRfc1036String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 75 14:15:16 -0500', $d->toRfc1036String()); } public function testToRfc1123String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRfc1123String()); } public function testToRfc2822String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRfc2822String()); } public function testToRfc3339String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toRfc3339String()); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16.000-05:00', $d->toRfc3339String(true)); } public function testToRssString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRssString()); } public function testToW3cString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toW3cString()); } public function testToRfc7231String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16, 'GMT'); $this->assertSame('Thu, 25 Dec 1975 14:15:16 GMT', $d->toRfc7231String()); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 19:15:16 GMT', $d->toRfc7231String()); } public function testIsoFormat() { $d = Carbon::parse('midnight'); $this->assertSame('24', $d->isoFormat('k')); $d = Carbon::parse('2017-01-01'); $this->assertSame('2017', $d->isoFormat('g')); $this->assertSame('2017', $d->locale('en_US')->isoFormat('g')); $this->assertSame('2016', $d->locale('fr')->isoFormat('g')); $this->assertSame('2016', $d->isoFormat('G')); $this->assertSame('2016', $d->locale('en_US')->isoFormat('G')); $this->assertSame('2016', $d->locale('fr')->isoFormat('G')); $d = Carbon::parse('2015-12-31'); $this->assertSame('2016', $d->isoFormat('g')); $this->assertSame('2016', $d->locale('en_US')->isoFormat('g')); $this->assertSame('2015', $d->locale('fr')->isoFormat('g')); $this->assertSame('2015', $d->isoFormat('G')); $this->assertSame('2015', $d->locale('en_US')->isoFormat('G')); $this->assertSame('2015', $d->locale('fr')->isoFormat('G')); $d = Carbon::parse('2017-01-01 22:25:24.182937'); $this->assertSame('1 18 182 1829 18293 182937 1829370 18293700 182937000', $d->isoFormat('S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS')); $this->assertSame('02017 +002017', $d->isoFormat('YYYYY YYYYYY')); $this->assertSame(-117, Carbon::create(-117, 1, 1)->year); $this->assertSame('-00117 -000117', Carbon::create(-117, 1, 1)->isoFormat('YYYYY YYYYYY')); $this->assertSame('M01', $d->isoFormat('\\MMM')); $this->assertSame('Jan', $d->isoFormat('MMM')); $this->assertSame('janv.', $d->locale('fr')->isoFormat('MMM')); $this->assertSame('ene.', $d->locale('es')->isoFormat('MMM')); $this->assertSame('1 de enero de 2017', $d->locale('es')->isoFormat('LL')); $this->assertSame('1 de ene. de 2017', $d->locale('es')->isoFormat('ll')); $this->assertSame('1st', Carbon::parse('2018-06-01')->isoFormat('Do')); $this->assertSame('11th', Carbon::parse('2018-06-11')->isoFormat('Do')); $this->assertSame('21st', Carbon::parse('2018-06-21')->isoFormat('Do')); $this->assertSame('15th', Carbon::parse('2018-06-15')->isoFormat('Do')); } public function testBadIsoFormat() { $d = BadIsoCarbon::parse('midnight'); $this->assertSame('', $d->isoFormat('MMM')); } public function testTranslatedFormat() { $this->assertSame('1st', Carbon::parse('01-01-01')->translatedFormat('jS')); $this->assertSame('1er', Carbon::parse('01-01-01')->locale('fr')->translatedFormat('jS')); $this->assertSame('31 мая', Carbon::parse('2019-05-15')->locale('ru')->translatedFormat('t F')); $this->assertSame('5 май', Carbon::parse('2019-05-15')->locale('ru')->translatedFormat('n F')); } } ================================================ FILE: tests/Carbon/SubTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\Unit; use DateTime; use Tests\AbstractTestCase; class SubTest extends AbstractTestCase { public function testSubMethod() { $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub('year', 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, Unit::Year)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(Unit::Year, 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub('2 years')->year); $lastNegated = null; $date = Carbon::createFromDate(1975)->sub( function (DateTime $date, bool $negated = false) use (&$lastNegated): DateTime { $lastNegated = $negated; return new DateTime($date->format('Y-m-d H:i:s').' - 2 years'); }, ); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(1973, $date->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract('year', 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(2, Unit::Year)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(Unit::Year, 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract('2 years')->year); $lastNegated = null; $this->assertSame(1973, Carbon::createFromDate(1975)->subtract( function (DateTime $date, bool $negated = false) use (&$lastNegated): DateTime { $lastNegated = $negated; return new DateTime($date->format('Y-m-d H:i:s').' - 2 years'); }, )->year); /** @var CarbonInterval $interval */ $interval = include __DIR__.'/../Fixtures/dynamicInterval.php'; $originalDate = Carbon::parse('2020-06-08'); $date = $originalDate->sub($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-05-31', $date->format('Y-m-d')); $this->assertSame($originalDate, $date); $date = Carbon::parse('2020-07-16')->subtract($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-06-30', $date->format('Y-m-d')); } public function testSubYearsPositive() { $this->assertSame(1974, Carbon::createFromDate(1975)->subYears(1)->year); } public function testSubYearsZero() { $this->assertSame(1975, Carbon::createFromDate(1975)->subYears(0)->year); } public function testSubYearsNegative() { $this->assertSame(1976, Carbon::createFromDate(1975)->subYears(-1)->year); } public function testSubYear() { $this->assertSame(1974, Carbon::createFromDate(1975)->subYear()->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, 'years')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(CarbonInterval::years(2))->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(2, 'years')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(CarbonInterval::years(2))->year); } public function testSubMonthsPositive() { $this->assertSame(12, Carbon::createFromDate(1975, 1, 1)->subMonths(1)->month); } public function testSubMonthsZero() { $this->assertSame(1, Carbon::createFromDate(1975, 1, 1)->subMonths(0)->month); } public function testSubMonthsNegative() { $this->assertSame(2, Carbon::createFromDate(1975, 1, 1)->subMonths(-1)->month); } public function testSubMonth() { $this->assertSame(12, Carbon::createFromDate(1975, 1, 1)->subMonth()->month); } public function testSubDaysPositive() { $this->assertSame(30, Carbon::createFromDate(1975, 5, 1)->subDays(1)->day); } public function testSubDaysZero() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 1)->subDays(0)->day); } public function testSubDaysNegative() { $this->assertSame(2, Carbon::createFromDate(1975, 5, 1)->subDays(-1)->day); } public function testSubDay() { $this->assertSame(30, Carbon::createFromDate(1975, 5, 1)->subDay()->day); } public function testSubWeekdaysPositive() { $this->assertSame(22, Carbon::createFromDate(2012, 1, 4)->subWeekdays(9)->day); } public function testSubWeekdaysZero() { $this->assertSame(4, Carbon::createFromDate(2012, 1, 4)->subWeekdays(0)->day); } public function testSubWeekdaysNegative() { $this->assertSame(13, Carbon::createFromDate(2012, 1, 31)->subWeekdays(-9)->day); } public function testSubWeekday() { $this->assertSame(6, Carbon::createFromDate(2012, 1, 9)->subWeekday()->day); } public function testSubWeekdayDuringWeekend() { $this->assertSame(6, Carbon::createFromDate(2012, 1, 8)->subWeekday()->day); } public function testSubWeeksPositive() { $this->assertSame(14, Carbon::createFromDate(1975, 5, 21)->subWeeks(1)->day); } public function testSubWeeksZero() { $this->assertSame(21, Carbon::createFromDate(1975, 5, 21)->subWeeks(0)->day); } public function testSubWeeksNegative() { $this->assertSame(28, Carbon::createFromDate(1975, 5, 21)->subWeeks(-1)->day); } public function testSubWeek() { $this->assertSame(14, Carbon::createFromDate(1975, 5, 21)->subWeek()->day); } public function testSubHoursPositive() { $this->assertSame(23, Carbon::createFromTime(0)->subHours(1)->hour); } public function testSubHoursZero() { $this->assertSame(0, Carbon::createFromTime(0)->subHours(0)->hour); } public function testSubHoursNegative() { $this->assertSame(1, Carbon::createFromTime(0)->subHours(-1)->hour); } public function testSubHour() { $this->assertSame(23, Carbon::createFromTime(0)->subHour()->hour); } public function testSubMinutesPositive() { $this->assertSame(59, Carbon::createFromTime(0, 0)->subMinutes(1)->minute); } public function testSubMinutesZero() { $this->assertSame(0, Carbon::createFromTime(0, 0)->subMinutes(0)->minute); } public function testSubMinutesNegative() { $this->assertSame(1, Carbon::createFromTime(0, 0)->subMinutes(-1)->minute); } public function testSubMinute() { $this->assertSame(59, Carbon::createFromTime(0, 0)->subMinute()->minute); } public function testSubSecondsPositive() { $this->assertSame(59, Carbon::createFromTime(0, 0, 0)->subSeconds(1)->second); } public function testSubSecondsZero() { $this->assertSame(0, Carbon::createFromTime(0, 0, 0)->subSeconds(0)->second); } public function testSubSecondsNegative() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->subSeconds(-1)->second); } public function testSubSecond() { $this->assertSame(59, Carbon::createFromTime(0, 0, 0)->subSecond()->second); } /** * Test non plural methods with non default args. */ public function testSubYearPassingArg() { // subYear should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1973, $date->subYear(2)->year); } public function testSubMonthPassingArg() { // subMonth should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 1); $this->assertSame(3, $date->subMonth(2)->month); } public function testSubMonthNoOverflowPassingArg() { // subMonthNoOverflow should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(2011, 4, 30); $date = $date->subMonthNoOverflow(2); $this->assertSame(2, $date->month); $this->assertSame(28, $date->day); } public function testSubDayPassingArg() { // subDay should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 10); $this->assertSame(8, $date->subDay(2)->day); } public function testSubHourPassingArg() { // subHour should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(22, $date->subHour(2)->hour); } public function testSubMinutePassingArg() { // subMinute should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(58, $date->subMinute(2)->minute); } public function testSubSecondPassingArg() { // subSecond should ideally be used without argument /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(58, $date->subSecond(2)->second); } } ================================================ FILE: tests/Carbon/TestingAidsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonImmutable; use DateTimeImmutable; use DateTimeZone; use Exception; use InvalidArgumentException; use stdClass; use SubCarbon; use Tests\AbstractTestCase; class TestingAidsTest extends AbstractTestCase { public function testTestingAidsWithTestNowNotSet() { Carbon::setTestNow(); $this->assertFalse(Carbon::hasTestNow()); $this->assertNull(Carbon::getTestNow()); } public function testTestingAidsWithTestNowSet() { Carbon::setTestNow($yesterday = Carbon::yesterday()); $this->assertTrue(Carbon::hasTestNow()); $this->assertEquals($yesterday, Carbon::getTestNow()); } public function testTestingAidsWithTestNowSetToString() { Carbon::setTestNow('2016-11-23'); $this->assertTrue(Carbon::hasTestNow()); $this->assertEquals(Carbon::getTestNow(), Carbon::parse('2016-11-23')); } public function testConstructorWithTestValueSet() { Carbon::setTestNow($yesterday = Carbon::yesterday()); $this->assertEquals($yesterday, new Carbon()); $this->assertEquals($yesterday, new Carbon(null)); $this->assertEquals($yesterday, new Carbon('')); $this->assertEquals($yesterday, new Carbon('now')); } public function testNowWithTestValueSet() { Carbon::setTestNow($yesterday = Carbon::yesterday()); $this->assertEquals($yesterday, Carbon::now()); } public function testParseWithTestValueSet() { $testNow = Carbon::yesterday(); $this->wrapWithTestNow(function () use ($testNow) { $this->assertEquals($testNow, Carbon::parse(null)); $this->assertEquals($testNow, Carbon::parse('')); $this->assertEquals($testNow, Carbon::parse('now')); }, $testNow); } public function testNowWithClosureValue() { $mockedNow = Carbon::parse('2019-09-21 12:34:56.123456'); $delta = 0; Carbon::setTestNow(function (Carbon $now) use (&$mockedNow, &$delta) { $this->assertInstanceOfCarbon($now); return $mockedNow->copy()->tz($now->tz)->addMicroseconds($delta); }); $this->assertSame('2019-09-21 12:34:56.123456', Carbon::now()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-09-21 00:00:00.000000', Carbon::today()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-09-22 00:00:00.000000', Carbon::create('tomorrow')->format('Y-m-d H:i:s.u')); $this->assertSame('2018-06-15 12:34:00.000000', Carbon::create(2018, 6, 15, null, null)->format('Y-m-d H:i:s.u')); $delta = 11111111; $date = Carbon::now(); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2019-09-21 12:35:07.234567', $date->format('Y-m-d H:i:s.u')); $date = Carbon::today(); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2019-09-21 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create('tomorrow'); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2019-09-22 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create(2018, 6, 15, null, null); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2018-06-15 12:35:00.000000', $date->format('Y-m-d H:i:s.u')); date_default_timezone_set('UTC'); $date = Carbon::now(); $this->assertSame('UTC', $date->tzName); $this->assertSame('2019-09-21 16:35:07.234567', $date->format('Y-m-d H:i:s.u')); $date = Carbon::today(); $this->assertSame('UTC', $date->tzName); $this->assertSame('2019-09-21 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create('tomorrow'); $this->assertSame('UTC', $date->tzName); $this->assertSame('2019-09-22 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create(2018, 6, 15, null, null); $this->assertSame('UTC', $date->tzName); $this->assertSame('2018-06-15 16:35:00.000000', $date->format('Y-m-d H:i:s.u')); date_default_timezone_set('America/Toronto'); } public function testParseRelativeWithTestValueSet() { $testNow = Carbon::parse('2013-09-01 05:15:05'); $this->wrapWithTestNow(function () { $this->assertSame('2013-09-01 05:10:05', Carbon::parse('5 minutes ago')->toDateTimeString()); $this->assertSame('2013-08-25 05:15:05', Carbon::parse('1 week ago')->toDateTimeString()); $this->assertSame('2013-09-02 00:00:00', Carbon::parse('tomorrow')->toDateTimeString()); $this->assertSame('2013-09-01 00:00:00', Carbon::parse('today')->toDateTimeString()); $this->assertSame('2013-08-31 00:00:00', Carbon::parse('yesterday')->toDateTimeString()); $this->assertSame('2013-09-02 05:15:05', Carbon::parse('+1 day')->toDateTimeString()); $this->assertSame('2013-08-31 05:15:05', Carbon::parse('-1 day')->toDateTimeString()); $this->assertSame('2013-09-02 00:00:00', Carbon::parse('next monday')->toDateTimeString()); $this->assertSame('2013-09-03 00:00:00', Carbon::parse('next tuesday')->toDateTimeString()); $this->assertSame('2013-09-04 00:00:00', Carbon::parse('next wednesday')->toDateTimeString()); $this->assertSame('2013-09-05 00:00:00', Carbon::parse('next thursday')->toDateTimeString()); $this->assertSame('2013-09-06 00:00:00', Carbon::parse('next friday')->toDateTimeString()); $this->assertSame('2013-09-07 00:00:00', Carbon::parse('next saturday')->toDateTimeString()); $this->assertSame('2013-09-08 00:00:00', Carbon::parse('next sunday')->toDateTimeString()); $this->assertSame('2013-08-26 00:00:00', Carbon::parse('last monday')->toDateTimeString()); $this->assertSame('2013-08-27 00:00:00', Carbon::parse('last tuesday')->toDateTimeString()); $this->assertSame('2013-08-28 00:00:00', Carbon::parse('last wednesday')->toDateTimeString()); $this->assertSame('2013-08-29 00:00:00', Carbon::parse('last thursday')->toDateTimeString()); $this->assertSame('2013-08-30 00:00:00', Carbon::parse('last friday')->toDateTimeString()); $this->assertSame('2013-08-31 00:00:00', Carbon::parse('last saturday')->toDateTimeString()); $this->assertSame('2013-08-25 00:00:00', Carbon::parse('last sunday')->toDateTimeString()); $this->assertSame('2013-09-02 00:00:00', Carbon::parse('this monday')->toDateTimeString()); $this->assertSame('2013-09-03 00:00:00', Carbon::parse('this tuesday')->toDateTimeString()); $this->assertSame('2013-09-04 00:00:00', Carbon::parse('this wednesday')->toDateTimeString()); $this->assertSame('2013-09-05 00:00:00', Carbon::parse('this thursday')->toDateTimeString()); $this->assertSame('2013-09-06 00:00:00', Carbon::parse('this friday')->toDateTimeString()); $this->assertSame('2013-09-07 00:00:00', Carbon::parse('this saturday')->toDateTimeString()); $this->assertSame('2013-09-01 00:00:00', Carbon::parse('this sunday')->toDateTimeString()); $this->assertSame('2013-10-01 05:15:05', Carbon::parse('first day of next month')->toDateTimeString()); $this->assertSame('2013-09-30 05:15:05', Carbon::parse('last day of this month')->toDateTimeString()); }, $testNow); } public function testHasRelativeKeywords() { $this->assertFalse(Carbon::hasRelativeKeywords('sunday 2015-02-23')); $this->assertTrue(Carbon::hasRelativeKeywords('today +2014 days')); $this->assertTrue(Carbon::hasRelativeKeywords('next sunday -3600 seconds')); $this->assertTrue(Carbon::hasRelativeKeywords('last day of this month')); $this->assertFalse(Carbon::hasRelativeKeywords('last day of december 2015')); $this->assertTrue(Carbon::hasRelativeKeywords('first sunday of next month')); $this->assertFalse(Carbon::hasRelativeKeywords('first sunday of January 2017')); } public function testParseRelativeWithMinusSignsInDate() { $testNow = Carbon::parse('2013-09-01 05:15:05'); $this->wrapWithTestNow(function () { $this->assertSame('2000-01-03 00:00:00', Carbon::parse('2000-1-3')->toDateTimeString()); $this->assertSame('2000-10-10 00:00:00', Carbon::parse('2000-10-10')->toDateTimeString()); }, $testNow); $this->assertSame('2000-01-03 00:00:00', Carbon::parse('2000-1-3')->toDateTimeString()); $this->assertSame('2000-10-10 00:00:00', Carbon::parse('2000-10-10')->toDateTimeString()); } public function testTimeZoneWithTestValueSet() { $testNow = Carbon::parse('2013-07-01 12:00:00', 'America/New_York'); $this->wrapWithTestNow(function () { $this->assertSame('2013-07-01T12:00:00-04:00', Carbon::parse('now')->toIso8601String()); $this->assertSame('2013-07-01T11:00:00-05:00', Carbon::parse('now', 'America/Mexico_City')->toIso8601String()); $this->assertSame('2013-07-01T09:00:00-07:00', Carbon::parse('now', 'America/Vancouver')->toIso8601String()); }, $testNow); } public function testSetTestNowAndTimezoneWithBadTimezone(): void { $this->expectExceptionObject(new InvalidArgumentException( "Timezone ID '-05:00' is invalid, did you mean 'America/Chicago'?\n". "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". 'For the record, hours/minutes offset are relevant only for a particular moment, but not as a default timezone.' )); Carbon::setTestNowAndTimezone(Carbon::parse('2018-05-06T12:00:00-05:00')); } public function testSetTestNowAndTimezoneWithBadTimezoneWithErrorAsException(): void { $this->expectExceptionObject(new InvalidArgumentException( "Timezone ID '-05:00' is invalid, did you mean 'America/Chicago'?\n". "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". 'For the record, hours/minutes offset are relevant only for a particular moment, but not as a default timezone.' )); $this->withErrorAsException(function () { Carbon::setTestNowAndTimezone(Carbon::parse('2018-05-06T12:00:00-05:00')); }); } public function testSetTestNowAndTimezoneWithNull(): void { Carbon::setTestNowAndTimezone(); Carbon::setTestNowAndTimezone(); // replay-able with no effect foreach ([null, 'UTC', 'Asia/Tokyo'] as $originalTimezone) { $originalTimezone ? date_default_timezone_set($originalTimezone) : ($originalTimezone = date_default_timezone_get()); Carbon::setTestNowAndTimezone('2013-09-01 05:10:15 America/Vancouver', 'America/Vancouver'); $this->assertSame('America/Vancouver', date_default_timezone_get()); $this->assertSame('America/Vancouver', Carbon::now()->tzName); Carbon::setTestNowAndTimezone(); $this->assertFalse(Carbon::hasTestNow()); $this->assertSame($originalTimezone, date_default_timezone_get()); $this->assertSame($originalTimezone, Carbon::now()->tzName); } } public function testCreateFromPartialFormat() { Carbon::setTestNowAndTimezone('2013-09-01 05:10:15 America/Vancouver', 'America/Vancouver'); // Simple partial time. $this->assertSame('2018-05-06T05:10:15-07:00', Carbon::createFromFormat('Y-m-d', '2018-05-06')->toIso8601String()); $this->assertSame('2013-09-01T10:20:30-07:00', Carbon::createFromFormat('H:i:s', '10:20:30')->toIso8601String()); // Custom timezone. $this->assertSame('2013-09-01T10:20:00+03:00', Carbon::createFromFormat('H:i e', '10:20 Europe/Kiev')->toIso8601String()); $this->assertSame('2013-09-01T10:20:00+01:00', Carbon::createFromFormat('H:i', '10:20', 'Europe/London')->toIso8601String()); $this->assertSame('2013-09-01T11:30:00+07:00', Carbon::createFromFormat('H:i:s e', '11:30:00+07:00')->toIso8601String()); $this->assertSame('2013-09-01T11:30:00+05:00', Carbon::createFromFormat('H:i:s', '11:30:00', '+05:00')->toIso8601String()); // Escaped timezone. $this->assertSame('2013-09-01T05:10:15-07:00', Carbon::createFromFormat('\e', 'e')->toIso8601String()); // Weird format, naive modify would fail here. $this->assertSame('2005-08-09T05:10:15-07:00', Carbon::createFromFormat('l jS \of F Y', 'Tuesday 9th of August 2005')->toIso8601String()); $this->assertSame('2013-09-01T00:12:13-07:00', Carbon::createFromFormat('i:s', '12:13')->toIso8601String()); $this->assertSame('2018-09-05T05:10:15-07:00', Carbon::createFromFormat('Y/d', '2018/5')->toIso8601String()); // Resetting to epoch. $this->assertSame('2018-05-06T00:00:00-07:00', Carbon::createFromFormat('!Y-m-d', '2018-05-06')->toIso8601String()); $this->assertSame('1970-01-01T10:20:30-08:00', Carbon::createFromFormat('Y-m-d! H:i:s', '2018-05-06 10:20:30')->toIso8601String()); $this->assertSame('2018-05-06T00:00:00-07:00', Carbon::createFromFormat('Y-m-d|', '2018-05-06')->toIso8601String()); $this->assertSame('1970-01-01T10:20:30-08:00', Carbon::createFromFormat('|H:i:s', '10:20:30')->toIso8601String()); $kyiv = $this->firstValidTimezoneAmong(['Europe/Kyiv', 'Europe/Kiev'])->getName(); // Resetting to epoch (timezone fun). $this->assertSame('1970-01-01T00:00:00-08:00', Carbon::createFromFormat('|', '')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+03:00', Carbon::createFromFormat('e|', $kyiv)->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+01:00', Carbon::createFromFormat('|', '', 'Europe/London')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00-08:00', Carbon::createFromFormat('!', '')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+03:00', Carbon::createFromFormat('!e', $kyiv)->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+01:00', Carbon::createFromFormat('!', '', 'Europe/London')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00-08:00', Carbon::createFromFormat('e!', $kyiv)->toIso8601String()); // Escaped epoch resets. $this->assertSame('2013-09-01T05:10:15-07:00', Carbon::createFromFormat('\|', '|')->toIso8601String()); $this->assertSame('2013-09-01T05:10:15-07:00', Carbon::createFromFormat('\!', '!')->toIso8601String()); $this->assertSame('2013-09-01T05:10:15+03:00', Carbon::createFromFormat('e \!', $kyiv.' !')->toIso8601String()); } public function testCreateFromPartialFormatWithMicroseconds() { Carbon::setTestNowAndTimezone(Carbon::parse('2013-09-01 05:10:15.123456', 'America/Vancouver')); $this->assertSame('2018-05-06 05:10:15.123456', Carbon::createFromFormat('Y-m-d', '2018-05-06')->format('Y-m-d H:i:s.u')); $this->assertSame('2013-09-01 10:20:30.654321', Carbon::createFromFormat('H:i:s.u', '10:20:30.654321')->format('Y-m-d H:i:s.u')); } public function testCreateFromDateTimeInterface() { Carbon::setTestNowAndTimezone(date_create('2013-09-01 05:10:15.123456', new DateTimeZone('America/Vancouver'))); $this->assertSame('2018-05-06 05:10:15.123456', Carbon::createFromFormat('Y-m-d', '2018-05-06')->format('Y-m-d H:i:s.u')); $this->assertSame('2013-09-01 10:20:30.654321', Carbon::createFromFormat('H:i:s.u', '10:20:30.654321')->format('Y-m-d H:i:s.u')); } public function testSetTestNow() { Carbon::setTestNow(null); $n1 = Carbon::now(); $n2 = Carbon::now(); $this->assertTrue($n2 > $n1); Carbon::setTestNow('2013-09-01 10:20:30.654321'); $n1 = Carbon::now(); $n2 = Carbon::now(); $this->assertFalse($n2 > $n1); Carbon::setTestNow(false); $n1 = Carbon::now(); $n2 = Carbon::now(); $this->assertTrue($n2 > $n1); } public function testSetTestNowGlobally(): void { require_once __DIR__.'/../Fixtures/SubCarbon.php'; SubCarbon::setTestNow('2018-05-06 05:10:15.123456'); $this->assertSame('2018-05-06 05:10:15.123456', SubCarbon::now()->format('Y-m-d H:i:s.u')); $this->assertSame('2018-05-06 05:10:15.123456', Carbon::now()->format('Y-m-d H:i:s.u')); $this->assertSame('2018-05-06 05:10:15.123456', CarbonImmutable::now()->format('Y-m-d H:i:s.u')); } public function testWithTestNow() { $self = $this; $testNow = '2020-09-16 10:20:00'; $object = new stdClass(); $result = Carbon::withTestNow($testNow, static function () use ($self, $testNow, $object) { $currentTime = Carbon::now(); $self->assertSame($testNow, $currentTime->format('Y-m-d H:i:s')); return $object; }); $this->assertSame($object, $result); $currentTime = Carbon::now(); $this->assertNotSame($testNow, $currentTime->format('Y-m-d H:i:s')); } public function testWithTestNowRestoresPreviousTestNow() { Carbon::setTestNow('2024-01-01 12:00:00'); Carbon::withTestNow('2024-06-15 10:00:00', function () { $this->assertEquals('2024-06-15', Carbon::now()->format('Y-m-d')); }); $this->assertEquals('2024-01-01', Carbon::now()->format('Y-m-d')); Carbon::setTestNow(); } public function testWithTestNowWithException() { $testNow = '2020-09-16 10:20:00'; try { Carbon::withTestNow($testNow, static function () { throw new Exception(); }); } catch (Exception $e) { // ignore } $currentTime = Carbon::now(); $this->assertNotSame($testNow, $currentTime->format('Y-m-d H:i:s')); } public function testWithModifyReturningDateTime() { Carbon::setTestNowAndTimezone(new class('2000-01-01 00:00 UTC') extends Carbon { public function modify($modify) { return $this->toDateTimeImmutable()->modify($modify); } }); $currentTime = new Carbon('tomorrow'); $this->assertSame('2000-01-02 00:00:00 UTC', $currentTime->format('Y-m-d H:i:s e')); } public function testTimezoneConsistency() { Carbon::setTestNow(); date_default_timezone_set('UTC'); $currentDate = Carbon::now()->setTimezone('America/Los_Angeles'); $laDate = $currentDate->format('Y-m-d H:i:s e'); $utcDate = $currentDate->copy()->utc()->format('Y-m-d H:i:s e'); Carbon::setTestNow($currentDate); $this->assertSame($utcDate, Carbon::now()->format('Y-m-d H:i:s e')); $this->assertSame($utcDate, Carbon::now('UTC')->format('Y-m-d H:i:s e')); Carbon::setTestNowAndTimezone($currentDate); $this->assertSame($laDate, Carbon::now()->format('Y-m-d H:i:s e')); $this->assertSame($utcDate, Carbon::now('UTC')->format('Y-m-d H:i:s e')); } public function testSleep() { $initial = Carbon::now('UTC'); Carbon::setTestNow($initial); $before = microtime(true); Carbon::sleep(5); Carbon::sleep(20); $after = microtime(true); $this->assertLessThan(0.1, $after - $before); $this->assertSame( $initial->copy()->addSeconds(25)->format('Y-m-d H:i:s.u'), Carbon::now('UTC')->format('Y-m-d H:i:s.u'), ); Carbon::setTestNow(null); $before = new DateTimeImmutable('now UTC'); Carbon::sleep(0.5); $after = new DateTimeImmutable('now UTC'); $this->assertSame( 5, (int) round(10 * ((float) $after->format('U.u') - ((float) $before->format('U.u')))), ); } } ================================================ FILE: tests/Carbon/WeekTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Carbon; use Carbon\Carbon; use Carbon\CarbonInterface; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class WeekTest extends AbstractTestCase { public const SAMPLE = [ '1990-12-20' => [ 1990, 1990, 51, 51, 52, 52, ], '1990-12-21' => [ 1990, 1990, 51, 51, 52, 52, ], '1990-12-22' => [ 1990, 1990, 51, 51, 52, 52, ], '1990-12-23' => [ 1990, 1990, 52, 51, 52, 52, ], '1990-12-24' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-25' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-26' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-27' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-28' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-29' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-30' => [ 1991, 1990, 1, 52, 52, 52, ], '1990-12-31' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-01' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-02' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-03' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-04' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-05' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-06' => [ 1991, 1991, 2, 1, 52, 52, ], '1991-01-07' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-01-08' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-01-09' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-01-10' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-12-20' => [ 1991, 1991, 51, 51, 52, 52, ], '1991-12-21' => [ 1991, 1991, 51, 51, 52, 52, ], '1991-12-22' => [ 1991, 1991, 52, 51, 52, 52, ], '1991-12-23' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-24' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-25' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-26' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-27' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-28' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-29' => [ 1992, 1991, 1, 52, 52, 52, ], '1991-12-30' => [ 1992, 1992, 1, 1, 52, 52, ], '1991-12-31' => [ 1992, 1992, 1, 1, 52, 52, ], '1992-01-01' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-02' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-03' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-04' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-05' => [ 1992, 1992, 2, 1, 52, 53, ], '1992-01-06' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-07' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-08' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-09' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-10' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-12-20' => [ 1992, 1992, 52, 51, 52, 53, ], '1992-12-21' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-22' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-23' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-24' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-25' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-26' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-27' => [ 1993, 1992, 1, 52, 52, 53, ], '1992-12-28' => [ 1993, 1992, 1, 53, 52, 53, ], '1992-12-29' => [ 1993, 1992, 1, 53, 52, 53, ], '1992-12-30' => [ 1993, 1992, 1, 53, 52, 53, ], '1992-12-31' => [ 1993, 1992, 1, 53, 52, 53, ], '1993-01-01' => [ 1993, 1992, 1, 53, 52, 52, ], '1993-01-02' => [ 1993, 1992, 1, 53, 52, 52, ], '1993-01-03' => [ 1993, 1992, 2, 53, 52, 52, ], '1993-01-04' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-05' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-06' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-07' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-08' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-09' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-10' => [ 1993, 1993, 3, 1, 52, 52, ], '1993-12-20' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-21' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-22' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-23' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-24' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-25' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-26' => [ 1994, 1993, 1, 51, 52, 52, ], '1993-12-27' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-28' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-29' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-30' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-31' => [ 1994, 1993, 1, 52, 52, 52, ], '1994-01-01' => [ 1994, 1993, 1, 52, 53, 52, ], '1994-01-02' => [ 1994, 1993, 2, 52, 53, 52, ], '1994-01-03' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-04' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-05' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-06' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-07' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-08' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-09' => [ 1994, 1994, 3, 1, 53, 52, ], '1994-01-10' => [ 1994, 1994, 3, 2, 53, 52, ], '1994-12-20' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-21' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-22' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-23' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-24' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-25' => [ 1994, 1994, 53, 51, 53, 52, ], '1994-12-26' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-27' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-28' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-29' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-30' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-31' => [ 1994, 1994, 53, 52, 53, 52, ], '1995-01-01' => [ 1995, 1994, 1, 52, 52, 52, ], '1995-01-02' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-03' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-04' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-05' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-06' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-07' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-08' => [ 1995, 1995, 2, 1, 52, 52, ], '1995-01-09' => [ 1995, 1995, 2, 2, 52, 52, ], '1995-01-10' => [ 1995, 1995, 2, 2, 52, 52, ], '1995-12-20' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-21' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-22' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-23' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-24' => [ 1995, 1995, 52, 51, 52, 52, ], '1995-12-25' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-26' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-27' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-28' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-29' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-30' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-31' => [ 1996, 1995, 1, 52, 52, 52, ], '1996-01-01' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-02' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-03' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-04' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-05' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-06' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-07' => [ 1996, 1996, 2, 1, 52, 52, ], '1996-01-08' => [ 1996, 1996, 2, 2, 52, 52, ], '1996-01-09' => [ 1996, 1996, 2, 2, 52, 52, ], '1996-01-10' => [ 1996, 1996, 2, 2, 52, 52, ], '1996-12-20' => [ 1996, 1996, 51, 51, 52, 52, ], '1996-12-21' => [ 1996, 1996, 51, 51, 52, 52, ], '1996-12-22' => [ 1996, 1996, 52, 51, 52, 52, ], '1996-12-23' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-24' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-25' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-26' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-27' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-28' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-29' => [ 1997, 1996, 1, 52, 52, 52, ], '1996-12-30' => [ 1997, 1997, 1, 1, 52, 52, ], '1996-12-31' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-01' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-02' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-03' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-04' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-05' => [ 1997, 1997, 2, 1, 52, 52, ], '1997-01-06' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-07' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-08' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-09' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-10' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-12-20' => [ 1997, 1997, 51, 51, 52, 52, ], '1997-12-21' => [ 1997, 1997, 52, 51, 52, 52, ], '1997-12-22' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-23' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-24' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-25' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-26' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-27' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-28' => [ 1998, 1997, 1, 52, 52, 52, ], '1997-12-29' => [ 1998, 1998, 1, 1, 52, 52, ], '1997-12-30' => [ 1998, 1998, 1, 1, 52, 52, ], '1997-12-31' => [ 1998, 1998, 1, 1, 52, 52, ], '1998-01-01' => [ 1998, 1998, 1, 1, 52, 53, ], '1998-01-02' => [ 1998, 1998, 1, 1, 52, 53, ], '1998-01-03' => [ 1998, 1998, 1, 1, 52, 53, ], '1998-01-04' => [ 1998, 1998, 2, 1, 52, 53, ], '1998-01-05' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-06' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-07' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-08' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-09' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-10' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-12-20' => [ 1998, 1998, 52, 51, 52, 53, ], '1998-12-21' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-22' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-23' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-24' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-25' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-26' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-27' => [ 1999, 1998, 1, 52, 52, 53, ], '1998-12-28' => [ 1999, 1998, 1, 53, 52, 53, ], '1998-12-29' => [ 1999, 1998, 1, 53, 52, 53, ], '1998-12-30' => [ 1999, 1998, 1, 53, 52, 53, ], '1998-12-31' => [ 1999, 1998, 1, 53, 52, 53, ], '1999-01-01' => [ 1999, 1998, 1, 53, 52, 52, ], '1999-01-02' => [ 1999, 1998, 1, 53, 52, 52, ], '1999-01-03' => [ 1999, 1998, 2, 53, 52, 52, ], '1999-01-04' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-05' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-06' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-07' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-08' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-09' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-10' => [ 1999, 1999, 3, 1, 52, 52, ], '1999-12-20' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-21' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-22' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-23' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-24' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-25' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-26' => [ 2000, 1999, 1, 51, 52, 52, ], '1999-12-27' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-28' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-29' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-30' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-31' => [ 2000, 1999, 1, 52, 52, 52, ], '2000-01-01' => [ 2000, 1999, 1, 52, 53, 52, ], '2000-01-02' => [ 2000, 1999, 2, 52, 53, 52, ], '2000-01-03' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-04' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-05' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-06' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-07' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-08' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-09' => [ 2000, 2000, 3, 1, 53, 52, ], '2000-01-10' => [ 2000, 2000, 3, 2, 53, 52, ], '2000-12-20' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-21' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-22' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-23' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-24' => [ 2000, 2000, 53, 51, 53, 52, ], '2000-12-25' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-26' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-27' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-28' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-29' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-30' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-31' => [ 2001, 2000, 1, 52, 53, 52, ], '2001-01-01' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-02' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-03' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-04' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-05' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-06' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-07' => [ 2001, 2001, 2, 1, 52, 52, ], '2001-01-08' => [ 2001, 2001, 2, 2, 52, 52, ], '2001-01-09' => [ 2001, 2001, 2, 2, 52, 52, ], '2001-01-10' => [ 2001, 2001, 2, 2, 52, 52, ], '2001-12-20' => [ 2001, 2001, 51, 51, 52, 52, ], '2001-12-21' => [ 2001, 2001, 51, 51, 52, 52, ], '2001-12-22' => [ 2001, 2001, 51, 51, 52, 52, ], '2001-12-23' => [ 2001, 2001, 52, 51, 52, 52, ], '2001-12-24' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-25' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-26' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-27' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-28' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-29' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-30' => [ 2002, 2001, 1, 52, 52, 52, ], '2001-12-31' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-01' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-02' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-03' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-04' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-05' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-06' => [ 2002, 2002, 2, 1, 52, 52, ], '2002-01-07' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-01-08' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-01-09' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-01-10' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-12-20' => [ 2002, 2002, 51, 51, 52, 52, ], '2002-12-21' => [ 2002, 2002, 51, 51, 52, 52, ], '2002-12-22' => [ 2002, 2002, 52, 51, 52, 52, ], '2002-12-23' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-24' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-25' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-26' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-27' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-28' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-29' => [ 2003, 2002, 1, 52, 52, 52, ], '2002-12-30' => [ 2003, 2003, 1, 1, 52, 52, ], '2002-12-31' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-01' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-02' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-03' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-04' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-05' => [ 2003, 2003, 2, 1, 52, 52, ], '2003-01-06' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-07' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-08' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-09' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-10' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-12-20' => [ 2003, 2003, 51, 51, 52, 52, ], '2003-12-21' => [ 2003, 2003, 52, 51, 52, 52, ], '2003-12-22' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-23' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-24' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-25' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-26' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-27' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-28' => [ 2004, 2003, 1, 52, 52, 52, ], '2003-12-29' => [ 2004, 2004, 1, 1, 52, 52, ], '2003-12-30' => [ 2004, 2004, 1, 1, 52, 52, ], '2003-12-31' => [ 2004, 2004, 1, 1, 52, 52, ], '2004-01-01' => [ 2004, 2004, 1, 1, 52, 53, ], '2004-01-02' => [ 2004, 2004, 1, 1, 52, 53, ], '2004-01-03' => [ 2004, 2004, 1, 1, 52, 53, ], '2004-01-04' => [ 2004, 2004, 2, 1, 52, 53, ], '2004-01-05' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-06' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-07' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-08' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-09' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-10' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-12-20' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-21' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-22' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-23' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-24' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-25' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-26' => [ 2005, 2004, 1, 52, 52, 53, ], '2004-12-27' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-28' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-29' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-30' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-31' => [ 2005, 2004, 1, 53, 52, 53, ], '2005-01-01' => [ 2005, 2004, 1, 53, 53, 52, ], '2005-01-02' => [ 2005, 2004, 2, 53, 53, 52, ], '2005-01-03' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-04' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-05' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-06' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-07' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-08' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-09' => [ 2005, 2005, 3, 1, 53, 52, ], '2005-01-10' => [ 2005, 2005, 3, 2, 53, 52, ], '2005-12-20' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-21' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-22' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-23' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-24' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-25' => [ 2005, 2005, 53, 51, 53, 52, ], '2005-12-26' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-27' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-28' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-29' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-30' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-31' => [ 2005, 2005, 53, 52, 53, 52, ], '2006-01-01' => [ 2006, 2005, 1, 52, 52, 52, ], '2006-01-02' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-03' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-04' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-05' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-06' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-07' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-08' => [ 2006, 2006, 2, 1, 52, 52, ], '2006-01-09' => [ 2006, 2006, 2, 2, 52, 52, ], '2006-01-10' => [ 2006, 2006, 2, 2, 52, 52, ], '2006-12-20' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-21' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-22' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-23' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-24' => [ 2006, 2006, 52, 51, 52, 52, ], '2006-12-25' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-26' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-27' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-28' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-29' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-30' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-31' => [ 2007, 2006, 1, 52, 52, 52, ], '2007-01-01' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-02' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-03' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-04' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-05' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-06' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-07' => [ 2007, 2007, 2, 1, 52, 52, ], '2007-01-08' => [ 2007, 2007, 2, 2, 52, 52, ], '2007-01-09' => [ 2007, 2007, 2, 2, 52, 52, ], '2007-01-10' => [ 2007, 2007, 2, 2, 52, 52, ], '2007-12-20' => [ 2007, 2007, 51, 51, 52, 52, ], '2007-12-21' => [ 2007, 2007, 51, 51, 52, 52, ], '2007-12-22' => [ 2007, 2007, 51, 51, 52, 52, ], '2007-12-23' => [ 2007, 2007, 52, 51, 52, 52, ], '2007-12-24' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-25' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-26' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-27' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-28' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-29' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-30' => [ 2008, 2007, 1, 52, 52, 52, ], '2007-12-31' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-01' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-02' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-03' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-04' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-05' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-06' => [ 2008, 2008, 2, 1, 52, 52, ], '2008-01-07' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-01-08' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-01-09' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-01-10' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-12-20' => [ 2008, 2008, 51, 51, 52, 52, ], '2008-12-21' => [ 2008, 2008, 52, 51, 52, 52, ], '2008-12-22' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-23' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-24' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-25' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-26' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-27' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-28' => [ 2009, 2008, 1, 52, 52, 52, ], '2008-12-29' => [ 2009, 2009, 1, 1, 52, 52, ], '2008-12-30' => [ 2009, 2009, 1, 1, 52, 52, ], '2008-12-31' => [ 2009, 2009, 1, 1, 52, 52, ], '2009-01-01' => [ 2009, 2009, 1, 1, 52, 53, ], '2009-01-02' => [ 2009, 2009, 1, 1, 52, 53, ], '2009-01-03' => [ 2009, 2009, 1, 1, 52, 53, ], '2009-01-04' => [ 2009, 2009, 2, 1, 52, 53, ], '2009-01-05' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-06' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-07' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-08' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-09' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-10' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-12-20' => [ 2009, 2009, 52, 51, 52, 53, ], '2009-12-21' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-22' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-23' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-24' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-25' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-26' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-27' => [ 2010, 2009, 1, 52, 52, 53, ], '2009-12-28' => [ 2010, 2009, 1, 53, 52, 53, ], '2009-12-29' => [ 2010, 2009, 1, 53, 52, 53, ], '2009-12-30' => [ 2010, 2009, 1, 53, 52, 53, ], '2009-12-31' => [ 2010, 2009, 1, 53, 52, 53, ], '2010-01-01' => [ 2010, 2009, 1, 53, 52, 52, ], '2010-01-02' => [ 2010, 2009, 1, 53, 52, 52, ], '2010-01-03' => [ 2010, 2009, 2, 53, 52, 52, ], '2010-01-04' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-05' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-06' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-07' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-08' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-09' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-10' => [ 2010, 2010, 3, 1, 52, 52, ], '2010-12-20' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-21' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-22' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-23' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-24' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-25' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-26' => [ 2011, 2010, 1, 51, 52, 52, ], '2010-12-27' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-28' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-29' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-30' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-31' => [ 2011, 2010, 1, 52, 52, 52, ], '2011-01-01' => [ 2011, 2010, 1, 52, 53, 52, ], '2011-01-02' => [ 2011, 2010, 2, 52, 53, 52, ], '2011-01-03' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-04' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-05' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-06' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-07' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-08' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-09' => [ 2011, 2011, 3, 1, 53, 52, ], '2011-01-10' => [ 2011, 2011, 3, 2, 53, 52, ], '2011-12-20' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-21' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-22' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-23' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-24' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-25' => [ 2011, 2011, 53, 51, 53, 52, ], '2011-12-26' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-27' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-28' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-29' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-30' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-31' => [ 2011, 2011, 53, 52, 53, 52, ], '2012-01-01' => [ 2012, 2011, 1, 52, 52, 52, ], '2012-01-02' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-03' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-04' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-05' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-06' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-07' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-08' => [ 2012, 2012, 2, 1, 52, 52, ], '2012-01-09' => [ 2012, 2012, 2, 2, 52, 52, ], '2012-01-10' => [ 2012, 2012, 2, 2, 52, 52, ], '2012-12-20' => [ 2012, 2012, 51, 51, 52, 52, ], '2012-12-21' => [ 2012, 2012, 51, 51, 52, 52, ], '2012-12-22' => [ 2012, 2012, 51, 51, 52, 52, ], '2012-12-23' => [ 2012, 2012, 52, 51, 52, 52, ], '2012-12-24' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-25' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-26' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-27' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-28' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-29' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-30' => [ 2013, 2012, 1, 52, 52, 52, ], '2012-12-31' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-01' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-02' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-03' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-04' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-05' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-06' => [ 2013, 2013, 2, 1, 52, 52, ], '2013-01-07' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-01-08' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-01-09' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-01-10' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-12-20' => [ 2013, 2013, 51, 51, 52, 52, ], '2013-12-21' => [ 2013, 2013, 51, 51, 52, 52, ], '2013-12-22' => [ 2013, 2013, 52, 51, 52, 52, ], '2013-12-23' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-24' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-25' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-26' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-27' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-28' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-29' => [ 2014, 2013, 1, 52, 52, 52, ], '2013-12-30' => [ 2014, 2014, 1, 1, 52, 52, ], '2013-12-31' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-01' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-02' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-03' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-04' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-05' => [ 2014, 2014, 2, 1, 52, 52, ], '2014-01-06' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-07' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-08' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-09' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-10' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-12-20' => [ 2014, 2014, 51, 51, 52, 52, ], '2014-12-21' => [ 2014, 2014, 52, 51, 52, 52, ], '2014-12-22' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-23' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-24' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-25' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-26' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-27' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-28' => [ 2015, 2014, 1, 52, 52, 52, ], '2014-12-29' => [ 2015, 2015, 1, 1, 52, 52, ], '2014-12-30' => [ 2015, 2015, 1, 1, 52, 52, ], '2014-12-31' => [ 2015, 2015, 1, 1, 52, 52, ], '2015-01-01' => [ 2015, 2015, 1, 1, 52, 53, ], '2015-01-02' => [ 2015, 2015, 1, 1, 52, 53, ], '2015-01-03' => [ 2015, 2015, 1, 1, 52, 53, ], '2015-01-04' => [ 2015, 2015, 2, 1, 52, 53, ], '2015-01-05' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-06' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-07' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-08' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-09' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-10' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-12-20' => [ 2015, 2015, 52, 51, 52, 53, ], '2015-12-21' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-22' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-23' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-24' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-25' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-26' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-27' => [ 2016, 2015, 1, 52, 52, 53, ], '2015-12-28' => [ 2016, 2015, 1, 53, 52, 53, ], '2015-12-29' => [ 2016, 2015, 1, 53, 52, 53, ], '2015-12-30' => [ 2016, 2015, 1, 53, 52, 53, ], '2015-12-31' => [ 2016, 2015, 1, 53, 52, 53, ], '2016-01-01' => [ 2016, 2015, 1, 53, 53, 52, ], '2016-01-02' => [ 2016, 2015, 1, 53, 53, 52, ], '2016-01-03' => [ 2016, 2015, 2, 53, 53, 52, ], '2016-01-04' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-05' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-06' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-07' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-08' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-09' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-10' => [ 2016, 2016, 3, 1, 53, 52, ], '2016-12-20' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-21' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-22' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-23' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-24' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-25' => [ 2016, 2016, 53, 51, 53, 52, ], '2016-12-26' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-27' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-28' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-29' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-30' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-31' => [ 2016, 2016, 53, 52, 53, 52, ], '2017-01-01' => [ 2017, 2016, 1, 52, 52, 52, ], '2017-01-02' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-03' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-04' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-05' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-06' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-07' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-08' => [ 2017, 2017, 2, 1, 52, 52, ], '2017-01-09' => [ 2017, 2017, 2, 2, 52, 52, ], '2017-01-10' => [ 2017, 2017, 2, 2, 52, 52, ], '2017-12-20' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-21' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-22' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-23' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-24' => [ 2017, 2017, 52, 51, 52, 52, ], '2017-12-25' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-26' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-27' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-28' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-29' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-30' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-31' => [ 2018, 2017, 1, 52, 52, 52, ], '2018-01-01' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-02' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-03' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-04' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-05' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-06' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-07' => [ 2018, 2018, 2, 1, 52, 52, ], '2018-01-08' => [ 2018, 2018, 2, 2, 52, 52, ], '2018-01-09' => [ 2018, 2018, 2, 2, 52, 52, ], '2018-01-10' => [ 2018, 2018, 2, 2, 52, 52, ], '2018-12-20' => [ 2018, 2018, 51, 51, 52, 52, ], '2018-12-21' => [ 2018, 2018, 51, 51, 52, 52, ], '2018-12-22' => [ 2018, 2018, 51, 51, 52, 52, ], '2018-12-23' => [ 2018, 2018, 52, 51, 52, 52, ], '2018-12-24' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-25' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-26' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-27' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-28' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-29' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-30' => [ 2019, 2018, 1, 52, 52, 52, ], '2018-12-31' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-01' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-02' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-03' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-04' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-05' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-06' => [ 2019, 2019, 2, 1, 52, 52, ], '2019-01-07' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-01-08' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-01-09' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-01-10' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-12-20' => [ 2019, 2019, 51, 51, 52, 52, ], '2019-12-21' => [ 2019, 2019, 51, 51, 52, 52, ], '2019-12-22' => [ 2019, 2019, 52, 51, 52, 52, ], '2019-12-23' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-24' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-25' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-26' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-27' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-28' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-29' => [ 2020, 2019, 1, 52, 52, 52, ], '2019-12-30' => [ 2020, 2020, 1, 1, 52, 52, ], '2019-12-31' => [ 2020, 2020, 1, 1, 52, 52, ], '2020-01-01' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-02' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-03' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-04' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-05' => [ 2020, 2020, 2, 1, 52, 53, ], '2020-01-06' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-07' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-08' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-09' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-10' => [ 2020, 2020, 2, 2, 52, 53, ], ]; public function testWeekUtils() { foreach (static::SAMPLE as $date => [$weekYear, $isoWeekYear, $week, $isoWeek, $weeksInYear, $isoWeeksInYear]) { $carbon = Carbon::parse("$date 00:00:00")->locale('en_US'); $this->assertSame($weekYear, $carbon->weekYear(), "Carbon::parse(\"$date 00:00:00\")->weekYear() should return $weekYear"); $this->assertSame($isoWeekYear, $carbon->isoWeekYear(), "Carbon::parse(\"$date 00:00:00\")->isoWeekYear() should return $isoWeekYear"); $this->assertSame($week, $carbon->week(), "Carbon::parse(\"$date 00:00:00\")->week() should return $week"); $this->assertSame($isoWeek, $carbon->isoWeek(), "Carbon::parse(\"$date 00:00:00\")->isoWeek() should return $isoWeek"); $this->assertSame($weeksInYear, $carbon->weeksInYear(), "Carbon::parse(\"$date 00:00:00\")->weeksInYear() should return $isoWeek"); $this->assertSame($isoWeeksInYear, $carbon->isoWeeksInYear(), "Carbon::parse(\"$date 00:00:00\")->isoWeeksInYear() should return $isoWeeksInYear"); } } public function testSetters() { $d = Carbon::parse('2018-01-01'); $this->assertSame(52, $d->weeksInYear); $this->assertSame(52, $d->isoWeeksInYear); $d2 = $d->week(3); $this->assertSame($d, $d2); $this->assertSame('2018-01-15', $d2->format('Y-m-d')); $d2->week = 34; $this->assertSame('2018-08-20', $d2->format('Y-m-d')); $d2->week = 0; $this->assertSame('2017-12-25', $d2->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d->week = -1; $this->assertSame('2017-12-18', $d->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d->week = -5; $this->assertSame('2017-11-20', $d->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d->week = -55; $this->assertSame('2016-12-05', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01'); $d->week = 34; $this->assertSame('2017-08-20', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01'); $d->isoWeek = 34; $this->assertSame('2016-08-28', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('en_US'); $d->weekYear = 2015; $this->assertSame('2014-12-28', $d->format('Y-m-d')); $d = Carbon::parse('2012-12-31'); $d->weekYear = 2013; $this->assertSame('2012-12-31', $d->format('Y-m-d')); $d = Carbon::parse('2012-12-30')->locale('en_US'); $d->weekYear = 2014; $this->assertSame('2013-12-29', $d->format('Y-m-d')); $d = Carbon::parse('2015-12-31'); $d->weekYear = 2013; $this->assertSame('2013-01-03', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01'); $d->isoWeekYear = 2015; $this->assertSame('2015-12-27', $d->format('Y-m-d')); $d->dayOfYear = 300; $this->assertSame('2015-10-27', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('fr'); $d->weekYear = 2015; $this->assertSame('2015-12-27', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('sr'); $d->weekYear = 2017; $this->assertSame('2017-01-01', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('fr'); $d->weekYear = 2012; $this->assertSame('2012-12-30', $d->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d = $d->setISODate(2019, 4, 5); $this->assertSame('2019-01-25', $d->format('Y-m-d')); } public function testWeekday() { $d = Carbon::parse('2018-08-08')->locale('en_US'); $this->assertSame(CarbonInterface::WEDNESDAY, $d->weekday()); $this->assertSame(CarbonInterface::WEDNESDAY, $d->isoWeekday()); $date = $d->copy(); $this->assertSame('08-05', $date->weekday(CarbonInterface::SUNDAY)->format('m-d')); $this->assertSame(CarbonInterface::SUNDAY, $date->weekday()); $this->assertSame(7, $date->isoWeekday()); $date = $d->copy(); $this->assertSame('08-12', $date->isoWeekday(7)->format('m-d')); $this->assertSame(CarbonInterface::SUNDAY, $date->weekday()); $this->assertSame(7, $date->isoWeekday()); $date = $d->copy(); $this->assertSame('08-06', $date->weekday(CarbonInterface::MONDAY)->format('m-d')); $this->assertSame(CarbonInterface::MONDAY, $date->weekday()); $this->assertSame(CarbonInterface::MONDAY, $date->isoWeekday()); $date = $d->copy(); $this->assertSame('08-06', $date->isoWeekday(CarbonInterface::MONDAY)->format('m-d')); $this->assertSame(CarbonInterface::MONDAY, $date->weekday()); $this->assertSame(CarbonInterface::MONDAY, $date->isoWeekday()); Carbon::setLocale('nb'); Carbon::setTestNowAndTimezone(Carbon::parse('2022-09-19 11:00:00'), 'Europe/Oslo'); $this->assertSame('2022-09-20 00:00', Carbon::today()->weekday(CarbonInterface::TUESDAY)->format('Y-m-d H:i')); Carbon::setTestNowAndTimezone(Carbon::parse('2022-10-21 16:00:00'), 'Europe/Oslo'); $this->assertSame('2022-10-18 00:00', Carbon::today()->weekday(CarbonInterface::TUESDAY)->format('Y-m-d H:i')); } public function testWeekStartAndEnd() { $this->assertSame(CarbonInterface::MONDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekEndsAt()); Carbon::setLocale('en_US'); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekEndsAt()); Carbon::setLocale('ar_AR'); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::FRIDAY, Carbon::getWeekEndsAt()); Carbon::setLocale('fr_FR'); $this->assertSame(CarbonInterface::MONDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekEndsAt()); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekStartsAt('en_US')); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekEndsAt('en_US')); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekStartsAt('ar_AR')); $this->assertSame(CarbonInterface::FRIDAY, Carbon::getWeekEndsAt('ar_AR')); $this->assertSame(CarbonInterface::MONDAY, Carbon::getWeekStartsAt('fr_FR')); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekEndsAt('fr_FR')); } #[DataProvider('getDaysFromStartOfWeekDataProvider')] public function testGetDaysFromStartOfWeek(string $locale, string $date, int $daysCount) { $this->assertSame( $daysCount, Carbon::parse($date)->locale($locale)->getDaysFromStartOfWeek() ); } public static function getDaysFromStartOfWeekDataProvider(): array { return [ 'Monday en_US' => ['en_US', '2022-11-21', 1], 'Monday late en_US' => ['en_US', '2022-11-21 23:59', 1], 'Tuesday en_US' => ['en_US', '2022-11-22 00:01', 2], 'Thursday en_US' => ['en_US', '2022-11-24', 4], 'Saturday en_US' => ['en_US', '2022-11-26 23:59:59.999999', 6], 'Sunday en_US' => ['en_US', '2022-11-27 00:00:00', 0], 'Monday fr_FR' => ['fr_FR', '2022-11-21', 0], 'Monday late fr_FR' => ['fr_FR', '2022-11-21 23:59', 0], 'Tuesday fr_FR' => ['fr_FR', '2022-11-22 00:01', 1], 'Thursday fr_FR' => ['fr_FR', '2022-11-24', 3], 'Saturday fr_FR' => ['fr_FR', '2022-11-26 23:59:59.999999', 5], 'Sunday fr_FR' => ['fr_FR', '2022-11-27 00:00:00', 6], 'Monday ku' => ['ku', '2022-11-21', 2], 'Monday late ku' => ['ku', '2022-11-21 23:59', 2], 'Tuesday ku' => ['ku', '2022-11-22 00:01', 3], 'Thursday ku' => ['ku', '2022-11-24', 5], 'Saturday ku' => ['ku', '2022-11-26 23:59:59.999999', 0], 'Sunday ku' => ['ku', '2022-11-27 00:00:00', 1], ]; } #[DataProvider('getDaysFromStartOfWeekDataProviderExplicit')] public function testGetDaysFromStartOfWeekExplicit(int $start, string $date, int $daysCount) { static $locales = [null, 'pt_BR', 'de_CH', 'ar_MA']; $carbon = Carbon::parse($date); $locale = $locales[array_rand($locales)]; if ($locale) { $carbon = $carbon->locale($locale); } $this->assertSame($daysCount, $carbon->getDaysFromStartOfWeek($start)); } public static function getDaysFromStartOfWeekDataProviderExplicit(): array { return [ 'Monday 0' => [0, '2022-11-21', 1], 'Monday late 0' => [0, '2022-11-21 23:59', 1], 'Tuesday 0' => [0, '2022-11-22 00:01', 2], 'Thursday 0' => [0, '2022-11-24', 4], 'Saturday 0' => [0, '2022-11-26 23:59:59.999999', 6], 'Sunday 0' => [0, '2022-11-27 00:00:00', 0], 'Monday 1' => [1, '2022-11-21', 0], 'Monday late 1' => [1, '2022-11-21 23:59', 0], 'Tuesday 1' => [1, '2022-11-22 00:01', 1], 'Thursday 1' => [1, '2022-11-24', 3], 'Saturday 1' => [1, '2022-11-26 23:59:59.999999', 5], 'Sunday 1' => [1, '2022-11-27 00:00:00', 6], 'Monday 6' => [6, '2022-11-21', 2], 'Monday late 6' => [6, '2022-11-21 23:59', 2], 'Tuesday 6' => [6, '2022-11-22 00:01', 3], 'Thursday 6' => [6, '2022-11-24', 5], 'Saturday 6' => [6, '2022-11-26 23:59:59.999999', 0], 'Sunday 6' => [6, '2022-11-27 00:00:00', 1], ]; } public function testSetDaysFromStartOfWeek() { $this->assertSame( '2022-11-29 23:59:59.999999', Carbon::parse('2022-11-26 23:59:59.999999') ->locale('ar_MA') ->setDaysFromStartOfWeek(3) ->format('Y-m-d H:i:s.u') ); $this->assertSame( '2022-11-24 12:34:56.123456', Carbon::parse('2022-11-24 12:34:56.123456') ->locale('fr_FR') ->setDaysFromStartOfWeek(3) ->format('Y-m-d H:i:s.u') ); $this->assertSame( '2022-11-23 12:34:56.123456', Carbon::parse('2022-11-24 12:34:56.123456') ->locale('en_US') ->setDaysFromStartOfWeek(3) ->format('Y-m-d H:i:s.u') ); $this->assertSame( '2022-11-27 12:34:56.123456', Carbon::parse('2022-11-24 12:34:56.123456') ->locale('en_US') ->setDaysFromStartOfWeek(3, 4) ->format('Y-m-d H:i:s.u') ); } } ================================================ FILE: tests/CarbonImmutable/AddMonthsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class AddMonthsTest extends AbstractTestCase { private ?Carbon $carbon = null; protected function setUp(): void { parent::setUp(); /** @var Carbon $date */ $date = Carbon::create(2016, 1, 31); $this->carbon = $date; } public static function dataForTestAddMonthNoOverflow() { return [ [-2, 2015, 11, 30], [-1, 2015, 12, 31], [0, 2016, 1, 31], [1, 2016, 2, 29], [2, 2016, 3, 31], ]; } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testAddMonthNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthNoOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testAddMonthsNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthsNoOverflow($months), $y, $m, $d); } public static function dataForTestSubMonthNoOverflow(): array { return [ [-2, 2016, 3, 31], [-1, 2016, 2, 29], [0, 2016, 1, 31], [1, 2015, 12, 31], [2, 2015, 11, 30], ]; } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSubMonthNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthNoOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSubMonthsNoOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthsNoOverflow($months), $y, $m, $d); } public static function dataForTestAddMonthWithOverflow(): array { return [ [-2, 2015, 12, 1], [-1, 2015, 12, 31], [0, 2016, 1, 31], [1, 2016, 3, 2], [2, 2016, 3, 31], ]; } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testAddMonthWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthWithOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testAddMonthsWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->addMonthsWithOverflow($months), $y, $m, $d); } public static function dataForTestSubMonthWithOverflow(): array { return [ [-2, 2016, 3, 31], [-1, 2016, 3, 2], [0, 2016, 1, 31], [1, 2015, 12, 31], [2, 2015, 12, 1], ]; } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testSubMonthWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthWithOverflow($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testSubMonthsWithOverflow(int $months, int $y, int $m, int $d) { $this->assertCarbon($this->carbon->subMonthsWithOverflow($months), $y, $m, $d); } public function testSetOverflowIsTrue() { Carbon::useMonthsOverflow(true); $this->assertTrue(Carbon::shouldOverflowMonths()); } public function testSetOverflowIsFalse() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::shouldOverflowMonths()); } public function testSetOverflowIsResetInTests() { $this->assertTrue(Carbon::shouldOverflowMonths()); } public function testSetOverflowIsReset() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::shouldOverflowMonths()); Carbon::resetMonthsOverflow(); $this->assertTrue(Carbon::shouldOverflowMonths()); } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testUseOverflowAddMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->addMonth($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthWithOverflow')] public function testUseOverflowAddMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->addMonths($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testUseOverflowSubMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->subMonth($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthWithOverflow')] public function testUseOverflowSubMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(true); $this->assertCarbon($this->carbon->subMonths($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testSkipOverflowAddMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->addMonth($months), $y, $m, $d); } #[DataProvider('dataForTestAddMonthNoOverflow')] public function testSkipOverflowAddMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->addMonths($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSkipOverflowSubMonth(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->subMonth($months), $y, $m, $d); } #[DataProvider('dataForTestSubMonthNoOverflow')] public function testSkipOverflowSubMonths(int $months, int $y, int $m, int $d) { Carbon::useMonthsOverflow(false); $this->assertCarbon($this->carbon->subMonths($months), $y, $m, $d); } } ================================================ FILE: tests/CarbonImmutable/AddTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterval; use Carbon\Unit; use DateTimeImmutable; use Tests\AbstractTestCase; class AddTest extends AbstractTestCase { public function testAddMethod() { $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, 'year')->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add('year', 2)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, Unit::Year)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(Unit::Year, 2)->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add('2 years')->year); $lastNegated = null; $date = Carbon::createFromDate(1975)->add( function (DateTimeImmutable $date, bool $negated = false) use (&$lastNegated): DateTimeImmutable { $lastNegated = $negated; return new DateTimeImmutable($date->format('Y-m-d H:i:s').' + 2 years'); }, ); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(1977, $date->year); $this->assertFalse($lastNegated); /** @var CarbonInterval $interval */ $interval = include __DIR__.'/../Fixtures/dynamicInterval.php'; $originalDate = Carbon::parse('2020-06-04'); $date = $originalDate->add($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-06-08', $date->format('Y-m-d')); $this->assertNotSame($date, $originalDate); $date = Carbon::parse('2020-06-23')->add($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-07-16', $date->format('Y-m-d')); } public function testAddYearsPositive() { $this->assertSame(1976, Carbon::createFromDate(1975)->addYears(1)->year); } public function testAddYearsZero() { $this->assertSame(1975, Carbon::createFromDate(1975)->addYears(0)->year); } public function testAddYearsNegative() { $this->assertSame(1974, Carbon::createFromDate(1975)->addYears(-1)->year); } public function testAddYear() { $this->assertSame(1976, Carbon::createFromDate(1975)->addYear()->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, 'year')->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(2, 'years')->year); $this->assertSame(1977, Carbon::createFromDate(1975)->add(CarbonInterval::years(2))->year); } public function testAddDaysPositive() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 31)->addDays(1)->day); } public function testAddDaysZero() { $this->assertSame(31, Carbon::createFromDate(1975, 5, 31)->addDays(0)->day); } public function testAddDaysNegative() { $this->assertSame(30, Carbon::createFromDate(1975, 5, 31)->addDays(-1)->day); } public function testAddDay() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 31)->addDay()->day); } public function testAddOverflow() { $this->assertSame( '2021-03-03', Carbon::parse('2021-01-31')->add(1, 'months', true)->format('Y-m-d'), ); $this->assertSame( '2021-03-03', Carbon::parse('2021-01-31')->add(1, 'months')->format('Y-m-d'), ); $this->assertSame( '2021-02-28', Carbon::parse('2021-01-31')->add(1, 'months', false)->format('Y-m-d'), ); } public function testAddWeekdaysPositive() { $dt = Carbon::create(2012, 1, 4, 13, 2, 1)->addWeekdays(9); $this->assertSame(17, $dt->day); // test for https://bugs.php.net/bug.php?id=54909 $this->assertSame(13, $dt->hour); $this->assertSame(2, $dt->minute); $this->assertSame(1, $dt->second); } public function testAddWeekdaysZero() { $this->assertSame(4, Carbon::createFromDate(2012, 1, 4)->addWeekdays(0)->day); } public function testAddWeekdaysNegative() { $this->assertSame(18, Carbon::createFromDate(2012, 1, 31)->addWeekdays(-9)->day); } public function testAddWeekday() { $this->assertSame(9, Carbon::createFromDate(2012, 1, 6)->addWeekday()->day); } public function testAddWeekdayDuringWeekend() { $this->assertSame(9, Carbon::createFromDate(2012, 1, 7)->addWeekday()->day); } public function testAddWeeksPositive() { $this->assertSame(28, Carbon::createFromDate(1975, 5, 21)->addWeeks(1)->day); } public function testAddWeeksZero() { $this->assertSame(21, Carbon::createFromDate(1975, 5, 21)->addWeeks(0)->day); } public function testAddWeeksNegative() { $this->assertSame(14, Carbon::createFromDate(1975, 5, 21)->addWeeks(-1)->day); } public function testAddWeek() { $this->assertSame(28, Carbon::createFromDate(1975, 5, 21)->addWeek()->day); } public function testAddHoursPositive() { $this->assertSame(1, Carbon::createFromTime(0)->addHours(1)->hour); } public function testAddHoursZero() { $this->assertSame(0, Carbon::createFromTime(0)->addHours(0)->hour); } public function testAddHoursNegative() { $this->assertSame(23, Carbon::createFromTime(0)->addHours(-1)->hour); } public function testAddHour() { $this->assertSame(1, Carbon::createFromTime(0)->addHour()->hour); } public function testAddMinutesPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0)->addMinutes(1)->minute); } public function testAddMinutesZero() { $this->assertSame(0, Carbon::createFromTime(0, 0)->addMinutes(0)->minute); } public function testAddMinutesNegative() { $this->assertSame(59, Carbon::createFromTime(0, 0)->addMinutes(-1)->minute); } public function testAddMinute() { $this->assertSame(1, Carbon::createFromTime(0, 0)->addMinute()->minute); } public function testAddSecondsPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addSeconds(1)->second); } public function testAddSecondsZero() { $this->assertSame(0, Carbon::createFromTime(0, 0, 0)->addSeconds(0)->second); } public function testAddSecondsNegative() { $this->assertSame(59, Carbon::createFromTime(0, 0, 0)->addSeconds(-1)->second); } public function testAddDecimalSeconds() { $this->assertSame( '1999-12-31 23:59:58.500000', Carbon::parse('2000-01-01 00:00:00')->addSeconds(-1.5)->format('Y-m-d H:i:s.u'), ); $this->assertSame( '2000-01-01 00:00:01.500000', Carbon::parse('2000-01-01 00:00:00')->addSeconds(1.5)->format('Y-m-d H:i:s.u'), ); $this->assertSame( '1999-12-31 23:59:58.500000', Carbon::parse('2000-01-01 00:00:00')->addRealSeconds(-1.5)->format('Y-m-d H:i:s.u'), ); $this->assertSame( '2000-01-01 00:00:01.500000', Carbon::parse('2000-01-01 00:00:00')->addRealSeconds(1.5)->format('Y-m-d H:i:s.u'), ); } public function testAddSecond() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addSecond()->second); } public function testAddMillisecondsPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addMilliseconds(1)->millisecond); } public function testAddMillisecondsZero() { $this->assertSame(100, Carbon::createFromTime(0, 0, 0.1)->addMilliseconds(0)->millisecond); } public function testAddMillisecondsNegative() { $this->assertSame(999, Carbon::createFromTime(0, 0, 0)->addMilliseconds(-1)->millisecond); $this->assertSame(99, Carbon::createFromTime(0, 0, 0.1)->addMilliseconds(-1)->millisecond); } public function testAddMillisecond() { $this->assertSame(101, Carbon::createFromTime(0, 0, 0.1)->addMillisecond()->millisecond); } public function testAddMicrosecondsPositive() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->addMicroseconds(1)->microsecond); } public function testAddMicrosecondsZero() { $this->assertSame(100000, Carbon::createFromTime(0, 0, 0.1)->addMicroseconds(0)->microsecond); } public function testAddMicrosecondsNegative() { $this->assertSame(999999, Carbon::createFromTime(0, 0, 0)->addMicroseconds(-1)->microsecond); $this->assertSame(99999, Carbon::createFromTime(0, 0, 0.1)->addMicroseconds(-1)->microsecond); } public function testAddMicrosecond() { $this->assertSame(100001, Carbon::createFromTime(0, 0, 0.1)->addMicrosecond()->microsecond); } /** * Test non plural methods with non default args. */ public function testAddYearPassingArg() { /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1977, $date->addYear(2)->year); } public function testAddDayPassingArg() { /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 10); $this->assertSame(12, $date->addDay(2)->day); } public function testAddHourPassingArg() { /** @var mixed $date */ $date = Carbon::createFromTime(10); $this->assertSame(12, $date->addHour(2)->hour); } public function testAddMinutePassingArg() { /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(2, $date->addMinute(2)->minute); } public function testAddSecondPassingArg() { /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(2, $date->addSecond(2)->second); } public function testAddQuarter() { $this->assertSame(8, Carbon::createFromDate(1975, 5, 6)->addQuarter()->month); } public function testAddQuarterNegative() { /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 6); $this->assertSame(2, $date->addQuarter(-1)->month); } public function testSubQuarter() { $this->assertSame(2, Carbon::createFromDate(1975, 5, 6)->subQuarter()->month); } public function testSubQuarterNegative() { $this->assertCarbon(Carbon::createFromDate(1975, 5, 6)->subQuarters(2), 1974, 11, 6); } public function testAddCentury() { $this->assertSame(2075, Carbon::createFromDate(1975)->addCentury()->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2075, $date->addCentury(1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2175, $date->addCentury(2)->year); } public function testAddCenturyNegative() { /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1875, $date->addCentury(-1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1775, $date->addCentury(-2)->year); } public function testAddCenturies() { $this->assertSame(2075, Carbon::createFromDate(1975)->addCenturies(1)->year); $this->assertSame(2175, Carbon::createFromDate(1975)->addCenturies(2)->year); } public function testAddCenturiesNegative() { $this->assertSame(1875, Carbon::createFromDate(1975)->addCenturies(-1)->year); $this->assertSame(1775, Carbon::createFromDate(1975)->addCenturies(-2)->year); } public function testSubCentury() { $this->assertSame(1875, Carbon::createFromDate(1975)->subCentury()->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1875, $date->subCentury(1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1775, $date->subCentury(2)->year); } public function testSubCenturyNegative() { /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2075, $date->subCentury(-1)->year); /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(2175, $date->subCentury(-2)->year); } public function testSubCenturies() { $this->assertSame(1875, Carbon::createFromDate(1975)->subCenturies(1)->year); $this->assertSame(1775, Carbon::createFromDate(1975)->subCenturies(2)->year); } public function testSubCenturiesNegative() { $this->assertSame(2075, Carbon::createFromDate(1975)->subCenturies(-1)->year); $this->assertSame(2175, Carbon::createFromDate(1975)->subCenturies(-2)->year); } public function testAddYearNoOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearNoOverflow(), 2017, 2, 28); } public function testAddYearWithOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearWithOverflow(), 2017, 3, 1); } public function testAddYearNoOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearsNoOverflow(2), 2018, 2, 28); } public function testAddYearWithOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYearsWithOverflow(2), 2018, 3, 1); } public function testSubYearNoOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearsNoOverflow(2), 2014, 2, 28); } public function testSubYearWithOverflowPassingArg() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearsWithOverflow(2), 2014, 3, 1); } public function testSubYearNoOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearNoOverflow(), 2015, 2, 28); } public function testSubYearWithOverflow() { $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->subYearWithOverflow(), 2015, 3, 1); } public function testUseYearsOverflow() { $this->assertTrue(Carbon::shouldOverflowYears()); $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYears(2), 2018, 3, 1); Carbon::useYearsOverflow(false); $this->assertFalse(Carbon::shouldOverflowYears()); $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYears(2), 2018, 2, 28); Carbon::resetYearsOverflow(); $this->assertTrue(Carbon::shouldOverflowYears()); $this->assertCarbon(Carbon::createFromDate(2016, 2, 29)->addYears(2), 2018, 3, 1); } } ================================================ FILE: tests/CarbonImmutable/ArraysTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Translator; use Tests\AbstractTestCase; class ArraysTest extends AbstractTestCase { public function testToArray() { $dt = Carbon::now(); $dtToArray = $dt->toArray(); $this->assertIsArray($dtToArray); $this->assertArrayHasKey('year', $dtToArray); $this->assertSame($dt->year, $dtToArray['year']); $this->assertArrayHasKey('month', $dtToArray); $this->assertSame($dt->month, $dtToArray['month']); $this->assertArrayHasKey('day', $dtToArray); $this->assertSame($dt->day, $dtToArray['day']); $this->assertArrayHasKey('dayOfWeek', $dtToArray); $this->assertSame($dt->dayOfWeek, $dtToArray['dayOfWeek']); $this->assertArrayHasKey('dayOfYear', $dtToArray); $this->assertSame($dt->dayOfYear, $dtToArray['dayOfYear']); $this->assertArrayHasKey('hour', $dtToArray); $this->assertSame($dt->hour, $dtToArray['hour']); $this->assertArrayHasKey('minute', $dtToArray); $this->assertSame($dt->minute, $dtToArray['minute']); $this->assertArrayHasKey('second', $dtToArray); $this->assertSame($dt->second, $dtToArray['second']); $this->assertArrayHasKey('micro', $dtToArray); $this->assertSame($dt->micro, $dtToArray['micro']); $this->assertArrayHasKey('timestamp', $dtToArray); $this->assertSame($dt->timestamp, $dtToArray['timestamp']); $this->assertArrayHasKey('timezone', $dtToArray); $this->assertEquals($dt->timezone, $dtToArray['timezone']); $this->assertArrayHasKey('formatted', $dtToArray); $this->assertSame($dt->format(Carbon::DEFAULT_TO_STRING_FORMAT), $dtToArray['formatted']); } public function testDebugInfo() { $dt = Carbon::parse('2019-04-09 11:10:10.667952'); $debug = $dt->__debugInfo(); // Ignored as not in PHP 8 if (isset($debug['timezone_type'])) { unset($debug['timezone_type']); } $this->assertSame([ 'date' => '2019-04-09 11:10:10.667952', 'timezone' => 'America/Toronto', ], $debug); $dt = Carbon::parse('2019-04-09 11:10:10.667952')->locale('fr_FR'); $debug = $dt->__debugInfo(); // Ignored as not in PHP 8 if (isset($debug['timezone_type'])) { unset($debug['timezone_type']); } $this->assertSame([ 'localTranslator' => Translator::get('fr_FR'), 'date' => '2019-04-09 11:10:10.667952', 'timezone' => 'America/Toronto', ], $debug); } } ================================================ FILE: tests/CarbonImmutable/ComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTime; use SubCarbon; use Tests\AbstractTestCase; class ComparisonTest extends AbstractTestCase { public function testEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->equalTo(Carbon::createFromDate(2000, 1, 1))); } public function testEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->equalTo(Carbon::createFromDate(2000, 1, 2))); } public function testEqualWithTimezoneTrue() { $this->assertTrue(Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto')->equalTo(Carbon::create(2000, 1, 1, 9, 0, 0, 'America/Vancouver'))); } public function testNotEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->notEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testNotEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->notEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThan(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->greaterThan(Carbon::createFromDate(2000, 1, 2))); } public function testGreaterThanWithTimezoneTrue() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 8, 59, 59, 'America/Vancouver'); $this->assertTrue($dt1->greaterThan($dt2)); } public function testGreaterThanWithTimezoneFalse() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 9, 0, 1, 'America/Vancouver'); $this->assertFalse($dt1->greaterThan($dt2)); } public function testGreaterThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThan(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lessThan(Carbon::createFromDate(1999, 12, 31))); } public function testLessThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testLessThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(1999, 12, 31))); } public function testBetweenEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); $this->assertTrue(\Carbon\Carbon::createFromDate(2000, 1, 15)->between(new DateTime('2000-01-01'), new DateTime('2000-01-31'), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(new DateTime('2000-01-01'), new DateTime('2000-01-31'), true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between('2000-01-01', '2000-01-31', true)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween('2000-01-01', '2000-01-31', true)); } public function testBetweenNotEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(new DateTime('2000-01-01'), new DateTime('2000-01-31'), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween(new DateTime('2000-01-01'), new DateTime('2000-01-31'), false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between('2000-01-01', '2000-01-31', false)); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->isBetween('2000-01-01', '2000-01-31', false)); } public function testBetweenExcludedTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->betweenExcluded(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31))); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->betweenExcluded(new DateTime('2000-01-01'), new DateTime('2000-01-31'))); $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->betweenExcluded('2000-01-01', '2000-01-31')); } public function testBetweenEqualFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); } public function testBetweenNotEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); } public function testBetweenEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testBetweenEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testMinIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->min()); } public function testMinWithNow() { $dt = Carbon::create(2012, 1, 1, 0, 0, 0)->min(); $this->assertCarbon($dt, 2012, 1, 1, 0, 0, 0); } public function testMinWithInstance() { $dt1 = Carbon::create(2013, 12, 31, 23, 59, 59); $dt2 = Carbon::create(2012, 1, 1, 0, 0, 0)->min($dt1); $this->assertCarbon($dt2, 2012, 1, 1, 0, 0, 0); } public function testMaxIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->max()); } public function testMaxWithNow() { $dt = Carbon::create(2099, 12, 31, 23, 59, 59)->max(); $this->assertCarbon($dt, 2099, 12, 31, 23, 59, 59); } public function testMaxWithInstance() { $dt1 = Carbon::create(2012, 1, 1, 0, 0, 0); $dt2 = Carbon::create(2099, 12, 31, 23, 59, 59)->max($dt1); $this->assertCarbon($dt2, 2099, 12, 31, 23, 59, 59); } public function testIsBirthday() { $dt = Carbon::now(); // Birthday test can't work on February 29th if ($dt->format('m-d') === '02-29') { Carbon::setTestNow($dt->subDay()); $dt = Carbon::now(); } $aBirthday = $dt->subYear(); $this->assertTrue($aBirthday->isBirthday()); $notABirthday = $dt->subDay(); $this->assertFalse($notABirthday->isBirthday()); $alsoNotABirthday = $dt->addDays(2); $this->assertFalse($alsoNotABirthday->isBirthday()); $dt1 = Carbon::createFromDate(1987, 4, 23); $dt2 = Carbon::createFromDate(2014, 9, 26); $dt3 = Carbon::createFromDate(2014, 4, 23); $this->assertFalse($dt2->isBirthday($dt1)); $this->assertTrue($dt3->isBirthday($dt1)); } public function testClosest() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 11, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $closest = $instance->closest($dt1, $dt2); $this->assertSame($dt1, $closest); } public function testClosestWithEquals() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 12, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $closest = $instance->closest($dt1, $dt2); $this->assertSame($dt1, $closest); } public function testClosestWithMicroseconds() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('2018-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('2018-10-11 20:59:06.300000'); $this->assertSame('06.600000', $baseDate->closest($closestDate, $farthestDate)->format('s.u')); } public function testClosestWithFarDates() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('-4025-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('9995-10-11 20:59:06.300000'); $this->assertSame('06.600000', $baseDate->closest($closestDate, $farthestDate)->format('s.u')); } public function testFarthest() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 11, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $farthest = $instance->farthest($dt1, $dt2); $this->assertSame($dt2, $farthest); } public function testFarthestWithEquals() { $instance = Carbon::create(2015, 5, 28, 12, 0, 0); $dt1 = Carbon::create(2015, 5, 28, 12, 0, 0); $dt2 = Carbon::create(2015, 5, 28, 14, 0, 0); $farthest = $instance->farthest($dt1, $dt2); $this->assertSame($dt2, $farthest); } public function testFarthestWithMicroseconds() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('2018-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('2018-10-11 20:59:06.300000'); $this->assertSame('06.300000', $baseDate->farthest($closestDate, $farthestDate)->format('s.u')); } public function testFarthestWithFarDates() { $baseDate = Carbon::parse('2018-10-11 20:59:06.500000'); $closestDate = Carbon::parse('-4025-10-11 20:59:06.600000'); $farthestDate = Carbon::parse('9995-10-11 20:59:06.300000'); $this->assertSame('06.300000', $baseDate->farthest($closestDate, $farthestDate)->format('s.u')); } public function testDifferentType() { require_once __DIR__.'/../Fixtures/SubCarbon.php'; $subCarbon = new SubCarbon('2024-01-24 00:00'); $carbon = new Carbon('2024-01-24 00:00'); $this->assertTrue($subCarbon->equalTo($carbon)); $this->assertTrue($carbon->equalTo($subCarbon)); } } ================================================ FILE: tests/CarbonImmutable/ConstructTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Exceptions\InvalidFormatException; use DateTime; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Tests\AbstractTestCase; class ConstructTest extends AbstractTestCase { public function testCreatesAnInstanceDefaultToNow() { $c = new Carbon(); $now = Carbon::now(); $this->assertInstanceOfCarbon($c); $this->assertInstanceOf(DateTimeImmutable::class, $c); $this->assertInstanceOf(DateTimeInterface::class, $c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } public function testCreatesAnInstanceFromADateTime() { $c = new Carbon(Carbon::parse('2009-09-09 09:09:09')); $this->assertSame('2009-09-09 09:09:09 America/Toronto', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09')); $this->assertSame('2009-09-09 09:09:09 America/Toronto', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09', new DateTimeZone('Europe/Paris'))); $this->assertSame('2009-09-09 09:09:09 Europe/Paris', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09'), 'Europe/Paris'); $this->assertSame('2009-09-09 15:09:09 Europe/Paris', $c->format('Y-m-d H:i:s e')); $c = new Carbon(new DateTime('2009-09-09 09:09:09', new DateTimeZone('Asia/Tokyo')), 'Europe/Paris'); $this->assertSame('2009-09-09 02:09:09 Europe/Paris', $c->format('Y-m-d H:i:s e')); } public function testParseCreatesAnInstanceDefaultToNow() { $c = Carbon::parse(null); $now = Carbon::now(); $this->assertInstanceOfCarbon($c); $this->assertSame($now->tzName, $c->tzName); $this->assertCarbon($c, $now->year, $now->month, $now->day, $now->hour, $now->minute, $now->second); } public function testWithFancyString() { Carbon::setTestNow(Carbon::today()); $c = new Carbon('first day of January 2008'); $this->assertCarbon($c, 2008, 1, 1, 0, 0, 0); } public function testParseWithFancyString() { Carbon::setTestNow(Carbon::today()); $c = Carbon::parse('first day of January 2008'); $this->assertCarbon($c, 2008, 1, 1, 0, 0, 0); } public function testParseWithYYYMMDD() { $c = Carbon::parse('20201128'); $this->assertCarbon($c, 2020, 11, 28, 0, 0, 0); } public function testParseWithYYYMMDDHHMMSS() { $c = Carbon::parse('20201128192533'); $this->assertCarbon($c, 2020, 11, 28, 19, 25, 33); } public function testDefaultTimezone() { $c = new Carbon('now'); $this->assertSame('America/Toronto', $c->tzName); } public function testParseWithDefaultTimezone() { $c = Carbon::parse('now'); $this->assertSame('America/Toronto', $c->tzName); } public function testSettingTimezone() { $timezone = 'Europe/London'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = new Carbon('now', $dtz); $this->assertSame($timezone, $c->tzName); $this->assertSame($dayLightSavingTimeOffset, $c->offsetHours); } public function testParseSettingTimezone() { $timezone = 'Europe/London'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = Carbon::parse('now', $dtz); $this->assertSame($timezone, $c->tzName); $this->assertSame($dayLightSavingTimeOffset, $c->offsetHours); } public function testSettingTimezoneWithString() { $timezone = 'Asia/Tokyo'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = new Carbon('now', $timezone); $this->assertSame($timezone, $c->tzName); $this->assertSame(9 + $dayLightSavingTimeOffset, $c->offsetHours); } public function testParseSettingTimezoneWithString() { $timezone = 'Asia/Tokyo'; $dtz = new DateTimeZone($timezone); $dt = new DateTime('now', $dtz); $dayLightSavingTimeOffset = (int) $dt->format('I'); $c = Carbon::parse('now', $timezone); $this->assertSame($timezone, $c->tzName); $this->assertSame(9 + $dayLightSavingTimeOffset, $c->offsetHours); } public function testParseError() { $this->expectException(InvalidFormatException::class); $this->expectExceptionMessage("Could not parse 'completely broken'"); $this->expectExceptionMessage('Failed to parse time string'); Carbon::parse('completely broken'); } public function testMockingWithMicroseconds() { $c = new Carbon(Carbon::now()->toDateTimeString().'.123456'); Carbon::setTestNow($c); $mockedC = Carbon::now(); $this->assertTrue($c->eq($mockedC)); Carbon::setTestNow(); } public function testTimestamp() { $date = new Carbon(1367186296); $this->assertSame('Sunday 28 April 2013 21:58:16.000000', $date->format('l j F Y H:i:s.u')); $date = new Carbon(123); $this->assertSame('Thursday 1 January 1970 00:02:03.000000', $date->format('l j F Y H:i:s.u')); } public function testFloatTimestamp() { $date = new Carbon(1367186296.654321); $this->assertSame('Sunday 28 April 2013 21:58:16.654321', $date->format('l j F Y H:i:s.u')); $date = new Carbon(123.5); $this->assertSame('Thursday 1 January 1970 00:02:03.500000', $date->format('l j F Y H:i:s.u')); } } ================================================ FILE: tests/CarbonImmutable/CopyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class CopyTest extends AbstractTestCase { public function testCopy() { $dating = Carbon::now(); $dating2 = $dating->copy(); $this->assertNotSame($dating, $dating2); } public function testClone() { $dating = Carbon::now(); $dating2 = $dating->clone(); $this->assertNotSame($dating, $dating2); } public function testCopyEnsureTzIsCopied() { $dating = Carbon::createFromDate(2000, 1, 1, 'Europe/London'); $dating2 = $dating->copy(); $this->assertSame($dating->tzName, $dating2->tzName); $this->assertSame($dating->offset, $dating2->offset); } public function testCopyEnsureMicrosAreCopied() { $micro = 254687; $dating = Carbon::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); $dating2 = $dating->copy(); $this->assertSame($micro, $dating2->micro); } } ================================================ FILE: tests/CarbonImmutable/CreateFromDateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromDateTest extends AbstractTestCase { public function testCreateFromDateWithDefaults() { $d = Carbon::createFromDate(); $this->assertSame($d->timestamp, Carbon::create(null, null, null, null, null, null)->timestamp); } public function testCreateFromDate() { $d = Carbon::createFromDate(1975, 5, 21); $this->assertCarbon($d, 1975, 5, 21); } public function testCreateFromDateWithYear() { $d = Carbon::createFromDate(1975); $this->assertSame(1975, $d->year); } public function testCreateFromDateWithMonth() { $d = Carbon::createFromDate(null, 5); $this->assertSame(5, $d->month); } public function testCreateFromDateWithDay() { $d = Carbon::createFromDate(null, null, 21); $this->assertSame(21, $d->day); } public function testCreateFromDateWithTimezone() { $d = Carbon::createFromDate(1975, 5, 21, 'Europe/London'); $this->assertCarbon($d, 1975, 5, 21); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromDateWithDateTimeZone() { $d = Carbon::createFromDate(1975, 5, 21, new DateTimeZone('Europe/London')); $this->assertCarbon($d, 1975, 5, 21); $this->assertSame('Europe/London', $d->tzName); } } ================================================ FILE: tests/CarbonImmutable/CreateFromFormatTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTime; use DateTimeZone; use PHPUnit\Framework\Attributes\RequiresPhp; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\MyCarbon; class CreateFromFormatTest extends AbstractTestCase { /** * @var array */ protected $lastErrors; /** * @var array */ protected $noErrors; protected function setUp(): void { parent::setUp(); $this->lastErrors = [ 'warning_count' => 1, 'warnings' => ['10' => 'The parsed date was invalid'], 'error_count' => 0, 'errors' => [], ]; } public function testCreateFromFormatReturnsCarbon() { $d = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertInstanceOfCarbon($d); } public function testCreateFromFormatWithTimezoneString() { $d = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11', 'Europe/London'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromFormatWithTimezone() { $d = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11', new DateTimeZone('Europe/London')); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromFormatWithMillis() { $d = Carbon::createFromFormat('Y-m-d H:i:s.u', '1975-05-21 22:32:11.254687'); $this->assertSame(254687, $d->micro); } public function testCreateFromFormatWithTestNow() { Carbon::setTestNow(); $nativeDate = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'); Carbon::setTestNow(Carbon::now()); $mockedDate = Carbon::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'); $this->assertSame($mockedDate->micro === 0, $nativeDate->micro === 0); } #[RequiresPhp('>=8.2')] public function testCreateLastErrorsCanBeAccessedByExtendingClass() { $this->assertFalse(MyCarbon::getLastErrors()); } public function testCreateFromFormatHandlesLastErrors() { $carbon = Carbon::createFromFormat('d/m/Y', '41/02/1900'); $datetime = DateTime::createFromFormat('d/m/Y', '41/02/1900'); $this->assertSame($this->lastErrors, $carbon->getLastErrors()); $this->assertSame($carbon->getLastErrors(), $datetime->getLastErrors()); } #[RequiresPhp('>=8.2')] public function testCreateFromFormatResetLastErrors() { $carbon = Carbon::createFromFormat('d/m/Y', '41/02/1900'); $this->assertSame($this->lastErrors, $carbon->getLastErrors()); $carbon = Carbon::createFromFormat('d/m/Y', '11/03/2016'); $this->assertFalse($carbon->getLastErrors()); } public function testCreateFromFormatWithDollar() { $d = Carbon::createFromFormat('$c', '$1975-05-21T22:32:11+01:00'); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 11); $this->assertInstanceOfCarbon($d); } } ================================================ FILE: tests/CarbonImmutable/CreateFromTimeStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromTimeStringTest extends AbstractTestCase { protected function setUp(): void { parent::setUp(); Carbon::setTestNow(); } public function testCreateFromTimeString() { $d = Carbon::createFromTimeString('22:45'); $this->assertSame(22, $d->hour); $this->assertSame(45, $d->minute); $this->assertSame(0, $d->second); $this->assertSame(0, $d->micro); } public function testCreateFromTimeStringWithSecond() { $d = Carbon::createFromTimeString('22:45:12'); $this->assertSame(22, $d->hour); $this->assertSame(45, $d->minute); $this->assertSame(12, $d->second); $this->assertSame(0, $d->micro); } public function testCreateFromTimeStringWithMicroSecond() { $d = Carbon::createFromTimeString('22:45:00.625341'); $this->assertSame(22, $d->hour); $this->assertSame(45, $d->minute); $this->assertSame(0, $d->second); $this->assertSame(625341, $d->micro); } public function testCreateFromTimeStringWithDateTimeZone() { $d = Carbon::createFromTimeString('12:20:30', new DateTimeZone('Europe/London')); $this->assertCarbonTime($d, 12, 20, 30, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromTimeStringWithTimeZoneString() { $d = Carbon::createFromTimeString('12:20:30', 'Europe/London'); $this->assertCarbonTime($d, 12, 20, 30, 0); $this->assertSame('Europe/London', $d->tzName); } } ================================================ FILE: tests/CarbonImmutable/CreateFromTimeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Exceptions\InvalidFormatException; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromTimeTest extends AbstractTestCase { public function testCreateWithTestNow() { Carbon::setTestNow($testNow = Carbon::create(2011, 1, 1, 12, 13, 14)); $dt = Carbon::create(null, null, null, null, null, null); $this->assertCarbon($dt, 2011, 1, 1, 12, 13, 14); $this->assertTrue($testNow->eq($dt)); } public function testCreateFromDateWithDefaults() { $d = Carbon::createFromTime(); $this->assertSame($d->timestamp, Carbon::create(null, null, null, 0, 0, 0)->timestamp); } public function testCreateFromDateWithNull() { $d = Carbon::createFromTime(null, null, null); $this->assertSame($d->timestamp, Carbon::create(null, null, null, null, null, null)->timestamp); } public function testCreateFromDate() { $d = Carbon::createFromTime(23, 5, 21); $this->assertCarbon($d, Carbon::now()->year, Carbon::now()->month, Carbon::now()->day, 23, 5, 21); } public function testCreateFromTimeWithHour() { $d = Carbon::createFromTime(22); $this->assertSame(22, $d->hour); $this->assertSame(0, $d->minute); $this->assertSame(0, $d->second); } public function testCreateFromTimeWithMinute() { $d = Carbon::createFromTime(null, 5); $this->assertSame(5, $d->minute); } public function testCreateFromTimeWithSecond() { $d = Carbon::createFromTime(null, null, 21); $this->assertSame(21, $d->second); } public function testCreateFromTimeWithDateTimeZone() { $d = Carbon::createFromTime(12, 0, 0, new DateTimeZone('Europe/London')); $this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromTimeWithTimeZoneString() { $d = Carbon::createFromTime(12, 0, 0, 'Europe/London'); $this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateFromTime() { // disable test for now // because we need Carbon::now() in Carbon::create() to work with given TZ $test = Carbon::getTestNow(); Carbon::setTestNow(); $tz = 'Etc/GMT+12'; try { $now = Carbon::now($tz); } catch (InvalidFormatException $exception) { if ($exception->getMessage() !== 'Unknown or bad timezone (Etc/GMT+12)') { throw $exception; } $tz = 'GMT+12'; $now = Carbon::now($tz); } $dt = Carbon::createFromTime($now->hour, $now->minute, $now->second, $tz); // re-enable test Carbon::setTestNow($test); // tested without microseconds // because they appear within calls to Carbon $this->assertSame($now->format('c'), $dt->format('c')); } } ================================================ FILE: tests/CarbonImmutable/CreateFromTimestampTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTimeZone; use Tests\AbstractTestCase; class CreateFromTimestampTest extends AbstractTestCase { public function testCreateReturnsDatingInstance() { $d = Carbon::createFromTimestamp(Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5); } public function testCreateFromTimestampMs() { $baseTimestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000; $timestamp = $baseTimestamp + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); $timestamp = $baseTimestamp + 321.8; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321800); $timestamp = $baseTimestamp + 321.84; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321840); $timestamp = $baseTimestamp + 321.847; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8474; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8479; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321848); } public function testCreateFromTimestampMsUTC() { // Toronto is GMT-04:00 in May $baseTimestamp = Carbon::create(1975, 5, 21, 22, 32, 5)->timestamp * 1000; $timestamp = $baseTimestamp + 321; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321000); $timestamp = $baseTimestamp + 321.8; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321800); $timestamp = $baseTimestamp + 321.84; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321840); $timestamp = $baseTimestamp + 321.847; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8474; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321847); $timestamp = $baseTimestamp + 321.8479; $d = Carbon::createFromTimestampMsUTC($timestamp); $this->assertCarbon($d, 1975, 5, 22, 2, 32, 5, 321848); $d = Carbon::createFromTimestampMsUTC(1); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0, 1000); $d = Carbon::createFromTimestampMsUTC(60); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0, 60000); $d = Carbon::createFromTimestampMsUTC(1000); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 1, 0); $d = Carbon::createFromTimestampMsUTC(-0.04); $this->assertCarbon($d, 1969, 12, 31, 23, 59, 59, 999960); } public function testComaDecimalSeparatorLocale() { $date = new Carbon('2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $date = Carbon::createFromFormat('Y-m-d\TH:i:s.uT', '2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $timestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000 + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); $locale = setlocale(LC_ALL, '0'); if (setlocale(LC_ALL, 'fr_FR.UTF-8', 'fr_FR.utf8', 'French_France.UTF8') === false) { $this->markTestSkipped('testComaDecimalSeparatorLocale test need fr_FR.UTF-8.'); } $timestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000 + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); $date = new Carbon('2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $date = Carbon::createFromFormat('Y-m-d\TH:i:s.uT', '2017-07-29T13:57:27.123456Z'); $this->assertSame('2017-07-29 13:57:27.123456 Z', $date->format('Y-m-d H:i:s.u e')); $timestamp = Carbon::create(1975, 5, 21, 22, 32, 5, 'UTC')->timestamp * 1000 + 321; $d = Carbon::createFromTimestampMs($timestamp); $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5, 321000); setlocale(LC_ALL, $locale); } public function testCreateFromTimestampUsesNoTimezone() { $d = Carbon::createFromTimestamp(0); // UTC by default $this->assertSame(1970, $d->year); $this->assertSame(0, $d->offset); } public function testCreateFromTimestampUsesDefaultTimezone() { $d = Carbon::createFromTimestamp(0, 'America/Toronto'); // We know Toronto is -5 since no DST in Jan $this->assertSame(1969, $d->year); $this->assertSame(-5 * 3600, $d->offset); } public function testCreateFromTimestampWithDateTimeZone() { $d = Carbon::createFromTimestamp(0, new DateTimeZone('UTC')); $this->assertSame('UTC', $d->tzName); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); } public function testCreateFromTimestampWithString() { $d = Carbon::createFromTimestamp(0, 'UTC'); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); $this->assertSame(0, $d->offset); $this->assertSame('UTC', $d->tzName); } public function testCreateFromTimestampGMTDoesNotUseDefaultTimezone() { $d = Carbon::createFromTimestampUTC(0); $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); $this->assertSame(0, $d->offset); } /** * Ensures DST php bug does not affect createFromTimestamp in DST change. * * @see https://github.com/briannesbitt/Carbon/issues/1951 */ public function testCreateFromTimestampInDstChange() { $this->assertSame( '2019-11-03T01:00:00-04:00', Carbon::createFromTimestamp(1572757200, 'America/New_York')->toIso8601String(), ); $this->assertSame( '2019-11-03T01:00:00-05:00', Carbon::createFromTimestamp(1572757200 + 3600, 'America/New_York')->toIso8601String(), ); $this->assertSame( '2019-11-03T01:00:00-04:00', Carbon::createFromTimestampMs(1572757200000, 'America/New_York')->toIso8601String(), ); $this->assertSame( '2019-11-03T01:00:00-05:00', Carbon::createFromTimestampMs(1572757200000 + 3600000, 'America/New_York')->toIso8601String(), ); } public function testCreateFromMicrotimeFloat() { $microtime = 1600887164.88952298; $d = Carbon::createFromTimestamp($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.889523', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889523', $d->format('U.u')); $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:44.889523', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889523', $d->format('U.u')); $microtime = 1600887164.0603; $d = Carbon::createFromTimestamp($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.060300', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.060300', $d->format('U.u')); $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:44.060300', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.060300', $d->format('U.u')); $this->assertSame('010000', Carbon::createFromTimestamp(0.01)->format('u')); } public function testCreateFromMicrotimeStrings() { $microtime = '0.88951247 1600887164'; $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:44.889512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889512', $d->format('U.u')); $d = Carbon::createFromTimestamp($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.889512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889512', $d->format('U.u')); $microtime = '0.88951247/1600887164/12.56'; $d = Carbon::createFromTimestamp($microtime, 'America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); $this->assertSame('2020-09-23 14:52:57.449512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887177.449512', $d->format('U.u')); $d = Carbon::createFromTimestamp($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:57.449512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887177.449512', $d->format('U.u')); $d = Carbon::createFromTimestamp('-10.6', 'America/Toronto'); $this->assertSame('1969-12-31 18:59:49.400000 -05:00', $d->format('Y-m-d H:i:s.u P')); $d = Carbon::createFromTimestamp('-10.6'); $this->assertSame('1969-12-31 23:59:49.400000 +00:00', $d->format('Y-m-d H:i:s.u P')); $d = new Carbon('@-10.6'); $this->assertSame('1969-12-31 23:59:49.400000 +00:00', $d->format('Y-m-d H:i:s.u P')); } public function testCreateFromMicrotimeUTCFloat() { $microtime = 1600887164.88952298; $d = Carbon::createFromTimestampUTC($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.889523', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889523', $d->format('U.u')); } public function testCreateFromMicrotimeUTCStrings() { $microtime = '0.88951247 1600887164'; $d = Carbon::createFromTimestampUTC($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:44.889512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887164.889512', $d->format('U.u')); $microtime = '0.88951247/1600887164/12.56'; $d = Carbon::createFromTimestampUTC($microtime); $this->assertSame('+00:00', $d->tzName); $this->assertSame('2020-09-23 18:52:57.449512', $d->format('Y-m-d H:i:s.u')); $this->assertSame('1600887177.449512', $d->format('U.u')); } public function testNegativeIntegerTimestamp() { $this->assertSame( '1969-12-31 18:59:59.000000 -05:00', Carbon::createFromTimestamp(-1, 'America/Toronto')->format('Y-m-d H:i:s.u P'), ); $this->assertSame( '1969-12-31 23:59:59.000000 +00:00', Carbon::createFromTimestamp(-1)->format('Y-m-d H:i:s.u P'), ); } } ================================================ FILE: tests/CarbonImmutable/CreateSafeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Exceptions\InvalidDateException; use Tests\AbstractTestCase; class CreateSafeTest extends AbstractTestCase { public function testInvalidDateExceptionProperties() { $e = new InvalidDateException('day', 'foo'); $this->assertSame('day', $e->getField()); $this->assertSame('foo', $e->getValue()); } public function testCreateSafeThrowsExceptionForSecondLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('second', -1)); Carbon::createSafe(null, null, null, null, null, -1); } public function testCreateSafeThrowsExceptionForSecondGreaterThan59() { $this->expectExceptionObject(new InvalidDateException('second', 60)); Carbon::createSafe(null, null, null, null, null, 60); } public function testCreateSafeThrowsExceptionForMinuteLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('minute', -1)); Carbon::createSafe(null, null, null, null, -1); } public function testCreateSafeThrowsExceptionForMinuteGreaterThan59() { $this->expectExceptionObject(new InvalidDateException('minute', 60)); Carbon::createSafe(null, null, null, null, 60, 25); } public function testCreateSafeThrowsExceptionForHourLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('hour', -6)); Carbon::createSafe(null, null, null, -6); } public function testCreateSafeThrowsExceptionForHourGreaterThan24() { $this->expectExceptionObject(new InvalidDateException('hour', 25)); Carbon::createSafe(null, null, null, 25, 16, 15); } public function testCreateSafeThrowsExceptionForDayLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('day', -5)); Carbon::createSafe(null, null, -5); } public function testCreateSafeThrowsExceptionForDayGreaterThan31() { $this->expectExceptionObject(new InvalidDateException('day', 32)); Carbon::createSafe(null, null, 32, 17, 16, 15); } public function testCreateSafeThrowsExceptionForMonthLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('month', -4)); Carbon::createSafe(null, -4); } public function testCreateSafeThrowsExceptionForMonthGreaterThan12() { $this->expectExceptionObject(new InvalidDateException('month', 13)); Carbon::createSafe(null, 13, 5, 17, 16, 15); } public function testCreateSafeThrowsExceptionForYearLowerThanZero() { $this->expectExceptionObject(new InvalidDateException('year', -5)); Carbon::createSafe(-5); } public function testCreateSafeThrowsExceptionForYearGreaterThan12() { $this->expectExceptionObject(new InvalidDateException('year', 10000)); Carbon::createSafe(10000, 12, 5, 17, 16, 15); } public function testCreateSafeThrowsExceptionForInvalidDayInShortMonth() { $this->expectExceptionObject(new InvalidDateException('day', 31)); // 30 days in April Carbon::createSafe(2016, 4, 31, 17, 16, 15); } public function testCreateSafeThrowsExceptionForInvalidDayForFebruaryInLeapYear() { $this->expectExceptionObject(new InvalidDateException('day', 30)); // 29 days in February for a leap year $this->assertTrue(Carbon::create(2016, 2)->isLeapYear()); Carbon::createSafe(2016, 2, 30, 17, 16, 15); } public function testCreateSafePassesForFebruaryInLeapYear() { // 29 days in February for a leap year $this->assertSame(29, Carbon::createSafe(2016, 2, 29, 17, 16, 15)->day); } public function testCreateSafeThrowsExceptionForInvalidDayForFebruaryInNonLeapYear() { $this->expectExceptionObject(new InvalidDateException('day', 29)); // 28 days in February for a non-leap year $this->assertFalse(Carbon::create(2015, 2)->isLeapYear()); Carbon::createSafe(2015, 2, 29, 17, 16, 15); } public function testCreateSafePassesForInvalidDSTTime() { $message = ''; $date = null; try { // 1h jumped to 2h because of the DST, so 1h30 is not a safe date in PHP 5.4+ Carbon::createSafe(2014, 3, 30, 1, 30, 0, 'Europe/London'); } catch (InvalidDateException $exception) { $message = $exception->getMessage(); } $this->assertStringContainsString('hour : 1 is not a valid value.', $message); } public function testCreateSafePassesForValidDSTTime() { $this->assertSame(0, Carbon::createSafe(2014, 3, 30, 0, 30, 0, 'Europe/London')->hour); $this->assertSame(2, Carbon::createSafe(2014, 3, 30, 2, 30, 0, 'Europe/London')->hour); $this->assertSame(1, Carbon::createSafe(2014, 3, 30, 1, 30, 0, 'UTC')->hour); } public function testCreateSafeThrowsExceptionForWithNonIntegerValue() { $this->expectExceptionObject(new InvalidDateException('second', 15.1)); Carbon::createSafe(2015, 2, 10, 17, 16, 15.1); } public function testCreateSafePassesForFebruaryInNonLeapYear() { // 28 days in February for a non-leap year $this->assertSame(28, Carbon::createSafe(2015, 2, 28, 17, 16, 15)->day); } public function testCreateSafePasses() { $sd = Carbon::createSafe(2015, 2, 15, 17, 16, 15); $d = Carbon::create(2015, 2, 15, 17, 16, 15); $this->assertEquals($d, $sd); $this->assertCarbon($sd, 2015, 2, 15, 17, 16, 15); } } ================================================ FILE: tests/CarbonImmutable/CreateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Exceptions\InvalidTimeZoneException; use DateTime; use DateTimeZone; use InvalidArgumentException; use Tests\AbstractTestCase; class CreateTest extends AbstractTestCase { public function testCreateReturnsDatingInstance() { $d = Carbon::create(); $this->assertInstanceOfCarbon($d); } public function testCreateWithDefaults() { $d = Carbon::create(); $this->assertSame($d->getTimestamp(), Carbon::create('0000-01-01 00:00:00')->getTimestamp()); } public function testCreateWithNull() { $d = Carbon::create(null, null, null, null, null, null); $this->assertSame($d->getTimestamp(), Carbon::now()->getTimestamp()); } public function testCreateAsParseAlias() { $d = Carbon::create('2019-02-05 12:30:06.99', 'Asia/Tokyo'); $this->assertSame('2019-02-05 12:30:06.990000 Asia/Tokyo', $d->format('Y-m-d H:i:s.u e')); } public function testCreateWithYear() { $d = Carbon::create(2012); $this->assertSame(2012, $d->year); } public function testCreateHandlesNegativeYear() { $c = Carbon::create(-1, 10, 12, 1, 2, 3); $this->assertCarbon($c, -1, 10, 12, 1, 2, 3); } public function testCreateHandlesFiveDigitsPositiveYears() { $c = Carbon::create(999999999, 10, 12, 1, 2, 3); $this->assertCarbon($c, 999999999, 10, 12, 1, 2, 3); } public function testCreateHandlesFiveDigitsNegativeYears() { $c = Carbon::create(-999999999, 10, 12, 1, 2, 3); $this->assertCarbon($c, -999999999, 10, 12, 1, 2, 3); } public function testCreateWithMonth() { $d = Carbon::create(null, 3); $this->assertSame(3, $d->month); } public function testCreateWithInvalidMonth() { $this->expectExceptionObject(new InvalidArgumentException( 'month must be between 0 and 99, -5 given', )); Carbon::create(null, -5); } public function testCreateMonthWraps() { $d = Carbon::create(2011, 0, 1, 0, 0, 0); $this->assertCarbon($d, 2010, 12, 1, 0, 0, 0); } public function testCreateWithDay() { $d = Carbon::create(null, null, 21); $this->assertSame(21, $d->day); } public function testCreateWithInvalidDay() { $this->expectExceptionObject(new InvalidArgumentException( 'day must be between 0 and 99, -4 given', )); Carbon::create(null, null, -4); } public function testCreateDayWraps() { $d = Carbon::create(2011, 1, 40, 0, 0, 0); $this->assertCarbon($d, 2011, 2, 9, 0, 0, 0); } public function testCreateWithHourAndDefaultMinSecToZero() { $d = Carbon::create(null, null, null, 14); $this->assertSame(14, $d->hour); $this->assertSame(0, $d->minute); $this->assertSame(0, $d->second); } public function testCreateWithInvalidHour() { $this->expectExceptionObject(new InvalidArgumentException( 'hour must be between 0 and 99, -1 given', )); Carbon::create(null, null, null, -1); } public function testCreateHourWraps() { $d = Carbon::create(2011, 1, 1, 24, 0, 0); $this->assertCarbon($d, 2011, 1, 2, 0, 0, 0); } public function testCreateWithMinute() { $d = Carbon::create(null, null, null, null, 58); $this->assertSame(58, $d->minute); } public function testCreateWithInvalidMinute() { $this->expectExceptionObject(new InvalidArgumentException( 'minute must be between 0 and 99, -2 given', )); Carbon::create(2011, 1, 1, 0, -2, 0); } public function testCreateMinuteWraps() { $d = Carbon::create(2011, 1, 1, 0, 62, 0); $this->assertCarbon($d, 2011, 1, 1, 1, 2, 0); } public function testCreateWithSecond() { $d = Carbon::create(null, null, null, null, null, 59); $this->assertSame(59, $d->second); } public function testCreateWithInvalidSecond() { $this->expectExceptionObject(new InvalidArgumentException( 'second must be between 0 and 99, -2 given', )); Carbon::create(null, null, null, null, null, -2); } public function testCreateSecondsWrap() { $d = Carbon::create(2012, 1, 1, 0, 0, 61); $this->assertCarbon($d, 2012, 1, 1, 0, 1, 1); } public function testCreateWithDateTimeZone() { $d = Carbon::create(2012, 1, 1, 0, 0, 0, new DateTimeZone('Europe/London')); $this->assertCarbon($d, 2012, 1, 1, 0, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testCreateWithTimeZoneString() { $d = Carbon::create(2012, 1, 1, 0, 0, 0, 'Europe/London'); $this->assertCarbon($d, 2012, 1, 1, 0, 0, 0); $this->assertSame('Europe/London', $d->tzName); } public function testMake() { $this->assertCarbon(Carbon::make('2017-01-05'), 2017, 1, 5, 0, 0, 0); $this->assertCarbon(Carbon::make(new DateTime('2017-01-05')), 2017, 1, 5, 0, 0, 0); $this->assertCarbon(Carbon::make(new Carbon('2017-01-05')), 2017, 1, 5, 0, 0, 0); $this->assertNull(Carbon::make(3)); } public function testCreateWithInvalidTimezoneOffset() { $this->expectExceptionObject(new InvalidTimeZoneException( 'Unknown or bad timezone (-28236)', )); Carbon::createFromDate(2000, 1, 1, -28236); } public function testCreateWithValidTimezoneOffset() { $dt = Carbon::createFromDate(2000, 1, 1, -4); $this->assertSame('America/New_York', $dt->tzName); $dt = Carbon::createFromDate(2000, 1, 1, '-4'); $this->assertSame('-04:00', $dt->tzName); } public function testParseFromLocale() { $date = Carbon::parseFromLocale('23 Okt 2019', 'de'); $this->assertSame('Wednesday, October 23, 2019 12:00 AM America/Toronto', $date->isoFormat('LLLL zz')); $date = Carbon::parseFromLocale('23 Okt 2019', 'de', 'Europe/Berlin')->locale('de'); $this->assertSame('Mittwoch, 23. Oktober 2019 00:00 Europe/Berlin', $date->isoFormat('LLLL zz')); $date = Carbon::parseFromLocale('23 červenec 2019', 'cs'); $this->assertSame('2019-07-23', $date->format('Y-m-d')); $date = Carbon::parseFromLocale('23 červen 2019', 'cs'); $this->assertSame('2019-06-23', $date->format('Y-m-d')); Carbon::setTestNow('2021-01-26 15:45:13'); $date = Carbon::parseFromLocale('завтра', 'ru'); $this->assertSame('2021-01-27 00:00:00', $date->format('Y-m-d H:i:s')); } public function testParseFromLocaleWithDefaultLocale() { Carbon::setLocale('fr'); $date = Carbon::parseFromLocale('Dimanche'); $this->assertSame('dimanche', $date->dayName); $date = Carbon::parseFromLocale('Lundi'); $this->assertSame('lundi', $date->dayName); } public function testCreateFromLocaleFormat() { $date = Carbon::createFromLocaleFormat('Y M d H,i,s', 'zh_CN', '2019 四月 4 12,04,21'); $this->assertSame('Thursday, April 4, 2019 12:04 PM America/Toronto', $date->isoFormat('LLLL zz')); $date = Carbon::createFromLocaleFormat('Y M d H,i,s', 'zh_TW', '2019 四月 4 12,04,21', 'Asia/Shanghai')->locale('zh'); $this->assertSame('2019年4月4日星期四 中午 12点04分 Asia/Shanghai', $date->isoFormat('LLLL zz')); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d * F * Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \of F \of Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \o\f F \o\f Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \d\e F \d\e Y', 'es', '05 de diciembre de 2022', 'America/Mexico_City') ->format('Y-m-d e') ); $this->assertSame( '2022-12-05 America/Mexico_City', Carbon::createFromLocaleFormat('d \n\o\t F \n\o\t Y', 'es', '05 not diciembre not 2022', 'America/Mexico_City') ->format('Y-m-d e') ); } public function testCreateFromIsoFormat() { $date = Carbon::createFromIsoFormat('!YYYYY MMMM D', '2019 April 4'); $this->assertSame('Thursday, April 4, 2019 12:00 AM America/Toronto', $date->isoFormat('LLLL zz')); } public function testCreateFromIsoFormatException() { $this->expectExceptionObject(new InvalidArgumentException( 'Format wo not supported for creation.', )); Carbon::createFromIsoFormat('YY D wo', '2019 April 4'); } public function testCreateFromLocaleIsoFormat() { $date = Carbon::createFromLocaleIsoFormat('YYYY MMMM D HH,mm,ss', 'zh_TW', '2019 四月 4 12,04,21'); $this->assertSame('Thursday, April 4, 2019 12:04 PM America/Toronto', $date->isoFormat('LLLL zz')); $date = Carbon::createFromLocaleIsoFormat('LLL zz', 'zh', '2019年4月4日 下午 2点04分 Asia/Shanghai'); $this->assertSame('Thursday, April 4, 2019 2:04 PM Asia/Shanghai', $date->isoFormat('LLLL zz')); $this->assertSame('2019年4月4日星期四 下午 2点04分 Asia/Shanghai', $date->locale('zh')->isoFormat('LLLL zz')); $date = Carbon::createFromLocaleIsoFormat('llll', 'fr_CA', 'mar. 24 juil. 2018 08:34'); $this->assertSame('2018-07-24 08:34', $date->format('Y-m-d H:i')); } public function testStartOfTime() { $this->assertTrue(Carbon::startOfTime()->isStartOfTime()); $this->assertTrue(Carbon::startOfTime()->toImmutable()->isStartOfTime()); } public function testEndOfTime() { $this->assertTrue(Carbon::endOfTime()->isEndOfTime()); $this->assertTrue(Carbon::endOfTime()->toImmutable()->isEndOfTime()); } } ================================================ FILE: tests/CarbonImmutable/DayOfWeekModifiersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class DayOfWeekModifiersTest extends AbstractTestCase { public function testGetWeekendDays() { $this->assertSame([Carbon::SATURDAY, Carbon::SUNDAY], Carbon::getWeekendDays()); } public function testSetWeekendDays() { Carbon::setWeekendDays([Carbon::THURSDAY, Carbon::FRIDAY]); $this->assertSame([Carbon::THURSDAY, Carbon::FRIDAY], Carbon::getWeekendDays()); $this->assertTrue(Carbon::createFromDate(2018, 2, 16)->isWeekend()); Carbon::setWeekendDays([Carbon::SATURDAY, Carbon::SUNDAY]); $this->assertSame([Carbon::SATURDAY, Carbon::SUNDAY], Carbon::getWeekendDays()); $this->assertFalse(Carbon::createFromDate(2018, 2, 16)->isWeekend()); } public function testStartOfWeek() { $d = Carbon::create(1980, 8, 7, 12, 11, 9)->startOfWeek(); $this->assertCarbon($d, 1980, 8, 4, 0, 0, 0); } public function testStartOfWeekFromWeekStart() { $d = Carbon::createFromDate(1980, 8, 4)->startOfWeek(); $this->assertCarbon($d, 1980, 8, 4, 0, 0, 0); } public function testStartOfWeekCrossingYearBoundary() { $d = Carbon::createFromDate(2013, 12, 31, 'GMT'); $d2 = $d->startOfWeek(); $this->assertCarbon($d, 2013, 12, 31); $this->assertCarbon($d2, 2013, 12, 30, 0, 0, 0); } public function testEndOfWeek() { $d = Carbon::create(1980, 8, 7, 11, 12, 13)->endOfWeek(); $this->assertCarbon($d, 1980, 8, 10, 23, 59, 59); } public function testEndOfWeekFromWeekEnd() { $d = Carbon::createFromDate(1980, 8, 9)->endOfWeek(); $this->assertCarbon($d, 1980, 8, 10, 23, 59, 59); } public function testEndOfWeekCrossingYearBoundary() { $d = Carbon::createFromDate(2013, 12, 31, 'GMT'); $d2 = $d->endOfWeek(); $this->assertCarbon($d, 2013, 12, 31); $this->assertCarbon($d2, 2014, 1, 5, 23, 59, 59); } /** * @see https://github.com/briannesbitt/Carbon/issues/735 */ public function testStartOrEndOfWeekFromWeekWithUTC() { $d = Carbon::create(2016, 7, 27, 17, 13, 7, 'UTC'); $this->assertCarbon($d->copy()->startOfWeek(), 2016, 7, 25, 0, 0, 0); $this->assertCarbon($d->copy()->endOfWeek(), 2016, 7, 31, 23, 59, 59); } /** * @see https://github.com/briannesbitt/Carbon/issues/735 */ public function testStartOrEndOfWeekFromWeekWithOtherTimezone() { $d = Carbon::create(2016, 7, 27, 17, 13, 7, 'America/New_York'); $this->assertCarbon($d->copy()->startOfWeek(), 2016, 7, 25, 0, 0, 0); $this->assertCarbon($d->copy()->endOfWeek(), 2016, 7, 31, 23, 59, 59); } public function testNext() { $d = Carbon::createFromDate(1975, 5, 21)->next(); $this->assertCarbon($d, 1975, 5, 28, 0, 0, 0); } public function testNextMonday() { $d = Carbon::createFromDate(1975, 5, 21)->next(Carbon::MONDAY); $this->assertCarbon($d, 1975, 5, 26, 0, 0, 0); } public function testNextSaturday() { $d = Carbon::createFromDate(1975, 5, 21)->next(6); $this->assertCarbon($d, 1975, 5, 24, 0, 0, 0); } public function testNextTimestamp() { $d = Carbon::createFromDate(1975, 11, 14)->next(); $this->assertCarbon($d, 1975, 11, 21, 0, 0, 0); } public function testPrevious() { $d = Carbon::createFromDate(1975, 5, 21)->previous(); $this->assertCarbon($d, 1975, 5, 14, 0, 0, 0); } public function testPreviousMonday() { $d = Carbon::createFromDate(1975, 5, 21)->previous(Carbon::MONDAY); $this->assertCarbon($d, 1975, 5, 19, 0, 0, 0); } public function testPreviousSaturday() { $d = Carbon::createFromDate(1975, 5, 21)->previous(6); $this->assertCarbon($d, 1975, 5, 17, 0, 0, 0); } public function testPreviousTimestamp() { $d = Carbon::createFromDate(1975, 11, 28)->previous(); $this->assertCarbon($d, 1975, 11, 21, 0, 0, 0); } public function testFirstDayOfMonth() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(); $this->assertCarbon($d, 1975, 11, 1, 0, 0, 0); } public function testFirstWednesdayOfMonth() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(Carbon::WEDNESDAY); $this->assertCarbon($d, 1975, 11, 5, 0, 0, 0); } public function testFirstFridayOfMonth() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(5); $this->assertCarbon($d, 1975, 11, 7, 0, 0, 0); } public function testLastDayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->lastOfMonth(); $this->assertCarbon($d, 1975, 12, 31, 0, 0, 0); } public function testLastTuesdayOfMonth() { $d = Carbon::createFromDate(1975, 12, 1)->lastOfMonth(Carbon::TUESDAY); $this->assertCarbon($d, 1975, 12, 30, 0, 0, 0); } public function testLastFridayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->lastOfMonth(5); $this->assertCarbon($d, 1975, 12, 26, 0, 0, 0); } public function testNthOfMonthOutsideScope() { $this->assertFalse(Carbon::createFromDate(1975, 12, 5)->nthOfMonth(6, Carbon::MONDAY)); } public function testNthOfMonthOutsideYear() { $this->assertFalse(Carbon::createFromDate(1975, 12, 5)->nthOfMonth(55, Carbon::MONDAY)); } public function test2ndMondayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->nthOfMonth(2, Carbon::MONDAY); $this->assertCarbon($d, 1975, 12, 8, 0, 0, 0); } public function test3rdWednesdayOfMonth() { $d = Carbon::createFromDate(1975, 12, 5)->nthOfMonth(3, 3); $this->assertCarbon($d, 1975, 12, 17, 0, 0, 0); } public function testFirstDayOfQuarter() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(); $this->assertCarbon($d, 1975, 10, 1, 0, 0, 0); } public function testFirstWednesdayOfQuarter() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(Carbon::WEDNESDAY); $this->assertCarbon($d, 1975, 10, 1, 0, 0, 0); } public function testFirstFridayOfQuarter() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(5); $this->assertCarbon($d, 1975, 10, 3, 0, 0, 0); } public function testFirstOfQuarterFromADayThatWillNotExistInTheFirstMonth() { $d = Carbon::createFromDate(2014, 5, 31)->firstOfQuarter(); $this->assertCarbon($d, 2014, 4, 1, 0, 0, 0); } public function testLastDayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 5)->lastOfQuarter(); $this->assertCarbon($d, 1975, 9, 30, 0, 0, 0); } public function testLastTuesdayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 1)->lastOfQuarter(Carbon::TUESDAY); $this->assertCarbon($d, 1975, 9, 30, 0, 0, 0); } public function testLastFridayOfQuarter() { $d = Carbon::createFromDate(1975, 7, 5)->lastOfQuarter(5); $this->assertCarbon($d, 1975, 9, 26, 0, 0, 0); } public function testLastOfQuarterFromADayThatWillNotExistInTheLastMonth() { $d = Carbon::createFromDate(2014, 5, 31)->lastOfQuarter(); $this->assertCarbon($d, 2014, 6, 30, 0, 0, 0); } public function testNthOfQuarterOutsideScope() { $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfQuarter(20, Carbon::MONDAY)); } public function testNthOfQuarterOutsideYear() { $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfQuarter(55, Carbon::MONDAY)); } public function testNthOfQuarterFromADayThatWillNotExistInTheFirstMonth() { $d = Carbon::createFromDate(2014, 5, 31)->nthOfQuarter(2, Carbon::MONDAY); $this->assertCarbon($d, 2014, 4, 14, 0, 0, 0); } public function test2ndMondayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfQuarter(2, Carbon::MONDAY); $this->assertCarbon($d, 1975, 7, 14, 0, 0, 0); } public function test3rdWednesdayOfQuarter() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfQuarter(3, 3); $this->assertCarbon($d, 1975, 7, 16, 0, 0, 0); } public function testFirstDayOfYear() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(); $this->assertCarbon($d, 1975, 1, 1, 0, 0, 0); } public function testFirstWednesdayOfYear() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(Carbon::WEDNESDAY); $this->assertCarbon($d, 1975, 1, 1, 0, 0, 0); } public function testFirstFridayOfYear() { $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(5); $this->assertCarbon($d, 1975, 1, 3, 0, 0, 0); } public function testLastDayOfYear() { $d = Carbon::createFromDate(1975, 8, 5)->lastOfYear(); $this->assertCarbon($d, 1975, 12, 31, 0, 0, 0); } public function testLastTuesdayOfYear() { $d = Carbon::createFromDate(1975, 8, 1)->lastOfYear(Carbon::TUESDAY); $this->assertCarbon($d, 1975, 12, 30, 0, 0, 0); } public function testLastFridayOfYear() { $d = Carbon::createFromDate(1975, 7, 5)->lastOfYear(5); $this->assertCarbon($d, 1975, 12, 26, 0, 0, 0); } public function testNthOfYearOutsideScope() { $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfYear(55, Carbon::MONDAY)); } public function test2ndMondayOfYear() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfYear(2, Carbon::MONDAY); $this->assertCarbon($d, 1975, 1, 13, 0, 0, 0); } public function test3rdWednesdayOfYear() { $d = Carbon::createFromDate(1975, 8, 5)->nthOfYear(3, 3); $this->assertCarbon($d, 1975, 1, 15, 0, 0, 0); } public function testNextWeekday() { // Friday to Monday $d = Carbon::create(2016, 7, 15)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Saturday to Monday $d = Carbon::create(2016, 7, 16)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Sunday to Monday $d = Carbon::create(2016, 7, 16)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Monday to Tuesday $d = Carbon::create(2016, 7, 17)->nextWeekday(); $this->assertCarbon($d, 2016, 7, 18); } public function testPreviousWeekday() { // Tuesday to Monday $d = Carbon::create(2016, 7, 19)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 18); // Monday to Friday $d = Carbon::create(2016, 7, 18)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 15); // Sunday to Friday $d = Carbon::create(2016, 7, 17)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 15); // Saturday to Friday $d = Carbon::create(2016, 7, 16)->previousWeekday(); $this->assertCarbon($d, 2016, 7, 15); } public function testNextWeekendDay() { // Thursday to Saturday $d = Carbon::create(2016, 7, 14)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 16); // Friday to Saturday $d = Carbon::create(2016, 7, 15)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 16); // Saturday to Sunday $d = Carbon::create(2016, 7, 16)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 17); // Sunday to Saturday $d = Carbon::create(2016, 7, 17)->nextWeekendDay(); $this->assertCarbon($d, 2016, 7, 23); } public function testPreviousWeekendDay() { // Thursday to Sunday $d = Carbon::create(2016, 7, 14)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 10); // Friday to Sunday $d = Carbon::create(2016, 7, 15)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 10); // Saturday to Sunday $d = Carbon::create(2016, 7, 16)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 10); // Sunday to Saturday $d = Carbon::create(2016, 7, 17)->previousWeekendDay(); $this->assertCarbon($d, 2016, 7, 16); } public function testWeekStartAndEndWithAutoMode() { $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_UM'); $this->assertSame('Sunday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_US'); $this->assertSame('Sunday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en'); $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('es_US'); $this->assertSame('domingo', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_GB'); $this->assertSame('Monday', Carbon::now()->startOfWeek()->dayName); Carbon::setLocale('en_UM'); $this->assertSame('Saturday', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('en_US'); $this->assertSame('Saturday', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('en'); $this->assertSame('Sunday', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('es_US'); $this->assertSame('sábado', Carbon::now()->endOfWeek()->dayName); Carbon::setLocale('en_GB'); $this->assertSame('Sunday', Carbon::now()->endOfWeek()->dayName); } } ================================================ FILE: tests/CarbonImmutable/DiffTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\UnknownUnitException; use Closure; use DateTime; use Tests\AbstractTestCase; use TypeError; class DiffTest extends AbstractTestCase { public function wrapWithTestNow(Closure $func, ?CarbonInterface $dt = null): void { parent::wrapWithTestNow($func, $dt ?: Carbon::createMidnightDate(2012, 1, 1)); } public function testDiffAsCarbonInterval() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertCarbonInterval($dt->diff($dt->copy()->addYear()), 1, 0, 0, 0, 0, 0); $this->assertTrue($dt->diff($dt)->isEmpty()); } public function testDiffInYearsPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1.0, $dt->diffInYears($dt->copy()->addYear())); } public function testDiffInYearsNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-1.0, $dt->diffInYears($dt->copy()->subYear())); } public function testDiffInYearsNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1.0, $dt->diffInYears($dt->copy()->subYear(), true)); } public function testDiffInYearsVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(1.0, Carbon::now()->subYear()->diffInYears()); }); } public function testDiffInYearsEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInYears($dt->copy()->addYear()->addMonths(7))); } public function testDiffInQuartersPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInQuarters($dt->copy()->addQuarter()->addDay())); } public function testDiffInQuartersNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-4, (int) $dt->diffInQuarters($dt->copy()->subQuarters(4))); } public function testDiffInQuartersNegativeWithNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(4, (int) $dt->diffInQuarters($dt->copy()->subQuarters(4), true)); } public function testDiffInQuartersVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(4, (int) Carbon::now()->subYear()->diffInQuarters()); }); } public function testDiffInQuartersEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInQuarters($dt->copy()->addQuarter()->addDays(12))); } public function testDiffInMonthsPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(13, (int) $dt->diffInMonths($dt->copy()->addYear()->addMonth())); } public function testDiffInMonthsNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-11, (int) $dt->diffInMonths($dt->copy()->subYear()->addMonth())); } public function testDiffInMonthsNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(11, (int) $dt->diffInMonths($dt->copy()->subYear()->addMonth(), true)); } public function testDiffInMonthsVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(12, (int) Carbon::now()->subYear()->diffInMonths()); }); } public function testDiffInMonthsEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInMonths($dt->copy()->addMonth()->addDays(16))); } public function testDiffInDaysPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(366.0, $dt->diffInDays($dt->copy()->addYear())); } public function testDiffInDaysNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-365.0, $dt->diffInDays($dt->copy()->subYear())); } public function testDiffInDaysNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(365.0, $dt->diffInDays($dt->copy()->subYear(), true)); } public function testDiffInDaysVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(7.0, Carbon::now()->subWeek()->diffInDays()); }); } public function testDiffInDaysEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1, (int) $dt->diffInDays($dt->copy()->addDay()->addHours(13))); } public function testDiffInDaysFilteredPositiveWithMutated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === 1; }, $dt->copy()->endOfMonth())); } public function testDiffInDaysFilteredPositiveWithSecondObject() { $dt1 = Carbon::createFromDate(2000, 1, 1); $dt2 = Carbon::createFromDate(2000, 1, 31); $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2)); } public function testDiffInDaysFilteredNegativeNoSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt->copy()->startOfMonth())); } public function testDiffInDaysFilteredNegativeNoSignWithSecondObject() { $dt1 = Carbon::createFromDate(2000, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2, true)); } public function testDiffInDaysFilteredNegativeWithSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === 1; }, $dt->copy()->startOfMonth())); } public function testDiffInDaysFilteredNegativeWithSignWithSecondObject() { $dt1 = Carbon::createFromDate(2000, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-5, $dt1->diffInDaysFiltered(function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt2)); } public function testDiffInHoursFiltered() { $dt1 = Carbon::createFromDate(2000, 1, 31)->endOfDay(); $dt2 = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(-31, $dt1->diffInHoursFiltered(function (Carbon $date) { return $date->hour === 9; }, $dt2)); } public function testDiffInHoursFilteredNegative() { $dt1 = Carbon::createFromDate(2000, 1, 31)->endOfDay(); $dt2 = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(-31, $dt1->diffInHoursFiltered(function (Carbon $date) { return $date->hour === 9; }, $dt2)); } public function testDiffInHoursFilteredWorkHoursPerWeek() { $dt1 = Carbon::createFromDate(2000, 1, 5)->endOfDay(); $dt2 = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(-40, $dt1->diffInHoursFiltered(function (Carbon $date) { return $date->hour > 8 && $date->hour < 17; }, $dt2)); } public function testDiffFilteredUsingMinutesPositiveWithMutated() { $dt = Carbon::createFromDate(2000, 1, 1)->startOfDay(); $this->assertSame(60, $dt->diffFiltered(CarbonInterval::minute(), function (Carbon $date) { return $date->hour === 12; }, Carbon::createFromDate(2000, 1, 1)->endOfDay())); } public function testDiffFilteredPositiveWithSecondObject() { $dt1 = Carbon::create(2000, 1, 1); $dt2 = $dt1->copy()->addSeconds(80); $this->assertSame(40, $dt1->diffFiltered(CarbonInterval::second(), function (Carbon $date) { return $date->second % 2 === 0; }, $dt2)); } public function testDiffFilteredNegativeNoSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-2, $dt->diffFiltered(CarbonInterval::days(2), function (Carbon $date) { return $date->dayOfWeek === Carbon::SUNDAY; }, $dt->copy()->startOfMonth())); } public function testDiffFilteredNegativeNoSignWithSecondObject() { $dt1 = Carbon::createFromDate(2006, 1, 31); $dt2 = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-7, $dt1->diffFiltered(CarbonInterval::year(), function (Carbon $date) { return $date->month === 1; }, $dt2)); } public function testDiffFilteredNegativeWithSignWithMutated() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-4, $dt->diffFiltered(CarbonInterval::week(), function (Carbon $date) { return $date->month === 12; }, $dt->copy()->subMonths(3), false)); } public function testDiffFilteredNegativeWithSignWithSecondObject() { $dt1 = Carbon::createFromDate(2001, 1, 31); $dt2 = Carbon::createFromDate(1999, 1, 1); $this->assertSame(-12, $dt1->diffFiltered(CarbonInterval::month(), function (Carbon $date) { return $date->year === 2000; }, $dt2, false)); } public function testBug188DiffWithSameDates() { $start = Carbon::create(2014, 10, 8, 15, 20, 0); $end = $start->copy(); $this->assertSame(0.0, $start->diffInDays($end)); $this->assertSame(0, $start->diffInWeekdays($end)); } public function testBug188DiffWithDatesOnlyHoursApart() { $start = Carbon::create(2014, 10, 8, 15, 20, 0); $end = $start->copy(); $this->assertSame(0.0, $start->diffInDays($end)); $this->assertSame(0, $start->diffInWeekdays($end)); } public function testBug188DiffWithSameDates1DayApart() { $start = Carbon::create(2014, 10, 8, 15, 20, 0); $end = $start->copy()->addDay(); $this->assertSame(1.0, $start->diffInDays($end)); $this->assertSame(1, $start->diffInWeekdays($end)); } public function testBug188DiffWithDatesOnTheWeekend() { $start = Carbon::create(2014, 1, 1, 0, 0, 0); $start = $start->next(Carbon::SATURDAY); $end = $start->copy()->addDay(); $this->assertSame(1.0, $start->diffInDays($end)); $this->assertSame(0, $start->diffInWeekdays($end)); } public function testDiffInWeekdaysPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(21, $dt->diffInWeekdays($dt->copy()->addMonth())); } public function testDiffInWeekdaysNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(20, $dt->diffInWeekdays($dt->copy()->startOfMonth(), true)); } public function testDiffInWeekdaysNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-20, $dt->diffInWeekdays($dt->copy()->startOfMonth())); } public function testDiffInWeekendDaysPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(10, $dt->diffInWeekendDays($dt->copy()->endOfMonth())); } public function testDiffInWeekendDaysNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(10, $dt->diffInWeekendDays($dt->copy()->startOfMonth(), true)); } public function testDiffInWeekendDaysNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 31); $this->assertSame(-10, $dt->diffInWeekendDays($dt->copy()->startOfMonth())); } public function testDiffInWeeksPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(52, (int) $dt->diffInWeeks($dt->copy()->addYear())); } public function testDiffInWeeksNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-52, (int) $dt->diffInWeeks($dt->copy()->subYear())); } public function testDiffInWeeksNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(52, (int) $dt->diffInWeeks($dt->copy()->subYear(), true)); } public function testDiffInWeeksVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(1.0, Carbon::now()->subWeek()->diffInWeeks()); }); } public function testDiffInWeeksEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(0.86, round($dt->diffInWeeks($dt->copy()->addWeek()->subDay()), 2)); } public function testDiffInHoursPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(26.0, $dt->diffInHours($dt->copy()->addDay()->addHours(2))); } public function testDiffInHoursNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-22.0, $dt->diffInHours($dt->copy()->subDay()->addHours(2))); } public function testDiffInHoursNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(22.0, $dt->diffInHours($dt->copy()->subDay()->addHours(2), true)); } public function testDiffInHoursVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(48.0, Carbon::now()->subDays(2)->diffInHours()); }, Carbon::create(2012, 1, 15)); } public function testDiffInHoursEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1.52, round($dt->diffInHours($dt->copy()->addHour()->addMinutes(31)), 2)); } public function testDiffInHoursWithTimezones() { date_default_timezone_set('Africa/Algiers'); Carbon::setTestNow(); $dtToronto = Carbon::create(2012, 1, 1, 0, 0, 0, 'America/Toronto'); $dtVancouver = Carbon::create(2012, 1, 1, 0, 0, 0, 'America/Vancouver'); $this->assertSame(-3.0, $dtVancouver->diffInHours($dtToronto), 'Midnight in Toronto is 3 hours from midnight in Vancouver'); $dtToronto = Carbon::createFromDate(2012, 1, 1, 'America/Toronto'); usleep(2); $dtVancouver = Carbon::createFromDate(2012, 1, 1, 'America/Vancouver'); $this->assertSame(0, ((int) round($dtVancouver->diffInHours($dtToronto))) % 24); $dtToronto = Carbon::createMidnightDate(2012, 1, 1, 'America/Toronto'); $dtVancouver = Carbon::createMidnightDate(2012, 1, 1, 'America/Vancouver'); $this->assertSame(-3.0, $dtVancouver->diffInHours($dtToronto), 'Midnight in Toronto is 3 hours from midnight in Vancouver'); } public function testDiffInMinutesPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(62.0, $dt->diffInMinutes($dt->copy()->addHour()->addMinutes(2))); } public function testDiffInMinutesPositiveALot() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1502.0, $dt->diffInMinutes($dt->copy()->addHours(25)->addMinutes(2))); } public function testDiffInMinutesNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-58.0, $dt->diffInMinutes($dt->copy()->subHour()->addMinutes(2))); } public function testDiffInMinutesNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(58.0, $dt->diffInMinutes($dt->copy()->subHour()->addMinutes(2), true)); } public function testDiffInMinutesVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(60.0, Carbon::now()->subHour()->diffInMinutes()); }); } public function testDiffInMinutesEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1.52, round($dt->diffInMinutes($dt->copy()->addMinute()->addSeconds(31)), 2)); } public function testDiffInSecondsPositive() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(62.0, $dt->diffInSeconds($dt->copy()->addMinute()->addSeconds(2))); } public function testDiffInSecondsPositiveALot() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(7202.0, $dt->diffInSeconds($dt->copy()->addHours(2)->addSeconds(2))); } public function testDiffInSecondsNegativeWithSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(-58.0, $dt->diffInSeconds($dt->copy()->subMinute()->addSeconds(2))); } public function testDiffInSecondsNegativeNoSign() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(58.0, $dt->diffInSeconds($dt->copy()->subMinute()->addSeconds(2), true)); } public function testDiffInSecondsVsDefaultNow() { $this->wrapWithTestNow(function () { $this->assertSame(3600.0, Carbon::now()->subHour()->diffInSeconds()); }); } public function testDiffInSecondsEnsureIsTruncated() { $dt = Carbon::createFromDate(2000, 1, 1); $this->assertSame(1.0, $dt->diffInSeconds($dt->copy()->addSeconds((int) 1.9))); } public function testDiffInSecondsWithTimezones() { $dtOttawa = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $dtVancouver = Carbon::createFromDate(2000, 1, 1, 'America/Vancouver'); $this->assertSame(0, $dtOttawa->diffInSeconds($dtVancouver) % (24 * 3600)); $dtOttawa = Carbon::createMidnightDate(2000, 1, 1, 'America/Toronto'); $dtVancouver = Carbon::createMidnightDate(2000, 1, 1, 'America/Vancouver'); $this->assertSame(3.0 * 60 * 60, $dtOttawa->diffInSeconds($dtVancouver)); } public function testDiffInSecondsWithTimezonesAndVsDefault() { $vanNow = Carbon::now('America/Vancouver'); $hereNow = $vanNow->copy()->setTimezone(Carbon::now()->tz); $this->wrapWithTestNow(function () use ($vanNow) { $this->assertSame(0.0, $vanNow->diffInSeconds()); }, $hereNow); } public function testDiffForHumansNowAndSecond() { $this->wrapWithTestNow(function () { $this->assertSame('0 seconds ago', Carbon::now()->diffForHumans()); }); } /** * @see https://github.com/briannesbitt/Carbon/issues/2136 */ public function testDiffInTheFuture() { Carbon::setTestNow('2020-07-22 09:15'); $this->assertSame( '1 week from now', Carbon::parse('2020-07-30 13:51:15') ->diffForHumans(['options' => CarbonInterface::ROUND]), ); } public function testDiffForHumansNowAndSecondWithTimezone() { $vanNow = Carbon::now('America/Vancouver'); $hereNow = $vanNow->copy()->setTimezone(Carbon::now()->tz); $this->wrapWithTestNow(function () use ($vanNow) { $this->assertSame('0 seconds ago', $vanNow->diffForHumans()); }, $hereNow); } public function testDiffForHumansNowAndSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds ago', Carbon::now()->subSeconds(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds ago', Carbon::now()->subSeconds(59)->diffForHumans()); }); } public function testDiffForHumansNowAndMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute ago', Carbon::now()->subMinute()->diffForHumans()); }); } public function testDiffForHumansNowAndMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes ago', Carbon::now()->subMinutes(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes ago', Carbon::now()->subMinutes(59)->diffForHumans()); }); } public function testDiffForHumansNowAndHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour ago', Carbon::now()->subHour()->diffForHumans()); }); } public function testDiffForHumansNowAndHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours ago', Carbon::now()->subHours(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours ago', Carbon::now()->subHours(23)->diffForHumans()); }); } public function testDiffForHumansNowAndDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day ago', Carbon::now()->subDay()->diffForHumans()); }); } public function testDiffForHumansNowAndDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days ago', Carbon::now()->subDays(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days ago', Carbon::now()->subDays(6)->diffForHumans()); }); } public function testDiffForHumansNowAndWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week ago', Carbon::now()->subWeek()->diffForHumans()); }); } public function testDiffForHumansNowAndWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks ago', Carbon::now()->subWeeks(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks ago', Carbon::now()->subWeeks(3)->diffForHumans()); }); } public function testDiffForHumansNowAndMonth() { Carbon::setTestNow('2018-12-01'); $this->assertSame('4 weeks ago', Carbon::now()->subWeeks(4)->diffForHumans()); $this->assertSame('1 month ago', Carbon::now()->subMonth()->diffForHumans()); } public function testDiffForHumansNowAndMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months ago', Carbon::now()->subMonthsNoOverflow(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months ago', Carbon::now()->subMonthsNoOverflow(11)->diffForHumans()); }); } public function testDiffForHumansNowAndYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year ago', Carbon::now()->subYear()->diffForHumans()); }); } public function testDiffForHumansNowAndYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years ago', Carbon::now()->subYears(2)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureSecond() { $this->wrapWithTestNow(function () { $this->assertSame('1 second from now', Carbon::now()->addSecond()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds from now', Carbon::now()->addSeconds(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds from now', Carbon::now()->addSeconds(59)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute from now', Carbon::now()->addMinute()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes from now', Carbon::now()->addMinutes(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes from now', Carbon::now()->addMinutes(59)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour from now', Carbon::now()->addHour()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours from now', Carbon::now()->addHours(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours from now', Carbon::now()->addHours(23)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day from now', Carbon::now()->addDay()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days from now', Carbon::now()->addDays(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days from now', Carbon::now()->addDays(6)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week from now', Carbon::now()->addWeek()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks from now', Carbon::now()->addWeeks(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks from now', Carbon::now()->addWeeks(3)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMonth() { $this->wrapWithTestNow(function () { $this->assertSame('4 weeks from now', Carbon::now()->addWeeks(4)->diffForHumans()); $this->assertSame('1 month from now', Carbon::now()->addMonth()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months from now', Carbon::now()->addMonths(2)->diffForHumans()); }); } public function testDiffForHumansNowAndNearlyFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months from now', Carbon::now()->addMonths(11)->diffForHumans()); }); } public function testDiffForHumansNowAndFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year from now', Carbon::now()->addYear()->diffForHumans()); }); } public function testDiffForHumansNowAndFutureYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years from now', Carbon::now()->addYears(2)->diffForHumans()); }); } public function testDiffForHumansOtherAndSecond() { $this->wrapWithTestNow(function () { $this->assertSame('1 second before', Carbon::now()->diffForHumans(Carbon::now()->addSecond())); }); } public function testDiffForHumansOtherAndSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds before', Carbon::now()->diffForHumans(Carbon::now()->addSeconds(2))); }); } public function testDiffForHumansOtherAndNearlyMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds before', Carbon::now()->diffForHumans(Carbon::now()->addSeconds(59))); }); } public function testDiffForHumansOtherAndMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute before', Carbon::now()->diffForHumans(Carbon::now()->addMinute())); }); } public function testDiffForHumansOtherAndMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes before', Carbon::now()->diffForHumans(Carbon::now()->addMinutes(2))); }); } public function testDiffForHumansOtherAndNearlyHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes before', Carbon::now()->diffForHumans(Carbon::now()->addMinutes(59))); }); } public function testDiffForHumansOtherAndHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour before', Carbon::now()->diffForHumans(Carbon::now()->addHour())); }); } public function testDiffForHumansOtherAndHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours before', Carbon::now()->diffForHumans(Carbon::now()->addHours(2))); }); } public function testDiffForHumansOtherAndNearlyDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours before', Carbon::now()->diffForHumans(Carbon::now()->addHours(23))); }); } public function testDiffForHumansOtherAndDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day before', Carbon::now()->diffForHumans(Carbon::now()->addDay())); }); } public function testDiffForHumansOtherAndDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days before', Carbon::now()->diffForHumans(Carbon::now()->addDays(2))); }); } public function testDiffForHumansOtherAndNearlyWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days before', Carbon::now()->diffForHumans(Carbon::now()->addDays(6))); }); } public function testDiffForHumansOverWeekWithDefaultPartsCount() { $this->wrapWithTestNow(function () { $this->assertSame('1 week ago', Carbon::now()->subDays(8)->diffForHumans()); }); } public function testDiffForHumansOverWeekWithPartsCount1() { $this->wrapWithTestNow(function () { $this->assertSame( '1 week ago', Carbon::now()->subDays(8)->diffForHumans(null, false, false, 1) ); }); } public function testDiffForHumansOverWeekWithPartsCount2() { $this->wrapWithTestNow(function () { $this->assertSame( '1 week 1 day ago', Carbon::now()->subDays(8)->diffForHumans(null, false, false, 2) ); }); } public function testDiffForHumansOverWeekWithMicrosecondsBuggyGap() { $this->wrapWithTestNow(function () { $this->assertSame( '23 hours 59 minutes 59 seconds after', Carbon::parse('2018-12-03 12:34:45.123456') ->diffForHumans('2018-12-02 12:34:45.123476', ['parts' => 3]) ); }); } public function testDiffForHumansOtherAndWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week before', Carbon::now()->diffForHumans(Carbon::now()->addWeek())); }); } public function testDiffForHumansOtherAndWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks before', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(2))); }); } public function testDiffForHumansOtherAndNearlyMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks before', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(3))); }); } public function testDiffForHumansOtherAndMonth() { $this->wrapWithTestNow(function () { $this->assertSame('4 weeks before', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(4))); $this->assertSame('1 month before', Carbon::now()->diffForHumans(Carbon::now()->addMonth())); }); } public function testDiffForHumansOtherAndMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months before', Carbon::now()->diffForHumans(Carbon::now()->addMonths(2))); }); } public function testDiffForHumansOtherAndNearlyYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months before', Carbon::now()->diffForHumans(Carbon::now()->addMonths(11))); }); } public function testDiffForHumansOtherAndYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year before', Carbon::now()->diffForHumans(Carbon::now()->addYear())); }); } public function testDiffForHumansOtherAndYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years before', Carbon::now()->diffForHumans(Carbon::now()->addYears(2))); }); } public function testDiffForHumansOtherAndFutureSecond() { $this->wrapWithTestNow(function () { $this->assertSame('1 second after', Carbon::now()->diffForHumans(Carbon::now()->subSecond())); }); } public function testDiffForHumansOtherAndFutureSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('2 seconds after', Carbon::now()->diffForHumans(Carbon::now()->subSeconds(2))); }); } public function testDiffForHumansOtherAndNearlyFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds after', Carbon::now()->diffForHumans(Carbon::now()->subSeconds(59))); }); } public function testDiffForHumansOtherAndFutureMinute() { $this->wrapWithTestNow(function () { $this->assertSame('1 minute after', Carbon::now()->diffForHumans(Carbon::now()->subMinute())); }); } public function testDiffForHumansOtherAndFutureMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('2 minutes after', Carbon::now()->diffForHumans(Carbon::now()->subMinutes(2))); }); } public function testDiffForHumansOtherAndNearlyFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('59 minutes after', Carbon::now()->diffForHumans(Carbon::now()->subMinutes(59))); }); } public function testDiffForHumansOtherAndFutureHour() { $this->wrapWithTestNow(function () { $this->assertSame('1 hour after', Carbon::now()->diffForHumans(Carbon::now()->subHour())); }); } public function testDiffForHumansOtherAndFutureHours() { $this->wrapWithTestNow(function () { $this->assertSame('2 hours after', Carbon::now()->diffForHumans(Carbon::now()->subHours(2))); }); } public function testDiffForHumansOtherAndNearlyFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('23 hours after', Carbon::now()->diffForHumans(Carbon::now()->subHours(23))); }); } public function testDiffForHumansOtherAndFutureDay() { $this->wrapWithTestNow(function () { $this->assertSame('1 day after', Carbon::now()->diffForHumans(Carbon::now()->subDay())); }); } public function testDiffForHumansOtherAndFutureDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days after', Carbon::now()->diffForHumans(Carbon::now()->subDays(2))); }); } public function testDiffForHumansOtherAndNearlyFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('6 days after', Carbon::now()->diffForHumans(Carbon::now()->subDays(6))); }); } public function testDiffForHumansOtherAndFutureWeek() { $this->wrapWithTestNow(function () { $this->assertSame('1 week after', Carbon::now()->diffForHumans(Carbon::now()->subWeek())); }); } public function testDiffForHumansOtherAndFutureWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks after', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(2))); }); } public function testDiffForHumansOtherAndNearlyFutureMonth() { $this->wrapWithTestNow(function () { $this->assertSame('3 weeks after', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(3))); }); } public function testDiffForHumansOtherAndFutureMonth() { Carbon::setTestNow('2018-12-01'); $this->assertSame('4 weeks after', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(4))); $this->assertSame('1 month after', Carbon::now()->diffForHumans(Carbon::now()->subMonth())); } public function testDiffForHumansOtherAndFutureMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months after', Carbon::now()->diffForHumans(Carbon::now()->subMonthsNoOverflow(2))); }); } public function testDiffForHumansOtherAndNearlyFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('11 months after', Carbon::now()->diffForHumans(Carbon::now()->subMonthsNoOverflow(11))); }); } public function testDiffForHumansOtherAndFutureYear() { $this->wrapWithTestNow(function () { $this->assertSame('1 year after', Carbon::now()->diffForHumans(Carbon::now()->subYear())); }); } public function testDiffForHumansOtherAndFutureYears() { $this->wrapWithTestNow(function () { $this->assertSame('2 years after', Carbon::now()->diffForHumans(Carbon::now()->subYears(2))); }); } public function testDiffForHumansAbsoluteSeconds() { $this->wrapWithTestNow(function () { $this->assertSame('59 seconds', Carbon::now()->diffForHumans(Carbon::now()->subSeconds(59), true)); $this->assertSame('59 seconds', Carbon::now()->diffForHumans(Carbon::now()->addSeconds(59), true)); }); } public function testDiffForHumansAbsoluteMinutes() { $this->wrapWithTestNow(function () { $this->assertSame('30 minutes', Carbon::now()->diffForHumans(Carbon::now()->subMinutes(30), true)); $this->assertSame('30 minutes', Carbon::now()->diffForHumans(Carbon::now()->addMinutes(30), true)); }); } public function testDiffForHumansAbsoluteHours() { $this->wrapWithTestNow(function () { $this->assertSame('3 hours', Carbon::now()->diffForHumans(Carbon::now()->subHours(3), true)); $this->assertSame('3 hours', Carbon::now()->diffForHumans(Carbon::now()->addHours(3), true)); }); } public function testDiffForHumansAbsoluteDays() { $this->wrapWithTestNow(function () { $this->assertSame('2 days', Carbon::now()->diffForHumans(Carbon::now()->subDays(2), true)); $this->assertSame('2 days', Carbon::now()->diffForHumans(Carbon::now()->addDays(2), true)); }); } public function testDiffForHumansAbsoluteWeeks() { $this->wrapWithTestNow(function () { $this->assertSame('2 weeks', Carbon::now()->diffForHumans(Carbon::now()->subWeeks(2), true)); $this->assertSame('2 weeks', Carbon::now()->diffForHumans(Carbon::now()->addWeeks(2), true)); }); } public function testDiffForHumansAbsoluteMonths() { $this->wrapWithTestNow(function () { $this->assertSame('2 months', Carbon::now()->diffForHumans(Carbon::now()->subMonthsNoOverflow(2), true)); $this->assertSame('2 months', Carbon::now()->diffForHumans(Carbon::now()->addMonthsNoOverflow(2), true)); }); } public function testDiffForHumansAbsoluteYears() { $this->wrapWithTestNow(function () { $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), true)); $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), true)); }); } public function testDiffForHumansWithOptions() { $this->wrapWithTestNow(function () { $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year after', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year before', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year from now', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year ago', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year after', Carbon::now()->diffForHumans(Carbon::now()->subYears(1), CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('1 year before', Carbon::now()->diffForHumans(Carbon::now()->addYears(1), CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('1 year', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_ABSOLUTE)); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_AUTO)); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year before', Carbon::now()->subYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('1 year after', Carbon::now()->addYears(1)->diffForHumans(null, CarbonInterface::DIFF_RELATIVE_TO_OTHER)); }); } public function testDiffForHumansWithMagicMethods() { $this->wrapWithTestNow(function () { $this->assertSame('1 year', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->subYears(1)->subMonth())); $this->assertSame('1 year 1 month', Carbon::now()->longAbsoluteDiffForHumans(2, Carbon::now()->subYears(1)->subMonth())); $this->assertSame('1 year 1 month', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->subYears(1)->subMonth(), 2)); $this->assertSame('1 year', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year', Carbon::now()->longAbsoluteDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr', Carbon::now()->shortAbsoluteDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr', Carbon::now()->shortAbsoluteDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year after', Carbon::now()->longRelativeDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year before', Carbon::now()->longRelativeDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr after', Carbon::now()->shortRelativeDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr before', Carbon::now()->shortRelativeDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year from now', Carbon::now()->longRelativeToNowDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year ago', Carbon::now()->longRelativeToNowDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr from now', Carbon::now()->shortRelativeToNowDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr ago', Carbon::now()->shortRelativeToNowDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year after', Carbon::now()->longRelativeToOtherDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1 year before', Carbon::now()->longRelativeToOtherDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1yr after', Carbon::now()->shortRelativeToOtherDiffForHumans(Carbon::now()->subYears(1))); $this->assertSame('1yr before', Carbon::now()->shortRelativeToOtherDiffForHumans(Carbon::now()->addYears(1))); $this->assertSame('1 year', Carbon::now()->subYears(1)->longAbsoluteDiffForHumans()); $this->assertSame('1 year', Carbon::now()->addYears(1)->longAbsoluteDiffForHumans()); $this->assertSame('1yr', Carbon::now()->subYears(1)->shortAbsoluteDiffForHumans()); $this->assertSame('1yr', Carbon::now()->addYears(1)->shortAbsoluteDiffForHumans()); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->longRelativeDiffForHumans()); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->longRelativeDiffForHumans()); $this->assertSame('1yr ago', Carbon::now()->subYears(1)->shortRelativeDiffForHumans()); $this->assertSame('1yr from now', Carbon::now()->addYears(1)->shortRelativeDiffForHumans()); $this->assertSame('1 year ago', Carbon::now()->subYears(1)->longRelativeToNowDiffForHumans()); $this->assertSame('1 year from now', Carbon::now()->addYears(1)->longRelativeToNowDiffForHumans()); $this->assertSame('1yr ago', Carbon::now()->subYears(1)->shortRelativeToNowDiffForHumans()); $this->assertSame('1yr from now', Carbon::now()->addYears(1)->shortRelativeToNowDiffForHumans()); $this->assertSame('1 year before', Carbon::now()->subYears(1)->longRelativeToOtherDiffForHumans()); $this->assertSame('1 year after', Carbon::now()->addYears(1)->longRelativeToOtherDiffForHumans()); $this->assertSame('1yr before', Carbon::now()->subYears(1)->shortRelativeToOtherDiffForHumans()); $this->assertSame('1yr after', Carbon::now()->addYears(1)->shortRelativeToOtherDiffForHumans()); }); } public function testDiffForHumansWithShorterMonthShouldStillBeAMonth() { $feb15 = Carbon::parse('2015-02-15'); $mar15 = Carbon::parse('2015-03-15'); $this->assertSame('1 month after', $mar15->diffForHumans($feb15)); } public function testDiffForHumansWithDateTimeInstance() { $feb15 = new DateTime('2015-02-15'); $mar15 = Carbon::parse('2015-03-15'); $this->assertSame('1 month after', $mar15->diffForHumans($feb15)); } public function testDiffForHumansWithDateString() { $mar13 = Carbon::parse('2018-03-13'); $this->assertSame('1 month before', $mar13->diffForHumans('2018-04-13')); } public function testDiffForHumansWithDateTimeString() { $mar13 = Carbon::parse('2018-03-13'); $this->assertSame('1 month before', $mar13->diffForHumans('2018-04-13 08:00:00')); } public function testDiffWithString() { $dt1 = Carbon::createFromDate(2000, 1, 25)->endOfDay(); $this->assertSame(384.0, round($dt1->diffInHours('2000-01-10', true))); $this->assertSame(383.0, floor($dt1->diffInHours('2000-01-10', true))); } public function testDiffWithDateTime() { $dt1 = Carbon::createFromDate(2000, 1, 25)->endOfDay(); $dt2 = new DateTime('2000-01-10'); $this->assertSame(-384.0, round($dt1->diffInHours($dt2))); } public function testDiffOptions() { $this->assertSame(1, Carbon::NO_ZERO_DIFF); $this->assertSame(2, Carbon::JUST_NOW); $this->assertSame(4, Carbon::ONE_DAY_WORDS); $this->assertSame(8, Carbon::TWO_DAY_WORDS); $this->assertSame(16, Carbon::SEQUENTIAL_PARTS_ONLY); $options = Carbon::getHumanDiffOptions(); $this->assertSame(0, $options); $date = Carbon::create(2018, 3, 12, 2, 5, 6, 'UTC'); $this->assertSame('0 seconds before', $date->diffForHumans($date)); Carbon::setHumanDiffOptions(0); $this->assertSame(0, Carbon::getHumanDiffOptions()); $this->assertSame('0 seconds before', $date->diffForHumans($date)); Carbon::setLocale('fr'); $this->assertSame('0 seconde avant', $date->diffForHumans($date)); Carbon::setLocale('en'); Carbon::setHumanDiffOptions(Carbon::JUST_NOW); $this->assertSame(2, Carbon::getHumanDiffOptions()); $this->assertSame('0 seconds before', $date->diffForHumans($date)); $this->assertSame('just now', Carbon::now()->diffForHumans()); Carbon::setHumanDiffOptions(Carbon::ONE_DAY_WORDS | Carbon::TWO_DAY_WORDS | Carbon::NO_ZERO_DIFF | Carbon::SEQUENTIAL_PARTS_ONLY); $this->assertSame(29, Carbon::getHumanDiffOptions()); Carbon::disableHumanDiffOption(Carbon::SEQUENTIAL_PARTS_ONLY); $oneDayAfter = Carbon::create(2018, 3, 13, 2, 5, 6, 'UTC'); $oneDayBefore = Carbon::create(2018, 3, 11, 2, 5, 6, 'UTC'); $twoDayAfter = Carbon::create(2018, 3, 14, 2, 5, 6, 'UTC'); $twoDayBefore = Carbon::create(2018, 3, 10, 2, 5, 6, 'UTC'); $this->assertSame('1 day after', $oneDayAfter->diffForHumans($date)); $this->assertSame('1 day before', $oneDayBefore->diffForHumans($date)); $this->assertSame('2 days after', $twoDayAfter->diffForHumans($date)); $this->assertSame('2 days before', $twoDayBefore->diffForHumans($date)); $this->assertSame('tomorrow', Carbon::now()->addDay()->diffForHumans()); $this->assertSame('yesterday', Carbon::now()->subDay()->diffForHumans()); $this->assertSame('after tomorrow', Carbon::now()->addDays(2)->diffForHumans()); $this->assertSame('before yesterday', Carbon::now()->subDays(2)->diffForHumans()); Carbon::disableHumanDiffOption(Carbon::TWO_DAY_WORDS); $this->assertSame(5, Carbon::getHumanDiffOptions()); Carbon::disableHumanDiffOption(Carbon::TWO_DAY_WORDS); $this->assertSame(5, Carbon::getHumanDiffOptions()); $this->assertSame('tomorrow', Carbon::now()->addDay()->diffForHumans()); $this->assertSame('yesterday', Carbon::now()->subDay()->diffForHumans()); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->diffForHumans()); $this->assertSame('2 days ago', Carbon::now()->subDays(2)->diffForHumans()); Carbon::enableHumanDiffOption(Carbon::JUST_NOW); $this->assertSame(7, Carbon::getHumanDiffOptions()); Carbon::enableHumanDiffOption(Carbon::JUST_NOW); $this->assertSame(7, Carbon::getHumanDiffOptions()); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 4, 0, 0, 0, 'UTC'); $this->assertSame('1 month before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 11, 0, 0, 0, 'UTC'); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 12, 0, 0, 0, 'UTC'); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $this->assertSame('1 month 1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 3, ])); $this->assertSame('1 month 1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 3, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2020, 1, 11, 0, 0, 0, 'UTC'); $this->assertSame('1 year 1 week before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 year before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 2, 5, 0, 0, 0, 'UTC'); $this->assertSame('1 month 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 month before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $origin = Carbon::create(2019, 1, 4, 0, 0, 0, 'UTC'); $comparison = Carbon::create(2019, 1, 12, 0, 1, 0, 'UTC'); $this->assertSame('1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 2, ])); $this->assertSame('1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 2, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); $this->assertSame('1 week 1 day 1 minute before', $origin->diffForHumans($comparison, [ 'parts' => 3, ])); $this->assertSame('1 week 1 day before', $origin->diffForHumans($comparison, [ 'parts' => 3, 'options' => CarbonInterface::SEQUENTIAL_PARTS_ONLY, ])); Carbon::setHumanDiffOptions($options); } public function testDiffForHumansArrayParameter() { Carbon::setTestNow('2000-01-01 00:00:00'); $date = Carbon::now()->subtract('2 days, 3 hours and 40 minutes'); $this->assertSame('2 days ago', $date->diffForHumans([ 'parts' => 1, 'join' => true, ])); $this->assertSame('2 days and 3 hours ago', $date->diffForHumans([ 'parts' => 2, 'join' => true, ])); $this->assertSame('hace 2 días y 3 horas', $date->copy()->locale('es')->diffForHumans([ 'parts' => 2, 'join' => true, ])); $this->assertSame('2 days, 3 hours and 40 minutes ago', $date->diffForHumans([ 'parts' => -1, 'join' => true, ])); $this->assertSame('3 days, 3 hours and 40 minutes before', $date->diffForHumans(Carbon::now()->addDay(), [ 'parts' => -1, 'join' => true, ])); $this->assertSame('3 days, 3 hours and 40 minutes before', $date->diffForHumans([ 'other' => Carbon::now()->addDay(), 'parts' => -1, 'join' => true, ])); $this->assertSame('2 days, 3 hours ago', $date->diffForHumans([ 'parts' => 2, 'join' => ', ', ])); $this->assertSame('2d, 3h ago', $date->diffForHumans([ 'parts' => 2, 'join' => ', ', 'short' => true, ])); $this->assertSame('2 days, 3 hours before', $date->diffForHumans([ 'parts' => 2, 'join' => ', ', 'syntax' => CarbonInterface::DIFF_RELATIVE_TO_OTHER, ])); $this->assertSame('yesterday', Carbon::yesterday()->diffForHumans([ 'options' => CarbonInterface::ONE_DAY_WORDS, ])); $this->assertSame('1 day ago', Carbon::yesterday()->diffForHumans([ 'options' => 0, ])); } public function testFromNow() { Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now('UTC')->addDays(2)->fromNow()); Carbon::setLocale('fr'); $this->assertSame('dans 2 jours', Carbon::now('UTC')->addDays(2)->fromNow()); Carbon::setLocale('en'); $this->assertSame('2 days after', Carbon::now('UTC')->addDays(2)->fromNow(CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('2d from now', Carbon::now('UTC')->addDays(2)->addHours(5)->fromNow(null, true)); $this->assertSame('2 days 5 hours', Carbon::now('UTC')->addDays(2)->addHours(5)->fromNow(true, false, 2)); } public function testFromNowBackwardCompatibleSyntax() { $date = Carbon::parse('-5 days'); $this->assertSame('5 days', $date->fromNow(Carbon::now(), true)); $date = Carbon::parse('+5 days'); $this->assertSame('5 days', $date->fromNow(Carbon::now(), true)); } public function testFrom() { Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->from()); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->from(null)); $this->assertSame('2 days after', Carbon::now()->addDay()->from(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours après', Carbon::now()->addDay()->from(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDay()->from(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d after', Carbon::now()->addDay()->addHours(5)->from(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->from(Carbon::now()->subDay(), true, false, 2)); } public function testSince() { Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->since()); $this->assertSame('2 days from now', Carbon::now()->addDays(2)->since(null)); $this->assertSame('2 days after', Carbon::now()->addDay()->since(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours après', Carbon::now()->addDay()->since(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days from now', Carbon::now()->addDay()->since(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d after', Carbon::now()->addDay()->addHours(5)->since(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->since(Carbon::now()->subDay(), true, false, 2)); } public function testToNow() { Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now('UTC')->addDays(2)->toNow()); Carbon::setLocale('fr'); $this->assertSame('il y a 2 jours', Carbon::now('UTC')->addDays(2)->toNow()); Carbon::setLocale('en'); $this->assertSame('2 days before', Carbon::now('UTC')->addDays(2)->toNow(CarbonInterface::DIFF_RELATIVE_TO_OTHER)); $this->assertSame('2d ago', Carbon::now('UTC')->addDays(2)->addHours(5)->toNow(null, true)); $this->assertSame('2 days 5 hours', Carbon::now('UTC')->addDays(2)->addHours(5)->toNow(true, false, 2)); } public function testTo() { Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->to()); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->to(null)); $this->assertSame('2 days before', Carbon::now()->addDay()->to(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours avant', Carbon::now()->addDay()->to(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDay()->to(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d before', Carbon::now()->addDay()->addHours(5)->to(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->to(Carbon::now()->subDay(), true, false, 2)); } public function testUntil() { Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->until()); $this->assertSame('2 days ago', Carbon::now()->addDays(2)->until(null)); $this->assertSame('2 days before', Carbon::now()->addDay()->until(Carbon::now()->subDay())); Carbon::setLocale('fr'); $this->assertSame('2 jours avant', Carbon::now()->addDay()->until(Carbon::now()->subDay())); Carbon::setLocale('en'); $this->assertSame('2 days ago', Carbon::now()->addDay()->until(Carbon::now()->subDay(), CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('2d before', Carbon::now()->addDay()->addHours(5)->until(Carbon::now()->subDay(), null, true)); $this->assertSame('2 days 5 hours', Carbon::now()->addDay()->addHours(5)->until(Carbon::now()->subDay(), true, false, 2)); } public function testDiffWithInvalidType() { $this->expectException(TypeError::class); Carbon::createFromDate(2000, 1, 25)->diffInHours(10); } public function testDiffWithInvalidObject() { $this->expectException(TypeError::class); Carbon::createFromDate(2000, 1, 25)->diffInHours(new CarbonInterval()); } public function testDiffForHumansWithIncorrectDateTimeStringWhichIsNotACarbonInstance() { $this->expectException(InvalidFormatException::class); $this->expectExceptionMessage('Failed to parse time string (2018-04-13---08:00:00) at position 10'); $mar13 = Carbon::parse('2018-03-13'); $mar13->diffForHumans('2018-04-13---08:00:00'); } public function testFloatDiff() { date_default_timezone_set('UTC'); $this->assertSame(8986.665965, Carbon::parse('2018-03-31 23:55:12.321456')->floatDiffInSeconds(Carbon::parse('2018-04-01 02:24:58.987421'))); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(0.959000397985738, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2018-04-12 14:24:58.987421'), true)); $this->assertVeryClose(0.959000397985738, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-03-13 20:55:12.321456'), true)); $this->assertVeryClose(0.959000397985738, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2018-04-12 14:24:58.987421'))); $this->assertVeryClose(-0.959000397985738, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-03-13 20:55:12.321456'))); $this->assertVeryClose(16.557633744585264, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(15.959000397985738, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(15.959000397985738, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(15.959000397985738, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInMonths(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-15.959000397985738, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInMonths(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3746000338015283, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(0.9609014036645421, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-01-30 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2023-06-12 14:24:58.987421'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInYears(Carbon::parse('2023-06-12 14:24:58.987421'))); $this->assertVeryClose(-5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00')->floatDiffInMonths(Carbon::parse('2018-11-28 00:00:00'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris'), true)); $this->assertVeryClose(-0.9999999999884258, Carbon::parse('2020-12-17 00:00:00.000001')->floatDiffInDays('2020-12-16 00:00:00.000002')); $this->assertSame(-1.0, Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00')->floatDiffInMonths(Carbon::parse('2018-10-28 00:00:00'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris')->floatDiffInMonths(Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris'))); } public function testFloatDiffWithRealUnits() { $from = Carbon::parse('2021-03-27 20:00 Europe/Warsaw'); $to = Carbon::parse('2021-03-27 20:00 Europe/London'); $from->floatDiffInRealDays($to); $this->assertSame('2021-03-27 20:00:00 Europe/Warsaw', $from->format('Y-m-d H:i:s e')); $this->assertSame('2021-03-27 20:00:00 Europe/London', $to->format('Y-m-d H:i:s e')); date_default_timezone_set('UTC'); $this->assertVeryClose(1.0006944444444446, Carbon::parse('2018-12-01 00:00')->floatDiffInRealDays(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-26 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-03-29 20:00')); $this->assertVeryClose(1.0416666666666667, Carbon::parse('2021-10-30 20:00 Europe/Warsaw')->floatDiffInRealDays('2021-10-31 20:00')); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInRealDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInRealDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInRealWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2018-04-12 14:24:58.987421'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-03-13 20:55:12.321456'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2018-04-12 14:24:58.987421'), false)); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-03-13 20:55:12.321456'), false)); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInRealWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInRealWeeks(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2018-04-12 14:24:58.987421'))); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-03-13 20:55:12.321456'))); $this->assertVeryClose(16.557633744585264, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealMonths(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealMonths(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3746000338015283, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(0.9609014036645421, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-01-30 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2023-06-12 14:24:58.987421'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInRealYears(Carbon::parse('2023-06-12 14:24:58.987421'))); $this->assertVeryClose(-5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInRealYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(1.0336021505376345, Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00')->floatDiffInRealMonths(Carbon::parse('2018-11-28 00:00:00'), true)); $this->assertVeryClose(1.0013888888888889, Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris'), true)); $this->assertVeryClose(-1.0336021505376345, Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00')->floatDiffInRealMonths(Carbon::parse('2018-10-28 00:00:00'))); $this->assertVeryClose(-1.0013888888888889, Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris')->floatDiffInRealMonths(Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris'))); Carbon::setTestNow('2021-03-28 20:00 Europe/Warsaw'); $this->assertSame(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInRealDays()); } public function testFloatDiffWithUTCUnits() { $from = Carbon::parse('2021-03-27 20:00 Europe/Warsaw'); $to = Carbon::parse('2021-03-27 20:00 Europe/London'); $from->floatDiffInUtcDays($to); $this->assertSame('2021-03-27 20:00:00 Europe/Warsaw', $from->format('Y-m-d H:i:s e')); $this->assertSame('2021-03-27 20:00:00 Europe/London', $to->format('Y-m-d H:i:s e')); date_default_timezone_set('UTC'); $this->assertVeryClose(1.0006944444444446, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcDays(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-26 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-03-28 20:00')); $this->assertVeryClose(1.9583333333333335, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-03-29 20:00')); $this->assertVeryClose(1.0416666666666667, Carbon::parse('2021-10-30 20:00 Europe/Warsaw')->floatDiffInUtcDays('2021-10-31 20:00')); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcDays(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2018-04-12 14:24:58.987421'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-03-13 20:55:12.321456'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2018-04-12 14:24:58.987421'), false)); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-03-13 20:55:12.321456'), false)); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcWeeks(Carbon::parse('2018-12-02 00:01'))); $this->assertVeryClose(1.0006944444444443 / 7, Carbon::parse('2018-12-01 00:00')->floatDiffInUtcWeeks(Carbon::parse('2018-12-02 00:01'), true)); $this->assertVeryClose(0.9590003979857377, Carbon::parse('2018-03-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2018-04-12 14:24:58.987421'))); $this->assertVeryClose(-0.9590003979857377, Carbon::parse('2018-04-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-03-13 20:55:12.321456'))); $this->assertVeryClose(16.557633744585264, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(15.9590003979857377, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcMonths(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-15.9590003979857377, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcMonths(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertSame(1.0, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3746000338015283, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-06-30 14:24:58.987421'), true)); $this->assertVeryClose(0.9609014036645421, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-01-30 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-06-12 14:24:58.987421'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(1.3252849653083778, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2019-06-12 14:24:58.987421'))); $this->assertVeryClose(-1.3252849653083778, Carbon::parse('2019-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2023-06-12 14:24:58.987421'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'), true)); $this->assertVeryClose(5.325284965308378, Carbon::parse('2018-02-13 20:55:12.321456')->floatDiffInUtcYears(Carbon::parse('2023-06-12 14:24:58.987421'))); $this->assertVeryClose(-5.325284965308378, Carbon::parse('2023-06-12 14:24:58.987421')->floatDiffInUtcYears(Carbon::parse('2018-02-13 20:55:12.321456'))); $this->assertVeryClose(1.0336021505376345, Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris'), true)); $this->assertSame(1.0, Carbon::parse('2018-10-28 00:00:00')->floatDiffInUtcMonths(Carbon::parse('2018-11-28 00:00:00'), true)); $this->assertVeryClose(1.0013888888888889, Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris'), true)); $this->assertVeryClose(-1.0336021505376345, Carbon::parse('2018-11-01 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-10-01 00:00:00', 'Europe/Paris'))); $this->assertSame(-1.0, Carbon::parse('2018-11-28 00:00:00')->floatDiffInUtcMonths(Carbon::parse('2018-10-28 00:00:00'))); $this->assertVeryClose(-1.0013888888888889, Carbon::parse('2018-11-28 00:00:00', 'Europe/Paris')->floatDiffInUtcMonths(Carbon::parse('2018-10-28 00:00:00', 'Europe/Paris'))); Carbon::setTestNow('2021-03-28 20:00 Europe/Warsaw'); $this->assertSame(0.9583333333333334, Carbon::parse('2021-03-27 20:00 Europe/Warsaw')->floatDiffInUtcDays()); } /** * https://bugs.php.net/bug.php?id=77007 * https://github.com/briannesbitt/Carbon/issues/1503 */ public function testPhpBug77007() { $this->assertSame(-3.0, Carbon::now()->addMinutes(3)->diffInMinutes()); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:07.237419'); $this->assertSame(0.322766, $startDate->diffInSeconds($endDate)); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:07.237419'); $this->assertSame('+ 00-00-00 00:00:00.322766', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(0.322766, $startDate->diffInSeconds($endDate)); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:05.237419'); $this->assertSame('+ 00-00-00 00:00:01.677234', $startDate->diff($endDate, true)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(1.677234, $startDate->diffInSeconds($endDate, true)); $this->assertSame('- 00-00-00 00:00:01.677234', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(-1.677234, $startDate->diffInSeconds($endDate, false)); $startDate = Carbon::parse('2018-10-11 20:59:06.914653'); $endDate = Carbon::parse('2018-10-11 20:59:06.237419'); $this->assertSame('+ 00-00-00 00:00:00.677234', $startDate->diff($endDate, true)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(0.677234, $startDate->diffInSeconds($endDate, true)); $this->assertSame('- 00-00-00 00:00:00.677234', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(-0.677234, $startDate->diffInSeconds($endDate, false)); $startDate = Carbon::parse('2017-12-31 23:59:59.914653'); $endDate = Carbon::parse('2018-01-01 00:00:00.237419'); $this->assertSame('+ 00-00-00 00:00:00.322766', $startDate->diff($endDate)->format('%R %Y-%M-%D %H:%I:%S.%F')); $this->assertSame(0.322766, $startDate->diffInSeconds($endDate)); } public function testPHPBug80974() { $this->assertSame(3, Carbon::parse('2018-07-01 America/Toronto')->diffAsDateInterval('2018-07-02 America/Vancouver')->h); $this->assertSame(0, Carbon::parse('2018-07-01')->utc()->diffAsDateInterval('2018-07-02')->days); $this->assertSame(1, Carbon::parse('2018-07-01')->utc()->diffAsDateInterval(Carbon::parse('2018-07-02'))->days); $this->assertSame(1, Carbon::parse('2018-07-01')->diffAsDateInterval(Carbon::parse('2018-07-02')->utc())->days); } public function testThreeMonthMinusOneDay() { $start = new Carbon('2022-11-11 22:29:50.000000'); $end = $start->addMonths(3); $now = $start->addDay(); $this->assertSame(3.0, $start->diffInMonths($end)); $this->assertSame(3 - 1 / 31, $now->diffInMonths($end)); $start = new Carbon('2022-04-11 22:29:50.000000'); $end = $start->addMonths(3); $now = $start->addDay(); $this->assertSame(3.0, $start->diffInMonths($end)); $this->assertSame(3 - 1 / 30, $now->diffInMonths($end)); } public function testDiffWithZeroAndNonZeroMicroseconds() { $requestTime = new Carbon('2018-11-14 18:23:12.0 +00:00'); $serverTime = new Carbon('2018-11-14 18:23:12.307628 +00:00'); $this->assertSame(-0.307628, $serverTime->diffInSeconds($requestTime)); $requestTime = new Carbon('2019-02-10 18:23:12.0 +00:00'); $serverTime = new Carbon('2019-02-10 18:23:12.307628 +00:00'); $this->assertSame(-0.307628, $serverTime->diffInSeconds($requestTime)); } public function testNearlyFullDayDiffInSeconds() { $d1 = Carbon::parse('2019-06-15 12:34:56.123456'); $d2 = Carbon::parse('2019-06-16 12:34:56.123455'); $this->assertVeryClose(-86399.99999899999, $d2->diffInSeconds($d1)); } public function testNearlyFullDayDiffInMicroseconds() { $d1 = Carbon::parse('2019-06-15 12:34:56.123456'); $d2 = Carbon::parse('2019-06-16 12:34:56.123455'); $this->assertVeryClose(-86399999999.0, $d2->diffInMicroseconds($d1)); } public function testExactMonthDiffInSeconds() { $d1 = Carbon::make('2019-01-23 12:00:00'); $d2 = Carbon::make('2019-02-23 12:00:00'); $this->assertSame(-2678400.0, $d2->diffInSeconds($d1)); } public function testDiffInUnit() { $this->assertSame(5.5, Carbon::make('2020-08-13 05:00')->diffInUnit('hour', '2020-08-13 10:30')); } public function testDiffInUnitException() { $this->expectException(UnknownUnitException::class); $this->expectExceptionMessage("Unknown unit 'moons'."); $this->assertSame(5.5, Carbon::make('2020-08-13 05:00')->diffInUnit('moon', '2020-08-13 10:30')); } public function testDaysDiffPreservation() { $deletedDate = Carbon::now()->startOfDay()->addDays(31); $this->assertSame('31 days', $deletedDate->diffForHumans(Carbon::now()->startOfDay(), [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'skip' => ['m', 'w'], 'minimumUnit' => 'd', ])); $this->assertSame('31 days', $deletedDate->diffForHumans(Carbon::now()->startOfDay()->subHours(5), [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'skip' => ['m', 'w'], 'minimumUnit' => 'd', ])); $this->assertSame('30 days', $deletedDate->diffForHumans(Carbon::now()->startOfDay()->addHours(5), [ 'syntax' => CarbonInterface::DIFF_ABSOLUTE, 'skip' => ['m', 'w'], 'minimumUnit' => 'd', ])); } public function testAFormat() { $past = new Carbon('-3 Days'); $today = new Carbon('today'); $interval = $today->diff($past); $this->assertSame('2', $interval->format('%a')); } } ================================================ FILE: tests/CarbonImmutable/ExpressiveComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class ExpressiveComparisonTest extends AbstractTestCase { public function testEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->equalTo(Carbon::createFromDate(2000, 1, 1))); } public function testEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->equalTo(Carbon::createFromDate(2000, 1, 2))); } public function testEqualWithTimezoneTrue() { $this->assertTrue(Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto')->equalTo(Carbon::create(2000, 1, 1, 9, 0, 0, 'America/Vancouver'))); } public function testNotEqualToTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->notEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testNotEqualToFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->notEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThan(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->greaterThan(Carbon::createFromDate(2000, 1, 2))); } public function testGreaterThanWithTimezoneTrue() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 8, 59, 59, 'America/Vancouver'); $this->assertTrue($dt1->greaterThan($dt2)); } public function testGreaterThanWithTimezoneFalse() { $dt1 = Carbon::create(2000, 1, 1, 12, 0, 0, 'America/Toronto'); $dt2 = Carbon::create(2000, 1, 1, 9, 0, 1, 'America/Vancouver'); $this->assertFalse($dt1->greaterThan($dt2)); } public function testGreaterThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(1999, 12, 31))); } public function testGreaterThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testGreaterThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->greaterThanOrEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThan(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lessThan(Carbon::createFromDate(1999, 12, 31))); } public function testLessThanOrEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(2000, 1, 2))); } public function testLessThanOrEqualTrueEqual() { $this->assertTrue(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(2000, 1, 1))); } public function testLessThanOrEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->lessThanOrEqualTo(Carbon::createFromDate(1999, 12, 31))); } public function testBetweenEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); } public function testBetweenNotEqualTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); } public function testBetweenEqualFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), true)); } public function testBetweenNotEqualFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 1), Carbon::createFromDate(2000, 1, 31), false)); } public function testBetweenEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchTrue() { $this->assertTrue(Carbon::createFromDate(2000, 1, 15)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testBetweenEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(1999, 12, 31)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), true)); } public function testBetweenNotEqualSwitchFalse() { $this->assertFalse(Carbon::createFromDate(2000, 1, 1)->between(Carbon::createFromDate(2000, 1, 31), Carbon::createFromDate(2000, 1, 1), false)); } public function testMinIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->minimum()); } public function testMinWithNow() { $dt = Carbon::create(2012, 1, 1, 0, 0, 0)->minimum(); $this->assertCarbon($dt, 2012, 1, 1, 0, 0, 0); } public function testMinWithInstance() { $dt1 = Carbon::create(2013, 12, 31, 23, 59, 59); $dt2 = Carbon::create(2012, 1, 1, 0, 0, 0)->minimum($dt1); $this->assertCarbon($dt2, 2012, 1, 1, 0, 0, 0); } public function testMaxIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->maximum()); } public function testMaxWithNow() { $dt = Carbon::create(2099, 12, 31, 23, 59, 59)->maximum(); $this->assertCarbon($dt, 2099, 12, 31, 23, 59, 59); } public function testMaxWithInstance() { $dt1 = Carbon::create(2012, 1, 1, 0, 0, 0); $dt2 = Carbon::create(2099, 12, 31, 23, 59, 59)->maximum($dt1); $this->assertCarbon($dt2, 2099, 12, 31, 23, 59, 59); } public function testIsBirthday() { $dt1 = Carbon::createFromDate(1987, 4, 23); $dt2 = Carbon::createFromDate(2014, 9, 26); $dt3 = Carbon::createFromDate(2014, 4, 23); $this->assertFalse($dt2->isBirthday($dt1)); $this->assertTrue($dt3->isBirthday($dt1)); } public function testIsLastOfMonth() { $dt1 = Carbon::createFromDate(2017, 1, 31); $dt2 = Carbon::createFromDate(2016, 2, 28); $dt3 = Carbon::createFromDate(2016, 2, 29); $dt4 = Carbon::createFromDate(2018, 5, 5); $this->assertTrue($dt1->isLastOfMonth()); $this->assertFalse($dt2->isLastOfMonth()); $this->assertTrue($dt3->isLastOfMonth()); $this->assertFalse($dt4->isLastOfMonth()); } } ================================================ FILE: tests/CarbonImmutable/Fixtures/BadIsoCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable\Fixtures; use Carbon\CarbonImmutable as Carbon; class BadIsoCarbon extends Carbon { public static function getIsoUnits(): array { return [ 'MMM' => ['fooxyz', ['barxyz']], ]; } } ================================================ FILE: tests/CarbonImmutable/Fixtures/Mixin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable\Fixtures; use Carbon\CarbonImmutable; class Mixin { public $timezone; public function setUserTimezone() { $mixin = $this; return function ($timezone) use ($mixin) { $mixin->timezone = $timezone; }; } public function userFormat() { $mixin = $this; return function ($format) use ($mixin) { /** @var CarbonImmutable $date */ $date = $this; if ($mixin->timezone) { $date = $date->setTimezone($mixin->timezone); } return $date->format($format); }; } } ================================================ FILE: tests/CarbonImmutable/Fixtures/MyCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable\Fixtures; use Carbon\CarbonImmutable as Carbon; class MyCarbon extends Carbon { // } ================================================ FILE: tests/CarbonImmutable/FluidSettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class FluidSettersTest extends AbstractTestCase { public function testFluidYearSetter() { $d = Carbon::now(); $d2 = $d->year(1995); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->year, $d->year); $this->assertSame(1995, $d2->year); } public function testFluidMonthSetter() { $d = Carbon::now(); $d2 = $d->month(3); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->month, $d->month); $this->assertSame(3, $d2->month); } public function testFluidMonthSetterWithWrap() { $d = Carbon::createFromDate(2012, 8, 21); $d2 = $d->month(13); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame(8, $d->month); $this->assertSame(1, $d2->month); } public function testFluidDaySetter() { $d = Carbon::now(); $d2 = $d->day(2); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->day, $d->day); $this->assertSame(2, $d2->day); } public function testFluidDaySetterWithWrap() { $d = Carbon::createFromDate(2000, 1, 3); $d2 = $d->day(32); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame(3, $d->day); $this->assertSame(1, $d2->day); } public function testFluidSetDate() { $d = Carbon::createFromDate(2000, 1, 1); $d2 = $d->setDate(1995, 13, 32); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertCarbon($d, 2000, 1, 1); $this->assertCarbon($d2, 1996, 2, 1); } public function testFluidHourSetter() { $d = Carbon::now(); $d2 = $d->hour(2); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->hour, $d->hour); $this->assertSame(2, $d2->hour); } public function testFluidHourSetterWithWrap() { $d = Carbon::now(); $d2 = $d->hour(25); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->hour, $d->hour); $this->assertSame(1, $d2->hour); } public function testFluidMinuteSetter() { $d = Carbon::now(); $d2 = $d->minute(2); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->minute, $d->minute); $this->assertSame(2, $d2->minute); } public function testFluidMinuteSetterWithWrap() { $d = Carbon::now(); $d2 = $d->minute(61); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->minute, $d->minute); $this->assertSame(1, $d2->minute); } public function testFluidSecondSetter() { $d = Carbon::now(); $d2 = $d->second(2); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->second, $d->second); $this->assertSame(2, $d2->second); } public function testFluidSecondSetterWithWrap() { $d = Carbon::now(); $d2 = $d->second(62); $this->assertInstanceOfCarbon($d2); $this->assertInstanceOf(Carbon::class, $d2); $this->assertSame($this->immutableNow->second, $d->second); $this->assertSame(2, $d2->second); } public function testFluidSetTime() { $d = Carbon::createFromDate(2000, 1, 1); $this->assertInstanceOfCarbon($d2 = $d->setTime(25, 61, 61)); $this->assertCarbon($d2, 2000, 1, 2, 2, 2, 1); } public function testFluidTimestampSetter() { $d = Carbon::now(); $this->assertInstanceOfCarbon($d2 = $d->timestamp(10)); $this->assertSame(10, $d2->timestamp); $this->assertInstanceOfCarbon($d2 = $d->timestamp(1600887164.88952298)); $this->assertSame('2020-09-23 14:52:44.889523', $d2->format('Y-m-d H:i:s.u')); $this->assertInstanceOfCarbon($d2 = $d->timestamp('0.88951247 1600887164')); $this->assertSame('2020-09-23 14:52:44.889512', $d2->format('Y-m-d H:i:s.u')); $this->assertInstanceOfCarbon($d2 = $d->timestamp('0.88951247/1600887164/12.56')); $this->assertSame('2020-09-23 14:52:57.449512', $d2->format('Y-m-d H:i:s.u')); } } ================================================ FILE: tests/CarbonImmutable/GenericMacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use BadMethodCallException; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCaseWithOldNow; use Throwable; class GenericMacroTest extends AbstractTestCaseWithOldNow { public function testGenericMacro() { Carbon::genericMacro(function ($method) { $time = preg_replace('/[A-Z]/', ' $0', $method); try { return self::this()->modify($time); } catch (Throwable $exception) { if (preg_match('(Could not modify with|Failed to parse)', $exception->getMessage())) { throw new BadMethodCallException('Try next macro', 0, $exception); } throw $exception; } }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('2017-07-02', $now->nextSunday()->format('Y-m-d')); $this->assertSame('2017-06-26', Carbon::lastMonday()->format('Y-m-d')); $message = null; try { Carbon::fooBar(); } catch (BadMethodCallException $exception) { $message = $exception->getMessage(); } $this->assertSame('Method '.Carbon::class.'::fooBar does not exist.', $message); $message = null; try { $now->barBiz(); } catch (BadMethodCallException $exception) { $message = $exception->getMessage(); } $this->assertSame('Method barBiz does not exist.', $message); } public function testGenericMacroPriority() { Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'myPrefix')) { throw new BadMethodCallException('Try next macro', 0); } return 'first'; }); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'myPrefix')) { throw new BadMethodCallException('Try next macro', 0); } return 'second'; }, 1); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'myPrefix')) { throw new BadMethodCallException('Try next macro', 0); } return 'third'; }, -1); Carbon::macro('myPrefixFooBar', function () { return 'myPrefixFooBar'; }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('second', $now->myPrefixSomething()); $this->assertSame('second', Carbon::myPrefixSomething()); $this->assertSame('myPrefixFooBar', $now->myPrefixFooBar()); $this->assertSame('myPrefixFooBar', Carbon::myPrefixFooBar()); } public function testLocalGenericMacroPriority() { Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'first'; }); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'second'; }, 1); Carbon::genericMacro(function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'third'; }, -1); Carbon::macro('mlpFooBar', function () { return 'mlpFooBar'; }); /** @var mixed $date */ $date = Carbon::now()->settings([ 'genericMacros' => [ function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'local-first'; }, function ($method) { if (!str_starts_with($method, 'mlp')) { throw new BadMethodCallException('Try next macro', 0); } return 'local-second'; }, ], ]); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('local-first', $date->mlpSomething()); $this->assertSame('second', $now->mlpSomething()); $this->assertSame('second', Carbon::mlpSomething()); $this->assertSame('mlpFooBar', $date->mlpFooBar()); $this->assertSame('mlpFooBar', $now->mlpFooBar()); $this->assertSame('mlpFooBar', Carbon::mlpFooBar()); } } ================================================ FILE: tests/CarbonImmutable/GettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class GettersTest extends AbstractTestCase { public function testGettersThrowExceptionOnUnknownGetter() { $this->expectExceptionObject(new InvalidArgumentException( "Unknown getter 'doesNotExit'", )); /** @var mixed $d */ $d = Carbon::create(1234, 5, 6, 7, 8, 9); $d->doesNotExit; } public function testGettersThrowExceptionOnUnknownOfGetter() { $this->expectExceptionObject(new InvalidArgumentException( "Unknown getter 'fooOfBar'", )); /** @var mixed $d */ $d = Carbon::create(1234, 5, 6, 7, 8, 9); $d->fooOfBar; } public function testYearGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(1234, $d->year); } public function testYearIsoGetter() { $d = Carbon::createFromDate(2012, 12, 31); $this->assertSame(2013, $d->yearIso); } public function testMonthGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(5, $d->month); } public function testDayGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(6, $d->day); } public function testHourGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(7, $d->hour); } public function testMinuteGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(8, $d->minute); } public function testSecondGetter() { $d = Carbon::create(1234, 5, 6, 7, 8, 9); $this->assertSame(9, $d->second); } public function testMicroGetter() { $micro = 345678; $d = Carbon::parse('2014-01-05 12:34:11.'.$micro); $this->assertSame($micro, $d->micro); } public function testMicroGetterWithDefaultNow() { $now = Carbon::getTestNow(); Carbon::setTestNow(null); $start = microtime(true); usleep(10000); $d = Carbon::now(); usleep(10000); $end = microtime(true); $microTime = $d->getTimestamp() + $d->micro / 1000000; $this->assertGreaterThan($start, $microTime); $this->assertLessThan($end, $microTime); Carbon::setTestNow($now); } public function testDayOfWeekGetter() { $d = Carbon::create(2012, 5, 7, 7, 8, 9); $this->assertSame(Carbon::MONDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 8, 7, 8, 9); $this->assertSame(Carbon::TUESDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 9, 7, 8, 9); $this->assertSame(Carbon::WEDNESDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 10, 0, 0, 0); $this->assertSame(Carbon::THURSDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 11, 23, 59, 59); $this->assertSame(Carbon::FRIDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 12, 12, 0, 0); $this->assertSame(Carbon::SATURDAY, $d->dayOfWeek); $d = Carbon::create(2012, 5, 13, 12, 0, 0); $this->assertSame(Carbon::SUNDAY, $d->dayOfWeek); } public function testDayOfWeekIsoGetter() { $d = Carbon::create(2012, 5, 7, 7, 8, 9); $this->assertSame(1, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 8, 7, 8, 9); $this->assertSame(2, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 9, 7, 8, 9); $this->assertSame(3, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 10, 0, 0, 0); $this->assertSame(4, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 11, 23, 59, 59); $this->assertSame(5, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 12, 12, 0, 0); $this->assertSame(6, $d->dayOfWeekIso); $d = Carbon::create(2012, 5, 13, 12, 0, 0); $this->assertSame(7, $d->dayOfWeekIso); } public function testDayOfYearGetter() { $d = Carbon::createFromDate(2012, 5, 7); $this->assertSame(128, $d->dayOfYear); } public function testDaysInMonthGetter() { $d = Carbon::createFromDate(2012, 5, 7); $this->assertSame(31, $d->daysInMonth); } public function testTimestampGetter() { $d = Carbon::create(); $d = $d->setTimezone('GMT'); $this->assertSame(0, $d->setDateTime(1970, 1, 1, 0, 0, 0)->timestamp); } public function testGetAge() { $d = Carbon::now(); $this->assertSame(0, $d->age); } public function testGetAgeWithRealAge() { $d = Carbon::createFromDate(1975, 5, 21); $age = (int) (substr((string) ((int) (date('Ymd')) - (int) (date('Ymd', $d->timestamp))), 0, -4)); $this->assertSame($age, $d->age); } public static function dataForTestQuarter(): array { return [ [1, 1], [2, 1], [3, 1], [4, 2], [5, 2], [6, 2], [7, 3], [8, 3], [9, 3], [10, 4], [11, 4], [12, 4], ]; } #[DataProvider('dataForTestQuarter')] public function testQuarterFirstOfMonth(int $month, int $quarter) { $c = Carbon::create(2015, $month, 1)->startOfMonth(); $this->assertSame($quarter, $c->quarter); } #[DataProvider('dataForTestQuarter')] public function testQuarterMiddleOfMonth(int $month, int $quarter) { $c = Carbon::create(2015, $month, 15, 12, 13, 14); $this->assertSame($quarter, $c->quarter); } #[DataProvider('dataForTestQuarter')] public function testQuarterLastOfMonth(int $month, int $quarter) { $c = Carbon::create(2015, $month, 1)->endOfMonth(); $this->assertSame($quarter, $c->quarter); } public function testGetLocalTrue() { // Default timezone has been set to America/Toronto in AbstractTestCase.php // @see : https://en.wikipedia.org/wiki/List_of_UTC_time_offsets $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->local); $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/New_York')->local); } public function testGetLocalFalse() { $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'UTC')->local); $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'Europe/London')->local); } public function testGetUtcFalse() { $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'America/Toronto')->utc); $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'Europe/Paris')->utc); } public function testGetUtcTrue() { $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Atlantic/Reykjavik')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Lisbon')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Casablanca')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Dakar')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Dublin')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/London')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'UTC')->utc); $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'GMT')->utc); } public function testGetDstFalse() { $this->assertFalse(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->dst); $this->assertFalse(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->isDST()); } public function testGetDstTrue() { $this->assertTrue(Carbon::createFromDate(2012, 7, 1, 'America/Toronto')->dst); $this->assertTrue(Carbon::createFromDate(2012, 7, 1, 'America/Toronto')->isDST()); } public function testGetMidDayAt() { $d = Carbon::now(); $this->assertSame(12, $d->getMidDayAt()); } public function testOffsetForTorontoWithDST() { $this->assertSame(-18000, Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->offset); } public function testOffsetForTorontoNoDST() { $this->assertSame(-14400, Carbon::createFromDate(2012, 6, 1, 'America/Toronto')->offset); } public function testOffsetForGMT() { $this->assertSame(0, Carbon::createFromDate(2012, 6, 1, 'GMT')->offset); } public function testOffsetHoursForTorontoWithDST() { $this->assertSame(-5, Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->offsetHours); } public function testOffsetHoursForTorontoNoDST() { $this->assertSame(-4, Carbon::createFromDate(2012, 6, 1, 'America/Toronto')->offsetHours); } public function testOffsetHoursForGMT() { $this->assertSame(0, Carbon::createFromDate(2012, 6, 1, 'GMT')->offsetHours); } public function testIsLeapYearTrue() { $this->assertTrue(Carbon::createFromDate(2012, 1, 1)->isLeapYear()); } public function testIsLeapYearFalse() { $this->assertFalse(Carbon::createFromDate(2011, 1, 1)->isLeapYear()); } public function testIsLongYearTrue() { $this->assertTrue(Carbon::createFromDate(2015, 1, 1)->isLongYear()); } public function testIsLongYearFalse() { $this->assertFalse(Carbon::createFromDate(2016, 1, 1)->isLongYear()); } public function testWeekOfMonth() { $this->assertSame(5, Carbon::createFromDate(2012, 9, 30)->weekOfMonth); $this->assertSame(4, Carbon::createFromDate(2012, 9, 28)->weekOfMonth); $this->assertSame(3, Carbon::createFromDate(2012, 9, 20)->weekOfMonth); $this->assertSame(2, Carbon::createFromDate(2012, 9, 8)->weekOfMonth); $this->assertSame(1, Carbon::createFromDate(2012, 9, 1)->weekOfMonth); } public function testWeekNumberInMonthIsNotFromTheBeginning() { $this->assertSame(5, Carbon::createFromDate(2017, 2, 28)->weekNumberInMonth); $this->assertSame(5, Carbon::createFromDate(2017, 2, 27)->weekNumberInMonth); $this->assertSame(4, Carbon::createFromDate(2017, 2, 26)->weekNumberInMonth); $this->assertSame(4, Carbon::createFromDate(2017, 2, 20)->weekNumberInMonth); $this->assertSame(3, Carbon::createFromDate(2017, 2, 19)->weekNumberInMonth); $this->assertSame(3, Carbon::createFromDate(2017, 2, 13)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2017, 2, 12)->weekNumberInMonth); $this->assertSame(2, Carbon::createFromDate(2017, 2, 6)->weekNumberInMonth); $this->assertSame(1, Carbon::createFromDate(2017, 2, 1)->weekNumberInMonth); } public function testWeekOfYearFirstWeek() { $this->assertSame(52, Carbon::createFromDate(2012, 1, 1)->weekOfYear); $this->assertSame(1, Carbon::createFromDate(2012, 1, 2)->weekOfYear); } public function testWeekOfYearLastWeek() { $this->assertSame(52, Carbon::createFromDate(2012, 12, 30)->weekOfYear); $this->assertSame(1, Carbon::createFromDate(2012, 12, 31)->weekOfYear); } public function testGetTimezone() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->timezone->getName()); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->timezone->getName()); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->timezone->getName()); } public function testGetTz() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->tz->getName()); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->tz->getName()); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->tz->getName()); } public function testGetTimezoneName() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->timezoneName); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->timezoneName); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->timezoneName); } public function testGetTzName() { $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); $this->assertSame('America/Toronto', $dt->tzName); $dt = Carbon::createFromDate(2000, 1, 1, -5); $this->assertSame('America/Chicago', $dt->timezoneName); $dt = Carbon::createFromDate(2000, 1, 1, '-5'); $this->assertSame('-05:00', $dt->timezoneName); } public function testShortDayName() { $dt = Carbon::createFromDate(2018, 8, 6); $this->assertSame('Mon', $dt->shortDayName); $this->assertSame('lun.', $dt->locale('fr')->shortDayName); } public function testMinDayName() { $dt = Carbon::createFromDate(2018, 8, 6); $this->assertSame('Mo', $dt->minDayName); $this->assertSame('lu', $dt->locale('fr')->minDayName); } public function testShortMonthName() { $dt = Carbon::createFromDate(2018, 7, 6); $this->assertSame('Jul', $dt->shortMonthName); $this->assertSame('juil.', $dt->locale('fr')->shortMonthName); } public function testGetDays() { $days = [ Carbon::SUNDAY => 'Sunday', Carbon::MONDAY => 'Monday', Carbon::TUESDAY => 'Tuesday', Carbon::WEDNESDAY => 'Wednesday', Carbon::THURSDAY => 'Thursday', Carbon::FRIDAY => 'Friday', Carbon::SATURDAY => 'Saturday', ]; $this->assertSame($days, Carbon::getDays()); } public function testUnitOfUnit() { $date = Carbon::createFromDate(2018, 7, 6); $this->assertSame(6, $date->dayOfQuarter); $date = Carbon::createFromDate(2018, 8, 6); $this->assertSame(6 + 31, $date->dayOfQuarter); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'UTC'); $this->assertSame((95 * 24 + 4) * 60 + 50, $date->minuteOfYear); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame((95 * 24 + 3) * 60 + 50, $date->minuteOfYear); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(0, $date->yearOfMinute); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(1, $date->dayOfMinute); } public function testUnitOfUnitMethod() { $date = Carbon::createFromDate(2018, 7, 6); $this->assertSame(6, $date->dayOfQuarter()); $date = Carbon::createFromDate(2018, 8, 6); $this->assertSame(6 + 31, $date->dayOfQuarter()); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'UTC'); $this->assertSame((95 * 24 + 4) * 60 + 50, $date->minuteOfYear()); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame((95 * 24 + 3) * 60 + 50, $date->minuteOfYear()); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(0, $date->yearOfMinute()); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(1, $date->dayOfMinute()); } public function testUnitInUnit() { $date = Carbon::createFromDate(2018, 7, 6); $this->assertSame(7, $date->daysInWeek); $date = Carbon::createFromDate(2018, 8, 6); $this->assertSame(92, $date->daysInQuarter); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'UTC'); $this->assertSame(365 * 24 * 60, $date->minutesInYear); $date = Carbon::create(2018, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(365 * 24 * 60, $date->minutesInYears); $date = Carbon::create(2024, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(366 * 24 * 60, $date->minuteInYear); $date = Carbon::create(2024, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(0, $date->yearsInMinute); $date = Carbon::create(2024, 4, 6, 4, 50, 0, 'America/Toronto'); $this->assertSame(0, $date->daysInMinute); } } ================================================ FILE: tests/CarbonImmutable/InstanceTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\Carbon as CarbonMutable; use Carbon\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterface; use DateTime; use DateTimeZone; use InvalidArgumentException; use Tests\AbstractTestCase; class InstanceTest extends AbstractTestCase { public function testInstanceFromDateTime() { $dating = Carbon::instance(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')); $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); $dating = Carbon::parse(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')); $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); } public function testInstanceFromCarbon() { $dating = Carbon::instance(Carbon::create(1975, 5, 21, 22, 32, 11)); $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); } public function testInstanceFromDateTimeKeepsTimezoneName() { $dating = Carbon::instance(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')->setTimezone(new DateTimeZone('America/Vancouver'))); $this->assertSame('America/Vancouver', $dating->tzName); } public function testInstanceFromCarbonKeepsTimezoneName() { $dating = Carbon::instance(Carbon::create(1975, 5, 21, 22, 32, 11)->setTimezone(new DateTimeZone('America/Vancouver'))); $this->assertSame('America/Vancouver', $dating->tzName); } public function testInstanceFromDateTimeKeepsMicros() { $micro = 254687; $datetime = DateTime::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); $carbon = Carbon::instance($datetime); $this->assertSame($micro, $carbon->micro); } public function testInstanceFromCarbonKeepsMicros() { $micro = 254687; $carbon = Carbon::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); $carbon = Carbon::instance($carbon); $this->assertSame($micro, $carbon->micro); } public function testTimezoneCopy() { $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); $carbon = CarbonMutable::instance($carbon); $this->assertSame('2017-06-27 13:14:15.123456 Europe/Paris', $carbon->format('Y-m-d H:i:s.u e')); } public function testInstanceStateSetBySetStateMethod() { $carbon = Carbon::__set_state([ 'date' => '2017-05-18 13:02:15.273420', 'timezone_type' => 3, 'timezone' => 'UTC', ]); $this->assertInstanceOf(Carbon::class, $carbon); $this->assertSame('2017-05-18 13:02:15.273420', $carbon->format('Y-m-d H:i:s.u')); } public function testInstanceStateSetBySetStateString() { $carbon = Carbon::__set_state('2017-05-18 13:02:15.273420'); $this->assertInstanceOf(Carbon::class, $carbon); $this->assertSame('2017-05-18 13:02:15.273420', $carbon->format('Y-m-d H:i:s.u')); } public function testDeserializationOccursCorrectly() { $carbon = new Carbon('2017-06-27 13:14:15.000000'); $serialized = 'return '.var_export($carbon, true).';'; $deserialized = eval($serialized); $this->assertInstanceOf(Carbon::class, $deserialized); } public function testMutableConversions() { $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); $carbon = $carbon->locale('en_CA'); $copy = $carbon->toImmutable(); $this->assertEquals($copy, $carbon); $this->assertSame($copy, $carbon); $this->assertSame('en_CA', $copy->locale()); $this->assertInstanceOf(CarbonImmutable::class, $copy); $this->assertTrue($copy->isImmutable()); $this->assertFalse($copy->isMutable()); $this->assertSame('2017-06-27 13:14:15.123456', $copy->format(CarbonInterface::MOCK_DATETIME_FORMAT)); $this->assertSame('Europe/Paris', $copy->tzName); $this->assertNotSame($copy, $copy->modify('+1 day')); $copy = $carbon->toMutable(); $this->assertEquals($copy, $carbon); $this->assertNotSame($copy, $carbon); $this->assertSame('en_CA', $copy->locale()); $this->assertInstanceOf(CarbonMutable::class, $copy); $this->assertFalse($copy->isImmutable()); $this->assertTrue($copy->isMutable()); $this->assertSame('2017-06-27 13:14:15.123456', $copy->format(CarbonInterface::MOCK_DATETIME_FORMAT)); $this->assertSame('Europe/Paris', $copy->tzName); $this->assertSame($copy, $copy->modify('+1 day')); } public function testInvalidCast() { $this->expectExceptionObject(new InvalidArgumentException( 'DateTimeZone has not the instance() method needed to cast the date.', )); $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); $carbon->cast(DateTimeZone::class); } public function testChildCast() { $class = \get_class(new class() extends Carbon { public function foo() { return 42; } }); $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); /** @var object $casted */ $casted = $carbon->cast($class); $this->assertInstanceOf($class, $casted); $this->assertInstanceOf(Carbon::class, $casted); $this->assertSame(42, $casted->foo()); $this->assertSame('2017-06-27', $casted->format('Y-m-d')); } public function testSiblingCast() { $class = \get_class(new class() extends DateTime { public function foo() { return 42; } }); $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris'); /** @var object $casted */ $casted = $carbon->cast($class); $this->assertInstanceOf($class, $casted); $this->assertInstanceOf(DateTime::class, $casted); $this->assertSame(42, $casted->foo()); $this->assertSame('2017-06-27', $casted->format('Y-m-d')); } } ================================================ FILE: tests/CarbonImmutable/IsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterval; use Carbon\Unit; use DateInterval; use DateTime; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use Tests\AbstractTestCase; use TypeError; class IsTest extends AbstractTestCase { public function testIsWeekdayTrue() { $this->assertTrue(Carbon::createFromDate(2012, 1, 2)->isWeekday()); } public function testIsWeekdayFalse() { $this->assertFalse(Carbon::createFromDate(2012, 1, 1)->isWeekday()); } public function testIsWeekendTrue() { $this->assertTrue(Carbon::createFromDate(2012, 1, 1)->isWeekend()); } public function testIsWeekendFalse() { $this->assertFalse(Carbon::createFromDate(2012, 1, 2)->isWeekend()); } public function testIsYesterdayTrue() { $this->assertTrue(Carbon::now()->subDay()->isYesterday()); } public function testIsYesterdayFalseWithToday() { $this->assertFalse(Carbon::now()->endOfDay()->isYesterday()); } public function testIsYesterdayFalseWith2Days() { $this->assertFalse(Carbon::now()->subDays(2)->startOfDay()->isYesterday()); } public function testIsTodayTrue() { $this->assertTrue(Carbon::now()->isToday()); } public function testIsCurrentWeek() { $this->assertFalse(Carbon::now()->subWeek()->isCurrentWeek()); $this->assertFalse(Carbon::now()->addWeek()->isCurrentWeek()); $this->assertTrue(Carbon::now()->isCurrentWeek()); $this->assertTrue(Carbon::now()->startOfWeek()->isCurrentWeek()); $this->assertTrue(Carbon::now()->endOfWeek()->isCurrentWeek()); } public function testIsSameWeek() { $this->assertFalse(Carbon::now()->subWeek()->isSameWeek(Carbon::now())); $this->assertFalse(Carbon::now()->addWeek()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::now()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::now()->startOfWeek()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::now()->endOfWeek()->isSameWeek(Carbon::now())); $this->assertTrue(Carbon::parse('2019-01-01')->isSameWeek(Carbon::parse('2018-12-31'))); } public function testIsNextWeekTrue() { $this->assertTrue(Carbon::now()->addWeek()->isNextWeek()); } public function testIsLastWeekTrue() { $this->assertTrue(Carbon::now()->subWeek()->isLastWeek()); } public function testIsNextWeekFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->addWeek(2)->isNextWeek()); } public function testIsLastWeekFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->subWeek(2)->isLastWeek()); } public function testIsNextQuarterTrue() { $this->assertTrue(Carbon::now()->addQuarterNoOverflow()->isNextQuarter()); } public function testIsLastQuarterTrue() { $this->assertTrue(Carbon::now()->subQuarterNoOverflow()->isLastQuarter()); } public function testIsNextQuarterFalse() { $this->assertFalse(Carbon::now()->addQuartersNoOverflow(2)->isNextQuarter()); $this->assertFalse(Carbon::now()->addQuartersNoOverflow(5)->isNextQuarter()); } public function testIsLastQuarterFalse() { $this->assertFalse(Carbon::now()->subQuartersNoOverflow(2)->isLastQuarter()); $this->assertFalse(Carbon::now()->subQuartersNoOverflow(5)->isLastQuarter()); } public function testIsNextMonthTrue() { $this->assertTrue(Carbon::now()->addMonthNoOverflow()->isNextMonth()); } public function testIsLastMonthTrue() { $this->assertTrue(Carbon::now()->subMonthNoOverflow()->isLastMonth()); } public function testIsNextMonthFalse() { $this->assertFalse(Carbon::now()->addMonthsNoOverflow(2)->isNextMonth()); $this->assertFalse(Carbon::now()->addMonthsNoOverflow(13)->isNextMonth()); } public function testIsLastMonthFalse() { $this->assertFalse(Carbon::now()->subMonthsNoOverflow(2)->isLastMonth()); $this->assertFalse(Carbon::now()->subMonthsNoOverflow(13)->isLastMonth()); } public function testIsNextYearTrue() { $this->assertTrue(Carbon::now()->addYear()->isNextYear()); } public function testIsLastYearTrue() { $this->assertTrue(Carbon::now()->subYear()->isLastYear()); } public function testIsNextYearFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->addYear(2)->isNextYear()); } public function testIsLastYearFalse() { /** @var mixed $date */ $date = Carbon::now(); $this->assertFalse($date->subYear(2)->isLastYear()); } public function testIsTodayFalseWithYesterday() { $this->assertFalse(Carbon::now()->subDay()->endOfDay()->isToday()); } public function testIsTodayFalseWithTomorrow() { $this->assertFalse(Carbon::now()->addDay()->startOfDay()->isToday()); } public function testIsTodayWithTimezone() { $this->assertTrue(Carbon::now('Asia/Tokyo')->isToday()); } public function testIsTomorrowTrue() { $this->assertTrue(Carbon::now()->addDay()->isTomorrow()); } public function testIsTomorrowFalseWithToday() { $this->assertFalse(Carbon::now()->endOfDay()->isTomorrow()); } public function testIsTomorrowFalseWith2Days() { $this->assertFalse(Carbon::now()->addDays(2)->startOfDay()->isTomorrow()); } public function testIsFutureTrue() { $this->assertTrue(Carbon::now()->addSecond()->isFuture()); } public function testIsFutureFalse() { $this->assertFalse(Carbon::now()->isFuture()); } public function testIsFutureFalseInThePast() { $this->assertFalse(Carbon::now()->subSecond()->isFuture()); } public function testIsPastTrue() { $this->assertTrue(Carbon::now()->subSecond()->isPast()); } public function testIsPastFalse() { $this->assertFalse(Carbon::now()->addSecond()->isPast()); } public function testNowIsPastFalse() { $this->assertFalse(Carbon::now()->isPast()); } public function testIsNowOrFutureTrue() { $this->assertTrue(Carbon::now()->addSecond()->isNowOrFuture()); } public function testIsNowOrFutureFalse() { $this->assertFalse(Carbon::now()->subSecond()->isNowOrFuture()); } public function testNowIsNowOrFutureTrue() { $this->assertTrue(Carbon::now()->isNowOrFuture()); } public function testIsNowOrPastTrue() { $this->assertTrue(Carbon::now()->subSecond()->isNowOrPast()); } public function testIsNowOrPastFalse() { $this->assertFalse(Carbon::now()->addSecond()->isNowOrPast()); } public function testNowIsNowOrPastTrue() { $this->assertTrue(Carbon::now()->isNowOrPast()); } public function testIsLeapYearTrue() { $this->assertTrue(Carbon::createFromDate(2016, 1, 1)->isLeapYear()); } public function testIsLeapYearFalse() { $this->assertFalse(Carbon::createFromDate(2014, 1, 1)->isLeapYear()); } public function testIsCurrentYearTrue() { $this->assertTrue(Carbon::now()->isCurrentYear()); } public function testIsCurrentYearFalse() { $this->assertFalse(Carbon::now()->subYear()->isCurrentYear()); } public function testIsSameYearTrue() { $this->assertTrue(Carbon::now()->isSameYear(Carbon::now())); } public function testIsSameYearFalse() { $this->assertFalse(Carbon::now()->isSameYear(Carbon::now()->subYear())); } public function testIsCurrentDecadeTrue() { $this->assertTrue(Carbon::now()->isCurrentDecade()); } public function testIsCurrentDecadeFalse() { $this->assertFalse(Carbon::now()->subDecade()->isCurrentDecade()); } public function testIsSameDecadeTrue() { $this->assertTrue(Carbon::now()->isSameDecade(Carbon::now())); $this->assertTrue(Carbon::now()->isSameUnit('millennium', Carbon::now())); } public function testIsSameDecadeFalse() { $this->assertFalse(Carbon::now()->isSameDecade(Carbon::now()->subDecade())); $this->assertFalse(Carbon::now()->isSameUnit('millennium', Carbon::now()->subMillennia(2))); } public function testIsSameFoobar() { $this->expectExceptionObject(new InvalidArgumentException( 'Bad comparison unit: \'foobar\'', )); Carbon::now()->isSameUnit('foobar', Carbon::now()->subMillennium()); } public function testIsCurrentQuarterTrue() { $this->assertTrue(Carbon::now()->isCurrentQuarter()); } public function testIsCurrentQuarterFalse() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::now()->subQuarter()->isCurrentQuarter()); Carbon::resetMonthsOverflow(); } public function testIsSameQuarterTrue() { $this->assertTrue(Carbon::now()->isSameQuarter(Carbon::now())); } public function testIsSameQuarterTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameQuarter(new DateTime())); } public function testIsSameQuarterFalse() { Carbon::useMonthsOverflow(false); $this->assertFalse(Carbon::now()->isSameQuarter(Carbon::now()->subQuarter())); Carbon::resetMonthsOverflow(); } public function testIsSameQuarterFalseWithDateTime() { $now = Carbon::now(); $dt = new DateTime(); $dt->modify((Carbon::MONTHS_PER_QUARTER * -1).' month'); if ($dt->format('d') !== $now->format('d')) { $dt->modify('last day of previous month'); } $this->assertFalse($now->isSameQuarter($dt)); } public function testIsSameQuarterAndYearTrue() { $this->assertTrue(Carbon::now()->isSameQuarter(Carbon::now(), true)); } public function testIsSameQuarterAndYearTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameQuarter(new DateTime(), true)); } public function testIsSameQuarterAndYearFalse() { $this->assertFalse(Carbon::now()->isSameQuarter(Carbon::now()->subYear(), true)); } public function testIsSameQuarterAndYearFalseWithDateTime() { $dt = new DateTime(); $dt->modify('-1 year'); $this->assertFalse(Carbon::now()->isSameQuarter($dt, true)); } public function testIsCurrentMonth() { $this->assertTrue(Carbon::now()->isCurrentMonth()); $dt = Carbon::now(); $dt = $dt->modify(Carbon::now()->year.$dt->format('-m-').'01'); $this->assertTrue($dt->isCurrentMonth()); $dt = $dt->modify((Carbon::now()->year + 1).$dt->format('-m-').'28'); $this->assertFalse($dt->isCurrentMonth()); } public function testIsCurrentMonthFalse() { $this->assertFalse(Carbon::now()->day(15)->subMonth()->isCurrentMonth()); $this->assertFalse(Carbon::now()->day(15)->addYear()->isCurrentMonth()); } public function testIsSameMonth() { $this->assertTrue(Carbon::now()->isSameMonth(Carbon::now())); $dt = Carbon::now(); for ($year = 1990; $year < Carbon::now()->year; $year++) { $dt->modify($year.$dt->format('-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); } } public function testIsSameMonthTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameMonth(new DateTime())); $dt = new DateTime(); for ($year = 1990; $year < 2200; $year++) { $dt->modify($year.$dt->format('-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); $dt->modify($year.$dt->format('-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, false)); } } public function testIsSameMonthOfSameYear() { $this->assertFalse(Carbon::now()->isSameMonth(Carbon::now()->day(15)->subMonth())); $this->assertTrue(Carbon::now()->isSameMonth(Carbon::now())); $dt = Carbon::now(); for ($year = 1990; $year < Carbon::now()->year; $year++) { $dt = $dt->modify($year.$dt->format('-m-').'01'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); $dt = $dt->modify($year.$dt->format('-m-').'28'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); } $year = Carbon::now()->year; $dt = $dt->modify($year.$dt->format('-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); $dt = $dt->modify($year.$dt->format('-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); for ($year = Carbon::now()->year + 1; $year < 2200; $year++) { $dt = $dt->modify($year.$dt->format('-m-').'01'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); $dt = $dt->modify($year.$dt->format('-m-').'28'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); } } public function testIsSameMonthFalseWithDateTime() { $dt = new DateTime(); $dt = $dt->modify('-2 month'); $this->assertFalse(Carbon::now()->isSameMonth($dt)); } public function testIsSameMonthAndYearTrue() { $this->assertTrue(Carbon::now()->isSameMonth(Carbon::now(), true)); $dt = Carbon::now(); $dt = $dt->modify($dt->format('Y-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); $dt = $dt->modify($dt->format('Y-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); } public function testIsSameMonthAndYearTrueWithDateTime() { $this->assertTrue(Carbon::now()->isSameMonth(new DateTime(), true)); $dt = new DateTime(); $dt = $dt->modify($dt->format('Y-m-').'01'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); $dt = $dt->modify($dt->format('Y-m-').'28'); $this->assertTrue(Carbon::now()->isSameMonth($dt, true)); } public function testIsSameMonthAndYearFalse() { $this->assertFalse(Carbon::now()->isSameMonth(Carbon::now()->subYear(), true)); } public function testIsSameMonthAndYearFalseWithDateTime() { $dt = new DateTime(); $dt = $dt->modify('-1 year'); $this->assertFalse(Carbon::now()->isSameMonth($dt, true)); } public function testIsSameDayTrue() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameDay(Carbon::createFromDate(2012, 1, 2))); $this->assertTrue($current->isSameDay(Carbon::create(2012, 1, 2, 23, 59, 59))); } public function testIsSameDayWithString() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameDay('2012-01-02 15:00:25')); $this->assertTrue($current->isSameDay('2012-01-02')); } public function testIsSameDayTrueWithDateTime() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameDay(new DateTime('2012-01-02'))); $this->assertTrue($current->isSameDay(new DateTime('2012-01-02 23:59:59'))); } public function testIsSameDayFalse() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertFalse($current->isSameDay(Carbon::createFromDate(2012, 1, 3))); $this->assertFalse($current->isSameDay(Carbon::createFromDate(2012, 6, 2))); } public function testIsSameDayFalseWithDateTime() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertFalse($current->isSameDay(new DateTime('2012-01-03'))); $this->assertFalse($current->isSameDay(new DateTime('2012-05-02'))); } public function testIsCurrentDayTrue() { $this->assertTrue(Carbon::now()->isCurrentDay()); $this->assertTrue(Carbon::now()->hour(0)->isCurrentDay()); $this->assertTrue(Carbon::now()->hour(23)->isCurrentDay()); } public function testIsCurrentDayFalse() { $this->assertFalse(Carbon::now()->subDay()->isCurrentDay()); $this->assertFalse(Carbon::now()->subMonth()->isCurrentDay()); } public function testIsSameHourTrue() { $current = Carbon::create(2018, 5, 6, 12); $this->assertTrue($current->isSameHour(Carbon::create(2018, 5, 6, 12))); $this->assertTrue($current->isSameHour(Carbon::create(2018, 5, 6, 12, 59, 59))); } public function testIsSameHourTrueWithDateTime() { $current = Carbon::create(2018, 5, 6, 12); $this->assertTrue($current->isSameHour(new DateTime('2018-05-06T12:00:00'))); $this->assertTrue($current->isSameHour(new DateTime('2018-05-06T12:59:59'))); } public function testIsSameHourFalse() { $current = Carbon::create(2018, 5, 6, 12); $this->assertFalse($current->isSameHour(Carbon::create(2018, 5, 6, 13))); $this->assertFalse($current->isSameHour(Carbon::create(2018, 5, 5, 12))); } public function testIsSameHourFalseWithDateTime() { $current = Carbon::create(2018, 5, 6, 12); $this->assertFalse($current->isSameHour(new DateTime('2018-05-06T13:00:00'))); $this->assertFalse($current->isSameHour(new DateTime('2018-06-06T12:00:00'))); } public function testIsCurrentHourTrue() { $this->assertTrue(Carbon::now()->isCurrentHour()); $this->assertTrue(Carbon::now()->second(1)->isCurrentHour()); $this->assertTrue(Carbon::now()->second(12)->isCurrentHour()); $this->assertTrue(Carbon::now()->minute(0)->isCurrentHour()); $this->assertTrue(Carbon::now()->minute(59)->second(59)->isCurrentHour()); } public function testIsCurrentHourFalse() { $this->assertFalse(Carbon::now()->subHour()->isCurrentHour()); $this->assertFalse(Carbon::now()->subDay()->isCurrentHour()); } public function testIsSameMinuteTrue() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertTrue($current->isSameMinute(Carbon::create(2018, 5, 6, 12, 30))); $current = Carbon::create(2018, 5, 6, 12, 30, 15); $this->assertTrue($current->isSameMinute(Carbon::create(2018, 5, 6, 12, 30, 45))); } public function testIsSameMinuteTrueWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertTrue($current->isSameMinute(new DateTime('2018-05-06T12:30:00'))); $current = Carbon::create(2018, 5, 6, 12, 30, 20); $this->assertTrue($current->isSameMinute(new DateTime('2018-05-06T12:30:40'))); } public function testIsSameMinuteFalse() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertFalse($current->isSameMinute(Carbon::create(2018, 5, 6, 13, 31))); $this->assertFalse($current->isSameMinute(Carbon::create(2019, 5, 6, 13, 30))); } public function testIsSameMinuteFalseWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30); $this->assertFalse($current->isSameMinute(new DateTime('2018-05-06T13:31:00'))); $this->assertFalse($current->isSameMinute(new DateTime('2018-05-06T17:30:00'))); } public function testIsCurrentMinuteTrue() { $this->assertTrue(Carbon::now()->isCurrentMinute()); $this->assertTrue(Carbon::now()->second(0)->isCurrentMinute()); $this->assertTrue(Carbon::now()->second(59)->isCurrentMinute()); } public function testIsCurrentMinuteFalse() { $this->assertFalse(Carbon::now()->subMinute()->isCurrentMinute()); $this->assertFalse(Carbon::now()->subHour()->isCurrentMinute()); } public function testIsSameSecondTrue() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $other = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertTrue($current->isSameSecond($other)); $this->assertTrue($current->modify($current->hour.':'.$current->minute.':'.$current->second.'.0')->isSameSecond($other)); $this->assertTrue($current->modify($current->hour.':'.$current->minute.':'.$current->second.'.999999')->isSameSecond($other)); } public function testIsSameSecondTrueWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertTrue($current->isSameSecond(new DateTime('2018-05-06T12:30:13'))); } public function testIsSameSecondFalse() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertFalse($current->isSameSecond(Carbon::create(2018, 5, 6, 12, 30, 55))); $this->assertFalse($current->isSameSecond(Carbon::create(2018, 5, 6, 14, 30, 13))); } public function testIsSameSecondFalseWithDateTime() { $current = Carbon::create(2018, 5, 6, 12, 30, 13); $this->assertFalse($current->isSameSecond(new DateTime('2018-05-06T13:30:54'))); $this->assertFalse($current->isSameSecond(new DateTime('2018-05-06T13:36:13'))); } public function testIsCurrentSecondTrue() { $this->assertTrue(Carbon::now()->isCurrentSecond()); $now = Carbon::now(); $this->assertTrue($now->modify($now->hour.':'.$now->minute.':'.$now->second.'.0')->isCurrentSecond()); $this->assertTrue($now->modify($now->hour.':'.$now->minute.':'.$now->second.'.999999')->isCurrentSecond()); } public function testIsCurrentSecondFalse() { $this->assertFalse(Carbon::now()->subSecond()->isCurrentSecond()); $this->assertFalse(Carbon::now()->subDay()->isCurrentSecond()); } public function testIsSameMicrosecond() { $current = new Carbon('2018-05-06T13:30:54.123456'); $this->assertTrue($current->isSameMicrosecond(new DateTime('2018-05-06T13:30:54.123456'))); $this->assertFalse($current->isSameMicrosecond(new DateTime('2018-05-06T13:30:54.123457'))); $this->assertFalse($current->isSameMicrosecond(new DateTime('2019-05-06T13:30:54.123456'))); $this->assertFalse($current->isSameMicrosecond(new DateTime('2018-05-06T13:30:55.123456'))); $this->assertTrue($current->isSameSecond($current->copy())); $this->assertTrue(Carbon::now()->isCurrentMicrosecond()); $this->assertFalse(Carbon::now()->subMicrosecond()->isCurrentMicrosecond()); $this->assertFalse(Carbon::now()->isLastMicrosecond()); $this->assertTrue(Carbon::now()->subMicrosecond()->isLastMicrosecond()); $this->assertFalse(Carbon::now()->isNextMicrosecond()); $this->assertTrue(Carbon::now()->addMicrosecond()->isNextMicrosecond()); $this->assertTrue(Carbon::now()->subMicroseconds(Carbon::MICROSECONDS_PER_SECOND)->isLastSecond()); $this->assertSame(4.0, Carbon::now()->subMicroseconds(4 * Carbon::MICROSECONDS_PER_SECOND)->diffInSeconds(Carbon::now())); } public function testIsDayOfWeek() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 5, 31)->isDayOfWeek(0)); $this->assertTrue(Carbon::createFromDate(2015, 6, 21)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isDayOfWeek('sunday')); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isDayOfWeek('SUNDAY')); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::SUNDAY)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek(0)); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('sunday')); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('SUNDAY')); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('monday')); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('MONDAY')); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isDayOfWeek('sunday')); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isDayOfWeek('SUNDAY')); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('monday')); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('MONDAY')); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek(0)); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('sunday')); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isDayOfWeek('SUNDAY')); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('monday')); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isDayOfWeek('MONDAY')); } public function testIsSameAs() { $current = Carbon::createFromDate(2012, 1, 2); $this->assertTrue($current->isSameAs('c', $current)); } public function testIsSameAsWithInvalidArgument() { $this->expectException(TypeError::class); $current = Carbon::createFromDate(2012, 1, 2); $current->isSameAs('Y-m-d', new stdClass()); } public function testIsSunday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 5, 31)->isSunday()); $this->assertTrue(Carbon::createFromDate(2015, 6, 21)->isSunday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isSunday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::SUNDAY)->isSunday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isSunday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::MONDAY)->isSunday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::MONDAY)->isSunday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::MONDAY)->isSunday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isSunday()); } public function testIsMonday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 1)->isMonday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::MONDAY)->isMonday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::MONDAY)->isMonday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::MONDAY)->isMonday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::TUESDAY)->isMonday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::TUESDAY)->isMonday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::TUESDAY)->isMonday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::TUESDAY)->isMonday()); } public function testIsTuesday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 2)->isTuesday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::TUESDAY)->isTuesday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::TUESDAY)->isTuesday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::TUESDAY)->isTuesday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::WEDNESDAY)->isTuesday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::WEDNESDAY)->isTuesday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::WEDNESDAY)->isTuesday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::WEDNESDAY)->isTuesday()); } public function testIsWednesday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 3)->isWednesday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::WEDNESDAY)->isWednesday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::WEDNESDAY)->isWednesday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::WEDNESDAY)->isWednesday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::THURSDAY)->isWednesday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::THURSDAY)->isWednesday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::THURSDAY)->isWednesday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::THURSDAY)->isWednesday()); } public function testIsThursday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 4)->isThursday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::THURSDAY)->isThursday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::THURSDAY)->isThursday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::THURSDAY)->isThursday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::FRIDAY)->isThursday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::FRIDAY)->isThursday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::FRIDAY)->isThursday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::FRIDAY)->isThursday()); } public function testIsFriday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 5)->isFriday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::FRIDAY)->isFriday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::FRIDAY)->isFriday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::FRIDAY)->isFriday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::SATURDAY)->isFriday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SATURDAY)->isFriday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::SATURDAY)->isFriday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SATURDAY)->isFriday()); } public function testIsSaturday() { // True in the past past $this->assertTrue(Carbon::createFromDate(2015, 6, 6)->isSaturday()); $this->assertTrue(Carbon::now()->subWeek()->previous(Carbon::SATURDAY)->isSaturday()); // True in the future $this->assertTrue(Carbon::now()->addWeek()->previous(Carbon::SATURDAY)->isSaturday()); $this->assertTrue(Carbon::now()->addMonth()->previous(Carbon::SATURDAY)->isSaturday()); // False in the past $this->assertFalse(Carbon::now()->subWeek()->previous(Carbon::SUNDAY)->isSaturday()); $this->assertFalse(Carbon::now()->subMonth()->previous(Carbon::SUNDAY)->isSaturday()); // False in the future $this->assertFalse(Carbon::now()->addWeek()->previous(Carbon::SUNDAY)->isSaturday()); $this->assertFalse(Carbon::now()->addMonth()->previous(Carbon::SUNDAY)->isSaturday()); } public function testIsStartOfDay() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay(false)); $this->assertTrue(Carbon::parse('00:00:00.999999')->isStartOfDay(false)); $this->assertTrue(Carbon::now()->startOfDay()->isStartOfDay(false)); $this->assertFalse(Carbon::parse('15:30:45')->isStartOfDay(false)); $this->assertFalse(Carbon::now()->endOfDay()->isStartOfDay(false)); $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay()); $this->assertTrue(Carbon::parse('00:00:00.999999')->isStartOfDay()); $this->assertTrue(Carbon::now()->startOfDay()->isStartOfDay()); $this->assertFalse(Carbon::parse('15:30:45')->isStartOfDay()); $this->assertFalse(Carbon::now()->endOfDay()->isStartOfDay()); } public function testIsStartOfDayInterval() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay('15 minutes')); $this->assertTrue(Carbon::parse('00:14:59.999999')->isStartOfDay('15 minutes')); $this->assertFalse(Carbon::parse('00:15:00')->isStartOfDay('15 minutes')); $this->assertTrue(Carbon::parse('00:59:59.999999')->isStartOfDay(Unit::Hour)); $this->assertFalse(Carbon::parse('01:00:00')->isStartOfDay(Unit::Hour)); $this->assertTrue(Carbon::parse('00:00:59.999999')->isStartOfDay(new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('00:01:00')->isStartOfDay(new DateInterval('PT1M'))); $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('00:14:59.999999')->isStartOfDay(interval: '15 minutes')); $this->assertFalse(Carbon::parse('00:15:00')->isStartOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('00:59:59.999999')->isStartOfDay(interval: Unit::Hour)); $this->assertFalse(Carbon::parse('01:00:00')->isStartOfDay(interval: Unit::Hour)); $this->assertTrue(Carbon::parse('00:00:59.999999')->isStartOfDay(interval: new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('00:01:00')->isStartOfDay(interval: new DateInterval('PT1M'))); $this->assertTrue(Carbon::parse('00:01:59.999999')->isStartOfDay(interval: CarbonInterval::minutes(2))); $this->assertFalse(Carbon::parse('00:02:00')->isStartOfDay(interval: CarbonInterval::minutes(2))); // Always false with negative interval $this->assertFalse(Carbon::parse('00:00:00')->isStartOfDay(interval: CarbonInterval::minutes(-2))); // Always true with interval bigger than 1 day $this->assertTrue(Carbon::parse('23:59:59.999999')->isStartOfDay(interval: CarbonInterval::hours(36))); } public function testIsStartOfUnit() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('00:00:00.000001')->isStartOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('00:00:01')->isStartOfUnit(Unit::Hour)); $this->assertTrue(Carbon::parse('00:00:00')->isStartOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('00:04:59.999999')->isStartOfUnit(Unit::Hour, '5 minutes')); $this->assertFalse(Carbon::parse('00:05:00')->isStartOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('Monday')->isStartOfUnit(Unit::Week)); $this->assertTrue(Carbon::parse('Monday 23:59:59.999999')->isStartOfUnit(Unit::Week)); $this->assertFalse(Carbon::parse('Tuesday')->isStartOfUnit(Unit::Week)); $this->assertFalse(Carbon::parse('Monday')->isStartOfUnit(Unit::Week, CarbonInterval::day(-1))); } public function testIsStartOfDayWithMicroseconds() { $this->assertTrue(Carbon::parse('00:00:00')->isStartOfDay(true)); $this->assertTrue(Carbon::now()->startOfDay()->isStartOfDay(true)); $this->assertFalse(Carbon::parse('00:00:00.000001')->isStartOfDay(true)); } public function testIsEndOfDay() { $this->assertTrue(Carbon::parse('23:59:59')->isEndOfDay(false)); $this->assertTrue(Carbon::parse('23:59:59.000000')->isEndOfDay(false)); $this->assertTrue(Carbon::now()->endOfDay()->isEndOfDay(false)); $this->assertFalse(Carbon::parse('15:30:45')->isEndOfDay(false)); $this->assertFalse(Carbon::now()->startOfDay()->isEndOfDay(false)); $this->assertTrue(Carbon::parse('23:59:59')->isEndOfDay()); $this->assertTrue(Carbon::parse('23:59:59.000000')->isEndOfDay()); $this->assertTrue(Carbon::now()->endOfDay()->isEndOfDay()); $this->assertFalse(Carbon::parse('15:30:45')->isEndOfDay()); $this->assertFalse(Carbon::now()->startOfDay()->isEndOfDay()); } public function testIsEndOfDayInterval() { $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay('15 minutes')); $this->assertTrue(Carbon::parse('23:45:00')->isEndOfDay('15 minutes')); $this->assertFalse(Carbon::parse('23:44:59.999999')->isEndOfDay('15 minutes')); $this->assertTrue(Carbon::parse('23:00:00')->isEndOfDay(Unit::Hour)); $this->assertFalse(Carbon::parse('22:59:59.999999')->isEndOfDay(Unit::Hour)); $this->assertTrue(Carbon::parse('23:59:00')->isEndOfDay(new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('23:58:59.999999')->isEndOfDay(new DateInterval('PT1M'))); $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('23:45:00')->isEndOfDay(interval: '15 minutes')); $this->assertFalse(Carbon::parse('23:44:59.999999')->isEndOfDay(interval: '15 minutes')); $this->assertTrue(Carbon::parse('23:00:00')->isEndOfDay(interval: Unit::Hour)); $this->assertFalse(Carbon::parse('22:59:59.999999')->isEndOfDay(interval: Unit::Hour)); $this->assertTrue(Carbon::parse('23:59:00')->isEndOfDay(interval: new DateInterval('PT1M'))); $this->assertFalse(Carbon::parse('23:58:59.999999')->isEndOfDay(interval: new DateInterval('PT1M'))); // Always false with negative interval $this->assertFalse(Carbon::parse('00:00:00')->isEndOfDay(interval: CarbonInterval::minutes(-2))); // Always true with interval bigger than 1 day $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay(interval: CarbonInterval::hours(36))); } public function testIsEndOfDayWithMicroseconds() { $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfDay(true)); $this->assertTrue(Carbon::now()->endOfDay()->isEndOfDay(true)); $this->assertFalse(Carbon::parse('23:59:59')->isEndOfDay(true)); $this->assertFalse(Carbon::parse('23:59:59.999998')->isEndOfDay(true)); } public function testIsEndOfUnit() { $this->assertTrue(Carbon::parse('23:59:59.999999')->isEndOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('23:59:59.999998')->isEndOfUnit(Unit::Hour)); $this->assertFalse(Carbon::parse('23:59:59')->isEndOfUnit(Unit::Hour)); $this->assertTrue(Carbon::parse('23:55:00.000001')->isEndOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('23:55:00')->isEndOfUnit(Unit::Hour, '5 minutes')); $this->assertFalse(Carbon::parse('23:54:59.999999')->isEndOfUnit(Unit::Hour, '5 minutes')); $this->assertTrue(Carbon::parse('Sunday 23:59:59')->isEndOfUnit(Unit::Week, '2 days')); $this->assertTrue(Carbon::parse('Saturday 00:00')->isEndOfUnit(Unit::Week, '2 days')); $this->assertFalse(Carbon::parse('Saturday 00:00')->isEndOfUnit(Unit::Week)); $this->assertFalse(Carbon::parse('Friday 23:59:59.999999')->isEndOfUnit(Unit::Week, '2 days')); $this->assertFalse(Carbon::parse('Sunday 23:59:59.999999')->isEndOfUnit(Unit::Week, CarbonInterval::day(-1))); } public function testIsMidnight() { $this->assertTrue(Carbon::parse('00:00:00')->isMidnight()); $this->assertFalse(Carbon::parse('15:30:45')->isMidnight()); } public function testIsMidday() { $this->assertTrue(Carbon::parse('12:00:00')->isMidday()); $this->assertFalse(Carbon::parse('15:30:45')->isMidday()); } public function testHasFormat() { $this->assertTrue(Carbon::hasFormat('1975-05-01', 'Y-m-d')); $this->assertTrue(Carbon::hasFormat('12/30/2019', 'm/d/Y')); $this->assertTrue(Carbon::hasFormat('30/12/2019', 'd/m/Y')); $this->assertTrue(Carbon::hasFormat('Sun 21st', 'D jS')); $this->assertTrue(Carbon::hasFormat('2000-07-01T00:00:00+00:00', DateTime::ATOM)); $this->assertTrue(Carbon::hasFormat('Y-01-30\\', '\\Y-m-d\\\\')); // @see https://github.com/briannesbitt/Carbon/issues/2180 $this->assertTrue(Carbon::hasFormat('2020-09-01 12:00:00Europe/Moscow', 'Y-m-d H:i:se')); $this->assertTrue(Carbon::hasFormat('2012-12-04 22:59.32130', 'Y-m-d H:s.vi')); // Format failure $this->assertFalse(Carbon::hasFormat('', 'd m Y')); $this->assertFalse(Carbon::hasFormat('1975-05-01', 'd m Y')); $this->assertFalse(Carbon::hasFormat('Foo 21st', 'D jS')); $this->assertFalse(Carbon::hasFormat('Sun 51st', 'D jS')); $this->assertFalse(Carbon::hasFormat('Sun 21xx', 'D jS')); // Regex failure $this->assertFalse(Carbon::hasFormat('1975-5-1', 'Y-m-d')); $this->assertFalse(Carbon::hasFormat('19-05-01', 'Y-m-d')); $this->assertFalse(Carbon::hasFormat('30/12/2019', 'm/d/Y')); $this->assertFalse(Carbon::hasFormat('12/30/2019', 'd/m/Y')); $this->assertTrue(Carbon::hasFormat('2012-12-04 22:59.32130', 'Y-m-d H:s.vi')); } public static function dataForFormatLetters(): array { return [ 'd' => ['d'], 'D' => ['D'], 'j' => ['j'], 'l' => ['l'], 'N' => ['N'], 'S' => ['S'], 'w' => ['w'], 'z' => ['z'], 'W' => ['W'], 'F' => ['F'], 'm' => ['m'], 'M' => ['M'], 'n' => ['n'], 't' => ['t'], 'L' => ['L'], 'o' => ['o'], 'Y' => ['Y'], 'y' => ['y'], 'a' => ['a'], 'A' => ['A'], 'B' => ['B'], 'g' => ['g'], 'G' => ['G'], 'h' => ['h'], 'H' => ['H'], 'i' => ['i'], 's' => ['s'], 'u' => ['u'], 'v' => ['v'], 'e' => ['e'], 'I' => ['I'], 'O' => ['O'], 'P' => ['P'], 'T' => ['T'], 'Z' => ['Z'], 'U' => ['U'], 'c' => ['c'], 'r' => ['r'], ]; } #[DataProvider('dataForFormatLetters')] public function testHasFormatWithSingleLetter($letter) { $output = Carbon::now()->format($letter); $this->assertTrue(Carbon::hasFormat($output, $letter), "'$letter' format should match '$output'"); } public function testIs() { $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2018')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2018-06')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-07')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('06-03')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('05-02')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-03')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-05-02')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2020-06-02')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('Monday')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('June')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('May')); $this->assertFalse(Carbon::parse('2023-10-01 00:00:00')->is('February')); $this->assertFalse(Carbon::parse('2023-10-01 00:00:00')->is('January')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('12:26')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('12h')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('15h')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('12:00')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('15:00')); $this->assertTrue(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); $this->assertFalse(Carbon::parse('2019-06-02 15:23:45')->is('4pm')); $this->assertFalse(Carbon::parse('2019-06-02 15:23:45')->is('3am')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02 12:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-03 12:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02 15:23')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02 12:33')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('2 June 2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('1 June 2019')); $this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('June 2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('August 2019')); $this->assertFalse(Carbon::parse('2019-06-02 12:23:45')->is('June 2018')); } public function testHasFormatWithDots() { $this->assertTrue(Carbon::hasFormat('2020.09.09', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020009009', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020-09-09', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020*09*09', 'Y.m.d')); $this->assertFalse(Carbon::hasFormat('2020k09d09', 'Y.m.d')); } } ================================================ FILE: tests/CarbonImmutable/IssetTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class IssetTest extends AbstractTestCase { public function testIssetReturnFalseForUnknownProperty(): void { $this->assertFalse(isset($this->immutableNow->sdfsdfss)); } public static function dataForTestIssetReturnTrueForProperties(): Generator { yield ['age']; yield ['century']; yield ['day']; yield ['dayName']; yield ['dayOfWeek']; yield ['dayOfWeekIso']; yield ['dayOfYear']; yield ['daysInMonth']; yield ['daysInYear']; yield ['decade']; yield ['dst']; yield ['englishDayOfWeek']; yield ['englishMonth']; yield ['firstWeekDay']; yield ['hour']; yield ['isoWeek']; yield ['isoWeekYear']; yield ['isoWeeksInYear']; yield ['lastWeekDay']; yield ['latinMeridiem']; yield ['latinUpperMeridiem']; yield ['local']; yield ['locale']; yield ['localeDayOfWeek']; yield ['localeMonth']; yield ['meridiem']; yield ['micro']; yield ['microsecond']; yield ['millennium']; yield ['milli']; yield ['millisecond']; yield ['milliseconds']; yield ['minDayName']; yield ['minute']; yield ['month']; yield ['monthName']; yield ['noZeroHour']; yield ['offset']; yield ['offsetHours']; yield ['offsetMinutes']; yield ['quarter']; yield ['second']; yield ['shortDayName']; yield ['shortEnglishDayOfWeek']; yield ['shortEnglishMonth']; yield ['shortLocaleDayOfWeek']; yield ['shortLocaleMonth']; yield ['shortMonthName']; yield ['timestamp']; yield ['timezone']; yield ['timezoneAbbreviatedName']; yield ['timezoneName']; yield ['tz']; yield ['tzAbbrName']; yield ['tzName']; yield ['upperMeridiem']; yield ['utc']; yield ['week']; yield ['weekNumberInMonth']; yield ['weekOfMonth']; yield ['weekOfYear']; yield ['weekYear']; yield ['weeksInYear']; yield ['year']; yield ['yearIso']; } #[DataProvider('dataForTestIssetReturnTrueForProperties')] public function testIssetReturnTrueForProperties(string $property): void { Carbon::useStrictMode(false); $this->assertTrue(isset($this->immutableNow->{$property})); } } ================================================ FILE: tests/CarbonImmutable/JsonSerializationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCaseWithOldNow; class JsonSerializationTest extends AbstractTestCaseWithOldNow { public function testCarbonAllowsCustomSerializer() { Carbon::serializeUsing(function (Carbon $carbon) { return $carbon->getTimestamp(); }); $result = json_decode(json_encode(Carbon::now()), true); $this->assertSame(1498569255, $result); } public function testCarbonAllowsCustomSerializerString() { Carbon::serializeUsing('Y-m-d'); $this->assertSame('"2017-06-27"', json_encode(Carbon::now())); } public function testCarbonAllowsCustomSerializerViaSettings() { $date = Carbon::now()->settings([ 'toJsonFormat' => 'H:i:s', ]); $this->assertSame('"13:14:15"', json_encode($date)); } public function testCarbonCanSerializeToJson() { $this->assertSame('2017-06-27T13:14:15.000000Z', Carbon::now()->jsonSerialize()); } } ================================================ FILE: tests/CarbonImmutable/LastErrorTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Traits\Creator; use DateTime; use PHPUnit\Framework\Attributes\RequiresPhp; use Tests\AbstractTestCase; class LastErrorTest extends AbstractTestCase { /** * @var array */ protected $lastErrors; /** * @var array */ protected $noErrors; protected function setUp(): void { parent::setUp(); $this->lastErrors = [ 'warning_count' => 1, 'warnings' => ['11' => 'The parsed date was invalid'], 'error_count' => 0, 'errors' => [], ]; } #[RequiresPhp('>=8.2')] public function testCreateHandlesLastErrors() { $carbon = new Carbon('2017-02-30'); $datetime = new DateTime('2017-02-30'); $this->assertSame($this->lastErrors, $carbon->getLastErrors()); $this->assertSame($carbon->getLastErrors(), $datetime->getLastErrors()); $carbon = new Carbon('2017-02-15'); $this->assertFalse($carbon->getLastErrors()); } public function testLastErrorsInitialization() { $obj = new class() { use Creator; /** @phpstan-ignore-next-line */ public function __construct($time = null, $tz = null) { } public function triggerError() { self::setLastErrors([ 'warning_count' => 1, 'warnings' => ['11' => 'The parsed date was invalid'], 'error_count' => 0, 'errors' => [], ]); } }; $this->assertFalse($obj::getLastErrors()); $obj->triggerError(); $this->assertSame($this->lastErrors, $obj::getLastErrors()); } } ================================================ FILE: tests/CarbonImmutable/LocalizationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterval; use Carbon\Language; use Carbon\Translator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\TestWith; use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Translation\Loader\ArrayLoader; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\Translator as SymfonyTranslator; use Tests\AbstractTestCase; use Tests\CarbonImmutable\Fixtures\MyCarbon; #[Group('localization')] class LocalizationTest extends AbstractTestCase { protected function tearDown(): void { parent::tearDown(); Carbon::setLocale('en'); } public function testGetTranslator() { /** @var Translator $t */ $t = Carbon::getTranslator(); $this->assertNotNull($t); $this->assertSame('en', $t->getLocale()); } public function testResetTranslator() { /** @var Translator $t */ $t = MyCarbon::getTranslator(); $this->assertNotNull($t); $this->assertSame('en', $t->getLocale()); } #[TestWith([ 'fr', ['fr_FR.UTF-8', 'fr_FR.utf8', 'fr_FR', 'fr'], 'il y a 2 secondes', ])] #[TestWith([ 'sr', ['sr_ME.UTF-8', 'sr_ME.utf8', 'sr_ME', 'sr'], ['pre 2 sekunde' /* sr */, 'prije 2 sekunde' /* sr_ME */], ])] #[TestWith([ 'zh', ['zh_TW.UTF-8', 'zh_TW.utf8', 'zh_TW', 'zh'], '2秒前', ])] public function testSetLocaleToAutoFromSupportedLocale(string $language, array $locales, array|string $twoSecondsAgo) { $currentLocale = setlocale(LC_ALL, '0'); $this->setLocaleOrSkip(...$locales); try { Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); } finally { setlocale(LC_ALL, $currentLocale); } $this->assertStringStartsWith($language, $locale); $this->assertContains($diff, (array) $twoSecondsAgo); } public function testSetLocaleToAutoFromUnsupportedLocale() { $currentLocale = setlocale(LC_ALL, '0'); $this->setLocaleOrSkip('ar_AE.UTF-8', 'ar_AE.utf8', 'ar_AE', 'ar'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); $translator->setLocale('en'); $directories = $translator->getDirectories(); $directory = sys_get_temp_dir().'/carbon'.mt_rand(0, 9999999); mkdir($directory); foreach (glob(__DIR__.'/../../src/Carbon/Lang/*.php') as $file) { copy($file, "$directory/".basename($file)); } try { $translator->setDirectories([$directory]); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); } finally { $translator->setDirectories([$directory]); setlocale(LC_ALL, $currentLocale); $this->remove($directory); $translator->setDirectories($directories); } $this->assertStringStartsWith('ar', $locale); $this->assertSame('منذ ثانيتين', $diff); } public function testSetLocaleToAutoFallback() { $currentLocale = setlocale(LC_ALL, '0'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); $translator->setLocale('en'); $directories = $translator->getDirectories(); $directory = sys_get_temp_dir().'/carbon'.mt_rand(0, 9999999); try { $this->setLocaleOrSkip('fr_FR.UTF-8', 'fr_FR.utf8', 'fr_FR', 'fr'); mkdir($directory); $files = [ 'en', 'zh_Hans', 'zh', 'fr', 'fr_CA', ]; foreach ($files as $file) { copy(__DIR__."/../../src/Carbon/Lang/$file.php", "$directory/$file.php"); } $translator->setDirectories([$directory]); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); setlocale(LC_ALL, $currentLocale); $this->assertSame('fr', $locale); $this->assertSame('il y a 2 secondes', $diff); $this->setLocaleOrSkip('zh_CN.UTF-8', 'zh_CN.utf8', 'zh_CN', 'zh'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); setlocale(LC_ALL, $currentLocale); $this->assertSame('zh', $locale); $this->assertSame('2秒前', $diff); $this->setLocaleOrSkip('yo_NG.UTF-8', 'yo_NG.utf8', 'yo_NG', 'yo'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->resetMessages(); Carbon::setLocale('en'); Carbon::setLocale('auto'); $locale = Carbon::getLocale(); $diff = Carbon::now()->subSeconds(2)->diffForHumans(); setlocale(LC_ALL, $currentLocale); $this->assertSame('en', $locale); $this->assertSame('2 seconds ago', $diff); } finally { setlocale(LC_ALL, $currentLocale); $translator->setDirectories($directories); $this->remove($directory); } } /** * @see \Tests\CarbonImmutable\LocalizationTest::testSetLocale * @see \Tests\CarbonImmutable\LocalizationTest::testSetTranslator */ public static function dataForLocales(): array { return [ 'af' => ['af'], 'ar' => ['ar'], 'ar_DZ' => ['ar_DZ'], 'ar_KW' => ['ar_KW'], 'ar_LY' => ['ar_LY'], 'ar_MA' => ['ar_MA'], 'ar_SA' => ['ar_SA'], 'ar_Shakl' => ['ar_Shakl'], 'ar_TN' => ['ar_TN'], 'az' => ['az'], 'be' => ['be'], 'bg' => ['bg'], 'bm' => ['bm'], 'bn' => ['bn'], 'bo' => ['bo'], 'br' => ['br'], 'bs' => ['bs'], 'bs_BA' => ['bs_BA'], 'ca' => ['ca'], 'cs' => ['cs'], 'cv' => ['cv'], 'cy' => ['cy'], 'da' => ['da'], 'de' => ['de'], 'de_AT' => ['de_AT'], 'de_CH' => ['de_CH'], 'dv' => ['dv'], 'dv_MV' => ['dv_MV'], 'el' => ['el'], 'en' => ['en'], 'en_AU' => ['en_AU'], 'en_CA' => ['en_CA'], 'en_GB' => ['en_GB'], 'en_IE' => ['en_IE'], 'en_IL' => ['en_IL'], 'en_NZ' => ['en_NZ'], 'eo' => ['eo'], 'es' => ['es'], 'es_DO' => ['es_DO'], 'es_US' => ['es_US'], 'et' => ['et'], 'eu' => ['eu'], 'fa' => ['fa'], 'fi' => ['fi'], 'fo' => ['fo'], 'fr' => ['fr'], 'fr_CA' => ['fr_CA'], 'fr_CH' => ['fr_CH'], 'fy' => ['fy'], 'gd' => ['gd'], 'gl' => ['gl'], 'gom_Latn' => ['gom_Latn'], 'gu' => ['gu'], 'he' => ['he'], 'hi' => ['hi'], 'hr' => ['hr'], 'hu' => ['hu'], 'hy' => ['hy'], 'hy_AM' => ['hy_AM'], 'id' => ['id'], 'is' => ['is'], 'it' => ['it'], 'ja' => ['ja'], 'jv' => ['jv'], 'ka' => ['ka'], 'kk' => ['kk'], 'km' => ['km'], 'kn' => ['kn'], 'ko' => ['ko'], 'ku' => ['ku'], 'ky' => ['ky'], 'lb' => ['lb'], 'lo' => ['lo'], 'lt' => ['lt'], 'lv' => ['lv'], 'me' => ['me'], 'mi' => ['mi'], 'mk' => ['mk'], 'ml' => ['ml'], 'mn' => ['mn'], 'mr' => ['mr'], 'ms' => ['ms'], 'ms_MY' => ['ms_MY'], 'mt' => ['mt'], 'my' => ['my'], 'nb' => ['nb'], 'ne' => ['ne'], 'nl' => ['nl'], 'nl_BE' => ['nl_BE'], 'nn' => ['nn'], 'no' => ['no'], 'oc' => ['oc'], 'pa_IN' => ['pa_IN'], 'pl' => ['pl'], 'ps' => ['ps'], 'pt' => ['pt'], 'pt_BR' => ['pt_BR'], 'ro' => ['ro'], 'ru' => ['ru'], 'sd' => ['sd'], 'se' => ['se'], 'sh' => ['sh'], 'si' => ['si'], 'sk' => ['sk'], 'sl' => ['sl'], 'sq' => ['sq'], 'sr' => ['sr'], 'sr_Cyrl' => ['sr_Cyrl'], 'sr_Cyrl_ME' => ['sr_Cyrl_ME'], 'sr_Latn_ME' => ['sr_Latn_ME'], 'sr_ME' => ['sr_ME'], 'ss' => ['ss'], 'sv' => ['sv'], 'sw' => ['sw'], 'ta' => ['ta'], 'te' => ['te'], 'tet' => ['tet'], 'tg' => ['tg'], 'th' => ['th'], 'tl_PH' => ['tl_PH'], 'tlh' => ['tlh'], 'tr' => ['tr'], 'tzl' => ['tzl'], 'tzm' => ['tzm'], 'tzm_Latn' => ['tzm_Latn'], 'ug_CN' => ['ug_CN'], 'uk' => ['uk'], 'ur' => ['ur'], 'uz' => ['uz'], 'uz_Latn' => ['uz_Latn'], 'vi' => ['vi'], 'yo' => ['yo'], 'zh' => ['zh'], 'zh_CN' => ['zh_CN'], 'zh_HK' => ['zh_HK'], 'zh_TW' => ['zh_TW'], ]; } #[DataProvider('dataForLocales')] public function testSetLocale(string $locale) { Carbon::setLocale($locale); $this->assertTrue($this->areSameLocales($locale, Carbon::getLocale())); } #[DataProvider('dataForLocales')] public function testSetTranslator(string $locale) { $ori = Carbon::getTranslator(); $t = new Translator($locale); $t->addLoader('array', new ArrayLoader()); Carbon::setTranslator($t); /** @var Translator $t */ $t = Carbon::getTranslator(); $this->assertNotNull($t); $this->assertTrue($this->areSameLocales($locale, $t->getLocale())); Carbon::setTranslator($ori); } public function testSetLocaleWithKnownLocale() { Carbon::setLocale('fr'); $this->assertSame('fr', Carbon::getLocale()); } #[TestWith(['DE'])] #[TestWith(['pt-BR'])] #[TestWith(['pt-br'])] #[TestWith(['PT-br'])] #[TestWith(['PT-BR'])] #[TestWith(['pt_br'])] #[TestWith(['PT_br'])] #[TestWith(['PT_BR'])] public function testSetLocaleWithMalformedLocale(string $malformedLocale) { Carbon::setLocale($malformedLocale); $split = preg_split('/[-_]/', $malformedLocale); $this->assertSame( strtolower($split[0]).(\count($split) === 1 ? '' : '_'.strtoupper($split[1])), Carbon::getLocale(), ); } public function testSetLocaleWithNonExistingLocale() { Carbon::setLocale('pt-XX'); $this->assertSame('pt', Carbon::getLocale()); } public function testSetLocaleWithUnknownLocale() { Carbon::setLocale('zz'); $this->assertSame('en', Carbon::getLocale()); } public function testCustomTranslation() { Carbon::setLocale('en'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); /** @var MessageCatalogue $messages */ $messages = $translator->getCatalogue('en'); $resources = $messages->all('messages'); $resources['day'] = '1 boring day|%count% boring days'; $translator->addResource('array', $resources, 'en'); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); $this->assertSame('3 boring days 4 hours', $diff); Carbon::setLocale('en'); } public function testAddCustomTranslation() { $enBoring = [ 'day' => '1 boring day|%count% boring days', ]; Carbon::setLocale('en'); $this->assertSame('en', Carbon::getLocale()); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages('en', $enBoring); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); $this->assertSame('3 boring days 4 hours', $diff); $translator->resetMessages('en'); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); $this->assertSame('3 days 4 hours', $diff); $translator->setMessages('en_Boring', $enBoring); $this->assertSame($enBoring, $translator->getMessages('en_Boring')); $messages = $translator->getMessages(); $this->assertArrayHasKey('en', $messages); $this->assertArrayHasKey('en_Boring', $messages); $this->assertSame($enBoring, $messages['en_Boring']); Carbon::setLocale('en_Boring'); $this->assertSame('en_Boring', Carbon::getLocale()); $diff = Carbon::create(2018, 1, 1, 0, 0, 0) ->diffForHumans(Carbon::create(2018, 1, 4, 4, 0, 0), true, false, 2); // en_Boring inherit en because it starts with "en", see symfony-translation behavior $this->assertSame('3 boring days 4 hours', $diff); $translator->resetMessages(); $this->assertSame([], $translator->getMessages()); Carbon::setLocale('en'); $this->assertSame('en', Carbon::getLocale()); } public function testCustomWeekStart() { Carbon::setLocale('ru'); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages('ru', [ 'first_day_of_week' => 1, ]); $calendar = Carbon::parse('2018-07-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-07 00:00:00')); $this->assertSame('В следующий вторник, в 0:00', $calendar); $calendar = Carbon::parse('2018-07-12 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-12 00:00:00')); $this->assertSame('В воскресенье, в 0:00', $calendar); $translator->setMessages('ru', [ 'first_day_of_week' => 5, ]); $calendar = Carbon::parse('2018-07-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-07 00:00:00')); $this->assertSame('Во вторник, в 0:00', $calendar); $calendar = Carbon::parse('2018-07-12 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-07-12 00:00:00')); $this->assertSame('В следующее воскресенье, в 0:00', $calendar); $translator->resetMessages('ru'); Carbon::setLocale('en'); } public function testAddAndRemoveDirectory() { $directory = sys_get_temp_dir().'/carbon'.mt_rand(0, 9999999); mkdir($directory); copy(__DIR__.'/../../src/Carbon/Lang/fr.php', "$directory/foo.php"); copy(__DIR__.'/../../src/Carbon/Lang/fr.php', "$directory/bar.php"); /** @var Translator $translator */ $translator = Carbon::getTranslator(); Carbon::setLocale('en'); Carbon::setLocale('foo'); $this->assertSame('Saturday', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); $translator->addDirectory($directory); Carbon::setLocale('foo'); $this->assertSame('samedi', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); Carbon::setLocale('en'); $translator->removeDirectory($directory); Carbon::setLocale('bar'); $this->assertSame('Saturday', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); Carbon::setLocale('foo'); $this->assertSame('samedi', Carbon::parse('2018-07-07 00:00:00')->isoFormat('dddd')); Carbon::setLocale('en'); } public function testLocaleHasShortUnits() { $withShortUnit = [ 'year' => 'foo', 'y' => 'bar', ]; $withShortHourOnly = [ 'year' => 'foo', 'y' => 'foo', 'day' => 'foo', 'd' => 'foo', 'hour' => 'foo', 'h' => 'bar', ]; $withoutShortUnit = [ 'year' => 'foo', ]; $withSameShortUnit = [ 'year' => 'foo', 'y' => 'foo', ]; $withShortHourOnlyLocale = 'zz_'.ucfirst(strtolower('withShortHourOnly')); $withShortUnitLocale = 'zz_'.ucfirst(strtolower('withShortUnit')); $withoutShortUnitLocale = 'zz_'.ucfirst(strtolower('withoutShortUnit')); $withSameShortUnitLocale = 'zz_'.ucfirst(strtolower('withSameShortUnit')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withShortUnitLocale, $withShortUnit); $translator->setMessages($withShortHourOnlyLocale, $withShortHourOnly); $translator->setMessages($withoutShortUnitLocale, $withoutShortUnit); $translator->setMessages($withSameShortUnitLocale, $withSameShortUnit); $this->assertTrue(Carbon::localeHasShortUnits($withShortUnitLocale)); $this->assertTrue(Carbon::localeHasShortUnits($withShortHourOnlyLocale)); $this->assertFalse(Carbon::localeHasShortUnits($withoutShortUnitLocale)); $this->assertFalse(Carbon::localeHasShortUnits($withSameShortUnitLocale)); } public function testLocaleHasDiffSyntax() { $withDiffSyntax = [ 'year' => 'foo', 'ago' => ':time ago', 'from_now' => ':time from now', 'after' => ':time after', 'before' => ':time before', ]; $withoutDiffSyntax = [ 'year' => 'foo', ]; $withDiffSyntaxLocale = 'zz_'.ucfirst(strtolower('withDiffSyntax')); $withoutDiffSyntaxLocale = 'zz_'.ucfirst(strtolower('withoutDiffSyntax')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withDiffSyntaxLocale, $withDiffSyntax); $translator->setMessages($withoutDiffSyntaxLocale, $withoutDiffSyntax); $this->assertTrue(Carbon::localeHasDiffSyntax($withDiffSyntaxLocale)); $this->assertFalse(Carbon::localeHasDiffSyntax($withoutDiffSyntaxLocale)); $this->assertTrue(Carbon::localeHasDiffSyntax('ka')); $this->assertFalse(Carbon::localeHasDiffSyntax('foobar')); } public function testLocaleHasDiffOneDayWords() { $withOneDayWords = [ 'year' => 'foo', 'diff_now' => 'just now', 'diff_yesterday' => 'yesterday', 'diff_tomorrow' => 'tomorrow', ]; $withoutOneDayWords = [ 'year' => 'foo', ]; $withOneDayWordsLocale = 'zz_'.ucfirst(strtolower('withOneDayWords')); $withoutOneDayWordsLocale = 'zz_'.ucfirst(strtolower('withoutOneDayWords')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withOneDayWordsLocale, $withOneDayWords); $translator->setMessages($withoutOneDayWordsLocale, $withoutOneDayWords); $this->assertTrue(Carbon::localeHasDiffOneDayWords($withOneDayWordsLocale)); $this->assertFalse(Carbon::localeHasDiffOneDayWords($withoutOneDayWordsLocale)); } public function testLocaleHasDiffTwoDayWords() { $withTwoDayWords = [ 'year' => 'foo', 'diff_before_yesterday' => 'before yesterday', 'diff_after_tomorrow' => 'after tomorrow', ]; $withoutTwoDayWords = [ 'year' => 'foo', ]; $withTwoDayWordsLocale = 'zz_'.ucfirst(strtolower('withTwoDayWords')); $withoutTwoDayWordsLocale = 'zz_'.ucfirst(strtolower('withoutTwoDayWords')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withTwoDayWordsLocale, $withTwoDayWords); $translator->setMessages($withoutTwoDayWordsLocale, $withoutTwoDayWords); $this->assertTrue(Carbon::localeHasDiffTwoDayWords($withTwoDayWordsLocale)); $this->assertFalse(Carbon::localeHasDiffTwoDayWords($withoutTwoDayWordsLocale)); } public function testLocaleHasPeriodSyntax() { $withPeriodSyntax = [ 'year' => 'foo', 'period_recurrences' => 'once|%count% times', 'period_interval' => 'every :interval', 'period_start_date' => 'from :date', 'period_end_date' => 'to :date', ]; $withoutPeriodSyntax = [ 'year' => 'foo', ]; $withPeriodSyntaxLocale = 'zz_'.ucfirst(strtolower('withPeriodSyntax')); $withoutPeriodSyntaxLocale = 'zz_'.ucfirst(strtolower('withoutPeriodSyntax')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($withPeriodSyntaxLocale, $withPeriodSyntax); $translator->setMessages($withoutPeriodSyntaxLocale, $withoutPeriodSyntax); $this->assertTrue(Carbon::localeHasPeriodSyntax($withPeriodSyntaxLocale)); $this->assertFalse(Carbon::localeHasPeriodSyntax($withoutPeriodSyntaxLocale)); $this->assertTrue(Carbon::localeHasPeriodSyntax('nl')); } public function testGetAvailableLocales() { $this->assertCount(\count(glob(__DIR__.'/../../src/Carbon/Lang/*.php')), Carbon::getAvailableLocales()); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages('zz_ZZ', []); $this->assertContains('zz_ZZ', Carbon::getAvailableLocales()); Carbon::setTranslator(new SymfonyTranslator('en')); $this->assertSame(['en'], Carbon::getAvailableLocales()); } public function testGetAvailableLocalesInfo() { $infos = Carbon::getAvailableLocalesInfo(); $this->assertCount(\count(Carbon::getAvailableLocales()), Carbon::getAvailableLocalesInfo()); $this->assertArrayHasKey('en', $infos); $this->assertInstanceOf(Language::class, $infos['en']); $this->assertSame('English', $infos['en']->getIsoName()); } public function testGeorgianSpecialFromNowTranslation() { $diff = Carbon::now()->locale('ka')->addWeeks(3)->diffForHumans(); $this->assertSame('3 კვირაში', $diff); } public function testWeekDayMultipleForms() { $date = Carbon::parse('2018-10-10')->locale('ru'); $this->assertSame('в среду', $date->isoFormat('[в] dddd')); $this->assertSame('среда, 10 октября 2018', $date->isoFormat('dddd, D MMMM YYYY')); $this->assertSame('среда', $date->dayName); $this->assertSame('ср', $date->isoFormat('dd')); $date = Carbon::parse('2018-10-10')->locale('uk'); $this->assertSame('середа, 10', $date->isoFormat('dddd, D')); $this->assertSame('в середу', $date->isoFormat('[в] dddd')); $this->assertSame('минулої середи', $date->isoFormat('[минулої] dddd')); } public function testTranslationCustomWithCustomTranslator() { $this->expectExceptionObject(new InvalidArgumentException( 'Translator does not implement Symfony\Contracts\Translation\TranslatorInterface '. 'and Symfony\Component\Translation\TranslatorBagInterface. '. 'Symfony\Component\Translation\IdentityTranslator has been given.', )); $date = Carbon::create(2018, 1, 1, 0, 0, 0); $date->setLocalTranslator(new IdentityTranslator()); $date->getTranslationMessage('foo'); } public function testTranslateTimeStringTo() { $date = Carbon::parse('2019-07-05')->locale('de'); $baseString = $date->isoFormat('LLLL'); $this->assertSame('Freitag, 5. Juli 2019 00:00', $baseString); $this->assertSame('Friday, 5. July 2019 00:00', $date->translateTimeStringTo($baseString)); $this->assertSame('vendredi, 5. juillet 2019 00:00', $date->translateTimeStringTo($baseString, 'fr')); } public function testFallbackLocales() { // /!\ Used for backward compatibility, please avoid this method // @see testMultiLocales() as preferred method $myDialect = 'xx_MY_Dialect'; $secondChoice = 'xy_MY_Dialect'; $thirdChoice = 'it_CH'; /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($myDialect, [ 'day' => ':count yub yub', ]); $translator->setMessages($secondChoice, [ 'day' => ':count buza', 'hour' => ':count ohto', ]); Carbon::setLocale($myDialect); Carbon::setFallbackLocale($thirdChoice); $this->assertSame($thirdChoice, Carbon::getFallbackLocale()); $this->assertSame('3 yub yub e 5 ora fa', Carbon::now()->subDays(3)->subHours(5)->ago([ 'parts' => 2, 'join' => true, ])); Carbon::setTranslator(new Translator('en')); /** @var Translator $translator */ $translator = Carbon::getTranslator(); $translator->setMessages($myDialect, [ 'day' => ':count yub yub', ]); $translator->setMessages($secondChoice, [ 'day' => ':count buza', 'hour' => ':count ohto', ]); Carbon::setLocale($myDialect); Carbon::setFallbackLocale($secondChoice); Carbon::setFallbackLocale($thirdChoice); $this->assertSame($thirdChoice, Carbon::getFallbackLocale()); $this->assertSame('3 yub yub e 5 ohto fa', Carbon::now()->subDays(3)->subHours(5)->ago([ 'parts' => 2, 'join' => true, ])); Carbon::setTranslator(new IdentityTranslator()); $this->assertNull(Carbon::getFallbackLocale()); Carbon::setTranslator(new Translator('en')); } public function testMultiLocales() { $myDialect = 'xx_MY_Dialect'; $secondChoice = 'xy_MY_Dialect'; $thirdChoice = 'it_CH'; Translator::get($myDialect)->setTranslations([ 'day' => ':count yub yub', ]); Translator::get($secondChoice)->setTranslations([ 'day' => ':count buza', 'hour' => ':count ohto', ]); $date = Carbon::now()->subDays(3)->subHours(5)->locale($myDialect, $secondChoice, $thirdChoice); $this->assertSame('3 yub yub e 5 ohto fa', $date->ago([ 'parts' => 2, 'join' => true, ])); } public function testStandAloneMonthsInLLLFormat() { $this->assertSame( '29 февраля 2020 г., 12:24', Carbon::parse('2020-02-29 12:24:00')->locale('ru_RU')->isoFormat('LLL'), 'Use "months" for date formatting', ); } public function testStandAloneMonthName() { $this->assertSame( 'февраль', Carbon::parse('2020-02-29 12:24:00')->locale('ru_RU')->monthName, 'Use "months_standalone" the month alone', ); } public function testShortMonthNameInFormat() { $this->assertSame( '29. мая', Carbon::parse('2020-05-29 12:24:00')->locale('ru_RU')->isoFormat('D. MMM'), 'Use "months_short" for date formatting', ); $this->assertSame( 'май', Carbon::parse('2020-05-29 12:24:00')->locale('ru_RU')->isoFormat('MMM'), 'Use "months_short" for date formatting', ); } public function testStandAloneShortMonthName() { $this->assertSame( 'май', Carbon::parse('2020-05-29 12:24:00')->locale('ru_RU')->shortMonthName, 'Use "months_short_standalone" the month alone', ); } public function testAgoDeclension() { $this->assertSame( 'година', CarbonInterval::hour()->locale('uk')->forHumans(['aUnit' => true]), ); $this->assertSame( 'годину тому', Carbon::now()->subHour()->locale('uk')->diffForHumans(['aUnit' => true]), ); } public function testPolishDeclensions() { $hour = Carbon::now()->addHour()->locale('pl'); $minute = Carbon::now()->addMinute()->locale('pl'); $second = Carbon::now()->addSecond()->locale('pl'); $this->assertSame('za 1 godzinę', $hour->diffForHumans()); $this->assertSame('za 1 minutę', $minute->diffForHumans()); $this->assertSame('za 1 sekundę', $second->diffForHumans()); $this->assertSame('za godzinę', $hour->diffForHumans(['aUnit' => true])); $this->assertSame('za minutę', $minute->diffForHumans(['aUnit' => true])); $this->assertSame('za sekundę', $second->translate('from_now', ['time' => 'sekunda'])); } public function testDeclensionModes() { Carbon::setTestNow('2022-12-30'); $this->assertSame( '2 жил 3 сар 1 өдөр 1с өмнө', Carbon::now() ->subYears(2) ->subMonths(3) ->subDay() ->subSecond() ->locale('mn') ->diffForHumans(null, null, true, 4) ); $this->assertSame( '2 жил 3 сар 1 өдөр 1 секундын өмнө', Carbon::now() ->subYears(2) ->subMonths(3) ->subDay() ->subSecond() ->locale('mn') ->diffForHumans(null, null, false, 4) ); } #[TestWith(['мая', 'May'])] #[TestWith(['май', 'May'])] #[TestWith(['февраль', 'February'])] #[TestWith(['февраля', 'February'])] public function testTranslateMonthsEitherStandaloneOrNot(string $ru, string $en) { $this->assertSame($en, \Carbon\Carbon::translateTimeString($ru, 'ru', 'en')); } } ================================================ FILE: tests/CarbonImmutable/MacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use BadMethodCallException; use Carbon\CarbonImmutable as Carbon; use CarbonTimezoneTrait; use Closure; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use SubCarbonImmutable; use Tests\AbstractTestCaseWithOldNow; use Tests\Carbon\Fixtures\FooBar; use Tests\CarbonImmutable\Fixtures\Mixin; class MacroTest extends AbstractTestCaseWithOldNow { #[RequiresPhpExtension('calendar')] public function testCarbonIsMacroableWhenNotCalledDynamically() { Carbon::macro('easterDays', function ($year = 2019) { return easter_days($year); }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame(22, $now->easterDays(2020)); $this->assertSame(31, $now->easterDays()); Carbon::macro('otherParameterName', function ($other = true) { return $other; }); $this->assertTrue($now->otherParameterName()); } #[RequiresPhpExtension('calendar')] public function testCarbonIsMacroableWhenNotCalledDynamicallyUsingThis() { Carbon::macro('diffFromEaster', function ($year) { /** @var Carbon $date */ $date = $this; return $date->toDateTime()->diff( Carbon::create($year, 3, 21) ->setTimezone($date->getTimezone()) ->addDays(easter_days($year)) ->endOfDay(), ); }); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame(1020, $now->diffFromEaster(2020)->days); } #[RequiresPhpExtension('calendar')] public function testCarbonIsMacroableWhenCalledStatically() { Carbon::macro('easterDate', function ($year) { return Carbon::create($year, 3, 21)->addDays(easter_days($year)); }); $this->assertSame('05/04', Carbon::easterDate(2015)->format('d/m')); } public function testCarbonIsMacroableWithNonClosureCallables() { Carbon::macro('lower2', 'strtolower'); /** @var mixed $now */ $now = Carbon::now(); $this->assertSame('abc', $now->lower2('ABC')); $this->assertSame('abc', Carbon::lower2('ABC')); } public function testCarbonIsMixinable() { include_once __DIR__.'/Fixtures/Mixin.php'; $mixin = new Mixin(); Carbon::mixin($mixin); Carbon::setUserTimezone('America/Belize'); /** @var mixed $date */ $date = Carbon::parse('2000-01-01 12:00:00', 'UTC'); $this->assertSame('06:00 America/Belize', $date->userFormat('H:i e')); } public function testCarbonRaisesExceptionWhenStaticMacroIsNotFound() { $this->expectExceptionObject(new BadMethodCallException( 'Method Carbon\CarbonImmutable::nonExistingStaticMacro does not exist.', )); Carbon::nonExistingStaticMacro(); } public function testCarbonRaisesExceptionWhenMacroIsNotFound() { $this->expectExceptionObject(new BadMethodCallException( 'Method nonExistingMacro does not exist.', )); /** @var mixed $date */ $date = Carbon::now(); $date->nonExistingMacro(); } public function testTraitMixin() { Carbon::mixin(FooBar::class); Carbon::setTestNow('2019-07-19 00:00:00'); $this->assertSame('supergirl / Friday / immutable', Carbon::super('girl')); $this->assertSame('superboy / Thursday / immutable', Carbon::parse('2019-07-18')->super('boy')); $this->assertInstanceOf(Carbon::class, Carbon::me()); } public function testTraitWithNamedParameters() { require_once __DIR__.'/../Fixtures/CarbonTimezoneTrait.php'; Carbon::mixin(CarbonTimezoneTrait::class); $now = Carbon::now(); $now = eval("return \$now->toAppTz(tz: 'Europe/Paris');"); $this->assertSame('Europe/Paris', $now->format('e')); } public function testSerializationAfterTraitChaining() { require_once __DIR__.'/../Fixtures/CarbonTimezoneTrait.php'; Carbon::mixin(CarbonTimezoneTrait::class); Carbon::setTestNow('2023-05-24 14:49'); $date = Carbon::toAppTz(false, 'Europe/Paris'); $this->assertSame('2023-05-24 16:49 Europe/Paris', unserialize(serialize($date))->format('Y-m-d H:i e')); $date = Carbon::parse('2023-06-12 11:49')->toAppTz(false, 'Europe/Paris'); $this->assertSame('2023-06-12 13:49 Europe/Paris', unserialize(serialize($date))->format('Y-m-d H:i e')); } public function testSubClassMacro() { require_once __DIR__.'/../Fixtures/SubCarbonImmutable.php'; $subCarbon = new SubCarbonImmutable('2024-01-24 00:00'); SubCarbonImmutable::macro('diffInDecades', function (SubCarbonImmutable|string|null $dt = null, $abs = true) { return (int) ($this->diffInYears($dt, $abs) / 10); }); $this->assertSame(2, $subCarbon->diffInDecades(new SubCarbonImmutable('2049-01-24 00:00'))); $this->assertSame(2, $subCarbon->diffInDecades('2049-01-24 00:00')); SubCarbonImmutable::resetMacros(); } public function testLazyMixinMethodCall() { $test = new class() { public static array $calledMethods = []; public function __construct() { self::$calledMethods[] = __METHOD__; } public function __destruct() { self::$calledMethods[] = __METHOD__; } public static function noReturnType() { self::$calledMethods[] = __METHOD__; return static fn () => 'foo'; } public static function returnVoid(): void { self::$calledMethods[] = __METHOD__; } public static function returnArray(): array { self::$calledMethods[] = __METHOD__; return []; } public static function returnObject(): object { self::$calledMethods[] = __METHOD__; return (object) []; } public static function returnClosure(): Closure { self::$calledMethods[] = __METHOD__; return static fn () => 'foo'; } public static function returnMixed(): mixed { self::$calledMethods[] = __METHOD__; return static fn () => 'foo'; } public static function returnOtherBuiltIn(): bool { self::$calledMethods[] = __METHOD__; return true; } public static function returnUnion(): bool|array { self::$calledMethods[] = __METHOD__; return true; } public static function getCalledMethods(): array { return self::$calledMethods; } }; Carbon::mixin($test); Carbon::resetMacros(); $this->assertSame([ '__construct', // Only happening because of $test = new class()... but none from Carbon::mixin() 'noReturnType', 'returnArray', 'returnObject', 'returnClosure', 'returnMixed', 'returnUnion', ], array_map( static fn (string $name) => explode('::', $name, 2)[1], $test::getCalledMethods(), )); } } ================================================ FILE: tests/CarbonImmutable/ModifyNearDSTChangeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use Tests\AbstractTestCase; class ModifyNearDSTChangeTest extends AbstractTestCase { /** * Tests transition through DST change hour in non default timezone. */ #[Group('dst')] #[DataProvider('dataForTransitionTests')] public function testTransitionInNonDefaultTimezone(string $dateString, int $addHours, string $expected): void { date_default_timezone_set('Europe/london'); $date = Carbon::parse($dateString, 'America/New_York'); $date = $date->addHours($addHours); $this->assertSame($expected, $date->format('c')); } /** * Tests transition through DST change hour in default timezone. */ #[Group('dst')] #[DataProvider('dataForTransitionTests')] public function testTransitionInDefaultTimezone(string $dateString, int $addHours, string $expected): void { date_default_timezone_set('America/New_York'); $date = Carbon::parse($dateString, 'America/New_York'); $date = $date->addHours($addHours); $this->assertSame($expected, $date->format('c')); } public static function dataForTransitionTests(): Generator { // arguments: // - Date string to Carbon::parse in America/New_York. // - Hours to add // - Resulting string in 'c' format // testForwardTransition // When standard time was about to reach 2010-03-14T02:00:00-05:00 clocks were turned forward 1 hour to // 2010-03-14T03:00:00-04:00 local daylight time instead yield [ '2010-03-14T00:00:00', 24, '2010-03-15T01:00:00-04:00', ]; // testBackwardTransition // When local daylight time was about to reach 2010-11-07T02:00:00-04:00 clocks were turned backward 1 hour // to 2010-11-07T01:00:00-05:00 local standard time instead yield ['2010-11-07T00:00:00', 24, '2010-11-07T23:00:00-05:00']; } } ================================================ FILE: tests/CarbonImmutable/ModifyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class ModifyTest extends AbstractTestCase { public function testSimpleModify() { $a = new Carbon('2014-03-30 00:00:00'); $b = $a->addHours(24); $this->assertSame(24.0, $a->diffInHours($b)); } public function testSimpleModifyWithNamedParameter() { $a = new Carbon('2014-03-30 00:00:00'); $b = $a->addHours(value: 24); $this->assertSame(24.0, $a->diffInHours($b)); } public function testTimezoneModify() { $php81Fix = 1.0; // For daylight saving time reason 2014-03-30 0h59 is immediately followed by 2h00 $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addHours(24); $this->assertSame(23.0 + $php81Fix, $a->diffInHours($b)); $this->assertSame(23.0 + $php81Fix, $b->diffInHours($a, true)); $this->assertSame(-23.0 - $php81Fix, $b->diffInHours($a)); $this->assertSame(-(23.0 + $php81Fix) * 60, $b->diffInMinutes($a)); $this->assertSame(-(23.0 + $php81Fix) * 60 * 60, $b->diffInSeconds($a)); $this->assertSame(-(23.0 + $php81Fix) * 60 * 60 * 1000, $b->diffInMilliseconds($a)); $this->assertSame(-(23.0 + $php81Fix) * 60 * 60 * 1000000, $b->diffInMicroseconds($a)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealHours(24); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $b = $b->subRealHours(24); $this->assertSame(0.0, $b->diffInHours($a, false)); $this->assertSame(0.0, $b->diffInHours($a, false)); $a = new Carbon('2014-03-30 00:59:00', 'Europe/London'); $a = $a->addRealHour(); $this->assertSame('02:59', $a->format('H:i')); $a = $a->subRealHour(); $this->assertSame('00:59', $a->format('H:i')); $a = new Carbon('2014-03-30 00:59:00', 'Europe/London'); $a = $a->addRealMinutes(2); $this->assertSame('02:01', $a->format('H:i')); $a = $a->subRealMinutes(2); $this->assertSame('00:59', $a->format('H:i')); $a = new Carbon('2014-03-30 00:59:30', 'Europe/London'); $a = $a->addRealMinute(); $this->assertSame('02:00:30', $a->format('H:i:s')); $a = $a->subRealMinute(); $this->assertSame('00:59:30', $a->format('H:i:s')); $a = new Carbon('2014-03-30 00:59:30', 'Europe/London'); $a = $a->addRealSeconds(40); $this->assertSame('02:00:10', $a->format('H:i:s')); $a = $a->subRealSeconds(40); $this->assertSame('00:59:30', $a->format('H:i:s')); $a = new Carbon('2014-03-30 00:59:59', 'Europe/London'); $a = $a->addRealSecond(); $this->assertSame('02:00:00', $a->format('H:i:s')); $a = $a->subRealSecond(); $this->assertSame('00:59:59', $a->format('H:i:s')); $a = new Carbon('2014-03-30 00:59:59.990000', 'Europe/London'); $a = $a->addRealMilliseconds(20); $this->assertSame('02:00:00.010000', $a->format('H:i:s.u')); $a = $a->subRealMilliseconds(20); $this->assertSame('00:59:59.990000', $a->format('H:i:s.u')); $a = new Carbon('2014-03-30 00:59:59.999990', 'Europe/London'); $a = $a->addRealMicroseconds(20); $this->assertSame('02:00:00.000010', $a->format('H:i:s.u')); $a = $a->subRealMicroseconds(20); $this->assertSame('00:59:59.999990', $a->format('H:i:s.u')); $a = new Carbon('2014-03-30 00:59:59.999999', 'Europe/London'); $a = $a->addRealMicrosecond(); $this->assertSame('02:00:00.000000', $a->format('H:i:s.u')); $a = $a->subRealMicrosecond(); $this->assertSame('00:59:59.999999', $a->format('H:i:s.u')); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealDay(); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealWeeks(1 / 7); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealMonths(1 / 30); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealQuarters(1 / 90); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealYears(1 / 365); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealDecades(1 / 3650); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealCenturies(1 / 36500); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); $a = new Carbon('2014-03-30 00:00:00', 'Europe/London'); $b = $a->addRealMillennia(1 / 365000); $this->assertSame(-24.0, $b->diffInHours($a, false)); $this->assertSame(-24.0 * 60, $b->diffInMinutes($a, false)); $this->assertSame(-24.0 * 60 * 60, $b->diffInSeconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000, $b->diffInMilliseconds($a, false)); $this->assertSame(-24.0 * 60 * 60 * 1000000, $b->diffInMicroseconds($a, false)); } public function testNextAndPrevious() { Carbon::setTestNow('2019-06-02 13:27:09.816752'); $this->assertSame('2019-06-02 14:00:00', Carbon::now()->next('2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::now()->previous('2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 14:00:00', Carbon::now()->next('14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::now()->previous('14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-03 09:00:00', Carbon::now()->next('9am')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 09:00:00', Carbon::now()->previous('9am')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 14:00:00', Carbon::parse('next 2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::parse('previous 2pm')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 14:00:00', Carbon::parse('next 14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-01 14:00:00', Carbon::parse('previous 14h')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-03 09:00:00', Carbon::parse('next 9am')->format('Y-m-d H:i:s')); $this->assertSame('2019-06-02 09:00:00', Carbon::parse('previous 9am')->format('Y-m-d H:i:s')); } } ================================================ FILE: tests/CarbonImmutable/NowAndOtherStaticHelpersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTime; use DateTimeZone; use Tests\AbstractTestCase; class NowAndOtherStaticHelpersTest extends AbstractTestCase { public function testNow() { $dt = Carbon::now(); $this->assertSame($this->immutableNow->getTimestamp(), $dt->timestamp); Carbon::setTestNow(); $before = $this->getTimestamp(); $dt = Carbon::now(); $after = $this->getTimestamp(); $this->assertGreaterThanOrEqual($before, $dt->timestamp); $this->assertLessThanOrEqual($after, $dt->timestamp); } public function testGetPreciseTimestamp() { $dt = Carbon::parse('2018-01-06 12:34:10.987126'); $this->assertSame(1515260.0, $dt->getPreciseTimestamp(-3)); $this->assertSame(151526005.0, $dt->getPreciseTimestamp(-1)); $this->assertSame(1515260051.0, $dt->getPreciseTimestamp(0)); $this->assertSame(15152600510.0, $dt->getPreciseTimestamp(1)); $this->assertSame(151526005099.0, $dt->getPreciseTimestamp(2)); $this->assertSame(1515260050987.0, $dt->valueOf()); $this->assertSame(15152600509871.0, $dt->getPreciseTimestamp(4)); $this->assertSame(151526005098713.0, $dt->getPreciseTimestamp(5)); $this->assertSame(1515260050987126.0, $dt->getPreciseTimestamp(6)); $this->assertSame(151526005098712600.0, $dt->getPreciseTimestamp(8)); $this->assertSame(1515260050987126000.0, $dt->getPreciseTimestamp(9)); } public function testGetTimestampMs() { $dt = Carbon::parse('2018-01-06 12:34:10.987126'); $this->assertSame(1515260050987, $dt->getTimestampMs()); } public function testNowWithTimezone() { $dt = Carbon::now('Europe/London'); $this->assertSame($this->immutableNow->getTimestamp(), $dt->timestamp); Carbon::setTestNow(); $before = $this->getTimestamp(); $dt = Carbon::now('Europe/London'); $after = $this->getTimestamp(); $this->assertGreaterThanOrEqual($before, $dt->timestamp); $this->assertLessThanOrEqual($after, $dt->timestamp); $this->assertSame('Europe/London', $dt->tzName); } public function testToday() { $dt = Carbon::today(); $this->assertSame(date('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testTodayWithTimezone() { $dt = Carbon::today('Europe/London'); $dt2 = new DateTime('now', new DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testTomorrow() { $dt = Carbon::tomorrow(); $dt2 = new DateTime('tomorrow'); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testTomorrowWithTimezone() { $dt = Carbon::tomorrow('Europe/London'); $dt2 = new DateTime('tomorrow', new DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testYesterday() { $dt = Carbon::yesterday(); $dt2 = new DateTime('yesterday'); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } public function testYesterdayWithTimezone() { $dt = Carbon::yesterday('Europe/London'); $dt2 = new DateTime('yesterday', new DateTimeZone('Europe/London')); $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); } } ================================================ FILE: tests/CarbonImmutable/NowDerivativesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class NowDerivativesTest extends AbstractTestCase { public function testNowWithSameTimezone() { $dt = Carbon::now('Europe/London'); $dt2 = $dt->nowWithSameTz(); $this->assertSame($dt2->toDateTimeString(), $dt->toDateTimeString()); $this->assertSame($dt2->tzName, $dt->tzName); Carbon::setTestNow(new Carbon('2017-07-29T07:57:27.123456Z')); $dt = Carbon::createFromTime(13, 40, 00, 'Africa/Asmara'); $dt2 = $dt->nowWithSameTz(); Carbon::setTestNow(); $this->assertSame($dt->format('H:i'), '13:40'); $this->assertSame($dt2->format('H:i'), '10:57'); $this->assertSame($dt2->tzName, $dt->tzName); } } ================================================ FILE: tests/CarbonImmutable/ObjectsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use DateTime; use DateTimeImmutable; use stdClass; use Tests\AbstractTestCase; class ObjectsTest extends AbstractTestCase { public function testToObject() { $dt = Carbon::now(); $dtToObject = $dt->toObject(); $this->assertInstanceOf(stdClass::class, $dtToObject); $this->assertObjectHasProperty('year', $dtToObject); $this->assertSame($dt->year, $dtToObject->year); $this->assertObjectHasProperty('month', $dtToObject); $this->assertSame($dt->month, $dtToObject->month); $this->assertObjectHasProperty('day', $dtToObject); $this->assertSame($dt->day, $dtToObject->day); $this->assertObjectHasProperty('dayOfWeek', $dtToObject); $this->assertSame($dt->dayOfWeek, $dtToObject->dayOfWeek); $this->assertObjectHasProperty('dayOfYear', $dtToObject); $this->assertSame($dt->dayOfYear, $dtToObject->dayOfYear); $this->assertObjectHasProperty('hour', $dtToObject); $this->assertSame($dt->hour, $dtToObject->hour); $this->assertObjectHasProperty('minute', $dtToObject); $this->assertSame($dt->minute, $dtToObject->minute); $this->assertObjectHasProperty('second', $dtToObject); $this->assertSame($dt->second, $dtToObject->second); $this->assertObjectHasProperty('micro', $dtToObject); $this->assertSame($dt->micro, $dtToObject->micro); $this->assertObjectHasProperty('timestamp', $dtToObject); $this->assertSame($dt->timestamp, $dtToObject->timestamp); $this->assertObjectHasProperty('timezone', $dtToObject); $this->assertEquals($dt->timezone, $dtToObject->timezone); $this->assertObjectHasProperty('formatted', $dtToObject); $this->assertSame($dt->format(Carbon::DEFAULT_TO_STRING_FORMAT), $dtToObject->formatted); } public function testToDateTime() { $dt = Carbon::create(2000, 3, 26); $date = $dt->toDateTime(); $this->assertInstanceOf(DateTime::class, $date); $this->assertSame('2000-03-26', $date->format('Y-m-d')); $date = $dt->toDate(); $this->assertInstanceOf(DateTime::class, $date); $this->assertSame('2000-03-26', $date->format('Y-m-d')); } public function testToDateTimeImmutable() { $dt = Carbon::create(2000, 3, 26); $date = $dt->toDateTimeImmutable(); $this->assertInstanceOf(DateTimeImmutable::class, $date); $this->assertSame('2000-03-26', $date->format('Y-m-d')); } } ================================================ FILE: tests/CarbonImmutable/PhpBug72338Test.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; /** * The problem is, that $date->setTimezone($tz) with $tz in 'HH:MM' notation (["timezone_type"]=>int(1)) put DateTime object * on inconsistent state. It looks like internal timestamp becomes changed and it affects to such functions: * * * $date->modify() uses changed timestamp and result is wrong * * * $date->setTimezone($tz) settle this changed timestamp, even in case if $tz is not in 'HH:MM' format * * * $date->format('U') returns changed timestamp * * @link https://bugs.php.net/bug.php?id=72338 This bug on bugs.php.net * * @internal I use days changing in tests because using seconds|minute|hours may run setTimezone within. */ class PhpBug72338Test extends AbstractTestCase { /** * Ensures that modify don't use changed timestamp */ public function testModify() { $date = Carbon::createFromTimestamp(0)->setTimezone('+02:00')->modify('+1 day'); $this->assertSame('86400', $date->format('U')); } /** * Ensures that $date->format('U') returns unchanged timestamp */ public function testTimestamp() { $date = Carbon::createFromTimestamp(0)->setTimezone('+02:00'); $this->assertSame('0', $date->format('U')); } /** * Ensures that date created from string with timezone and with same timezone set by setTimezone() is equal */ public function testEqualSetAndCreate() { $date = Carbon::createFromTimestamp(0)->setTimezone('+02:00'); $date1 = new Carbon('1970-01-01T02:00:00+02:00'); $this->assertSame($date->format('U'), $date1->format('U')); } /** * Ensures that second call to setTimezone() don't changing timestamp */ public function testSecondSetTimezone() { $date = Carbon::createFromTimestamp(0)->setTimezone('+02:00')->setTimezone('Europe/Moscow'); $this->assertSame('0', $date->format('U')); } } ================================================ FILE: tests/CarbonImmutable/RelativeDateStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class RelativeDateStringTest extends AbstractTestCase { public $scenarios = [ // ensure regular timestamps are flagged as relative '2018-01-02 03:04:05' => ['date' => '2018-01-02', 'is_relative' => false], '1500-01-02 12:00:00' => ['date' => '1500-01-02', 'is_relative' => false], '1985-12-10' => ['date' => '1985-12-10', 'is_relative' => false], 'Dec 2017' => ['date' => '2017-12-01', 'is_relative' => false], '25-Dec-2017' => ['date' => '2017-12-25', 'is_relative' => false], '25 December 2017' => ['date' => '2017-12-25', 'is_relative' => false], '25 Dec 2017' => ['date' => '2017-12-25', 'is_relative' => false], 'Dec 25 2017' => ['date' => '2017-12-25', 'is_relative' => false], // dates not relative now 'first day of January 2008' => ['date' => '2008-01-01', 'is_relative' => false], 'first day of January 1999' => ['date' => '1999-01-01', 'is_relative' => false], 'last day of January 1999' => ['date' => '1999-01-31', 'is_relative' => false], 'last monday of January 1999' => ['date' => '1999-01-25', 'is_relative' => false], 'first day of January 0001' => ['date' => '0001-01-01', 'is_relative' => false], 'monday december 1750' => ['date' => '1750-12-07', 'is_relative' => false], 'december 1750' => ['date' => '1750-12-01', 'is_relative' => false], 'last sunday of January 2005' => ['date' => '2005-01-30', 'is_relative' => false], 'January 2008' => ['date' => '2008-01-01', 'is_relative' => false], // dates relative to now 'first day of next month' => ['date' => '2017-02-01', 'is_relative' => true], 'sunday noon' => ['date' => '2017-01-01', 'is_relative' => true], 'sunday midnight' => ['date' => '2017-01-01', 'is_relative' => true], 'monday december' => ['date' => '2017-12-04', 'is_relative' => true], 'next saturday' => ['date' => '2017-01-07', 'is_relative' => true], 'april' => ['date' => '2017-04-01', 'is_relative' => true], ]; public function testKeywordMatching() { foreach ($this->scenarios as $string => $expected) { $actual = Carbon::hasRelativeKeywords($string); $this->assertSame( $expected['is_relative'], $actual, "Failed relative keyword matching for scenario: {$string} (expected: {$expected['is_relative']})", ); } } public function testRelativeInputStrings() { Carbon::setTestNow('2017-01-01 12:00:00'); foreach ($this->scenarios as $string => $expected) { $actual = Carbon::parse($string)->format('Y-m-d'); $this->assertSame( $expected['date'], $actual, "Failed relative date scenario: {$string}", ); } } } ================================================ FILE: tests/CarbonImmutable/RelativeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class RelativeTest extends AbstractTestCase { public function testSecondsSinceMidnight() { $d = Carbon::today()->addSeconds(30); $this->assertSame(30.0, $d->secondsSinceMidnight()); $d = Carbon::today()->addDays(1); $this->assertSame(0.0, $d->secondsSinceMidnight()); $d = Carbon::today()->addDays(1)->addSeconds(120); $this->assertSame(120.0, $d->secondsSinceMidnight()); $d = Carbon::today()->addMonths(3)->addSeconds(42); $this->assertSame(42.0, $d->secondsSinceMidnight()); } public function testSecondsUntilEndOfDay() { $d = Carbon::today()->endOfDay(); $this->assertSame(0.0, $d->secondsUntilEndOfDay()); $d = Carbon::today()->endOfDay()->subSeconds(60); $this->assertSame(60.0, $d->secondsUntilEndOfDay()); $d = Carbon::create(2014, 10, 24, 12, 34, 56); $this->assertVeryClose(41103.999999, $d->secondsUntilEndOfDay()); $d = Carbon::create(2014, 10, 24, 0, 0, 0); $this->assertVeryClose(86399.99999899999, $d->secondsUntilEndOfDay()); } } ================================================ FILE: tests/CarbonImmutable/RoundTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use InvalidArgumentException; use Tests\AbstractTestCase; class RoundTest extends AbstractTestCase { public function testRoundWithDefaultUnit() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->round(); $this->assertNotEquals($ref, $copy); $this->assertNotSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->round(5), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->floor()->round(5), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->round(3), 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->round(4), 2315, 7, 18, 22, 42, 16, 0); $this->assertCarbon($dt->copy()->round(10), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->round(0.5), 2315, 7, 18, 22, 42, 17, 500000); $this->assertCarbon($dt->copy()->round(0.25), 2315, 7, 18, 22, 42, 17, 750000); $this->assertCarbon($dt->copy()->round(3.8), 2315, 7, 18, 22, 42, 19, 800000); $this->assertCarbon($dt->copy()->floor(5), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->floor()->floor(5), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->floor(3), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->floor(4), 2315, 7, 18, 22, 42, 16, 0); $this->assertCarbon($dt->copy()->floor(10), 2315, 7, 18, 22, 42, 10, 0); $this->assertCarbon($dt->copy()->floor(0.5), 2315, 7, 18, 22, 42, 17, 500000); $this->assertCarbon($dt->copy()->floor(0.25), 2315, 7, 18, 22, 42, 17, 500000); $this->assertCarbon($dt->copy()->floor(3.8), 2315, 7, 18, 22, 42, 15, 0); $this->assertCarbon($dt->copy()->ceil(5), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->floor()->ceil(5), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->ceil(3), 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->ceil(4), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->ceil(10), 2315, 7, 18, 22, 42, 20, 0); $this->assertCarbon($dt->copy()->ceil(0.5), 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->ceil(0.25), 2315, 7, 18, 22, 42, 17, 750000); $this->assertCarbon($dt->copy()->ceil(3.8), 2315, 7, 18, 22, 42, 19, 800000); } public function testRoundWithBaseUnit() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->roundSecond(); $this->assertNotEquals($ref, $copy); $this->assertNotSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->roundDay(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundDay(5), 2315, 7, 21, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilDay(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorDay(), 2315, 7, 18, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundYear(), 2316, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->subMonths(2)->roundYear(), 2315, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundYear(2), 2315, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorYear(2), 2315, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilYear(2), 2317, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundMonth(), 2315, 8, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorMonth(), 2315, 7, 1, 0, 0, 0, 0); } public function testRoundWithMetaUnit() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->roundSecond(); $this->assertNotEquals($ref, $copy); $this->assertNotSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->roundMillisecond(), 2315, 7, 18, 22, 42, 17, 644000); $this->assertCarbon($dt->copy()->roundMillennium(), 2001, 1, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundQuarter(), 2315, 7, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundQuarters(2), 2315, 7, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->subMonth()->floorQuarter(), 2315, 4, 1, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->subMonth()->floorQuarters(2), 2315, 1, 1, 0, 0, 0, 0); } public function testRoundWeek() { $dt = Carbon::create(2315, 7, 18, 22, 42, 17.643971); $copy = $dt->copy(); $ref = $copy->roundSecond(); $this->assertNotEquals($ref, $copy); $this->assertNotSame($ref, $copy); $this->assertCarbon($ref, 2315, 7, 18, 22, 42, 18, 0); $this->assertCarbon($dt->copy()->floorWeek(), 2315, 7, 12, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilWeek(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundWeek(), 2315, 7, 19, 0, 0, 0, 0); $dt = Carbon::create(2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->floorWeek(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->ceilWeek(), 2315, 7, 19, 0, 0, 0, 0); $this->assertCarbon($dt->copy()->roundWeek(), 2315, 7, 19, 0, 0, 0, 0); } public function testCeilMonth() { $this->assertCarbon(Carbon::parse('2021-01-29')->ceilMonth(), 2021, 2, 1, 0, 0, 0); $this->assertCarbon(Carbon::parse('2021-01-31')->ceilMonth(), 2021, 2, 1, 0, 0, 0); $this->assertCarbon(Carbon::parse('2021-12-17')->ceilMonth(), 2022, 1, 1, 0, 0, 0); } public function testFloorMonth() { $this->assertCarbon(Carbon::parse('2021-05-31')->floorMonth(3), 2021, 4, 1, 0, 0, 0); } public function testRoundInvalidArgument() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'foobar\'.', )); Carbon::now()->roundUnit('foobar'); } } ================================================ FILE: tests/CarbonImmutable/SerializationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonTimeZone; use DateTimeImmutable; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use ReflectionClass; use ReflectionObject; use ReflectionProperty; use Tests\AbstractTestCase; use Throwable; class SerializationTest extends AbstractTestCase { protected string $serialized; protected function setUp(): void { parent::setUp(); $this->serialized = \extension_loaded('msgpack') ? 'O:22:"Carbon\CarbonImmutable":4:{s:4:"date";s:26:"2016-02-01 13:20:25.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";s:18:"dumpDateProperties";a:2:{s:4:"date";s:26:"2016-02-01 13:20:25.000000";s:8:"timezone";s:15:"America/Toronto";}}' : 'O:22:"Carbon\CarbonImmutable":3:{s:4:"date";s:26:"2016-02-01 13:20:25.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}'; } protected function cleanSerialization(string $serialization): string { return preg_replace('/s:\d+:"[^"]*dumpDateProperties"/', 's:18:"dumpDateProperties"', $serialization); } public function testSerialize() { $dt = Carbon::create(2016, 2, 1, 13, 20, 25); $this->assertSame($this->serialized, $this->cleanSerialization($dt->serialize())); $this->assertSame($this->serialized, $this->cleanSerialization(serialize($dt))); } public function testFromUnserialized() { $dt = Carbon::fromSerialized($this->serialized); $this->assertCarbon($dt, 2016, 2, 1, 13, 20, 25); $timezone = $dt->getTimezone(); $this->assertSame(CarbonTimeZone::class, $timezone::class); $this->assertSame('America/Toronto', $timezone->getName()); $dt = unserialize($this->serialized); $timezone = $dt->getTimezone(); $this->assertCarbon($dt, 2016, 2, 1, 13, 20, 25); $this->assertSame(CarbonTimeZone::class, $timezone::class); $this->assertSame('America/Toronto', $timezone->getName()); } public function testSerialization() { $this->assertEquals(Carbon::now(), unserialize(serialize(Carbon::now()))); } public static function dataForTestFromUnserializedWithInvalidValue() { return [ [null], [true], [false], [123], ['foobar'], ]; } #[DataProvider('dataForTestFromUnserializedWithInvalidValue')] public function testFromUnserializedWithInvalidValue(mixed $value) { $this->expectExceptionObject(new InvalidArgumentException( "Invalid serialized value: $value", )); Carbon::fromSerialized($value); } public function testDateSerializationReflectionCompatibility() { $tz = $this->firstValidTimezoneAmong(['America/Los_Angeles', 'US/Pacific'])->getName(); try { $reflection = (new ReflectionClass(DateTimeImmutable::class))->newInstanceWithoutConstructor(); @$reflection->date = '1990-01-17 10:28:07'; @$reflection->timezone_type = 3; @$reflection->timezone = $tz; $date = unserialize(serialize($reflection)); } catch (Throwable $exception) { $this->markTestSkipped( "It fails on DateTime so Carbon can't support it, error was:\n".$exception->getMessage() ); } $this->assertSame('1990-01-17 10:28:07', $date->format('Y-m-d h:i:s')); $reflection = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); @$reflection->date = '1990-01-17 10:28:07'; @$reflection->timezone_type = 3; @$reflection->timezone = $tz; $date = unserialize(serialize($reflection)); $this->assertSame('1990-01-17 10:28:07', $date->format('Y-m-d h:i:s')); $reflection = new ReflectionObject(Carbon::parse('1990-01-17 10:28:07')); $target = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); /** @var ReflectionProperty[] $properties */ $properties = []; foreach ($reflection->getProperties() as $property) { $properties[$property->getName()] = $property; } $setValue = function ($key, $value) use (&$properties, &$target) { if (isset($properties[$key])) { $properties[$key]->setValue($target, $value); return; } @$target->$key = $value; }; $setValue('date', '1990-01-17 10:28:07'); $setValue('timezone_type', 3); $setValue('timezone', $tz); $date = unserialize(serialize($target)); $this->assertSame('1990-01-17 10:28:07', $date->format('Y-m-d h:i:s')); } #[RequiresPhpExtension('msgpack')] public function testMsgPackExtension(): void { $string = '2018-06-01 21:25:13.321654 Europe/Vilnius'; $date = Carbon::parse('2018-06-01 21:25:13.321654 Europe/Vilnius'); $message = @msgpack_pack($date); $copy = msgpack_unpack($message); $this->assertSame($string, $copy->format('Y-m-d H:i:s.u e')); } public function testSerializeRawMethod(): void { $date = Carbon::parse('2018-06-01 21:25:13.321654 Europe/Vilnius'); $expected = [ 'date' => '2018-06-01 21:25:13.321654', 'timezone_type' => 3, 'timezone' => 'Europe/Vilnius', ]; if (\extension_loaded('msgpack')) { $expected['dumpDateProperties'] = [ 'date' => $date->format('Y-m-d H:i:s.u'), 'timezone' => $date->tzName, ]; } $this->assertSame($expected, $date->__serialize()); $date->locale('lt_LT'); $expected['dumpLocale'] = 'lt_LT'; $this->assertSame($expected, $date->__serialize()); } public function testNewInstanceWithoutConstructor(): void { $tz = $this->firstValidTimezoneAmong(['America/Los_Angeles', 'US/Pacific'])->getName(); /** @var Carbon $date */ $date = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); @$date->date = '1990-01-17 10:28:07'; @$date->timezone_type = 3; @$date->timezone = $tz; @$date->dumpLocale = 'es'; @$date->constructedObjectId = spl_object_hash($this); $date->__construct('1990-01-17 10:28:07', $tz); $date->locale('es'); $this->assertSame('1990-01-17 10:28:07 '.$tz, $date->format('Y-m-d H:i:s e')); $this->assertSame('es', $date->locale); } public function testUnserializeRawMethod(): void { /** @var Carbon $date */ $date = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); $date->__unserialize([ 'date' => '2018-06-01 21:25:13.321654', 'timezone_type' => 3, 'timezone' => 'Europe/Vilnius', ]); $this->assertSame('2018-06-01 21:25:13.321654 Europe/Vilnius', $date->format('Y-m-d H:i:s.u e')); $this->assertSame('en', $date->locale); /** @var Carbon $date */ $date = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); $date->__unserialize([ 'date' => '2018-06-01 21:25:13.321654', 'timezone_type' => 3, 'timezone' => 'Europe/Vilnius', 'dumpLocale' => 'lt_LT', ]); $this->assertSame('2018-06-01 21:25:13.321654 Europe/Vilnius', $date->format('Y-m-d H:i:s.u e')); $this->assertSame('lt_LT', $date->locale); } } ================================================ FILE: tests/CarbonImmutable/SetDateAndTimeFromTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class SetDateAndTimeFromTest extends AbstractTestCase { public function testSetDateFrom() { $this->assertCarbon( Carbon::create(2001, 1, 1, 1, 1, 1) ->setDateFrom(Carbon::create(2002, 2, 2, 2, 2, 2)), 2002, 2, 2, 1, 1, 1, ); } public function testSetTimeFrom() { $this->assertCarbon( Carbon::create(2001, 1, 1, 1, 1, 1) ->setTimeFrom(Carbon::create(2002, 2, 2, 2, 2, 2)), 2001, 1, 1, 2, 2, 2, ); } } ================================================ FILE: tests/CarbonImmutable/SetStateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\Traits\Serialization; use stdClass; use Tests\AbstractTestCase; class SetStateTest extends AbstractTestCase { public function testSteState(): void { $obj = new class(null) { use Serialization; public function __construct(public mixed $data) { } public static function instance($value): static { return new static($value); } public function callSetState($value) { return static::__set_state($value); } }; $data = $obj->callSetState(['foo' => 'bar']); $this->assertInstanceOf(\get_class($obj), $data); $this->assertInstanceOf(stdClass::class, $data->data); $this->assertSame('bar', $data->data->foo); $this->assertSame(['foo' => 'bar'], (array) $data->data); } } ================================================ FILE: tests/CarbonImmutable/SettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\Exceptions\UnitException; use Carbon\Month; use DateTimeZone; use InvalidArgumentException; use PHPUnit\Framework\Attributes\TestWith; use RuntimeException; use Tests\AbstractTestCase; class SettersTest extends AbstractTestCase { public function testYearSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->year = 1995; } public function testMonthSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->month = 3; } public function testMonthEnumOnWrongUnit() { $this->expectExceptionObject(new UnitException( 'Month enum cannot be used to set hour', )); $d = Carbon::now(); $d->setHours(Month::February); } public function testMonthEnum() { $d = Carbon::parse('2023-10-25 21:14:51'); $result = $d->setMonth(Month::February); $this->assertSame('2023-02-25 21:14:51', $result->format('Y-m-d H:i:s')); $result = $d->setMonth(Month::July); $this->assertSame('2023-07-25 21:14:51', $result->format('Y-m-d H:i:s')); } public function testMonthFloatFailWithDecimalPart() { $this->expectExceptionObject(new InvalidArgumentException( 'month cannot be changed to float value 2.5, integer expected', )); $d = Carbon::parse('2023-10-25 21:14:51'); $d->setMonth(2.5); } public function testMonthFloatPassWithZeroDecimalPart() { $d = Carbon::parse('2023-10-25 21:14:51'); $result = $d->setMonth(2.0); $this->assertSame('2023-02-25 21:14:51', $result->format('Y-m-d H:i:s')); } public function testMonthSetterWithWrap() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->month = 13; } public function testDaySetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->day = 2; } public function testDaySetterWithWrap() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::createFromDate(2012, 8, 5); $d->day = 32; } public function testHourSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->hour = 2; } public function testHourSetterWithWrap() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->hour = 25; } public function testMinuteSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->minute = 2; } public function testMinuteSetterWithWrap() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->minute = 65; } public function testSecondSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->second = 2; } public function testTimeSetter() { $d = Carbon::now(); $d = $d->setTime(1, 1, 1); $this->assertSame(1, $d->second); $d = $d->setTime(1, 1); $this->assertSame(0, $d->second); } public function testTimeSetterWithChaining() { $d = Carbon::now(); $d = $d->setTime(2, 2, 2)->setTime(1, 1, 1); $this->assertInstanceOfCarbon($d); $this->assertSame(1, $d->second); $d = $d->setTime(2, 2, 2)->setTime(1, 1); $this->assertInstanceOfCarbon($d); $this->assertSame(0, $d->second); } public function testTimeSetterWithZero() { $d = Carbon::now(); $d = $d->setTime(1, 1); $this->assertSame(0, $d->second); } public function testDateTimeSetter() { $d = Carbon::now(); $d = $d->setDateTime($d->year, $d->month, $d->day, 1, 1, 1); $this->assertSame(1, $d->second); } public function testDateTimeSetterWithZero() { $d = Carbon::now(); $d = $d->setDateTime($d->year, $d->month, $d->day, 1, 1); $this->assertSame(0, $d->second); } public function testDateTimeSetterWithChaining() { $d = Carbon::now(); $d = $d->setDateTime(2013, 9, 24, 17, 4, 29); $this->assertInstanceOfCarbon($d); $d = $d->setDateTime(2014, 10, 25, 18, 5, 30); $this->assertInstanceOfCarbon($d); $this->assertCarbon($d, 2014, 10, 25, 18, 5, 30); } /** * @link https://github.com/briannesbitt/Carbon/issues/539 */ public function testSetDateAfterStringCreation() { $d = new Carbon('first day of this month'); $this->assertSame(1, $d->day); $d = $d->setDate($d->year, $d->month, 12); $this->assertSame(12, $d->day); } public function testSecondSetterWithWrap() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->second = 65; } public function testTimestampSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); $d = Carbon::now(); $d->timestamp = 10; } public function testSetTimezoneWithInvalidTimezone() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); $d = Carbon::now(); $d->setTimezone('sdf'); } public function testTimezoneWithInvalidTimezone() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->timezone = 'sdf'; } public function testTimezoneWithInvalidTimezoneSetter() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); $d = Carbon::now(); $d->timezone('sdf'); } public function testTzWithInvalidTimezone() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->tz = 'sdf'; } public function testTzWithInvalidTimezoneSetter() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown or bad timezone (sdf)', )); $d = Carbon::now(); $d->tz('sdf'); } public function testSetTimezoneUsingString() { $d = Carbon::now(); $d = $d->setTimezone('America/Toronto'); $this->assertSame('America/Toronto', $d->tzName); } public function testShiftTimezone() { $d = Carbon::parse('2018-08-13 10:53:12', 'Europe/Paris'); $d2 = $d->copy()->setTimezone('America/Toronto'); $this->assertSame(0, $d2->getTimestamp() - $d->getTimestamp()); $this->assertSame('04:53:12', $d2->format('H:i:s')); $d = Carbon::parse('2018-08-13 10:53:12', 'Europe/Paris'); $d2 = $d->copy()->shiftTimezone('America/Toronto'); $this->assertSame(21600, $d2->getTimestamp() - $d->getTimestamp()); $this->assertSame('America/Toronto', $d2->tzName); $this->assertSame('10:53:12', $d2->format('H:i:s')); $d = Carbon::parse('2018-03-25 00:53:12.321654 America/Toronto')->shiftTimezone('Europe/Oslo'); $this->assertSame('2018-03-25 00:53:12.321654 Europe/Oslo', $d->format('Y-m-d H:i:s.u e')); } public function testTimezoneUsingString() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->timezone = 'America/Toronto'; } public function testTzUsingString() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->tz = 'America/Toronto'; } public function testSetTimezoneUsingDateTimeZone() { $d = Carbon::now(); $d = $d->setTimezone(new DateTimeZone('America/Toronto')); $this->assertSame('America/Toronto', $d->tzName); } public function testTimezoneUsingDateTimeZone() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->timezone = new DateTimeZone('America/Toronto'); } public function testTzUsingDateTimeZone() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->tz = new DateTimeZone('America/Toronto'); } public function testInvalidSetter() { $this->expectExceptionObject(new RuntimeException( 'Carbon\CarbonImmutable class is immutable.', )); /** @var mixed $d */ $d = Carbon::now(); $d->doesNotExit = 'bb'; } #[TestWith([9, 15, 30, '09:15:30'])] #[TestWith([9, 15, 0, '09:15'])] #[TestWith([9, 0, 0, '09'])] #[TestWith([9, 5, 3, '9:5:3'])] #[TestWith([9, 5, 0, '9:5'])] #[TestWith([9, 0, 0, '9'])] public function testSetTimeFromTimeString(int $hour, int $minute, int $second, string $time) { Carbon::setTestNow(Carbon::create(2016, 2, 12, 1, 2, 3)); $d = Carbon::now()->setTimeFromTimeString($time); $this->assertCarbon($d, 2016, 2, 12, $hour, $minute, $second); } public function testWeekendDaysSetter() { $weekendDays = [Carbon::FRIDAY, Carbon::SATURDAY]; $d = Carbon::now(); $d->setWeekendDays($weekendDays); $this->assertSame($weekendDays, $d->getWeekendDays()); Carbon::setWeekendDays([Carbon::SATURDAY, Carbon::SUNDAY]); } public function testMidDayAtSetter() { $d = Carbon::now(); $d->setMidDayAt(11); $this->assertSame(11, $d->getMidDayAt()); $d->setMidDayAt(12); $this->assertSame(12, $d->getMidDayAt()); } public function testSetter() { $d = Carbon::now(); $d->setMidDayAt(11); $this->assertSame(11, $d->getMidDayAt()); $d->setMidDayAt(12); $this->assertSame(12, $d->getMidDayAt()); } public function testSetUnitNoOverflowFebruary() { $d = Carbon::parse('2024-02-29')->setUnitNoOverFlow('day', 31, 'month'); $this->assertInstanceOf(Carbon::class, $d); $this->assertSame('2024-02-29 23:59:59.999999', $d->format('Y-m-d H:i:s.u')); } } ================================================ FILE: tests/CarbonImmutable/SettingsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Tests\AbstractTestCase; class SettingsTest extends AbstractTestCase { public function testSettings() { $paris = Carbon::parse('2018-01-31 00:00:00')->settings([ 'timezone' => 'Europe/Paris', 'locale' => 'fr_FR', 'monthOverflow' => true, 'yearOverflow' => true, ]); $this->assertEquals([ 'timezone' => 'Europe/Paris', 'locale' => 'fr_FR', 'monthOverflow' => true, 'yearOverflow' => true, ], $paris->getSettings()); $saoPaulo = Carbon::parse('2018-01-31 00:00:00')->settings([ 'timezone' => 'America/Sao_Paulo', 'locale' => 'pt', 'monthOverflow' => false, 'yearOverflow' => false, ]); $this->assertEquals([ 'timezone' => 'America/Sao_Paulo', 'locale' => 'pt', 'monthOverflow' => false, 'yearOverflow' => false, ], $saoPaulo->getSettings()); $this->assertSame('2 jours 1 heure avant', $paris->addMonth()->from(Carbon::parse('2018-03-05', 'UTC'), null, false, 3)); $this->assertSame('4 dias 21 horas antes', $saoPaulo->addMonth()->from(Carbon::parse('2018-03-05', 'UTC'), null, false, 3)); $this->assertSame('2 jours et une heure avant', $paris->addMonth()->from(Carbon::parse('2018-03-05', 'UTC'), ['parts' => 3, 'join' => true, 'aUnit' => true])); } } ================================================ FILE: tests/CarbonImmutable/StartEndOfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class StartEndOfTest extends AbstractTestCase { public function testStartOfDay() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt2 = $dt->startOfDay()); $this->assertCarbon($dt2, $dt->year, $dt->month, $dt->day, 0, 0, 0, 0); } public function testEndOfDay() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt2 = $dt->endOfDay()); $this->assertCarbon($dt2, $dt->year, $dt->month, $dt->day, 23, 59, 59, 999999); } public function testStartOfMonthIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfMonth()); } public function testStartOfMonthFromNow() { $dt = Carbon::now()->startOfMonth(); $this->assertCarbon($dt, $dt->year, $dt->month, 1, 0, 0, 0); } public function testStartOfMonthFromLastDay() { $dt = Carbon::create(2000, 1, 31, 2, 3, 4)->startOfMonth(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testStartOfYearIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfYear()); } public function testStartOfYearFromNow() { $dt = Carbon::now()->startOfYear(); $this->assertCarbon($dt, $dt->year, 1, 1, 0, 0, 0); } public function testStartOfYearFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfYear(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testStartOfYearFromLastDay() { $dt = Carbon::create(2000, 12, 31, 23, 59, 59)->startOfYear(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testEndOfMonthIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfMonth()); } public function testEndOfMonth() { $dt = Carbon::create(2000, 1, 1, 2, 3, 4)->endOfMonth(); $this->assertCarbon($dt, 2000, 1, 31, 23, 59, 59); } public function testEndOfMonthFromLastDay() { $dt = Carbon::create(2000, 1, 31, 2, 3, 4)->endOfMonth(); $this->assertCarbon($dt, 2000, 1, 31, 23, 59, 59); } public function testEndOfYearIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfYear()); } public function testEndOfYearFromNow() { $dt = Carbon::now()->endOfYear(); $this->assertCarbon($dt, $dt->year, 12, 31, 23, 59, 59); } public function testEndOfYearFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfYear(); $this->assertCarbon($dt, 2000, 12, 31, 23, 59, 59); } public function testEndOfYearFromLastDay() { $dt = Carbon::create(2000, 12, 31, 23, 59, 59)->endOfYear(); $this->assertCarbon($dt, 2000, 12, 31, 23, 59, 59); } public function testStartOfDecadeIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfDecade()); } public function testStartOfDecadeFromNow() { $dt = Carbon::now()->startOfDecade(); $this->assertCarbon($dt, $dt->year - $dt->year % 10, 1, 1, 0, 0, 0); } public function testStartOfDecadeFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfDecade(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testStartOfDecadeFromLastDay() { $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->startOfDecade(); $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); } public function testEndOfDecadeIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfDecade()); } public function testEndOfDecadeFromNow() { $dt = Carbon::now()->endOfDecade(); $this->assertCarbon($dt, $dt->year - $dt->year % 10 + 9, 12, 31, 23, 59, 59); } public function testEndOfDecadeFromFirstDay() { $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfDecade(); $this->assertCarbon($dt, 2009, 12, 31, 23, 59, 59); } public function testEndOfDecadeFromLastDay() { $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->endOfDecade(); $this->assertCarbon($dt, 2009, 12, 31, 23, 59, 59); } public function testStartOfCenturyIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfCentury()); } public function testStartOfCenturyFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfCentury(); $this->assertCarbon($dt, $now->year - $now->year % 100 + 1, 1, 1, 0, 0, 0); } public function testStartOfCenturyFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfCentury(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfCenturyFromLastDay() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfCentury(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfMillenniumIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfMillennium()); } public function testStartOfMillenniumFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfMillennium(); $this->assertCarbon($dt, $now->year - $now->year % 1000 + 1, 1, 1, 0, 0, 0); } public function testStartOfMillenniumFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfMillennium(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfMillenniumFromLastDay() { $dt = Carbon::create(3000, 12, 31, 23, 59, 59)->startOfMillennium(); $this->assertCarbon($dt, 2001, 1, 1, 0, 0, 0); } public function testStartOfHourIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfHour()); } public function testStartOfHourFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfHour(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, 0, 0); } public function testStartOfHourFromFirstMinute() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 0, 0); } public function testStartOfHourFromLastMinute() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 0, 0); } public function testEndOfHourIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfHour()); } public function testEndOfHourFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfHour(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, 59, 59); } public function testEndOfHourFromFirstMinute() { $dt = Carbon::create(2001, 1, 1, 1, 1, rand(0, 59))->endOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 59, 59); } public function testEndOfHourFromLastMinute() { $dt = Carbon::create(2100, 12, 31, 23, 59, rand(0, 59))->endOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, 59, 59); } public function testStartOfMinuteIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfMinute()); } public function testStartOfMinuteFromNow() { $now = Carbon::now(); $dt = Carbon::now()->startOfMinute(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, $now->minute, 0); } public function testStartOfMinuteFromFirstSecond() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->startOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 0); } public function testStartOfMinuteFromLastSecond() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->startOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 0); } public function testEndOfMinuteIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfMinute()); } public function testEndOfMinuteFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfMinute(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, $now->hour, $now->minute, 59); } public function testEndOfMinuteFromFirstSecond() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->endOfMinute(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 59); } public function testEndOfMinuteFromLastSecond() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->endOfHour(); $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, 59); } public function testMidDayIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->midDay()); } public function testMidDayFromNow() { $now = Carbon::now(); $dt = Carbon::now()->midDay(); $this->assertCarbon($dt, $now->year, $now->month, $now->day, 12, 0, 0); } public function testEndOfCenturyIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfCentury()); } public function testEndOfCenturyFromNow() { $now = Carbon::now(); $dt = Carbon::now()->endOfCentury(); $this->assertCarbon($dt, $now->year - $now->year % 100 + 100, 12, 31, 23, 59, 59); } public function testEndOfCenturyFromFirstDay() { $dt = Carbon::create(2001, 1, 1, 1, 1, 1)->endOfCentury(); $this->assertCarbon($dt, 2100, 12, 31, 23, 59, 59); } public function testEndOfCenturyFromLastDay() { $dt = Carbon::create(2100, 12, 31, 23, 59, 59)->endOfCentury(); $this->assertCarbon($dt, 2100, 12, 31, 23, 59, 59); } public function testStartOfQuarterIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->startOfQuarter()); } #[TestWith([1, 1])] #[TestWith([2, 1])] #[TestWith([3, 1])] #[TestWith([4, 4])] #[TestWith([5, 4])] #[TestWith([6, 4])] #[TestWith([7, 7])] #[TestWith([8, 7])] #[TestWith([9, 7])] #[TestWith([10, 10])] #[TestWith([11, 10])] #[TestWith([12, 10])] public function testStartOfQuarter(int $month, int $startOfQuarterMonth) { $dt = Carbon::create(2015, $month, 15, 1, 2, 3); $this->assertCarbon($dt->startOfQuarter(), 2015, $startOfQuarterMonth, 1, 0, 0, 0); } public function testEndOfQuarterIsFluid() { $dt = Carbon::now(); $this->assertInstanceOfCarbon($dt->endOfQuarter()); } #[TestWith([1, 3, 31])] #[TestWith([2, 3, 31])] #[TestWith([3, 3, 31])] #[TestWith([4, 6, 30])] #[TestWith([5, 6, 30])] #[TestWith([6, 6, 30])] #[TestWith([7, 9, 30])] #[TestWith([8, 9, 30])] #[TestWith([9, 9, 30])] #[TestWith([10, 12, 31])] #[TestWith([11, 12, 31])] #[TestWith([12, 12, 31])] public function testEndOfQuarter(int $month, int $endOfQuarterMonth, int $endOfQuarterDay) { $dt = Carbon::create(2015, $month, 15, 1, 2, 3); $this->assertCarbon($dt->endOfQuarter(), 2015, $endOfQuarterMonth, $endOfQuarterDay, 23, 59, 59); } public function testAverageIsFluid() { $dt = Carbon::now()->average(); $this->assertInstanceOfCarbon($dt); } public function testAverageFromSame() { $dt1 = Carbon::create(2000, 1, 31, 2, 3, 4); $dt2 = Carbon::create(2000, 1, 31, 2, 3, 4)->average($dt1); $this->assertCarbon($dt2, 2000, 1, 31, 2, 3, 4); } public function testAverageFromGreater() { $dt1 = Carbon::create(2000, 1, 1, 1, 1, 1); $dt2 = Carbon::create(2009, 12, 31, 23, 59, 59)->average($dt1); $this->assertCarbon($dt2, 2004, 12, 31, 12, 30, 30); } public function testAverageFromLower() { $dt1 = Carbon::create(2009, 12, 31, 23, 59, 59); $dt2 = Carbon::create(2000, 1, 1, 1, 1, 1)->average($dt1); $this->assertCarbon($dt2, 2004, 12, 31, 12, 30, 30); } public function testAverageWithCloseDates() { $dt1 = Carbon::parse('2004-01-24 09:46:56.500000'); $dt2 = Carbon::parse('2004-01-24 09:46:56.600000'); $this->assertSame('2004-01-24 09:46:56.550000', $dt1->average($dt2)->format('Y-m-d H:i:s.u')); } public function testAverageWithFarDates() { $dt1 = Carbon::parse('-2018-05-07 12:34:46.500000', 'UTC'); $dt2 = Carbon::parse('6025-10-11 20:59:06.600000', 'UTC'); $this->assertSame('2004-01-24 04:46:56.550000', $dt1->average($dt2)->format('Y-m-d H:i:s.u')); } } ================================================ FILE: tests/CarbonImmutable/StringsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterface; use Carbon\FactoryImmutable; use DateTime; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\MyCarbon; use Tests\CarbonImmutable\Fixtures\BadIsoCarbon; class StringsTest extends AbstractTestCase { public function testToString() { $d = Carbon::now(); $this->assertSame(Carbon::now()->toDateTimeString(), ''.$d); } public function testSetToStringFormatString() { Carbon::setToStringFormat('jS \o\f F, Y g:i:s a'); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('25th of December, 1975 2:15:16 pm', ''.$d); } public function testSetToStringFormatClosure() { Carbon::setToStringFormat(function (CarbonInterface $d) { $format = $d->year === 1976 ? 'jS \o\f F g:i:s a' : 'jS \o\f F, Y g:i:s a'; return $d->format($format); }); $d = Carbon::create(1976, 12, 25, 14, 15, 16); $this->assertSame('25th of December 2:15:16 pm', ''.$d); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('25th of December, 1975 2:15:16 pm', ''.$d); } public function testSetToStringFormatViaSettings() { $factory = new FactoryImmutable([ 'toStringFormat' => function (CarbonInterface $d) { return $d->isoFormat('dddd'); }, ]); $d = $factory->create(1976, 12, 25, 14, 15, 16); $this->assertSame('Saturday', ''.$d); } public function testResetToStringFormat() { $d = Carbon::now(); Carbon::setToStringFormat('123'); Carbon::resetToStringFormat(); $this->assertSame($d->toDateTimeString(), ''.$d); } public function testExtendedClassToString() { $d = MyCarbon::now(); $this->assertSame($d->toDateTimeString(), ''.$d); } public function testToDateString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25', $d->toDateString()); } public function testToFormattedDateString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Dec 25, 1975', $d->toFormattedDateString()); } public function testToTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('14:15:16', $d->toTimeString()); } public function testToDateTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25 14:15:16', $d->toDateTimeString()); } public function testToDateTimeStringWithPaddedZeroes() { $d = Carbon::create(2000, 5, 2, 4, 3, 4); $this->assertSame('2000-05-02 04:03:04', $d->toDateTimeString()); } public function testToDayDateTimeString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, Dec 25, 1975 2:15 PM', $d->toDayDateTimeString()); } public function testToAtomString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toAtomString()); } public function testToCOOKIEString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame( DateTime::COOKIE === 'l, d-M-y H:i:s T' ? 'Thursday, 25-Dec-75 14:15:16 EST' : 'Thursday, 25-Dec-1975 14:15:16 EST', $d->toCookieString(), ); } public function testToIso8601String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toIso8601String()); } public function testToIso8601ZuluString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T19:15:16Z', $d->toIso8601ZuluString()); } public function testToRC822String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 75 14:15:16 -0500', $d->toRfc822String()); } public function testToRfc850String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thursday, 25-Dec-75 14:15:16 EST', $d->toRfc850String()); } public function testToRfc1036String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 75 14:15:16 -0500', $d->toRfc1036String()); } public function testToRfc1123String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRfc1123String()); } public function testToRfc2822String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRfc2822String()); } public function testToRfc3339String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toRfc3339String()); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16.000-05:00', $d->toRfc3339String(true)); } public function testToRssString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 14:15:16 -0500', $d->toRssString()); } public function testToW3cString() { $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('1975-12-25T14:15:16-05:00', $d->toW3cString()); } public function testToRfc7231String() { $d = Carbon::create(1975, 12, 25, 14, 15, 16, 'GMT'); $this->assertSame('Thu, 25 Dec 1975 14:15:16 GMT', $d->toRfc7231String()); $d = Carbon::create(1975, 12, 25, 14, 15, 16); $this->assertSame('Thu, 25 Dec 1975 19:15:16 GMT', $d->toRfc7231String()); } public function testIsoFormat() { $d = Carbon::parse('midnight'); $this->assertSame('24', $d->isoFormat('k')); $d = Carbon::parse('2017-01-01'); $this->assertSame('2017', $d->isoFormat('g')); $this->assertSame('2017', $d->locale('en_US')->isoFormat('g')); $this->assertSame('2016', $d->locale('fr')->isoFormat('g')); $this->assertSame('2016', $d->isoFormat('G')); $this->assertSame('2016', $d->locale('en_US')->isoFormat('G')); $this->assertSame('2016', $d->locale('fr')->isoFormat('G')); $d = Carbon::parse('2015-12-31'); $this->assertSame('2016', $d->isoFormat('g')); $this->assertSame('2016', $d->locale('en_US')->isoFormat('g')); $this->assertSame('2015', $d->locale('fr')->isoFormat('g')); $this->assertSame('2015', $d->isoFormat('G')); $this->assertSame('2015', $d->locale('en_US')->isoFormat('G')); $this->assertSame('2015', $d->locale('fr')->isoFormat('G')); $d = Carbon::parse('2017-01-01 22:25:24.182937'); $this->assertSame('1 18 182 1829 18293 182937', $d->isoFormat('S SS SSS SSSS SSSSS SSSSSS')); $this->assertSame('02017 +002017', $d->isoFormat('YYYYY YYYYYY')); $this->assertSame(-117, Carbon::create(-117, 1, 1)->year); $this->assertSame('-00117 -000117', Carbon::create(-117, 1, 1)->isoFormat('YYYYY YYYYYY')); $this->assertSame('M01', $d->isoFormat('\\MMM')); $this->assertSame('Jan', $d->isoFormat('MMM')); $this->assertSame('janv.', $d->locale('fr')->isoFormat('MMM')); $this->assertSame('ene.', $d->locale('es')->isoFormat('MMM')); $this->assertSame('1 de enero de 2017', $d->locale('es')->isoFormat('LL')); $this->assertSame('1 de ene. de 2017', $d->locale('es')->isoFormat('ll')); $this->assertSame('1st', Carbon::parse('2018-06-01')->isoFormat('Do')); $this->assertSame('11th', Carbon::parse('2018-06-11')->isoFormat('Do')); $this->assertSame('21st', Carbon::parse('2018-06-21')->isoFormat('Do')); $this->assertSame('15th', Carbon::parse('2018-06-15')->isoFormat('Do')); } public function testBadIsoFormat() { $d = BadIsoCarbon::parse('midnight'); $this->assertSame('', $d->isoFormat('MMM')); } public function testTranslatedFormat() { $this->assertSame('1st', Carbon::parse('01-01-01')->translatedFormat('jS')); $this->assertSame('1er', Carbon::parse('01-01-01')->locale('fr')->translatedFormat('jS')); $this->assertSame('31 мая', Carbon::parse('2019-05-15')->locale('ru')->translatedFormat('t F')); $this->assertSame('5 май', Carbon::parse('2019-05-15')->locale('ru')->translatedFormat('n F')); } } ================================================ FILE: tests/CarbonImmutable/SubTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterval; use Carbon\Unit; use DateTimeImmutable; use Tests\AbstractTestCase; class SubTest extends AbstractTestCase { public function testSubMethod() { $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub('year', 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, Unit::Year)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(Unit::Year, 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub('2 years')->year); $lastNegated = null; $date = Carbon::createFromDate(1975)->sub( function (DateTimeImmutable $date, bool $negated = false) use (&$lastNegated): DateTimeImmutable { $lastNegated = $negated; return new DateTimeImmutable($date->format('Y-m-d H:i:s').' - 2 years'); }, ); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(1973, $date->year); $this->assertTrue($lastNegated); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract('year', 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(2, Unit::Year)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract(Unit::Year, 2)->year); $this->assertSame(1973, Carbon::createFromDate(1975)->subtract('2 years')->year); $lastNegated = null; $this->assertSame(1973, Carbon::createFromDate(1975)->subtract( function (DateTimeImmutable $date, bool $negated = false) use (&$lastNegated): DateTimeImmutable { $lastNegated = $negated; return new DateTimeImmutable($date->format('Y-m-d H:i:s').' - 2 years'); }, )->year); $this->assertTrue($lastNegated); /** @var CarbonInterval $interval */ $interval = include __DIR__.'/../Fixtures/dynamicInterval.php'; $originalDate = Carbon::parse('2020-06-08'); $date = $originalDate->sub($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-05-31', $date->format('Y-m-d')); $this->assertNotSame($originalDate, $date); $date = Carbon::parse('2020-07-16')->subtract($interval); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-06-30', $date->format('Y-m-d')); } public function testSubYearsPositive() { $this->assertSame(1974, Carbon::createFromDate(1975)->subYears(1)->year); } public function testSubYearsZero() { $this->assertSame(1975, Carbon::createFromDate(1975)->subYears(0)->year); } public function testSubYearsNegative() { $this->assertSame(1976, Carbon::createFromDate(1975)->subYears(-1)->year); } public function testSubYear() { $this->assertSame(1974, Carbon::createFromDate(1975)->subYear()->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, 'year')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(2, 'years')->year); $this->assertSame(1973, Carbon::createFromDate(1975)->sub(CarbonInterval::years(2))->year); } public function testSubMonthsPositive() { $this->assertSame(12, Carbon::createFromDate(1975, 1, 1)->subMonths(1)->month); } public function testSubMonthsZero() { $this->assertSame(1, Carbon::createFromDate(1975, 1, 1)->subMonths(0)->month); } public function testSubMonthsNegative() { $this->assertSame(2, Carbon::createFromDate(1975, 1, 1)->subMonths(-1)->month); } public function testSubMonth() { $this->assertSame(12, Carbon::createFromDate(1975, 1, 1)->subMonth()->month); } public function testSubDaysPositive() { $this->assertSame(30, Carbon::createFromDate(1975, 5, 1)->subDays(1)->day); } public function testSubDaysZero() { $this->assertSame(1, Carbon::createFromDate(1975, 5, 1)->subDays(0)->day); } public function testSubDaysNegative() { $this->assertSame(2, Carbon::createFromDate(1975, 5, 1)->subDays(-1)->day); } public function testSubDay() { $this->assertSame(30, Carbon::createFromDate(1975, 5, 1)->subDay()->day); } public function testSubWeekdaysPositive() { $this->assertSame(22, Carbon::createFromDate(2012, 1, 4)->subWeekdays(9)->day); } public function testSubWeekdaysZero() { $this->assertSame(4, Carbon::createFromDate(2012, 1, 4)->subWeekdays(0)->day); } public function testSubWeekdaysNegative() { $this->assertSame(13, Carbon::createFromDate(2012, 1, 31)->subWeekdays(-9)->day); } public function testSubWeekday() { $this->assertSame(6, Carbon::createFromDate(2012, 1, 9)->subWeekday()->day); } public function testSubWeekdayDuringWeekend() { $this->assertSame(6, Carbon::createFromDate(2012, 1, 8)->subWeekday()->day); } public function testSubWeeksPositive() { $this->assertSame(14, Carbon::createFromDate(1975, 5, 21)->subWeeks(1)->day); } public function testSubWeeksZero() { $this->assertSame(21, Carbon::createFromDate(1975, 5, 21)->subWeeks(0)->day); } public function testSubWeeksNegative() { $this->assertSame(28, Carbon::createFromDate(1975, 5, 21)->subWeeks(-1)->day); } public function testSubWeek() { $this->assertSame(14, Carbon::createFromDate(1975, 5, 21)->subWeek()->day); } public function testSubHoursPositive() { $this->assertSame(23, Carbon::createFromTime(0)->subHours(1)->hour); } public function testSubHoursZero() { $this->assertSame(0, Carbon::createFromTime(0)->subHours(0)->hour); } public function testSubHoursNegative() { $this->assertSame(1, Carbon::createFromTime(0)->subHours(-1)->hour); } public function testSubHour() { $this->assertSame(23, Carbon::createFromTime(0)->subHour()->hour); } public function testSubMinutesPositive() { $this->assertSame(59, Carbon::createFromTime(0, 0)->subMinutes(1)->minute); } public function testSubMinutesZero() { $this->assertSame(0, Carbon::createFromTime(0, 0)->subMinutes(0)->minute); } public function testSubMinutesNegative() { $this->assertSame(1, Carbon::createFromTime(0, 0)->subMinutes(-1)->minute); } public function testSubMinute() { $this->assertSame(59, Carbon::createFromTime(0, 0)->subMinute()->minute); } public function testSubSecondsPositive() { $this->assertSame(59, Carbon::createFromTime(0, 0, 0)->subSeconds(1)->second); } public function testSubSecondsZero() { $this->assertSame(0, Carbon::createFromTime(0, 0, 0)->subSeconds(0)->second); } public function testSubSecondsNegative() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->subSeconds(-1)->second); } public function testSubSecond() { $this->assertSame(59, Carbon::createFromTime(0, 0, 0)->subSecond()->second); } public function testSubMillisecondsPositive() { $this->assertSame(999, Carbon::createFromTime(0, 0, 0)->subMilliseconds(1)->millisecond); } public function testSubMillisecondsZero() { $this->assertSame(100, Carbon::createFromTime(0, 0, 0.1)->subMilliseconds(0)->millisecond); } public function testSubMillisecondsNegative() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->subMilliseconds(-1)->millisecond); $this->assertSame(101, Carbon::createFromTime(0, 0, 0.1)->subMilliseconds(-1)->millisecond); } public function testSubMillisecond() { $this->assertSame(99, Carbon::createFromTime(0, 0, 0.1)->subMillisecond()->millisecond); } public function testSubMicrosecondsPositive() { $this->assertSame(999999, Carbon::createFromTime(0, 0, 0)->subMicroseconds(1)->microsecond); } public function testSubMicrosecondsZero() { $this->assertSame(100000, Carbon::createFromTime(0, 0, 0.1)->subMicroseconds(0)->microsecond); } public function testSubMicrosecondsNegative() { $this->assertSame(1, Carbon::createFromTime(0, 0, 0)->subMicroseconds(-1)->microsecond); $this->assertSame(100001, Carbon::createFromTime(0, 0, 0.1)->subMicroseconds(-1)->microsecond); } public function testSubMicrosecond() { $this->assertSame(99999, Carbon::createFromTime(0, 0, 0.1)->subMicrosecond()->microsecond); } /** * Test non plural methods with non default args. */ public function testSubYearPassingArg() { /** @var mixed $date */ $date = Carbon::createFromDate(1975); $this->assertSame(1973, $date->subYear(2)->year); } public function testSubMonthPassingArg() { /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 1); $this->assertSame(3, $date->subMonth(2)->month); } public function testSubMonthNoOverflowPassingArg() { /** @var mixed $date */ $date = Carbon::createFromDate(2011, 4, 30); $date = $date->subMonthNoOverflow(2); $this->assertSame(2, $date->month); $this->assertSame(28, $date->day); } public function testSubDayPassingArg() { /** @var mixed $date */ $date = Carbon::createFromDate(1975, 5, 10); $this->assertSame(8, $date->subDay(2)->day); } public function testSubHourPassingArg() { /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(22, $date->subHour(2)->hour); } public function testSubMinutePassingArg() { /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(58, $date->subMinute(2)->minute); } public function testSubSecondPassingArg() { /** @var mixed $date */ $date = Carbon::createFromTime(0); $this->assertSame(58, $date->subSecond(2)->second); } } ================================================ FILE: tests/CarbonImmutable/TestingAidsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterface; use Closure; use DateTime; use DateTimeZone; use Exception; use stdClass; use Tests\AbstractTestCase; class TestingAidsTest extends AbstractTestCase { public function wrapWithTestNow(Closure $func, ?CarbonInterface $dt = null): void { Carbon::setTestNow($dt ?: Carbon::now()); $func(); Carbon::setTestNow(); } public function testTestingAidsWithTestNowNotSet() { Carbon::setTestNow(); $this->assertFalse(Carbon::hasTestNow()); $this->assertNull(Carbon::getTestNow()); } public function testTestingAidsWithTestNowSet() { Carbon::setTestNow($yesterday = Carbon::yesterday()); $this->assertTrue(Carbon::hasTestNow()); $this->assertSame($yesterday->format('Y-m-d H:i:s.u e'), Carbon::getTestNow()->format('Y-m-d H:i:s.u e')); } public function testTestingAidsWithTestNowSetToString() { Carbon::setTestNow('2016-11-23'); $this->assertTrue(Carbon::hasTestNow()); $this->assertEquals(Carbon::getTestNow(), Carbon::parse('2016-11-23')); } public function testConstructorWithTestValueSet() { Carbon::setTestNow($yesterday = Carbon::yesterday()); $this->assertEquals($yesterday, new Carbon()); $this->assertEquals($yesterday, new Carbon(null)); $this->assertEquals($yesterday, new Carbon('')); $this->assertEquals($yesterday, new Carbon('now')); } public function testNowWithTestValueSet() { Carbon::setTestNow($yesterday = Carbon::yesterday()); $this->assertEquals($yesterday, Carbon::now()); } public function testNowWithDateTime() { Carbon::setTestNow(new DateTime('2021-05-26 08:41:59')); $this->assertSame('2021-05-26 08:41:59', Carbon::now()->format('Y-m-d H:i:s')); } public function testNowWithClosureValue() { $mockedNow = Carbon::parse('2019-09-21 12:34:56.123456'); $delta = 0; Carbon::setTestNow(function (Carbon $now) use (&$mockedNow, &$delta) { $this->assertInstanceOfCarbon($now); return $mockedNow->copy()->tz($now->tz)->addMicroseconds($delta); }); $this->assertSame('2019-09-21 12:34:56.123456', Carbon::now()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-09-21 00:00:00.000000', Carbon::today()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-09-22 00:00:00.000000', Carbon::create('tomorrow')->format('Y-m-d H:i:s.u')); $this->assertSame('2018-06-15 12:34:00.000000', Carbon::create(2018, 6, 15, null, null)->format('Y-m-d H:i:s.u')); $delta = 11111111; $date = Carbon::now(); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2019-09-21 12:35:07.234567', $date->format('Y-m-d H:i:s.u')); $date = Carbon::today(); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2019-09-21 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create('tomorrow'); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2019-09-22 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create(2018, 6, 15, null, null); $this->assertSame('America/Toronto', $date->tzName); $this->assertSame('2018-06-15 12:35:00.000000', $date->format('Y-m-d H:i:s.u')); date_default_timezone_set('UTC'); $date = Carbon::now(); $this->assertSame('UTC', $date->tzName); $this->assertSame('2019-09-21 16:35:07.234567', $date->format('Y-m-d H:i:s.u')); $date = Carbon::today(); $this->assertSame('UTC', $date->tzName); $this->assertSame('2019-09-21 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create('tomorrow'); $this->assertSame('UTC', $date->tzName); $this->assertSame('2019-09-22 00:00:00.000000', $date->format('Y-m-d H:i:s.u')); $date = Carbon::create(2018, 6, 15, null, null); $this->assertSame('UTC', $date->tzName); $this->assertSame('2018-06-15 16:35:00.000000', $date->format('Y-m-d H:i:s.u')); date_default_timezone_set('America/Toronto'); } public function testParseWithTestValueSet() { $testNow = Carbon::yesterday(); $this->wrapWithTestNow(function () use ($testNow) { $this->assertEquals($testNow, Carbon::parse(null)); $this->assertEquals($testNow, Carbon::parse('')); $this->assertEquals($testNow, Carbon::parse('now')); }, $testNow); } public function testParseRelativeWithTestValueSet() { $testNow = Carbon::parse('2013-09-01 05:15:05'); $this->wrapWithTestNow(function () { $this->assertSame('2013-09-01 05:10:05', Carbon::parse('5 minutes ago')->toDateTimeString()); $this->assertSame('2013-08-25 05:15:05', Carbon::parse('1 week ago')->toDateTimeString()); $this->assertSame('2013-09-02 00:00:00', Carbon::parse('tomorrow')->toDateTimeString()); $this->assertSame('2013-09-01 00:00:00', Carbon::parse('today')->toDateTimeString()); $this->assertSame('2013-08-31 00:00:00', Carbon::parse('yesterday')->toDateTimeString()); $this->assertSame('2013-09-02 05:15:05', Carbon::parse('+1 day')->toDateTimeString()); $this->assertSame('2013-08-31 05:15:05', Carbon::parse('-1 day')->toDateTimeString()); $this->assertSame('2013-09-02 00:00:00', Carbon::parse('next monday')->toDateTimeString()); $this->assertSame('2013-09-03 00:00:00', Carbon::parse('next tuesday')->toDateTimeString()); $this->assertSame('2013-09-04 00:00:00', Carbon::parse('next wednesday')->toDateTimeString()); $this->assertSame('2013-09-05 00:00:00', Carbon::parse('next thursday')->toDateTimeString()); $this->assertSame('2013-09-06 00:00:00', Carbon::parse('next friday')->toDateTimeString()); $this->assertSame('2013-09-07 00:00:00', Carbon::parse('next saturday')->toDateTimeString()); $this->assertSame('2013-09-08 00:00:00', Carbon::parse('next sunday')->toDateTimeString()); $this->assertSame('2013-08-26 00:00:00', Carbon::parse('last monday')->toDateTimeString()); $this->assertSame('2013-08-27 00:00:00', Carbon::parse('last tuesday')->toDateTimeString()); $this->assertSame('2013-08-28 00:00:00', Carbon::parse('last wednesday')->toDateTimeString()); $this->assertSame('2013-08-29 00:00:00', Carbon::parse('last thursday')->toDateTimeString()); $this->assertSame('2013-08-30 00:00:00', Carbon::parse('last friday')->toDateTimeString()); $this->assertSame('2013-08-31 00:00:00', Carbon::parse('last saturday')->toDateTimeString()); $this->assertSame('2013-08-25 00:00:00', Carbon::parse('last sunday')->toDateTimeString()); $this->assertSame('2013-09-02 00:00:00', Carbon::parse('this monday')->toDateTimeString()); $this->assertSame('2013-09-03 00:00:00', Carbon::parse('this tuesday')->toDateTimeString()); $this->assertSame('2013-09-04 00:00:00', Carbon::parse('this wednesday')->toDateTimeString()); $this->assertSame('2013-09-05 00:00:00', Carbon::parse('this thursday')->toDateTimeString()); $this->assertSame('2013-09-06 00:00:00', Carbon::parse('this friday')->toDateTimeString()); $this->assertSame('2013-09-07 00:00:00', Carbon::parse('this saturday')->toDateTimeString()); $this->assertSame('2013-09-01 00:00:00', Carbon::parse('this sunday')->toDateTimeString()); $this->assertSame('2013-10-01 05:15:05', Carbon::parse('first day of next month')->toDateTimeString()); $this->assertSame('2013-09-30 05:15:05', Carbon::parse('last day of this month')->toDateTimeString()); }, $testNow); } public function testHasRelativeKeywords() { $this->assertFalse(Carbon::hasRelativeKeywords('sunday 2015-02-23')); $this->assertTrue(Carbon::hasRelativeKeywords('today +2014 days')); $this->assertTrue(Carbon::hasRelativeKeywords('next sunday -3600 seconds')); $this->assertTrue(Carbon::hasRelativeKeywords('last day of this month')); $this->assertFalse(Carbon::hasRelativeKeywords('last day of december 2015')); $this->assertTrue(Carbon::hasRelativeKeywords('first sunday of next month')); $this->assertFalse(Carbon::hasRelativeKeywords('first sunday of January 2017')); } public function testParseRelativeWithMinusSignsInDate() { $testNow = Carbon::parse('2013-09-01 05:15:05'); $this->wrapWithTestNow(function () { $this->assertSame('2000-01-03 00:00:00', Carbon::parse('2000-1-3')->toDateTimeString()); $this->assertSame('2000-10-10 00:00:00', Carbon::parse('2000-10-10')->toDateTimeString()); }, $testNow); $this->assertSame('2000-01-03 00:00:00', Carbon::parse('2000-1-3')->toDateTimeString()); $this->assertSame('2000-10-10 00:00:00', Carbon::parse('2000-10-10')->toDateTimeString()); } public function testTimeZoneWithTestValueSet() { $testNow = Carbon::parse('2013-07-01 12:00:00', 'America/New_York'); $this->wrapWithTestNow(function () { $this->assertSame('2013-07-01T12:00:00-04:00', Carbon::parse('now')->toIso8601String()); $this->assertSame('2013-07-01T11:00:00-05:00', Carbon::parse('now', 'America/Mexico_City')->toIso8601String()); $this->assertSame('2013-07-01T09:00:00-07:00', Carbon::parse('now', 'America/Vancouver')->toIso8601String()); }, $testNow); } public function testCreateFromPartialFormat() { Carbon::setTestNowAndTimezone(Carbon::parse('2013-09-01 05:10:15', 'America/Vancouver')); // Simple partial time. $this->assertSame('2018-05-06T05:10:15-07:00', Carbon::createFromFormat('Y-m-d', '2018-05-06')->toIso8601String()); $this->assertSame('2013-09-01T10:20:30-07:00', Carbon::createFromFormat('H:i:s', '10:20:30')->toIso8601String()); // Custom timezone. $this->assertSame('2013-09-01T10:20:00+03:00', Carbon::createFromFormat('H:i e', '10:20 Europe/Kiev')->toIso8601String()); $this->assertSame('2013-09-01T10:20:00+01:00', Carbon::createFromFormat('H:i', '10:20', 'Europe/London')->toIso8601String()); $this->assertSame('2013-09-01T11:30:00+07:00', Carbon::createFromFormat('H:i:s e', '11:30:00+07:00')->toIso8601String()); $this->assertSame('2013-09-01T11:30:00+05:00', Carbon::createFromFormat('H:i:s', '11:30:00', '+05:00')->toIso8601String()); // Escaped timezone. $this->assertSame('2013-09-01T05:10:15-07:00', Carbon::createFromFormat('\e', 'e')->toIso8601String()); // Weird format, naive modify would fail here. $this->assertSame('2005-08-09T05:10:15-07:00', Carbon::createFromFormat('l jS \of F Y', 'Tuesday 9th of August 2005')->toIso8601String()); $this->assertSame('2013-09-01T00:12:13-07:00', Carbon::createFromFormat('i:s', '12:13')->toIso8601String()); $this->assertSame('2018-09-05T05:10:15-07:00', Carbon::createFromFormat('Y/d', '2018/5')->toIso8601String()); // Resetting to epoch. $this->assertSame('2018-05-06T00:00:00-07:00', Carbon::createFromFormat('!Y-m-d', '2018-05-06')->toIso8601String()); $this->assertSame('1970-01-01T10:20:30-08:00', Carbon::createFromFormat('Y-m-d! H:i:s', '2018-05-06 10:20:30')->toIso8601String()); $this->assertSame('2018-05-06T00:00:00-07:00', Carbon::createFromFormat('Y-m-d|', '2018-05-06')->toIso8601String()); $this->assertSame('1970-01-01T10:20:30-08:00', Carbon::createFromFormat('|H:i:s', '10:20:30')->toIso8601String()); $kyiv = $this->firstValidTimezoneAmong(['Europe/Kyiv', 'Europe/Kiev'])->getName(); // Resetting to epoch (timezone fun). $this->assertSame('1970-01-01T00:00:00-08:00', Carbon::createFromFormat('|', '')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+03:00', Carbon::createFromFormat('e|', $kyiv)->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+01:00', Carbon::createFromFormat('|', '', 'Europe/London')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00-08:00', Carbon::createFromFormat('!', '')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+03:00', Carbon::createFromFormat('!e', $kyiv)->toIso8601String()); $this->assertSame('1970-01-01T00:00:00+01:00', Carbon::createFromFormat('!', '', 'Europe/London')->toIso8601String()); $this->assertSame('1970-01-01T00:00:00-08:00', Carbon::createFromFormat('e!', $kyiv)->toIso8601String()); // Escaped epoch resets. $this->assertSame('2013-09-01T05:10:15-07:00', Carbon::createFromFormat('\|', '|')->toIso8601String()); $this->assertSame('2013-09-01T05:10:15-07:00', Carbon::createFromFormat('\!', '!')->toIso8601String()); $this->assertSame('2013-09-01T05:10:15+03:00', Carbon::createFromFormat('e \!', $kyiv.' !')->toIso8601String()); Carbon::setTestNow('2023-12-05 21:09:54'); $this->assertSame('2023-12-05 15:00:00.000000', Carbon::createFromFormat('H', '15')->format('Y-m-d H:i:s.u')); } public function testCreateFromPartialFormatWithMicroseconds() { Carbon::setTestNowAndTimezone(Carbon::parse('2013-09-01 05:10:15.123456', 'America/Vancouver')); $this->assertSame('2018-05-06 05:10:15.123456', Carbon::createFromFormat('Y-m-d', '2018-05-06')->format('Y-m-d H:i:s.u')); $this->assertSame('2013-09-01 10:20:30.654321', Carbon::createFromFormat('H:i:s.u', '10:20:30.654321')->format('Y-m-d H:i:s.u')); } public function testCreateFromDateTimeInterface() { Carbon::setTestNowAndTimezone(date_create_immutable('2013-09-01 05:10:15.123456', new DateTimeZone('America/Vancouver'))); $this->assertSame('2018-05-06 05:10:15.123456', Carbon::createFromFormat('Y-m-d', '2018-05-06')->format('Y-m-d H:i:s.u')); $this->assertSame('2013-09-01 10:20:30.654321', Carbon::createFromFormat('H:i:s.u', '10:20:30.654321')->format('Y-m-d H:i:s.u')); } public function testWithTestNow() { $self = $this; $testNow = '2020-09-16 10:20:00'; $object = new stdClass(); $result = Carbon::withTestNow($testNow, static function () use ($self, $testNow, $object) { $currentTime = Carbon::now(); $self->assertSame($testNow, $currentTime->format('Y-m-d H:i:s')); return $object; }); $this->assertSame($object, $result); $currentTime = Carbon::now(); $this->assertNotEquals($testNow, $currentTime->format('Y-m-d H:i:s')); } public function testWithTestNowWithException() { $testNow = '2020-09-16 10:20:00'; try { Carbon::withTestNow($testNow, static function () { throw new Exception(); }); } catch (Exception $e) { // ignore } $currentTime = Carbon::now(); $this->assertNotEquals($testNow, $currentTime->format('Y-m-d H:i:s')); } } ================================================ FILE: tests/CarbonImmutable/WeekTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonImmutable; use Carbon\CarbonImmutable as Carbon; use Carbon\CarbonInterface; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class WeekTest extends AbstractTestCase { public const SAMPLE = [ '1990-12-20' => [ 1990, 1990, 51, 51, 52, 52, ], '1990-12-21' => [ 1990, 1990, 51, 51, 52, 52, ], '1990-12-22' => [ 1990, 1990, 51, 51, 52, 52, ], '1990-12-23' => [ 1990, 1990, 52, 51, 52, 52, ], '1990-12-24' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-25' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-26' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-27' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-28' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-29' => [ 1990, 1990, 52, 52, 52, 52, ], '1990-12-30' => [ 1991, 1990, 1, 52, 52, 52, ], '1990-12-31' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-01' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-02' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-03' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-04' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-05' => [ 1991, 1991, 1, 1, 52, 52, ], '1991-01-06' => [ 1991, 1991, 2, 1, 52, 52, ], '1991-01-07' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-01-08' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-01-09' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-01-10' => [ 1991, 1991, 2, 2, 52, 52, ], '1991-12-20' => [ 1991, 1991, 51, 51, 52, 52, ], '1991-12-21' => [ 1991, 1991, 51, 51, 52, 52, ], '1991-12-22' => [ 1991, 1991, 52, 51, 52, 52, ], '1991-12-23' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-24' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-25' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-26' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-27' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-28' => [ 1991, 1991, 52, 52, 52, 52, ], '1991-12-29' => [ 1992, 1991, 1, 52, 52, 52, ], '1991-12-30' => [ 1992, 1992, 1, 1, 52, 52, ], '1991-12-31' => [ 1992, 1992, 1, 1, 52, 52, ], '1992-01-01' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-02' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-03' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-04' => [ 1992, 1992, 1, 1, 52, 53, ], '1992-01-05' => [ 1992, 1992, 2, 1, 52, 53, ], '1992-01-06' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-07' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-08' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-09' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-01-10' => [ 1992, 1992, 2, 2, 52, 53, ], '1992-12-20' => [ 1992, 1992, 52, 51, 52, 53, ], '1992-12-21' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-22' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-23' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-24' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-25' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-26' => [ 1992, 1992, 52, 52, 52, 53, ], '1992-12-27' => [ 1993, 1992, 1, 52, 52, 53, ], '1992-12-28' => [ 1993, 1992, 1, 53, 52, 53, ], '1992-12-29' => [ 1993, 1992, 1, 53, 52, 53, ], '1992-12-30' => [ 1993, 1992, 1, 53, 52, 53, ], '1992-12-31' => [ 1993, 1992, 1, 53, 52, 53, ], '1993-01-01' => [ 1993, 1992, 1, 53, 52, 52, ], '1993-01-02' => [ 1993, 1992, 1, 53, 52, 52, ], '1993-01-03' => [ 1993, 1992, 2, 53, 52, 52, ], '1993-01-04' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-05' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-06' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-07' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-08' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-09' => [ 1993, 1993, 2, 1, 52, 52, ], '1993-01-10' => [ 1993, 1993, 3, 1, 52, 52, ], '1993-12-20' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-21' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-22' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-23' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-24' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-25' => [ 1993, 1993, 52, 51, 52, 52, ], '1993-12-26' => [ 1994, 1993, 1, 51, 52, 52, ], '1993-12-27' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-28' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-29' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-30' => [ 1994, 1993, 1, 52, 52, 52, ], '1993-12-31' => [ 1994, 1993, 1, 52, 52, 52, ], '1994-01-01' => [ 1994, 1993, 1, 52, 53, 52, ], '1994-01-02' => [ 1994, 1993, 2, 52, 53, 52, ], '1994-01-03' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-04' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-05' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-06' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-07' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-08' => [ 1994, 1994, 2, 1, 53, 52, ], '1994-01-09' => [ 1994, 1994, 3, 1, 53, 52, ], '1994-01-10' => [ 1994, 1994, 3, 2, 53, 52, ], '1994-12-20' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-21' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-22' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-23' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-24' => [ 1994, 1994, 52, 51, 53, 52, ], '1994-12-25' => [ 1994, 1994, 53, 51, 53, 52, ], '1994-12-26' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-27' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-28' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-29' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-30' => [ 1994, 1994, 53, 52, 53, 52, ], '1994-12-31' => [ 1994, 1994, 53, 52, 53, 52, ], '1995-01-01' => [ 1995, 1994, 1, 52, 52, 52, ], '1995-01-02' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-03' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-04' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-05' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-06' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-07' => [ 1995, 1995, 1, 1, 52, 52, ], '1995-01-08' => [ 1995, 1995, 2, 1, 52, 52, ], '1995-01-09' => [ 1995, 1995, 2, 2, 52, 52, ], '1995-01-10' => [ 1995, 1995, 2, 2, 52, 52, ], '1995-12-20' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-21' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-22' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-23' => [ 1995, 1995, 51, 51, 52, 52, ], '1995-12-24' => [ 1995, 1995, 52, 51, 52, 52, ], '1995-12-25' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-26' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-27' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-28' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-29' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-30' => [ 1995, 1995, 52, 52, 52, 52, ], '1995-12-31' => [ 1996, 1995, 1, 52, 52, 52, ], '1996-01-01' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-02' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-03' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-04' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-05' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-06' => [ 1996, 1996, 1, 1, 52, 52, ], '1996-01-07' => [ 1996, 1996, 2, 1, 52, 52, ], '1996-01-08' => [ 1996, 1996, 2, 2, 52, 52, ], '1996-01-09' => [ 1996, 1996, 2, 2, 52, 52, ], '1996-01-10' => [ 1996, 1996, 2, 2, 52, 52, ], '1996-12-20' => [ 1996, 1996, 51, 51, 52, 52, ], '1996-12-21' => [ 1996, 1996, 51, 51, 52, 52, ], '1996-12-22' => [ 1996, 1996, 52, 51, 52, 52, ], '1996-12-23' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-24' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-25' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-26' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-27' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-28' => [ 1996, 1996, 52, 52, 52, 52, ], '1996-12-29' => [ 1997, 1996, 1, 52, 52, 52, ], '1996-12-30' => [ 1997, 1997, 1, 1, 52, 52, ], '1996-12-31' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-01' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-02' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-03' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-04' => [ 1997, 1997, 1, 1, 52, 52, ], '1997-01-05' => [ 1997, 1997, 2, 1, 52, 52, ], '1997-01-06' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-07' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-08' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-09' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-01-10' => [ 1997, 1997, 2, 2, 52, 52, ], '1997-12-20' => [ 1997, 1997, 51, 51, 52, 52, ], '1997-12-21' => [ 1997, 1997, 52, 51, 52, 52, ], '1997-12-22' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-23' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-24' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-25' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-26' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-27' => [ 1997, 1997, 52, 52, 52, 52, ], '1997-12-28' => [ 1998, 1997, 1, 52, 52, 52, ], '1997-12-29' => [ 1998, 1998, 1, 1, 52, 52, ], '1997-12-30' => [ 1998, 1998, 1, 1, 52, 52, ], '1997-12-31' => [ 1998, 1998, 1, 1, 52, 52, ], '1998-01-01' => [ 1998, 1998, 1, 1, 52, 53, ], '1998-01-02' => [ 1998, 1998, 1, 1, 52, 53, ], '1998-01-03' => [ 1998, 1998, 1, 1, 52, 53, ], '1998-01-04' => [ 1998, 1998, 2, 1, 52, 53, ], '1998-01-05' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-06' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-07' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-08' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-09' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-01-10' => [ 1998, 1998, 2, 2, 52, 53, ], '1998-12-20' => [ 1998, 1998, 52, 51, 52, 53, ], '1998-12-21' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-22' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-23' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-24' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-25' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-26' => [ 1998, 1998, 52, 52, 52, 53, ], '1998-12-27' => [ 1999, 1998, 1, 52, 52, 53, ], '1998-12-28' => [ 1999, 1998, 1, 53, 52, 53, ], '1998-12-29' => [ 1999, 1998, 1, 53, 52, 53, ], '1998-12-30' => [ 1999, 1998, 1, 53, 52, 53, ], '1998-12-31' => [ 1999, 1998, 1, 53, 52, 53, ], '1999-01-01' => [ 1999, 1998, 1, 53, 52, 52, ], '1999-01-02' => [ 1999, 1998, 1, 53, 52, 52, ], '1999-01-03' => [ 1999, 1998, 2, 53, 52, 52, ], '1999-01-04' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-05' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-06' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-07' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-08' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-09' => [ 1999, 1999, 2, 1, 52, 52, ], '1999-01-10' => [ 1999, 1999, 3, 1, 52, 52, ], '1999-12-20' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-21' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-22' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-23' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-24' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-25' => [ 1999, 1999, 52, 51, 52, 52, ], '1999-12-26' => [ 2000, 1999, 1, 51, 52, 52, ], '1999-12-27' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-28' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-29' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-30' => [ 2000, 1999, 1, 52, 52, 52, ], '1999-12-31' => [ 2000, 1999, 1, 52, 52, 52, ], '2000-01-01' => [ 2000, 1999, 1, 52, 53, 52, ], '2000-01-02' => [ 2000, 1999, 2, 52, 53, 52, ], '2000-01-03' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-04' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-05' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-06' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-07' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-08' => [ 2000, 2000, 2, 1, 53, 52, ], '2000-01-09' => [ 2000, 2000, 3, 1, 53, 52, ], '2000-01-10' => [ 2000, 2000, 3, 2, 53, 52, ], '2000-12-20' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-21' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-22' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-23' => [ 2000, 2000, 52, 51, 53, 52, ], '2000-12-24' => [ 2000, 2000, 53, 51, 53, 52, ], '2000-12-25' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-26' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-27' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-28' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-29' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-30' => [ 2000, 2000, 53, 52, 53, 52, ], '2000-12-31' => [ 2001, 2000, 1, 52, 53, 52, ], '2001-01-01' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-02' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-03' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-04' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-05' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-06' => [ 2001, 2001, 1, 1, 52, 52, ], '2001-01-07' => [ 2001, 2001, 2, 1, 52, 52, ], '2001-01-08' => [ 2001, 2001, 2, 2, 52, 52, ], '2001-01-09' => [ 2001, 2001, 2, 2, 52, 52, ], '2001-01-10' => [ 2001, 2001, 2, 2, 52, 52, ], '2001-12-20' => [ 2001, 2001, 51, 51, 52, 52, ], '2001-12-21' => [ 2001, 2001, 51, 51, 52, 52, ], '2001-12-22' => [ 2001, 2001, 51, 51, 52, 52, ], '2001-12-23' => [ 2001, 2001, 52, 51, 52, 52, ], '2001-12-24' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-25' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-26' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-27' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-28' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-29' => [ 2001, 2001, 52, 52, 52, 52, ], '2001-12-30' => [ 2002, 2001, 1, 52, 52, 52, ], '2001-12-31' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-01' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-02' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-03' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-04' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-05' => [ 2002, 2002, 1, 1, 52, 52, ], '2002-01-06' => [ 2002, 2002, 2, 1, 52, 52, ], '2002-01-07' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-01-08' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-01-09' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-01-10' => [ 2002, 2002, 2, 2, 52, 52, ], '2002-12-20' => [ 2002, 2002, 51, 51, 52, 52, ], '2002-12-21' => [ 2002, 2002, 51, 51, 52, 52, ], '2002-12-22' => [ 2002, 2002, 52, 51, 52, 52, ], '2002-12-23' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-24' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-25' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-26' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-27' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-28' => [ 2002, 2002, 52, 52, 52, 52, ], '2002-12-29' => [ 2003, 2002, 1, 52, 52, 52, ], '2002-12-30' => [ 2003, 2003, 1, 1, 52, 52, ], '2002-12-31' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-01' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-02' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-03' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-04' => [ 2003, 2003, 1, 1, 52, 52, ], '2003-01-05' => [ 2003, 2003, 2, 1, 52, 52, ], '2003-01-06' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-07' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-08' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-09' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-01-10' => [ 2003, 2003, 2, 2, 52, 52, ], '2003-12-20' => [ 2003, 2003, 51, 51, 52, 52, ], '2003-12-21' => [ 2003, 2003, 52, 51, 52, 52, ], '2003-12-22' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-23' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-24' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-25' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-26' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-27' => [ 2003, 2003, 52, 52, 52, 52, ], '2003-12-28' => [ 2004, 2003, 1, 52, 52, 52, ], '2003-12-29' => [ 2004, 2004, 1, 1, 52, 52, ], '2003-12-30' => [ 2004, 2004, 1, 1, 52, 52, ], '2003-12-31' => [ 2004, 2004, 1, 1, 52, 52, ], '2004-01-01' => [ 2004, 2004, 1, 1, 52, 53, ], '2004-01-02' => [ 2004, 2004, 1, 1, 52, 53, ], '2004-01-03' => [ 2004, 2004, 1, 1, 52, 53, ], '2004-01-04' => [ 2004, 2004, 2, 1, 52, 53, ], '2004-01-05' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-06' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-07' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-08' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-09' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-01-10' => [ 2004, 2004, 2, 2, 52, 53, ], '2004-12-20' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-21' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-22' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-23' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-24' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-25' => [ 2004, 2004, 52, 52, 52, 53, ], '2004-12-26' => [ 2005, 2004, 1, 52, 52, 53, ], '2004-12-27' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-28' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-29' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-30' => [ 2005, 2004, 1, 53, 52, 53, ], '2004-12-31' => [ 2005, 2004, 1, 53, 52, 53, ], '2005-01-01' => [ 2005, 2004, 1, 53, 53, 52, ], '2005-01-02' => [ 2005, 2004, 2, 53, 53, 52, ], '2005-01-03' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-04' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-05' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-06' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-07' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-08' => [ 2005, 2005, 2, 1, 53, 52, ], '2005-01-09' => [ 2005, 2005, 3, 1, 53, 52, ], '2005-01-10' => [ 2005, 2005, 3, 2, 53, 52, ], '2005-12-20' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-21' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-22' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-23' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-24' => [ 2005, 2005, 52, 51, 53, 52, ], '2005-12-25' => [ 2005, 2005, 53, 51, 53, 52, ], '2005-12-26' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-27' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-28' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-29' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-30' => [ 2005, 2005, 53, 52, 53, 52, ], '2005-12-31' => [ 2005, 2005, 53, 52, 53, 52, ], '2006-01-01' => [ 2006, 2005, 1, 52, 52, 52, ], '2006-01-02' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-03' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-04' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-05' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-06' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-07' => [ 2006, 2006, 1, 1, 52, 52, ], '2006-01-08' => [ 2006, 2006, 2, 1, 52, 52, ], '2006-01-09' => [ 2006, 2006, 2, 2, 52, 52, ], '2006-01-10' => [ 2006, 2006, 2, 2, 52, 52, ], '2006-12-20' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-21' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-22' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-23' => [ 2006, 2006, 51, 51, 52, 52, ], '2006-12-24' => [ 2006, 2006, 52, 51, 52, 52, ], '2006-12-25' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-26' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-27' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-28' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-29' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-30' => [ 2006, 2006, 52, 52, 52, 52, ], '2006-12-31' => [ 2007, 2006, 1, 52, 52, 52, ], '2007-01-01' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-02' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-03' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-04' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-05' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-06' => [ 2007, 2007, 1, 1, 52, 52, ], '2007-01-07' => [ 2007, 2007, 2, 1, 52, 52, ], '2007-01-08' => [ 2007, 2007, 2, 2, 52, 52, ], '2007-01-09' => [ 2007, 2007, 2, 2, 52, 52, ], '2007-01-10' => [ 2007, 2007, 2, 2, 52, 52, ], '2007-12-20' => [ 2007, 2007, 51, 51, 52, 52, ], '2007-12-21' => [ 2007, 2007, 51, 51, 52, 52, ], '2007-12-22' => [ 2007, 2007, 51, 51, 52, 52, ], '2007-12-23' => [ 2007, 2007, 52, 51, 52, 52, ], '2007-12-24' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-25' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-26' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-27' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-28' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-29' => [ 2007, 2007, 52, 52, 52, 52, ], '2007-12-30' => [ 2008, 2007, 1, 52, 52, 52, ], '2007-12-31' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-01' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-02' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-03' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-04' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-05' => [ 2008, 2008, 1, 1, 52, 52, ], '2008-01-06' => [ 2008, 2008, 2, 1, 52, 52, ], '2008-01-07' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-01-08' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-01-09' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-01-10' => [ 2008, 2008, 2, 2, 52, 52, ], '2008-12-20' => [ 2008, 2008, 51, 51, 52, 52, ], '2008-12-21' => [ 2008, 2008, 52, 51, 52, 52, ], '2008-12-22' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-23' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-24' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-25' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-26' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-27' => [ 2008, 2008, 52, 52, 52, 52, ], '2008-12-28' => [ 2009, 2008, 1, 52, 52, 52, ], '2008-12-29' => [ 2009, 2009, 1, 1, 52, 52, ], '2008-12-30' => [ 2009, 2009, 1, 1, 52, 52, ], '2008-12-31' => [ 2009, 2009, 1, 1, 52, 52, ], '2009-01-01' => [ 2009, 2009, 1, 1, 52, 53, ], '2009-01-02' => [ 2009, 2009, 1, 1, 52, 53, ], '2009-01-03' => [ 2009, 2009, 1, 1, 52, 53, ], '2009-01-04' => [ 2009, 2009, 2, 1, 52, 53, ], '2009-01-05' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-06' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-07' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-08' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-09' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-01-10' => [ 2009, 2009, 2, 2, 52, 53, ], '2009-12-20' => [ 2009, 2009, 52, 51, 52, 53, ], '2009-12-21' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-22' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-23' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-24' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-25' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-26' => [ 2009, 2009, 52, 52, 52, 53, ], '2009-12-27' => [ 2010, 2009, 1, 52, 52, 53, ], '2009-12-28' => [ 2010, 2009, 1, 53, 52, 53, ], '2009-12-29' => [ 2010, 2009, 1, 53, 52, 53, ], '2009-12-30' => [ 2010, 2009, 1, 53, 52, 53, ], '2009-12-31' => [ 2010, 2009, 1, 53, 52, 53, ], '2010-01-01' => [ 2010, 2009, 1, 53, 52, 52, ], '2010-01-02' => [ 2010, 2009, 1, 53, 52, 52, ], '2010-01-03' => [ 2010, 2009, 2, 53, 52, 52, ], '2010-01-04' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-05' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-06' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-07' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-08' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-09' => [ 2010, 2010, 2, 1, 52, 52, ], '2010-01-10' => [ 2010, 2010, 3, 1, 52, 52, ], '2010-12-20' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-21' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-22' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-23' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-24' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-25' => [ 2010, 2010, 52, 51, 52, 52, ], '2010-12-26' => [ 2011, 2010, 1, 51, 52, 52, ], '2010-12-27' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-28' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-29' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-30' => [ 2011, 2010, 1, 52, 52, 52, ], '2010-12-31' => [ 2011, 2010, 1, 52, 52, 52, ], '2011-01-01' => [ 2011, 2010, 1, 52, 53, 52, ], '2011-01-02' => [ 2011, 2010, 2, 52, 53, 52, ], '2011-01-03' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-04' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-05' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-06' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-07' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-08' => [ 2011, 2011, 2, 1, 53, 52, ], '2011-01-09' => [ 2011, 2011, 3, 1, 53, 52, ], '2011-01-10' => [ 2011, 2011, 3, 2, 53, 52, ], '2011-12-20' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-21' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-22' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-23' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-24' => [ 2011, 2011, 52, 51, 53, 52, ], '2011-12-25' => [ 2011, 2011, 53, 51, 53, 52, ], '2011-12-26' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-27' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-28' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-29' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-30' => [ 2011, 2011, 53, 52, 53, 52, ], '2011-12-31' => [ 2011, 2011, 53, 52, 53, 52, ], '2012-01-01' => [ 2012, 2011, 1, 52, 52, 52, ], '2012-01-02' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-03' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-04' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-05' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-06' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-07' => [ 2012, 2012, 1, 1, 52, 52, ], '2012-01-08' => [ 2012, 2012, 2, 1, 52, 52, ], '2012-01-09' => [ 2012, 2012, 2, 2, 52, 52, ], '2012-01-10' => [ 2012, 2012, 2, 2, 52, 52, ], '2012-12-20' => [ 2012, 2012, 51, 51, 52, 52, ], '2012-12-21' => [ 2012, 2012, 51, 51, 52, 52, ], '2012-12-22' => [ 2012, 2012, 51, 51, 52, 52, ], '2012-12-23' => [ 2012, 2012, 52, 51, 52, 52, ], '2012-12-24' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-25' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-26' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-27' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-28' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-29' => [ 2012, 2012, 52, 52, 52, 52, ], '2012-12-30' => [ 2013, 2012, 1, 52, 52, 52, ], '2012-12-31' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-01' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-02' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-03' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-04' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-05' => [ 2013, 2013, 1, 1, 52, 52, ], '2013-01-06' => [ 2013, 2013, 2, 1, 52, 52, ], '2013-01-07' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-01-08' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-01-09' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-01-10' => [ 2013, 2013, 2, 2, 52, 52, ], '2013-12-20' => [ 2013, 2013, 51, 51, 52, 52, ], '2013-12-21' => [ 2013, 2013, 51, 51, 52, 52, ], '2013-12-22' => [ 2013, 2013, 52, 51, 52, 52, ], '2013-12-23' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-24' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-25' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-26' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-27' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-28' => [ 2013, 2013, 52, 52, 52, 52, ], '2013-12-29' => [ 2014, 2013, 1, 52, 52, 52, ], '2013-12-30' => [ 2014, 2014, 1, 1, 52, 52, ], '2013-12-31' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-01' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-02' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-03' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-04' => [ 2014, 2014, 1, 1, 52, 52, ], '2014-01-05' => [ 2014, 2014, 2, 1, 52, 52, ], '2014-01-06' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-07' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-08' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-09' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-01-10' => [ 2014, 2014, 2, 2, 52, 52, ], '2014-12-20' => [ 2014, 2014, 51, 51, 52, 52, ], '2014-12-21' => [ 2014, 2014, 52, 51, 52, 52, ], '2014-12-22' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-23' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-24' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-25' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-26' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-27' => [ 2014, 2014, 52, 52, 52, 52, ], '2014-12-28' => [ 2015, 2014, 1, 52, 52, 52, ], '2014-12-29' => [ 2015, 2015, 1, 1, 52, 52, ], '2014-12-30' => [ 2015, 2015, 1, 1, 52, 52, ], '2014-12-31' => [ 2015, 2015, 1, 1, 52, 52, ], '2015-01-01' => [ 2015, 2015, 1, 1, 52, 53, ], '2015-01-02' => [ 2015, 2015, 1, 1, 52, 53, ], '2015-01-03' => [ 2015, 2015, 1, 1, 52, 53, ], '2015-01-04' => [ 2015, 2015, 2, 1, 52, 53, ], '2015-01-05' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-06' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-07' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-08' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-09' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-01-10' => [ 2015, 2015, 2, 2, 52, 53, ], '2015-12-20' => [ 2015, 2015, 52, 51, 52, 53, ], '2015-12-21' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-22' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-23' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-24' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-25' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-26' => [ 2015, 2015, 52, 52, 52, 53, ], '2015-12-27' => [ 2016, 2015, 1, 52, 52, 53, ], '2015-12-28' => [ 2016, 2015, 1, 53, 52, 53, ], '2015-12-29' => [ 2016, 2015, 1, 53, 52, 53, ], '2015-12-30' => [ 2016, 2015, 1, 53, 52, 53, ], '2015-12-31' => [ 2016, 2015, 1, 53, 52, 53, ], '2016-01-01' => [ 2016, 2015, 1, 53, 53, 52, ], '2016-01-02' => [ 2016, 2015, 1, 53, 53, 52, ], '2016-01-03' => [ 2016, 2015, 2, 53, 53, 52, ], '2016-01-04' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-05' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-06' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-07' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-08' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-09' => [ 2016, 2016, 2, 1, 53, 52, ], '2016-01-10' => [ 2016, 2016, 3, 1, 53, 52, ], '2016-12-20' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-21' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-22' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-23' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-24' => [ 2016, 2016, 52, 51, 53, 52, ], '2016-12-25' => [ 2016, 2016, 53, 51, 53, 52, ], '2016-12-26' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-27' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-28' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-29' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-30' => [ 2016, 2016, 53, 52, 53, 52, ], '2016-12-31' => [ 2016, 2016, 53, 52, 53, 52, ], '2017-01-01' => [ 2017, 2016, 1, 52, 52, 52, ], '2017-01-02' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-03' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-04' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-05' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-06' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-07' => [ 2017, 2017, 1, 1, 52, 52, ], '2017-01-08' => [ 2017, 2017, 2, 1, 52, 52, ], '2017-01-09' => [ 2017, 2017, 2, 2, 52, 52, ], '2017-01-10' => [ 2017, 2017, 2, 2, 52, 52, ], '2017-12-20' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-21' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-22' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-23' => [ 2017, 2017, 51, 51, 52, 52, ], '2017-12-24' => [ 2017, 2017, 52, 51, 52, 52, ], '2017-12-25' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-26' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-27' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-28' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-29' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-30' => [ 2017, 2017, 52, 52, 52, 52, ], '2017-12-31' => [ 2018, 2017, 1, 52, 52, 52, ], '2018-01-01' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-02' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-03' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-04' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-05' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-06' => [ 2018, 2018, 1, 1, 52, 52, ], '2018-01-07' => [ 2018, 2018, 2, 1, 52, 52, ], '2018-01-08' => [ 2018, 2018, 2, 2, 52, 52, ], '2018-01-09' => [ 2018, 2018, 2, 2, 52, 52, ], '2018-01-10' => [ 2018, 2018, 2, 2, 52, 52, ], '2018-12-20' => [ 2018, 2018, 51, 51, 52, 52, ], '2018-12-21' => [ 2018, 2018, 51, 51, 52, 52, ], '2018-12-22' => [ 2018, 2018, 51, 51, 52, 52, ], '2018-12-23' => [ 2018, 2018, 52, 51, 52, 52, ], '2018-12-24' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-25' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-26' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-27' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-28' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-29' => [ 2018, 2018, 52, 52, 52, 52, ], '2018-12-30' => [ 2019, 2018, 1, 52, 52, 52, ], '2018-12-31' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-01' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-02' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-03' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-04' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-05' => [ 2019, 2019, 1, 1, 52, 52, ], '2019-01-06' => [ 2019, 2019, 2, 1, 52, 52, ], '2019-01-07' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-01-08' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-01-09' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-01-10' => [ 2019, 2019, 2, 2, 52, 52, ], '2019-12-20' => [ 2019, 2019, 51, 51, 52, 52, ], '2019-12-21' => [ 2019, 2019, 51, 51, 52, 52, ], '2019-12-22' => [ 2019, 2019, 52, 51, 52, 52, ], '2019-12-23' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-24' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-25' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-26' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-27' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-28' => [ 2019, 2019, 52, 52, 52, 52, ], '2019-12-29' => [ 2020, 2019, 1, 52, 52, 52, ], '2019-12-30' => [ 2020, 2020, 1, 1, 52, 52, ], '2019-12-31' => [ 2020, 2020, 1, 1, 52, 52, ], '2020-01-01' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-02' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-03' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-04' => [ 2020, 2020, 1, 1, 52, 53, ], '2020-01-05' => [ 2020, 2020, 2, 1, 52, 53, ], '2020-01-06' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-07' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-08' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-09' => [ 2020, 2020, 2, 2, 52, 53, ], '2020-01-10' => [ 2020, 2020, 2, 2, 52, 53, ], ]; public function testWeekUtils() { foreach (static::SAMPLE as $date => [$weekYear, $isoWeekYear, $week, $isoWeek, $weeksInYear, $isoWeeksInYear]) { $carbon = Carbon::parse("$date 00:00:00")->locale('en_US'); $this->assertSame($weekYear, $carbon->weekYear(), "Carbon::parse(\"$date 00:00:00\")->weekYear() should return $weekYear"); $this->assertSame($isoWeekYear, $carbon->isoWeekYear(), "Carbon::parse(\"$date 00:00:00\")->isoWeekYear() should return $isoWeekYear"); $this->assertSame($week, $carbon->week(), "Carbon::parse(\"$date 00:00:00\")->week() should return $week"); $this->assertSame($isoWeek, $carbon->isoWeek(), "Carbon::parse(\"$date 00:00:00\")->isoWeek() should return $isoWeek"); $this->assertSame($weeksInYear, $carbon->weeksInYear(), "Carbon::parse(\"$date 00:00:00\")->weeksInYear() should return $isoWeek"); $this->assertSame($isoWeeksInYear, $carbon->isoWeeksInYear(), "Carbon::parse(\"$date 00:00:00\")->isoWeeksInYear() should return $isoWeeksInYear"); } } public function testSetters() { $d = Carbon::parse('2018-01-01'); $this->assertSame(52, $d->weeksInYear); $this->assertSame(52, $d->isoWeeksInYear); $d2 = $d->week(3); $this->assertNotSame($d, $d2); $this->assertSame('2018-01-15', $d2->format('Y-m-d')); $d2 = $d2->week(34); $this->assertSame('2018-08-20', $d2->format('Y-m-d')); $d2 = $d2->week(0); $this->assertSame('2017-12-25', $d2->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d = $d->week(-1); $this->assertSame('2017-12-18', $d->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d = $d->week(-5); $this->assertSame('2017-11-20', $d->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d = $d->week(-55); $this->assertSame('2016-12-05', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01'); $d = $d->week(34); $this->assertSame('2017-08-20', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01'); $d = $d->isoWeek(34); $this->assertSame('2016-08-28', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('en_US'); $d = $d->weekYear(2015); $this->assertSame('2014-12-28', $d->format('Y-m-d')); $d = Carbon::parse('2012-12-31'); $d = $d->weekYear(2013); $this->assertSame('2012-12-31', $d->format('Y-m-d')); $d = Carbon::parse('2012-12-30')->locale('en_US'); $d = $d->weekYear(2014); $this->assertSame('2013-12-29', $d->format('Y-m-d')); $d = Carbon::parse('2015-12-31'); $d = $d->weekYear(2013); $this->assertSame('2013-01-03', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01'); $d = $d->isoWeekYear(2015); $this->assertSame('2015-12-27', $d->format('Y-m-d')); $d = $d->dayOfYear(300); $this->assertSame('2015-10-27', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('fr'); $d = $d->weekYear(2015); $this->assertSame('2015-12-27', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('sr'); $d = $d->weekYear(2017); $this->assertSame('2017-01-01', $d->format('Y-m-d')); $d = Carbon::parse('2017-01-01')->locale('fr'); $d = $d->weekYear(2012); $this->assertSame('2012-12-30', $d->format('Y-m-d')); $d = Carbon::parse('2018-01-01'); $d = $d->setISODate(2019, 4, 5); $this->assertSame('2019-01-25', $d->format('Y-m-d')); } public function testWeekday() { $d = Carbon::parse('2018-08-08')->locale('en_US'); $this->assertSame(CarbonInterface::WEDNESDAY, $d->weekday()); $this->assertSame(CarbonInterface::WEDNESDAY, $d->isoWeekday()); $date = $d->weekday(CarbonInterface::SUNDAY); $this->assertSame('08-05', $date->format('m-d')); $this->assertSame(CarbonInterface::SUNDAY, $date->weekday()); $this->assertSame(7, $date->isoWeekday()); $date = $d->isoWeekday(7); $this->assertSame('08-12', $date->format('m-d')); $this->assertSame(CarbonInterface::SUNDAY, $date->weekday()); $this->assertSame(7, $date->isoWeekday()); $date = $d->weekday(CarbonInterface::MONDAY); $this->assertSame('08-06', $date->format('m-d')); $this->assertSame(CarbonInterface::MONDAY, $date->weekday()); $this->assertSame(CarbonInterface::MONDAY, $date->isoWeekday()); $date = $d->isoWeekday(CarbonInterface::MONDAY); $this->assertSame('08-06', $date->format('m-d')); $this->assertSame(CarbonInterface::MONDAY, $date->weekday()); $this->assertSame(CarbonInterface::MONDAY, $date->isoWeekday()); } public function testWeekStartAndEnd() { $this->assertSame(CarbonInterface::MONDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekEndsAt()); Carbon::setLocale('en_US'); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekEndsAt()); Carbon::setLocale('ar_AR'); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::FRIDAY, Carbon::getWeekEndsAt()); Carbon::setLocale('fr_FR'); $this->assertSame(CarbonInterface::MONDAY, Carbon::getWeekStartsAt()); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekEndsAt()); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekStartsAt('en_US')); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekEndsAt('en_US')); $this->assertSame(CarbonInterface::SATURDAY, Carbon::getWeekStartsAt('ar_AR')); $this->assertSame(CarbonInterface::FRIDAY, Carbon::getWeekEndsAt('ar_AR')); $this->assertSame(CarbonInterface::MONDAY, Carbon::getWeekStartsAt('fr_FR')); $this->assertSame(CarbonInterface::SUNDAY, Carbon::getWeekEndsAt('fr_FR')); } #[DataProvider('getDaysFromStartOfWeekDataProvider')] public function testGetDaysFromStartOfWeek(string $locale, string $date, int $daysCount) { $this->assertSame( $daysCount, Carbon::parse($date)->locale($locale)->getDaysFromStartOfWeek() ); } public static function getDaysFromStartOfWeekDataProvider(): array { return [ 'Monday en_US' => ['en_US', '2022-11-21', 1], 'Monday late en_US' => ['en_US', '2022-11-21 23:59', 1], 'Tuesday en_US' => ['en_US', '2022-11-22 00:01', 2], 'Thursday en_US' => ['en_US', '2022-11-24', 4], 'Saturday en_US' => ['en_US', '2022-11-26 23:59:59.999999', 6], 'Sunday en_US' => ['en_US', '2022-11-27 00:00:00', 0], 'Monday fr_FR' => ['fr_FR', '2022-11-21', 0], 'Monday late fr_FR' => ['fr_FR', '2022-11-21 23:59', 0], 'Tuesday fr_FR' => ['fr_FR', '2022-11-22 00:01', 1], 'Thursday fr_FR' => ['fr_FR', '2022-11-24', 3], 'Saturday fr_FR' => ['fr_FR', '2022-11-26 23:59:59.999999', 5], 'Sunday fr_FR' => ['fr_FR', '2022-11-27 00:00:00', 6], 'Monday ku' => ['ku', '2022-11-21', 2], 'Monday late ku' => ['ku', '2022-11-21 23:59', 2], 'Tuesday ku' => ['ku', '2022-11-22 00:01', 3], 'Thursday ku' => ['ku', '2022-11-24', 5], 'Saturday ku' => ['ku', '2022-11-26 23:59:59.999999', 0], 'Sunday ku' => ['ku', '2022-11-27 00:00:00', 1], ]; } #[DataProvider('getDaysFromStartOfWeekDataProviderExplicit')] public function testGetDaysFromStartOfWeekExplicit(int $start, string $date, int $daysCount) { static $locales = [null, 'pt_BR', 'de_CH', 'ar_MA']; $carbon = Carbon::parse($date); $locale = $locales[array_rand($locales)]; if ($locale) { $carbon = $carbon->locale($locale); } $this->assertSame($daysCount, $carbon->getDaysFromStartOfWeek($start)); } public static function getDaysFromStartOfWeekDataProviderExplicit(): array { return [ 'Monday 0' => [0, '2022-11-21', 1], 'Monday late 0' => [0, '2022-11-21 23:59', 1], 'Tuesday 0' => [0, '2022-11-22 00:01', 2], 'Thursday 0' => [0, '2022-11-24', 4], 'Saturday 0' => [0, '2022-11-26 23:59:59.999999', 6], 'Sunday 0' => [0, '2022-11-27 00:00:00', 0], 'Monday 1' => [1, '2022-11-21', 0], 'Monday late 1' => [1, '2022-11-21 23:59', 0], 'Tuesday 1' => [1, '2022-11-22 00:01', 1], 'Thursday 1' => [1, '2022-11-24', 3], 'Saturday 1' => [1, '2022-11-26 23:59:59.999999', 5], 'Sunday 1' => [1, '2022-11-27 00:00:00', 6], 'Monday 6' => [6, '2022-11-21', 2], 'Monday late 6' => [6, '2022-11-21 23:59', 2], 'Tuesday 6' => [6, '2022-11-22 00:01', 3], 'Thursday 6' => [6, '2022-11-24', 5], 'Saturday 6' => [6, '2022-11-26 23:59:59.999999', 0], 'Sunday 6' => [6, '2022-11-27 00:00:00', 1], ]; } public function testSetDaysFromStartOfWeek() { $this->assertSame( '2022-11-29 23:59:59.999999', Carbon::parse('2022-11-26 23:59:59.999999') ->locale('ar_MA') ->setDaysFromStartOfWeek(3) ->format('Y-m-d H:i:s.u') ); $this->assertSame( '2022-11-24 12:34:56.123456', Carbon::parse('2022-11-24 12:34:56.123456') ->locale('fr_FR') ->setDaysFromStartOfWeek(3) ->format('Y-m-d H:i:s.u') ); $this->assertSame( '2022-11-23 12:34:56.123456', Carbon::parse('2022-11-24 12:34:56.123456') ->locale('en_US') ->setDaysFromStartOfWeek(3) ->format('Y-m-d H:i:s.u') ); $this->assertSame( '2022-11-27 12:34:56.123456', Carbon::parse('2022-11-24 12:34:56.123456') ->locale('en_US') ->setDaysFromStartOfWeek(3, 4) ->format('Y-m-d H:i:s.u') ); } } ================================================ FILE: tests/CarbonInterval/AddTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use DateInterval; use DateTime; use DateTimeImmutable; use InvalidArgumentException; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\MyCarbon; class AddTest extends AbstractTestCase { public function testAdd() { $ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add(new DateInterval('P2Y1M5DT22H33M44S')); $this->assertCarbonInterval($ci, 6, 4, 54, 30, 43, 55); } public function testNamedParameters() { $ci = CarbonInterval::years(years: 3)->addYears(years: 4); $this->assertCarbonInterval($ci, 7); $ci = CarbonInterval::months(months: 3)->addMonths(months: 4); $this->assertCarbonInterval($ci, 0, 7); $ci = CarbonInterval::weeks(weeks: 3)->addWeeks(weeks: 4); $this->assertCarbonInterval($ci, 0, 0, 7 * 7); $ci = CarbonInterval::days(days: 3)->addDays(days: 4); $this->assertCarbonInterval($ci, 0, 0, 7); $ci = CarbonInterval::hours(hours: 3)->addHours(hours: 4); $this->assertCarbonInterval($ci, 0, 0, 0, 7); $ci = CarbonInterval::minutes(minutes: 3)->addMinutes(minutes: 4); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 7); $ci = CarbonInterval::seconds(seconds: 3)->addSeconds(seconds: 4); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 7); $ci = CarbonInterval::milliseconds(milliseconds: 3)->addMilliseconds(milliseconds: 4); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0, 7000); $ci = CarbonInterval::microseconds(microseconds: 3)->addMicroseconds(microseconds: 4); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0, 7); } public function testAddWithDiffDateInterval() { $diff = Carbon::now()->diff(Carbon::now()->addWeeks(3)); $ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add($diff); $this->assertCarbonInterval($ci, 4, 3, 70, 8, 10, 11); } public function testAddWithNegativeDiffDateInterval() { $diff = Carbon::now()->diff(Carbon::now()->subWeeks(3)); $ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add($diff); $this->assertCarbonInterval($ci, 4, 3, 28, 8, 10, 11); } public function testAddMicroseconds() { $diff = Carbon::now()->diff(Carbon::now()->addDays(3)->addMicroseconds(111222)); $ci = CarbonInterval::create(1, 0, 0, 2, 0, 0, 0, 222333)->add($diff); if ($ci->seconds === 1) { $ci->seconds--; $ci->microseconds += 1000000; } $this->assertCarbonInterval($ci, 1, 0, 5, 0, 0, 0, 333555); $diff = Carbon::now()->diff(Carbon::now()->addDays(3)); $ci = CarbonInterval::create(1, 0, 0, 2, 0, 0, 0, 222333)->add($diff); $this->assertCarbonInterval($ci, 1, 0, 5, 0, 0, 0, 222333); $diff = Carbon::now()->diff(Carbon::now()->addDays(3)->addMicroseconds(111222)); $ci = CarbonInterval::create(1, 0, 0, 2, 0, 0, 0)->add($diff); if ($ci->seconds === 1) { $ci->seconds--; $ci->microseconds += 1000000; } $this->assertCarbonInterval($ci, 1, 0, 5, 0, 0, 0, 111222); } public function testAddWithRawDiffDateInterval() { date_default_timezone_set('UTC'); $date = new DateTime(); $diff = $date->diff((clone $date)->modify('3 weeks')); $ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add($diff); $this->assertCarbonInterval($ci, 4, 3, 70, 8, 10, 11); } public function testAddWithRawNegativeDiffDateInterval() { date_default_timezone_set('UTC'); $date = new DateTime(); $diff = $date->diff((clone $date)->modify('-3 weeks')); $ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add($diff); $this->assertCarbonInterval($ci, 4, 3, 28, 8, 10, 11); } #[TestWith([5, 2, 7])] #[TestWith([-5, -2, -7])] #[TestWith([-5, 2, -3])] #[TestWith([5, -2, 3])] #[TestWith([2, 5, 7])] #[TestWith([-2, -5, -7])] #[TestWith([-2, 5, 3])] #[TestWith([2, -5, -3])] public function testAddSign(int $base, int $increment, int $expectedResult) { $interval = new CarbonInterval(); $interval->hours(abs($base)); if ($base < 0) { $interval->invert(); } $add = new CarbonInterval(); $add->hours(abs($increment)); if ($increment < 0) { $add->invert(); } $interval->add($add); $this->assertGreaterThanOrEqual(0, $interval->hours); $actualResult = ($interval->invert ? -1 : 1) * $interval->hours; $this->assertSame($expectedResult, $actualResult); } public function testAddAndSubMultipleFormats() { $this->assertCarbonInterval(CarbonInterval::day()->add('hours', 3), 0, 0, 1, 3, 0, 0); $this->assertCarbonInterval(CarbonInterval::day()->add(5, 'hours'), 0, 0, 1, 5, 0, 0); $this->assertCarbonInterval(CarbonInterval::day()->add(3, '4 hours'), 0, 0, 1, 12, 0, 0); $this->assertCarbonInterval(CarbonInterval::day()->add(-5, 'hours'), 0, 0, 1, -5, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(4)->add('hour'), 0, 0, 0, 5, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(4)->add(new DateInterval('P5D')), 0, 0, 5, 4, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(4)->add(CarbonInterval::minutes(30)), 0, 0, 0, 4, 30, 0); $this->assertCarbonInterval(CarbonInterval::day()->sub('hours', 3), 0, 0, 1, -3, 0, 0); $this->assertCarbonInterval(CarbonInterval::day()->subtract(5, 'hours'), 0, 0, 1, -5, 0, 0); $this->assertCarbonInterval(CarbonInterval::day()->subtract(3, '4 hours'), 0, 0, 1, -12, 0, 0); $this->assertCarbonInterval(CarbonInterval::day()->subtract(-5, 'hours'), 0, 0, 1, 5, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(4)->sub('hour'), 0, 0, 0, 3, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(4)->subtract(new DateInterval('P5D')), 0, 0, -5, 4, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(4)->sub(CarbonInterval::minutes(30)), 0, 0, 0, 4, -30, 0); } public function testAddWrongFormat() { $this->expectExceptionObject(new InvalidArgumentException( 'This type of data cannot be added/subtracted.', )); CarbonInterval::day()->add(Carbon::now()); } public function testConvertDate() { $this->assertCarbon(CarbonInterval::days(3)->convertDate(new DateTime('2020-06-14')), 2020, 6, 17, 0, 0, 0); $this->assertCarbon(CarbonInterval::days(3)->convertDate(new DateTimeImmutable('2020-06-14')), 2020, 6, 17, 0, 0, 0); $this->assertCarbon(CarbonInterval::days(3)->convertDate(new DateTime('2020-06-14'), true), 2020, 6, 11, 0, 0, 0); $this->assertCarbon(CarbonInterval::days(3)->convertDate(new DateTimeImmutable('2020-06-14'), true), 2020, 6, 11, 0, 0, 0); $interval = new CarbonInterval(static fn (MyCarbon $carbon) => $carbon->addTwoHours()); $result = CarbonImmutable::parse('2024-01-18 08:00')->add($interval); $this->assertSame(CarbonImmutable::class, $result::class); $this->assertSame('2024-01-18 10:00:00', $result->format('Y-m-d H:i:s')); } public function testMagicAddAndSubMethods() { $this->assertCarbonInterval(CarbonInterval::days(3)->addWeeks(2), 0, 0, 17, 0, 0, 0); $this->assertCarbonInterval(CarbonInterval::weeks(3)->addDays(2), 0, 0, 23, 0, 0, 0); $this->assertCarbonInterval(CarbonInterval::weeks(3)->subDays(2), 0, 0, 19, 0, 0, 0); $this->assertCarbonInterval(CarbonInterval::hours(2)->subMinutes(15), 0, 0, 0, 2, -15, 0); $this->assertCarbonInterval(CarbonInterval::hours(2)->subMinutes(15)->cascade(), 0, 0, 0, 1, 45, 0); } public function testPlus() { $this->assertCarbonInterval(CarbonInterval::days(3)->plus(0, 0, 2, 0, 26), 0, 0, 17, 26, 0, 0); $this->assertCarbonInterval(CarbonInterval::days(3)->plus(0, 0, 0.25), 0, 0, 4, 18, 0, 0); $interval = CarbonInterval::days(3)->plus(0, 0, 0.25)->plus(0, 0, 0.25)->cascade(); $this->assertCarbonInterval($interval, 0, 0, 6, 12, 0, 0); } public function testPlusWithPHP8Syntax() { $interval = CarbonInterval::days(3)->plus(weeks: 2, hours: 26); $this->assertCarbonInterval($interval, 0, 0, 17, 26, 0, 0); $interval = CarbonInterval::days(3)->plus(hours: 1, minutes: 1.5); $this->assertCarbonInterval($interval, 0, 0, 3, 1, 1, 30); $interval = CarbonInterval::days(3)->plus(hours: 1, minutes: -1.5); $this->assertCarbonInterval($interval, 0, 0, 3, 1, -1, -30); } public function testMinus() { $this->assertCarbonInterval(CarbonInterval::days(3)->minus(0, 0, 2, 0, 26), 0, 0, 11, 26, 0, 0, 0, true); } public function testMinusWithPHP8Syntax() { $interval = CarbonInterval::days(3)->minus(weeks: 2, hours: 26); $this->assertCarbonInterval($interval, 0, 0, 11, 26, 0, 0, 0, true); } } ================================================ FILE: tests/CarbonInterval/AlternativeNumbersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class AlternativeNumbersTest extends AbstractTestCase { public function testAlternativesNumbers() { $this->assertSame( '۵۲ ساعت', CarbonInterval::hours(52)->locale('fa')->forHumans(['altNumbers' => true]), ); $this->assertSame( '۰۱ ساعت', CarbonInterval::hour()->locale('fa')->forHumans(['altNumbers' => 'fa']), ); $this->assertSame( '1時間', CarbonInterval::hour()->locale('ja')->forHumans(['altNumbers' => 'fa']), ); $this->assertSame( '۰۱ ساعت', CarbonInterval::hour()->locale('fa')->forHumans(['altNumbers' => ['fa', 'ja']]), ); $this->assertSame( '52 ساعت', CarbonInterval::hours(52)->locale('fa')->forHumans(['altNumbers' => 'ja']), ); $this->assertSame( '52 ساعت', CarbonInterval::hours(52)->locale('fa')->forHumans(['altNumbers' => ['lzh', 'ja']]), ); $this->assertSame( '五十二時間', CarbonInterval::hours(52)->locale('ja')->forHumans(['altNumbers' => ['lzh', 'ja']]), ); $this->assertSame( '-6', CarbonInterval::hours(-6)->locale('fa')->translateNumber(-6), ); } } ================================================ FILE: tests/CarbonInterval/CascadeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonInterval; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class CascadeTest extends AbstractTestCase { protected function assertIntervalSpec(CarbonInterval $interval, string $spec, bool|int $inverted = false): void { $this->assertSame( ($inverted ? '- ' : '+ ').$spec, ($interval->invert ? '- ' : '+ ').$interval->spec(), ); } #[TestWith(['3600s', 'PT1H'])] #[TestWith(['10000s', 'PT2H46M40S'])] #[TestWith(['1276d', 'P3Y9M16D'])] #[TestWith(['47d 14h', 'P1M19DT14H'])] #[TestWith(['2y 123mo 5w 6d 47h 160m 217s', 'P12Y4M15DT1H43M37S'])] public function testCascadesOverflowedValues($spec, $expected) { $interval = CarbonInterval::fromString($spec)->cascade(); $this->assertIntervalSpec($interval, $expected); $interval = CarbonInterval::fromString($spec)->invert()->cascade(); $this->assertIntervalSpec($interval, $expected, true); } #[DataProvider('dataForMixedSignsIntervalSpecs')] public function testMixedSignsCascadesOverflowedValues($units, $expected, $expectingInversion) { $interval = new CarbonInterval(0); foreach ($units as $unit => $value) { $interval->$unit($value); } $interval->cascade(); $this->assertIntervalSpec($interval, $expected, $expectingInversion); $interval = new CarbonInterval(0); foreach ($units as $unit => $value) { $interval->$unit($value); } $interval->invert()->cascade(); $this->assertIntervalSpec($interval, $expected, 1 - $expectingInversion); } public static function dataForMixedSignsIntervalSpecs(): Generator { yield [ [ 'hours' => 1, 'minutes' => -30, ], 'PT30M', 0, ]; yield [ [ 'hours' => 1, 'minutes' => -90, ], 'PT30M', 1, ]; yield [ [ 'hours' => 1, 'minutes' => -90, 'seconds' => 3660, ], 'PT31M', 0, ]; yield [ [ 'hours' => 1, 'minutes' => -90, 'seconds' => 3540, ], 'PT29M', 0, ]; yield [ [ 'hours' => 1, 'minutes' => 90, 'seconds' => -3540, ], 'PT1H31M', 0, ]; yield [ [ 'hours' => 1, 'minutes' => 90, 'seconds' => -3660, ], 'PT1H29M', 0, ]; yield [ [ 'hours' => -1, 'minutes' => 90, 'seconds' => -3660, ], 'PT31M', 1, ]; yield [ [ 'hours' => -1, 'minutes' => 61, 'seconds' => -120, ], 'PT1M', 1, ]; yield [ [ 'days' => 48, 'hours' => -8, ], 'P1M19DT16H', 0, ]; yield [ [ 'days' => 48, 'hours' => -28, ], 'P1M18DT20H', 0, ]; yield [ [ 'hours' => 1, 'seconds' => -3615, ], 'PT15S', 1, ]; yield [ [ 'hours' => -1, 'seconds' => 3615, ], 'PT15S', 0, ]; yield [ [ 'hours' => 1, 'seconds' => -59, ], 'PT59M1S', 0, ]; yield [ [ 'hours' => -1, 'seconds' => 59, ], 'PT59M1S', 1, ]; yield [ [ 'years' => 94, 'months' => 11, 'days' => 24, 'hours' => 3848, 'microseconds' => 7991, ], 'P95Y5M16DT8H', 0, ]; } public function testCascadesWithMicroseconds() { $interval = CarbonInterval::fromString('1040ms 3012µs')->cascade(); $this->assertSame('PT1S', $interval->spec()); $this->assertSame(43, $interval->milliseconds); $this->assertSame(43012, $interval->microseconds); } #[TestWith(['3600s', '1h'])] #[TestWith(['10000s', '2h 46m 40s'])] #[TestWith(['1276d', '255w 1d'])] #[TestWith(['47d 14h', '9w 3d 6h'])] #[TestWith(['2y 123mo 5w 6d 47h 160m 217s', '2yrs 123mos 7w 2d 1h 43m 37s'])] public function testCustomCascadesOverflowedValues($spec, $expected) { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'], 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], 'dayz' => [8, 'hours'], 'weeks' => [5, 'dayz'], ]); $actual = CarbonInterval::fromString($spec)->cascade()->forHumans(true); CarbonInterval::setCascadeFactors($cascades); $this->assertSame($expected, $actual); } #[TestWith(['3600s', '1 hour'])] #[TestWith(['10000s', '2 hours 46 minutes 40 seconds'])] #[TestWith(['1276d', '255 weeks 1 day'])] #[TestWith(['47d 14h', '9 weeks 3 days 6 hours'])] #[TestWith(['2y 123mo 5w 6d 47h 160m 217s', '2 years 123 months 7 weeks 2 days 1 hour 43 minutes 37 seconds'])] public function testCustomCascadesOverflowedValuesLongFormat($spec, $expected) { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'], 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], 'dayz' => [8, 'hours'], 'weeks' => [5, 'dayz'], ]); $actual = CarbonInterval::fromString($spec)->cascade()->forHumans(false); CarbonInterval::setCascadeFactors($cascades); $this->assertSame($expected, $actual); } public function testMultipleAdd() { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'], 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], 'days' => [8, 'hours'], 'weeks' => [5, 'days'], ]); $actual = CarbonInterval::fromString('3d') ->add(CarbonInterval::fromString('1d 5h')) ->add(CarbonInterval::fromString('7h')) ->cascade() ->forHumans(true); CarbonInterval::setCascadeFactors($cascades); $this->assertSame('1w 4h', $actual); } public function testFactorsGroups() { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], 'weeks' => [5, 'days'], ]); $actual = CarbonInterval::fromString('3d 50m') ->add(CarbonInterval::fromString('1d 5h 30m')) ->add(CarbonInterval::fromString('7h 45m')) ->add(CarbonInterval::fromString('1w 15m')) ->cascade() ->forHumans(true); CarbonInterval::setCascadeFactors($cascades); $this->assertSame('1w 4d 14h 20m', $actual); } public function testGetFactor() { $this->assertSame(28, CarbonInterval::getFactor('day', 'months')); $this->assertSame(28, CarbonInterval::getFactor('day', 'month')); $this->assertSame(28, CarbonInterval::getFactor('days', 'month')); $this->assertSame(28, CarbonInterval::getFactor('day', 'month')); $this->assertSame(28, CarbonInterval::getFactor('dayz', 'months')); } public function testComplexInterval() { $interval = CarbonInterval::create(0); $this->assertFalse($interval->hasNegativeValues()); $this->assertFalse($interval->hasPositiveValues()); $interval->days = -6; $this->assertTrue($interval->hasNegativeValues()); $this->assertFalse($interval->hasPositiveValues()); $interval->days = 6; $this->assertFalse($interval->hasNegativeValues()); $this->assertTrue($interval->hasPositiveValues()); $interval->hours = -40; $this->assertTrue($interval->hasNegativeValues()); $this->assertTrue($interval->hasPositiveValues()); $interval = CarbonInterval::create() ->years(-714)->months(-101)->days(-737) ->seconds(442)->microseconds(-19) ->cascade(); $this->assertFalse($interval->hasNegativeValues()); $this->assertTrue($interval->hasPositiveValues()); $interval = CarbonInterval::create(0)->hours(-7024)->cascade(); $this->assertLessThan(0, $interval->totalDays); } } ================================================ FILE: tests/CarbonInterval/CloneTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class CloneTest extends AbstractTestCase { public function testClone() { $first = CarbonInterval::minute(); $second = $first->clone(); $result = $first->compare($second); $this->assertSame(0, $result); $this->assertNotSame($second, $first); $this->assertEquals($second, $first); } public function testCopy() { $first = CarbonInterval::minute(); $second = $first->copy(); $result = $first->compare($second); $this->assertSame(0, $result); $this->assertNotSame($second, $first); $this->assertEquals($second, $first); } } ================================================ FILE: tests/CarbonInterval/CompareTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class CompareTest extends AbstractTestCase { public function testNegative() { $first = CarbonInterval::minute(); $second = CarbonInterval::minutes(2); $result = $first->compare($second); $this->assertSame(-1, $result); } public function testPositive() { $first = CarbonInterval::day(); $second = CarbonInterval::hour(); $result = $first->compare($second); $this->assertSame(1, $result); } public function testEqual() { $first = CarbonInterval::year(); $second = CarbonInterval::year(); $result = $first->compare($second); $this->assertSame(0, $result); } } ================================================ FILE: tests/CarbonInterval/ComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\Exceptions\InvalidFormatException; use DateInterval; use Tests\AbstractTestCase; class ComparisonTest extends AbstractTestCase { public function testEqualToTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->equalTo($oneDay)); $this->assertTrue($oneDay->eq($oneDay)); $this->assertTrue($oneDay->eq(CarbonInterval::day())); $this->assertTrue($oneDay->eq(new DateInterval('P1D'))); $this->assertTrue($oneDay->eq(CarbonInterval::hours(24))); $this->assertTrue($oneDay->eq(CarbonInterval::hours(23)->minutes(60))); $this->assertTrue($oneDay->eq('24 hours')); $this->assertTrue($oneDay->eq('P1D')); $this->assertTrue(CarbonInterval::day()->invert()->eq(CarbonInterval::days(-1))); $this->assertTrue(CarbonInterval::day()->sub('1 day')->eq(CarbonInterval::create())); $nextWeekday = function (CarbonInterface $date) { return $date->nextWeekday(); }; $this->assertTrue(CarbonInterval::create($nextWeekday)->eq(CarbonInterval::create($nextWeekday))); } public function testEqualToFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->equalTo(CarbonInterval::hours(24)->microsecond(1))); $this->assertFalse($oneDay->equalTo(['not-valid'])); $this->assertFalse($oneDay->eq(CarbonInterval::hours(24)->microsecond(1))); $this->assertFalse($oneDay->eq(CarbonInterval::hours(23)->minutes(59)->seconds(59)->microseconds(999999))); $nextWeekday = function (CarbonInterface $date) { return $date->nextWeekday(); }; $nextWeekendDay = function (CarbonInterface $date) { return $date->nextWeekendDay(); }; $this->assertFalse(CarbonInterval::create($nextWeekday)->eq(CarbonInterval::create($nextWeekendDay))); } public function testNotEqualToTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->notEqualTo(CarbonInterval::hours(24)->microsecond(1))); $this->assertTrue($oneDay->ne(CarbonInterval::hours(24)->microsecond(1))); $this->assertTrue($oneDay->ne(CarbonInterval::hours(23)->minutes(59)->seconds(59)->microseconds(999999))); } public function testNotEqualToFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->notEqualTo($oneDay)); $this->assertFalse($oneDay->ne($oneDay)); $this->assertFalse($oneDay->ne(CarbonInterval::day())); $this->assertFalse($oneDay->ne(new DateInterval('P1D'))); $this->assertFalse($oneDay->ne(CarbonInterval::hours(24))); $this->assertFalse($oneDay->ne(CarbonInterval::hours(23)->minutes(60))); $this->assertFalse($oneDay->ne('24 hours')); $this->assertFalse($oneDay->ne('P1D')); } public function testGreaterThanToTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->greaterThan(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertTrue($oneDay->gt(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertTrue($oneDay->gt(new DateInterval('P0DT23H59M59S'))); $this->assertTrue($oneDay->gt(CarbonInterval::hours(23)->minutes(59)->seconds(59)->microseconds(999999))); $this->assertTrue($oneDay->gt('23 hours 59 minutes 59 seconds 999999 microseconds')); $this->assertTrue($oneDay->gt('P0DT23H59M59S')); } public function testGreaterThanError() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('xxx', true), )); CarbonInterval::day()->gt('xxx'); } public function testGreaterThanToFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->greaterThan($oneDay)); $this->assertFalse($oneDay->gt($oneDay)); $this->assertFalse($oneDay->gt(CarbonInterval::day())); $this->assertFalse($oneDay->gt(CarbonInterval::hours(23)->minutes(60))); $this->assertFalse($oneDay->greaterThan(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertFalse($oneDay->gt(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertFalse($oneDay->gt(CarbonInterval::hours(23)->minutes(59)->seconds(59)->milliseconds(1001))); } public function testGreaterThanOrEqualToTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->greaterThanOrEqualTo($oneDay)); $this->assertTrue($oneDay->gte($oneDay)); $this->assertTrue($oneDay->gte(CarbonInterval::day())); $this->assertTrue($oneDay->gte(CarbonInterval::hours(23)->minutes(60))); $this->assertTrue($oneDay->greaterThanOrEqualTo(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertTrue($oneDay->gte(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertTrue($oneDay->gte(CarbonInterval::hours(23)->minutes(59)->seconds(59)->microseconds(999999))); } public function testGreaterThanOrEqualError() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('xxx', true), )); CarbonInterval::day()->gte('xxx'); } public function testGreaterThanOrEqualToFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->greaterThanOrEqualTo(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertFalse($oneDay->gte(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertFalse($oneDay->gte(new DateInterval('P0DT23H59M61S'))); $this->assertFalse($oneDay->gte(CarbonInterval::hours(23)->minutes(59)->seconds(59)->milliseconds(1001))); $this->assertFalse($oneDay->gte('23 hours 59 minutes 59 seconds 59 milliseconds 1001 milliseconds')); $this->assertFalse($oneDay->gte('P0DT23H59M61S')); } public function testLessThanToTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->lessThan(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertTrue($oneDay->lt(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertTrue($oneDay->lt(new DateInterval('P0DT23H59M61S'))); $this->assertTrue($oneDay->lt(CarbonInterval::hours(23)->minutes(59)->seconds(59)->milliseconds(1001))); $this->assertTrue($oneDay->lt('23 hours 59 minutes 59 seconds 59 milliseconds 1001 milliseconds')); $this->assertTrue($oneDay->lt('P0DT23H59M61S')); } public function testLessThanToFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->lessThan($oneDay)); $this->assertFalse($oneDay->lt($oneDay)); $this->assertFalse($oneDay->lt(CarbonInterval::day())); $this->assertFalse($oneDay->lt(CarbonInterval::hours(23)->minutes(60))); $this->assertFalse($oneDay->lessThan(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertFalse($oneDay->lt(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertFalse($oneDay->lt(CarbonInterval::hours(23)->minutes(59)->seconds(59)->microseconds(999999))); } public function testLessThanError() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('xxx', true), )); CarbonInterval::day()->lt('xxx'); } public function testLessThanOrEqualToTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->lessThanOrEqualTo($oneDay)); $this->assertTrue($oneDay->lte($oneDay)); $this->assertTrue($oneDay->lte(CarbonInterval::day())); $this->assertTrue($oneDay->lte(CarbonInterval::hours(23)->minutes(60))); $this->assertTrue($oneDay->lessThanOrEqualTo(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertTrue($oneDay->lte(CarbonInterval::day()->add(1, 'microseconds'))); $this->assertTrue($oneDay->lte(CarbonInterval::hours(23)->minutes(59)->seconds(59)->milliseconds(1001))); } public function testLessThanOrEqualToFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->lessThanOrEqualTo(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertFalse($oneDay->lte(CarbonInterval::day()->sub(1, 'microseconds'))); $this->assertFalse($oneDay->lte(new DateInterval('P0DT23H59M59S'))); $this->assertFalse($oneDay->lte(CarbonInterval::hours(23)->minutes(59)->seconds(59)->microseconds(999999))); $this->assertFalse($oneDay->lte('23 hours 59 minutes 59 seconds 999999 microseconds')); $this->assertFalse($oneDay->lte('P0DT23H59M59S')); } public function testLessThanOrEqualError() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('xxx', true), )); CarbonInterval::day()->lte('xxx'); } public function testBetweenFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->between(CarbonInterval::days(2), CarbonInterval::days(3))); $twoDays = CarbonInterval::hours(48); $this->assertFalse($twoDays->between(CarbonInterval::day(), CarbonInterval::days(2), false)); } public function testBetweenTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->between(CarbonInterval::hours(12), CarbonInterval::hours(36))); $twoDays = CarbonInterval::hours(48); $this->assertTrue($twoDays->between(CarbonInterval::day(), CarbonInterval::days(3), false)); $this->assertTrue($twoDays->between(CarbonInterval::day(), CarbonInterval::days(3), true)); $this->assertTrue($twoDays->between(CarbonInterval::day(), CarbonInterval::days(3))); $this->assertTrue($twoDays->between(CarbonInterval::day(), CarbonInterval::days(2))); } public function testBetweenIncludedFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->betweenIncluded(CarbonInterval::days(2), CarbonInterval::days(3))); } public function testBetweenIncludedTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->betweenIncluded(CarbonInterval::hours(12), CarbonInterval::hours(36))); $twoDays = CarbonInterval::hours(48); $this->assertTrue($twoDays->betweenIncluded(CarbonInterval::day(), CarbonInterval::days(2))); } public function testBetweenExcludedFalse() { $oneDay = CarbonInterval::day(); $this->assertFalse($oneDay->betweenExcluded(CarbonInterval::days(2), CarbonInterval::days(3))); $twoDays = CarbonInterval::hours(48); $this->assertFalse($twoDays->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2))); } public function testIsBetweenTrue() { $oneDay = CarbonInterval::day(); $this->assertTrue($oneDay->isBetween(CarbonInterval::hours(12), CarbonInterval::hours(36))); $twoDays = CarbonInterval::hours(48); $this->assertTrue($twoDays->isBetween(CarbonInterval::day(), CarbonInterval::days(3), false)); $this->assertTrue($twoDays->isBetween(CarbonInterval::day(), CarbonInterval::days(3), true)); $this->assertTrue($twoDays->isBetween(CarbonInterval::day(), CarbonInterval::days(3))); $this->assertTrue($twoDays->isBetween(CarbonInterval::day(), CarbonInterval::days(2))); } } ================================================ FILE: tests/CarbonInterval/ConstructTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\OutOfRangeException; use Carbon\Unit; use DateInterval; use Exception; use Tests\AbstractTestCase; class ConstructTest extends AbstractTestCase { public function testInheritedConstruct() { /** @phpstan-var CarbonInterval $ci */ $ci = CarbonInterval::createFromDateString('1 hour'); $this->assertSame('PT1H', $ci->spec()); $ci = new CarbonInterval('PT0S'); $this->assertInstanceOf(CarbonInterval::class, $ci); $this->assertInstanceOf(DateInterval::class, $ci); $this->assertSame('PT0S', $ci->spec()); $ci = new CarbonInterval('P1Y2M3D'); $this->assertSame('P1Y2M3D', $ci->spec()); $ci = CarbonInterval::create('PT0S'); $this->assertSame('PT0S', $ci->spec()); $ci = CarbonInterval::create('P1Y2M3D'); $this->assertSame('P1Y2M3D', $ci->spec()); $ci = CarbonInterval::create('P1Y2M3.0D'); $this->assertSame('P1Y2M3D', $ci->spec()); $ci = CarbonInterval::create('PT9.5H+85M'); $this->assertSame('PT9H115M', $ci->spec()); $ci = CarbonInterval::create('PT9H+85M'); $this->assertSame('PT9H85M', $ci->spec()); $ci = CarbonInterval::create('PT1999999999999.5H+85M'); $this->assertSame('PT1999999999999H115M', $ci->spec()); } public function testConstructWithDateInterval() { $month = (PHP_VERSION_ID === 8_03_20) ? 6 : -6; // PHP 8.3.20 triggers segfault with negative or zero values $ci = new CarbonInterval(new DateInterval('P1Y2M3D')); $this->assertSame('P1Y2M3D', $ci->spec()); $interval = new DateInterval('P1Y2M3D'); $interval->m = $month; $interval->invert = 1; $ci = new CarbonInterval($interval); $this->assertSame(1, $ci->y); $this->assertSame($month, $ci->m); $this->assertSame(3, $ci->d); $this->assertSame(1, $ci->invert); } public function testDefaults() { $ci = new CarbonInterval(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); } public function testNulls() { $ci = new CarbonInterval(null, null, null, null, null, null); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); $ci = CarbonInterval::days(null); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); } public function testZeroes() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 0); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); $ci = CarbonInterval::days(0); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); } public function testZeroesChained() { $ci = CarbonInterval::days(0)->week(0)->minutes(0); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); } public function testYears() { $ci = new CarbonInterval(1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 1, 0, 0, 0, 0, 0); $ci = CarbonInterval::years(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 2, 0, 0, 0, 0, 0); $ci = CarbonInterval::year(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 1, 0, 0, 0, 0, 0); $ci = CarbonInterval::year(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 3, 0, 0, 0, 0, 0); } public function testMonths() { $ci = new CarbonInterval(0, 1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 1, 0, 0, 0, 0); $ci = CarbonInterval::months(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 2, 0, 0, 0, 0); $ci = CarbonInterval::month(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 1, 0, 0, 0, 0); $ci = CarbonInterval::month(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 3, 0, 0, 0, 0); } public function testWeeks() { $ci = new CarbonInterval(0, 0, 1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 7, 0, 0, 0); $ci = CarbonInterval::weeks(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 14, 0, 0, 0); $ci = CarbonInterval::week(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 7, 0, 0, 0); $ci = CarbonInterval::week(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 21, 0, 0, 0); } public function testDays() { $ci = new CarbonInterval(0, 0, 0, 1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 1, 0, 0, 0); $ci = CarbonInterval::days(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 2, 0, 0, 0); $ci = CarbonInterval::dayz(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 2, 0, 0, 0); $ci = CarbonInterval::day(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 1, 0, 0, 0); $ci = CarbonInterval::day(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 3, 0, 0, 0); } public function testHours() { $ci = new CarbonInterval(0, 0, 0, 0, 1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 1, 0, 0); $ci = CarbonInterval::hours(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 2, 0, 0); $ci = CarbonInterval::hour(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 1, 0, 0); $ci = CarbonInterval::hour(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 3, 0, 0); } public function testMinutes() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 1, 0); $ci = CarbonInterval::minutes(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 2, 0); $ci = CarbonInterval::minute(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 1, 0); $ci = CarbonInterval::minute(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 3, 0); } public function testSeconds() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 0, 1); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 1); $ci = CarbonInterval::seconds(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 2); $ci = CarbonInterval::second(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 1); $ci = CarbonInterval::second(3); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 3); } public function testMilliseconds() { $ci = CarbonInterval::milliseconds(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); $this->assertSame(2, $ci->milliseconds); $ci = CarbonInterval::millisecond(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); $this->assertSame(1, $ci->milliseconds); } public function testMicroseconds() { $ci = CarbonInterval::microseconds(2); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); $this->assertSame(2, $ci->microseconds); $ci = CarbonInterval::microsecond(); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); $this->assertSame(1, $ci->microseconds); } public function testYearsAndHours() { $ci = new CarbonInterval(5, 0, 0, 0, 3, 0, 0); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 5, 0, 0, 3, 0, 0); } public function testAll() { $ci = new CarbonInterval(5, 6, 2, 5, 9, 10, 11); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 5, 6, 19, 9, 10, 11); } public function testAllWithCreate() { $ci = CarbonInterval::create(5, 6, 2, 5, 9, 10, 11); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 5, 6, 19, 9, 10, 11); } public function testInstance() { $ci = CarbonInterval::instance(new DateInterval('P2Y1M5DT22H33M44S')); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 2, 1, 5, 22, 33, 44); $this->assertFalse($ci->days); } public function testInstanceWithSkipCopy() { $ci = CarbonInterval::instance(new DateInterval('P2Y1M5DT22H33M44S')); $copy = CarbonInterval::instance($ci, [], true); $this->assertSame($ci, $copy); } public function testInstanceWithNegativeDateInterval() { $di = new DateInterval('P2Y1M5DT22H33M44S'); $di->invert = 1; $ci = CarbonInterval::instance($di); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 2, 1, 5, 22, 33, 44); $this->assertFalse($ci->days); $this->assertSame(1, $ci->invert); } public function testInstanceWithDays() { $expectedDiff = PHP_VERSION_ID < 8_02_00 ? false : 21; $diff = Carbon::now()->diffAsDateInterval(Carbon::now()->addWeeks(3)); $ci = CarbonInterval::instance($diff); $this->assertCarbonInterval($ci, 0, 0, 21, 0, 0, 0); $this->assertSame($expectedDiff, $ci->days); $this->assertSame($expectedDiff, $ci->toDateInterval()->days); $ci2 = CarbonInterval::instance($ci->toDateInterval()); $this->assertCarbonInterval($ci2, 0, 0, 21, 0, 0, 0); $this->assertSame($expectedDiff, $ci2->days); $this->assertSame($expectedDiff, $ci2->toDateInterval()->days); $ci3 = unserialize(serialize($ci2)); $this->assertCarbonInterval($ci3, 0, 0, 21, 0, 0, 0); $this->assertSame($expectedDiff, $ci3->days); $this->assertSame($expectedDiff, $ci3->toDateInterval()->days); $ci = Carbon::now()->diffAsCarbonInterval(Carbon::now()->addWeeks(3)); $this->assertCarbonInterval($ci, 0, 0, 21, 0, 0, 0); $this->assertSame($expectedDiff, $ci->days); $this->assertSame($expectedDiff, $ci->toDateInterval()->days); } public function testInstanceWithoutDays() { $ci = CarbonInterval::fromString('1 day 3 hours'); $this->assertCarbonInterval($ci, 0, 0, 1, 3, 0, 0); $this->assertFalse($ci->days); $this->assertFalse($ci->toDateInterval()->days); $ci2 = CarbonInterval::instance($ci->toDateInterval()); $this->assertCarbonInterval($ci2, 0, 0, 1, 3, 0, 0); $this->assertFalse($ci2->days); $this->assertFalse($ci2->toDateInterval()->days); $ci3 = unserialize(serialize($ci2)); $this->assertCarbonInterval($ci3, 0, 0, 1, 3, 0, 0); $this->assertFalse($ci3->days); $this->assertFalse($ci3->toDateInterval()->days); } public function testCopy() { $one = CarbonInterval::days(10); $two = $one->hours(6)->copy()->hours(3); $this->assertCarbonInterval($one, 0, 0, 10, 6, 0, 0); $this->assertCarbonInterval($two, 0, 0, 10, 3, 0, 0); } public function testMake() { $this->assertCarbonInterval(CarbonInterval::make(3, 'hours'), 0, 0, 0, 3, 0, 0); $this->assertCarbonInterval(CarbonInterval::make('3 hours 30 m'), 0, 0, 0, 3, 30, 0); $this->assertCarbonInterval(CarbonInterval::make('PT5H'), 0, 0, 0, 5, 0, 0); $this->assertCarbonInterval(CarbonInterval::make('PT13.516837S'), 0, 0, 0, 0, 0, 13, 516_837); $this->assertCarbonInterval(CarbonInterval::make('PT32.245S'), 0, 0, 0, 0, 0, 32, 245_000); $this->assertCarbonInterval(CarbonInterval::make('PT13.000001S'), 0, 0, 0, 0, 0, 13, 1); $this->assertCarbonInterval(CarbonInterval::make('PT13.001S'), 0, 0, 0, 0, 0, 13, 1_000); $this->assertCarbonInterval(CarbonInterval::make(new DateInterval('P1D')), 0, 0, 1, 0, 0, 0); $this->assertCarbonInterval(CarbonInterval::make(new CarbonInterval('P2M')), 0, 2, 0, 0, 0, 0); $this->assertNull(CarbonInterval::make(3)); $this->assertSame(3.0, CarbonInterval::make('3 milliseconds')->totalMilliseconds); $this->assertSame(3.0, CarbonInterval::make('3 microseconds')->totalMicroseconds); $this->assertSame(21.0, CarbonInterval::make('3 weeks')->totalDays); $this->assertSame(9.0, CarbonInterval::make('3 quarters')->totalMonths); $this->assertSame(30.0, CarbonInterval::make('3 decades')->totalYears); $this->assertSame(300.0, CarbonInterval::make('3 centuries')->totalYears); $this->assertSame(3000.0, CarbonInterval::make('3 millennia')->totalYears); } public function testBadFormats() { $this->expectExceptionObject(new Exception('PT1999999999999.5.5H+85M')); CarbonInterval::create('PT1999999999999.5.5H+85M'); } public function testOutOfRange() { $this->expectExceptionObject(new OutOfRangeException( 'hour', -0x7fffffffffffffff, 0x7fffffffffffffff, 999999999999999999999999 )); CarbonInterval::create('PT999999999999999999999999H'); } public function testCallInvalidStaticMethod() { $this->expectExceptionObject(new BadMethodCallException( 'Unknown fluent constructor \'anything\'', )); CarbonInterval::anything(); } public function testOriginal() { $this->assertSame('3 hours', CarbonInterval::make(3, 'hours')->original()); $this->assertSame('3 hours 30 m', CarbonInterval::make('3 hours 30 m')->original()); $this->assertSame('PT5H', CarbonInterval::make('PT5H')->original()); $interval = new DateInterval('P1D'); $this->assertSame($interval, CarbonInterval::make($interval)->original()); $interval = new CarbonInterval('P2M'); $this->assertSame($interval, CarbonInterval::make($interval)->original()); } public function testCreateFromDateString() { $this->assertCarbonInterval(CarbonInterval::createFromDateString('3 hours'), 0, 0, 0, 3, 0, 0); $this->assertCarbonInterval(CarbonInterval::createFromDateString('46 days, 43 hours and 57 minutes'), 0, 0, 46, 43, 57, 0); } public function testCreateFromDateIncorrectString() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('foo bar', true), )); CarbonInterval::createFromDateString('foo bar'); } public function testCreateFromDateIncorrectStringWithErrorAsException() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('foo bar', true), )); $this->withErrorAsException(function () { CarbonInterval::createFromDateString('foo bar'); }); } public function testMakeFromDateIncorrectString() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('foo bar', true), )); CarbonInterval::make('foo bar'); } public function testMakeFromDateIncorrectStringWithErrorAsException() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('foo bar', true), )); $this->withErrorAsException(function () { CarbonInterval::make('foo bar'); }); } public function testEnums() { $this->assertCarbonInterval(CarbonInterval::make(3, Unit::Hour), 0, 0, 0, 3, 0, 0); $this->assertCarbonInterval(CarbonInterval::make(Unit::Week), 0, 0, 7, 0, 0, 0); } public function testFromSerialization() { $past = new Carbon('-3 Days'); $today = new Carbon('today'); $interval = $today->diffAsCarbonInterval($past); /** @var CarbonInterval $copy */ $copy = unserialize(serialize($interval)); $this->assertInstanceOf(CarbonInterval::class, $copy); $this->assertSame('2 days', $interval->forHumans(parts: 1)); $this->assertSame('2 days', $copy->forHumans(parts: 1)); $this->assertSame(['en'], array_keys($interval->getLocalTranslator()->getMessages()) ?: ['en']); $this->assertSame(['en'], array_keys($copy->getLocalTranslator()->getMessages()) ?: ['en']); $this->assertSame($interval->locale, $copy->locale); // Ignore translator for the English comparison $copy->setLocalTranslator($interval->getLocalTranslator()); $this->assertSameIntervals($interval, $copy, 1); $interval = $today->locale('ja')->diffAsCarbonInterval($past); /** @var CarbonInterval $copy */ $copy = unserialize(serialize($interval)); $this->assertInstanceOf(CarbonInterval::class, $copy); $this->assertSame('二日', $interval->forHumans(['altNumbers' => true, 'parts' => 1])); $this->assertSame('二日', $copy->forHumans(['altNumbers' => true, 'parts' => 1])); $this->assertSame(['ja'], array_keys($interval->getLocalTranslator()->getMessages())); $this->assertSame(['ja'], array_keys($copy->getLocalTranslator()->getMessages())); $this->assertSameIntervals($interval, $copy, 1); } public function testFromSerializationConst() { $past = new Carbon('2024-01-01 00:00:00'); $today = new Carbon('2024-01-03 06:39:47.065034'); $interval = $today->diffAsCarbonInterval($past); /** @var CarbonInterval $copy */ $copy = unserialize(serialize($interval)); $this->assertInstanceOf(CarbonInterval::class, $copy); $this->assertSame('2 days', $interval->forHumans(parts: 1)); $this->assertSame('2 days', $copy->forHumans(parts: 1)); $this->assertSame(['en'], array_keys($interval->getLocalTranslator()->getMessages()) ?: ['en']); $this->assertSame(['en'], array_keys($copy->getLocalTranslator()->getMessages()) ?: ['en']); $this->assertSame($interval->locale, $copy->locale); // Ignore translator for the English comparison $copy->setLocalTranslator($interval->getLocalTranslator()); $this->assertSameIntervals($interval, $copy, 1); $interval = $today->locale('ja')->diffAsCarbonInterval($past); /** @var CarbonInterval $copy */ $copy = unserialize(serialize($interval)); $this->assertInstanceOf(CarbonInterval::class, $copy); $this->assertSame('二日', $interval->forHumans(['altNumbers' => true, 'parts' => 1])); $this->assertSame('二日', $copy->forHumans(['altNumbers' => true, 'parts' => 1])); $this->assertSame(['ja'], array_keys($interval->getLocalTranslator()->getMessages())); $this->assertSame(['ja'], array_keys($copy->getLocalTranslator()->getMessages())); $this->assertSameIntervals($interval, $copy, 1); } public function testFromV2SerializedInterval() { $serializedData = trim(file_get_contents(__DIR__.'/../Fixtures/serialized-interval-from-v2.txt')); $interval = unserialize($serializedData); $this->assertInstanceOf(CarbonInterval::class, $interval); $this->assertSame(2, $interval->m); $this->assertSame(5.4e-5, $interval->f); } } ================================================ FILE: tests/CarbonInterval/CreateFromFormatTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Carbon\Exceptions\ParseErrorException; use Tests\AbstractTestCase; class CreateFromFormatTest extends AbstractTestCase { public function testDefaults() { $this->expectExceptionObject(new ParseErrorException( 'number', '', )); CarbonInterval::createFromFormat('H:i:s', ''); } public function testNulls() { $this->expectExceptionObject(new ParseErrorException( 'number', '', )); CarbonInterval::createFromFormat('H:i:s', null); } public function testTrailingData() { $this->expectExceptionObject(new ParseErrorException( 'end of string', ':25', )); CarbonInterval::createFromFormat('H:i', '01:30:25'); } public function testInvalidSubstitute() { $this->expectExceptionObject( new ParseErrorException( "'N'", '4', 'Allowed substitutes for interval formats are y, Y, o, m, n, W, d, j, z, h, g, H, G, i, s, u, v'. "\n". 'See https://php.net/manual/en/function.date.php for their meaning', ), ); CarbonInterval::createFromFormat('N', '4'); } public function testYears() { $ci = CarbonInterval::createFromFormat('Y', '1'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 1, 0, 0, 0, 0, 0); $ci = CarbonInterval::createFromFormat('Y', '2'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 2, 0, 0, 0, 0, 0); } public function testMonths() { $ci = CarbonInterval::createFromFormat('m', '1'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 1, 0, 0, 0, 0); $ci = CarbonInterval::createFromFormat('m', '2'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 2, 0, 0, 0, 0); } public function testWeeks() { $ci = CarbonInterval::createFromFormat('W', '1'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 7, 0, 0, 0); $ci = CarbonInterval::createFromFormat('W', '2'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 14, 0, 0, 0); } public function testDays() { $ci = CarbonInterval::createFromFormat('d', '1'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 1, 0, 0, 0); $ci = CarbonInterval::createFromFormat('d', '2'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 2, 0, 0, 0); } public function testWeeksAndDays() { $ci = CarbonInterval::createFromFormat('W d', '3 5'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 26, 0, 0, 0); $ci = CarbonInterval::createFromFormat('W d', '2 -6'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 8, 0, 0, 0); } public function testHours() { $ci = CarbonInterval::createFromFormat('H', '1'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 1, 0, 0); $ci = CarbonInterval::createFromFormat('H', '2'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 2, 0, 0); } public function testMinutes() { $ci = CarbonInterval::createFromFormat('i', '01'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 1, 0); $ci = CarbonInterval::createFromFormat('i', '02'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 2, 0); } public function testSeconds() { $ci = CarbonInterval::createFromFormat('s', '01'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 1); $ci = CarbonInterval::createFromFormat('s', '02'); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 2); } public function testDecimalSeconds() { $ci = CarbonInterval::createFromFormat('s.v', '1.5'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 1, 500000); $ci = CarbonInterval::createFromFormat('s.u', '1.2534'); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 1, 253400); } public function testMilliseconds() { $ci = CarbonInterval::createFromFormat('v', '100'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0, 100000); $this->assertSame(100000, $ci->microseconds); $ci = CarbonInterval::createFromFormat('v', '200'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0, 200000); } public function testMicroseconds() { $ci = CarbonInterval::createFromFormat('u', '100000'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0, 100000); $this->assertSame(100000, $ci->microseconds); $ci = CarbonInterval::createFromFormat('u', '200000'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0, 200000); } public function testTime() { $ci = CarbonInterval::createFromFormat('H:i:s', '00:05:00'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 5, 0, 0); } public function testAll() { $ci = CarbonInterval::createFromFormat('Y-m-d H:i:s.u', '2000-01-02 3:04:05.500000'); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 2000, 1, 2, 3, 4, 5, 500000); } public function testCopy() { $one = CarbonInterval::createFromFormat('H:i:s', '10:10:10'); $two = $one->copy()->hours(3)->minutes(3)->seconds(3); $this->assertCarbonInterval($one, 0, 0, 0, 10, 10, 10); $this->assertCarbonInterval($two, 0, 0, 0, 3, 3, 3); } } ================================================ FILE: tests/CarbonInterval/DivideTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class DivideTest extends AbstractTestCase { public function testDivideSimple() { $ci = CarbonInterval::hours(3)->minutes(43)->divide(0.25); $this->assertCarbonInterval($ci, 0, 0, 0, 14, 52, 00); } public function testDivideMoreThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->divide(1 / 2.75); $this->assertCarbonInterval($ci, 11, 10, 3, 20, 13, 0); } public function testDivideOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->divide(1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); } public function testDivideLessThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->divide(3); $this->assertCarbonInterval($ci, 1, 5, 6, 9, 43, 23); } public function testDivideLessThanZero() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->divide(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(1, $ci->invert); } public function testDivideLessThanZeroWithInvertedInterval() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11); $ci->invert = 1; $ci->divide(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(0, $ci->invert); } } ================================================ FILE: tests/CarbonInterval/Fixtures/Mixin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval\Fixtures; use Carbon\CarbonInterval; class Mixin { public $factor; public function setFactor() { $mixin = $this; return function ($factor) use ($mixin) { $mixin->factor = $factor; }; } public function doMultiply() { $mixin = $this; return function () use ($mixin) { /** @var CarbonInterval $interval */ $interval = $this; return $interval->times($mixin->factor); }; } } ================================================ FILE: tests/CarbonInterval/Fixtures/MixinTrait.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval\Fixtures; trait MixinTrait { public function andAgain() { return $this->times(2); } public function copyAndAgain() { return $this->copy()->andAgain(); } } ================================================ FILE: tests/CarbonInterval/Fixtures/MyCarbonInterval.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval\Fixtures; use Carbon\CarbonInterval; class MyCarbonInterval extends CarbonInterval { // } ================================================ FILE: tests/CarbonInterval/FloatSettersEnabledTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use RuntimeException; use Tests\AbstractTestCase; class FloatSettersEnabledTest extends AbstractTestCase { protected function setUp(): void { parent::setUp(); CarbonInterval::enableFloatSetters(); } protected function tearDown(): void { CarbonInterval::enableFloatSetters(false); parent::tearDown(); } public function testInheritedConstruct() { $ci = new CarbonInterval('PT0S'); $ci->hours(0.5); $this->assertSame('PT30M', $ci->spec()); $ci = new CarbonInterval('P1D'); $ci->hours(0.5); $this->assertSame('P1DT30M', $ci->spec()); $ci = new CarbonInterval('PT4H'); $ci->hours(0.5); $this->assertSame('PT30M', $ci->spec()); $period = CarbonPeriod::since('2018-04-21 00:00:00')->hours(0.5)->until('2018-04-21 02:00:00'); $this->assertSame('2018-04-21 00:30:00', $period->toArray()[1]->format('Y-m-d H:i:s')); CarbonInterval::enableFloatSetters(false); $ci = new CarbonInterval('PT4H'); $ci->hours(0.5); $this->assertSame('PT0S', $ci->spec()); } public function testOverridePrevention() { $this->expectExceptionObject(new RuntimeException( 'You cannot set hour to a float value as minute would be overridden, '. 'set it first to 0 explicitly if you really want to erase its value' )); $ci = new CarbonInterval('PT10M'); $ci->hours(0.5); } } ================================================ FILE: tests/CarbonInterval/ForHumansTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\Translator as CarbonTranslator; use Symfony\Component\Translation\Loader\ArrayLoader; use Symfony\Component\Translation\Translator; use Tests\AbstractTestCase; use Tests\CarbonInterval\Fixtures\MyCarbonInterval; class ForHumansTest extends AbstractTestCase { protected function tearDown(): void { parent::tearDown(); CarbonInterval::setLocale('en'); } public function testGetTranslator() { /** @var CarbonTranslator $t */ $t = CarbonInterval::getTranslator(); $this->assertNotNull($t); $this->assertSame('en', $t->getLocale()); $this->assertSame('en', CarbonInterval::day()->locale()); } public function testResetTranslator() { /** @var CarbonTranslator $t */ $t = MyCarbonInterval::getTranslator(); $this->assertNotNull($t); $this->assertSame('en', $t->getLocale()); $this->assertSame('en', CarbonInterval::day()->locale()); } public function testSetTranslator() { /** @var CarbonTranslator $ori */ $ori = CarbonInterval::getTranslator(); $t = new Translator('fr'); $t->addLoader('array', new ArrayLoader()); CarbonInterval::setTranslator($t); /** @var CarbonTranslator $t */ $t = CarbonInterval::getTranslator(); $this->assertNotNull($t); $this->assertSame('fr', $t->getLocale()); CarbonInterval::setTranslator($ori); } public function testDumpTranslator() { $t = new CarbonTranslator('tr_CY'); $this->assertSame([ 'locale' => 'tr_CY', ], $t->__debugInfo()); } public function testGetLocale() { CarbonInterval::setLocale('en'); $this->assertSame('en', CarbonInterval::getLocale()); } public function testSetLocale() { CarbonInterval::setLocale('en'); $this->assertSame('en', CarbonInterval::getLocale()); CarbonInterval::setLocale('fr'); $this->assertSame('fr', CarbonInterval::getLocale()); } public function testOptions() { CarbonInterval::setLocale('en'); $this->assertSame('1 year 2 months ago', CarbonInterval::year()->add(CarbonInterval::months(2))->forHumans(CarbonInterface::DIFF_RELATIVE_TO_NOW)); $this->assertSame('1 year before', CarbonInterval::year()->add(CarbonInterval::months(2))->forHumans(CarbonInterface::DIFF_RELATIVE_TO_OTHER, 1)); } public function testYear() { CarbonInterval::setLocale('en'); $this->assertSame('1 year', CarbonInterval::year()->forHumans()); } public function testYearToString() { CarbonInterval::setLocale('en'); $this->assertSame('1 year:abc', CarbonInterval::year().':abc'); } public function testYears() { CarbonInterval::setLocale('en'); $this->assertSame('2 years', CarbonInterval::years(2)->forHumans()); } public function testYearsAndMonth() { CarbonInterval::setLocale('en'); $this->assertSame('2 years 1 month', CarbonInterval::create(2, 1)->forHumans()); } public function testAll() { CarbonInterval::setLocale('en'); $ci = CarbonInterval::create(11, 1, 2, 5, 22, 33, 55)->forHumans(); $this->assertSame('11 years 1 month 2 weeks 5 days 22 hours 33 minutes 55 seconds', $ci); } public function testYearsAndMonthInFrench() { CarbonInterval::setLocale('fr'); $this->assertSame('2 ans 1 mois', CarbonInterval::create(2, 1)->forHumans()); } public function testYearsAndMonthInGerman() { CarbonInterval::setLocale('de'); $this->assertSame('1 Jahr 1 Monat', CarbonInterval::create(1, 1)->forHumans()); $this->assertSame('2 Jahre 1 Monat', CarbonInterval::create(2, 1)->forHumans()); } public function testYearsAndMonthInBulgarian() { CarbonInterval::setLocale('bg'); $this->assertSame('1 година 1 месец', CarbonInterval::create(1, 1)->forHumans()); $this->assertSame('2 години 1 месец', CarbonInterval::create(2, 1)->forHumans()); } public function testYearsAndMonthInCatalan() { CarbonInterval::setLocale('ca'); $this->assertSame('1 any 1 mes', CarbonInterval::create(1, 1)->forHumans()); $this->assertSame('2 anys 1 mes', CarbonInterval::create(2, 1)->forHumans()); } public function testYearsAndMonthInCzech() { CarbonInterval::setLocale('cs'); $this->assertSame('1 rok 1 měsíc', CarbonInterval::create(1, 1)->forHumans()); $this->assertSame('2 roky 1 měsíc', CarbonInterval::create(2, 1)->forHumans()); } public function testYearsAndMonthInGreek() { CarbonInterval::setLocale('el'); $this->assertSame('1 χρόνος 1 μήνας', CarbonInterval::create(1, 1)->forHumans()); $this->assertSame('2 χρόνια 1 μήνας', CarbonInterval::create(2, 1)->forHumans()); } public function testYearsAndMonthsInDanish() { CarbonInterval::setLocale('da'); $this->assertSame('1 år 1 måned', CarbonInterval::create(1, 1)->forHumans()); $this->assertSame('2 år 1 måned', CarbonInterval::create(2, 1)->forHumans()); } public function testCustomJoin() { $interval = CarbonInterval::create(1, 1, 0, 1, 1)->locale('fr'); $this->assertSame('1 an 1 mois 1 jour 1 heure', $interval->forHumans()); $this->assertSame('1 an, 1 mois, 1 jour et 1 heure', $interval->forHumans([ 'join' => true, ])); $this->assertSame('1 နှစ် 1 လ 1 ရက် 1 နာရီ', $interval->copy()->locale('my')->forHumans([ 'join' => true, ])); $this->assertSame('တစ်နှစ် တစ်လ တစ်ရက် တစ်နာရီ', $interval->copy()->locale('my')->forHumans([ 'join' => true, 'aUnit' => true, ])); $this->assertSame('un an, un mois, un jour, une heure', $interval->forHumans([ 'join' => ', ', 'aUnit' => true, ])); $this->assertSame('un an et un mois et un jour et aussi une heure', $interval->forHumans([ 'join' => [' et ', ' et aussi '], 'aUnit' => true, ])); $interval = CarbonInterval::create(1, 1, 0, 1, 1)->locale('en'); $this->assertSame('1 year 1 month 1 day 1 hour', $interval->forHumans()); $this->assertSame('1 year, 1 month, 1 day and 1 hour', $interval->forHumans([ 'join' => true, ])); $this->assertSame('1 year, 1 month, 1 day, 1 hour', $interval->forHumans([ 'join' => ', ', ])); $this->assertSame('a year and a month and a day and also an hour', $interval->forHumans([ 'join' => [' and ', ' and also '], 'aUnit' => true, ])); $this->assertSame('[1 year;1 month;1 day;1 hour]', $interval->forHumans([ 'join' => function ($list) { return '['.implode(';', $list).']'; }, ])); } public function testChineseJoin() { $interval = CarbonInterval::create(1, 1, 0, 1, 1)->locale('zh_Hans'); $this->assertSame('1年1个月1天1小时', $interval->forHumans()); $this->assertSame('1年1个月1天1小时', $interval->forHumans([ 'join' => true, ])); $this->assertSame('1 年 1 个月 1 天 1 小时', $interval->forHumans([ 'join' => false, ])); $this->assertSame('1年1个月1天1小时', $interval->forHumans([ 'join' => '', ])); $this->assertSame('1 年 1 个月 1 天 1 小时', $interval->forHumans([ 'join' => ' ', ])); $this->assertSame('1年-1个月-1天-1小时', $interval->forHumans([ 'join' => '-', ])); } public function testOptionsAsArray() { $interval = CarbonInterval::create(1, 1, 0, 1, 1)->locale('fr'); $this->assertSame('1 an', $interval->forHumans([ 'join' => 'foo', 'parts' => 1, ])); $this->assertSame('il y a un an', $interval->forHumans([ 'join' => 'foo', 'aUnit' => true, 'parts' => 1, 'syntax' => CarbonInterface::DIFF_RELATIVE_TO_NOW, ])); $interval = CarbonInterval::day(); $this->assertSame('1d', $interval->forHumans([ 'short' => true, ])); $interval = CarbonInterval::day(); $this->assertSame('yesterday', $interval->forHumans([ 'parts' => 1, 'syntax' => CarbonInterface::DIFF_RELATIVE_TO_NOW, 'options' => CarbonInterface::ONE_DAY_WORDS, ])); } public function testRoundYears() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::years(2)->months(11); $this->assertSame('3 years', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::years(2)->months(5)->days(70); $this->assertSame('3 years', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundMonths() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::months(2)->weeks(3); $this->assertSame('3 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundUp() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->hours(23); $this->assertSame('3 days', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundDown() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->hours(11); $this->assertSame('2 days', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundMinutes() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->hours(11)->minutes(15); $this->assertSame('2 days 11 hours', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::ROUND])); } public function testRoundDownWhenNextIntervalIsNonSequential() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->minutes(59); $this->assertSame('2 days', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundMultipleParts() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->minutes(45)->seconds(59); $this->assertSame('2 days 46 minutes', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::ROUND])); } public function testRoundMultiplePartsGap() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->seconds(59); $this->assertSame('2 days 59 seconds', $interval->forHumans(['parts' => 2])); $this->assertSame('2 days 59 seconds', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::ROUND])); $this->assertSame('2 days', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundWeeks() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(13); $this->assertSame('2 weeks', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundWeeksWithMultipleParts() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(13); $this->assertSame('1 week 6 days', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::ROUND])); } public function testRoundOverflowNonSequentialRoundUp() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::years(2)->months(35); $this->assertSame('5 years', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundOverflowNonSequentialRoundDown() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::years(2)->months(37); $this->assertSame('5 years', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); } public function testRoundCarryOverDoesntMatter() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(2)->hours(11)->minutes(59); $this->assertSame('2 days', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::days(2)->minutes(780); $this->assertSame('3 days', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::days(2)->minutes(59)->seconds(58); $this->assertSame('2 days 1 hour', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::days(2)->minutes(59)->seconds(1); $this->assertSame('2 days 1 hour', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::CEIL])); $interval = CarbonInterval::days(2)->minutes(59)->seconds(58); $this->assertSame('2 days 59 minutes', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::FLOOR])); // Floor is not the default behavior, see the difference below: $interval = CarbonInterval::days(2)->minutes(59)->seconds(62); $this->assertSame('2 days 1 hour', $interval->forHumans(['parts' => 2, 'options' => CarbonInterface::FLOOR])); $interval = CarbonInterval::days(2)->minutes(59)->seconds(62); $this->assertSame('2 days 59 minutes', $interval->forHumans(['parts' => 2])); $start = Carbon::create(2009, 9)->startOfMonth(); $end = Carbon::create(2012, 2)->endOfMonth(); $interval = CarbonInterval::instance($start->diff($end))->forHumans( Carbon::DIFF_ABSOLUTE, false, 2, Carbon::CEIL, ); $this->assertSame('2 years 6 months', $interval); $interval = CarbonInterval::months(2)->days(30); $this->assertSame('3 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::months(2)->days(31); $this->assertSame('3 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::months(2)->days(32); $this->assertSame('3 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::ROUND])); $interval = CarbonInterval::months(2)->days(30); $this->assertSame('3 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::CEIL])); $interval = CarbonInterval::months(2)->days(31); $this->assertSame('3 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::CEIL])); $interval = CarbonInterval::months(2)->days(32); $this->assertSame('4 months', $interval->forHumans(['parts' => 1, 'options' => CarbonInterface::CEIL])); } public function testCeilShortMonth() { Carbon::setTestNow('2022-02-08T10:27:03Z'); $this->assertSame( '4 weeks ago', Carbon::parse('2022-01-11 15:36:29')->diffForHumans(['parts' => 1, 'options' => Carbon::CEIL]) ); $this->assertSame( '1 month ago', Carbon::parse('2022-01-10 16:57:38')->diffForHumans(['parts' => 1, 'options' => Carbon::CEIL]) ); } public function testSkipUnits() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::days(15)->hours(11)->minutes(15); $this->assertSame('15 days 11 hours', $interval->forHumans([ 'parts' => 2, 'skip' => 'week', ])); $this->assertSame('15 days 675 minutes', $interval->forHumans([ 'parts' => 2, 'skip' => ['weeks', 'hours'], ])); $interval = CarbonInterval::days(15)->hours(11)->minutes(15); $this->assertSame('15 days 675 minutes', $interval->forHumans([ 'parts' => 2, 'skip' => ['weeks', 'hours'], ])); $factors = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors(['weeks' => [5, 'days']]); $interval = CarbonInterval::days(15)->hours(11)->minutes(15); $this->assertSame('15 days 675 minutes', $interval->forHumans([ 'parts' => 2, 'skip' => ['weeks', 'hours'], ])); CarbonInterval::setCascadeFactors([ 'weeks' => [5, 'days'], 'hours' => [30, 'minutes'], ]); $interval = CarbonInterval::days(15)->hours(11)->minutes(15); $this->assertSame('15 days 345 minutes', $interval->forHumans([ 'parts' => 2, 'skip' => ['weeks', 'hours'], ])); CarbonInterval::setCascadeFactors($factors); } public function testGetValuesSequence() { $this->assertSame([], CarbonInterval::days(0)->getValuesSequence()); } public function testMinimumUnitDefault() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::fromString('1 second 114 milliseconds'); $this->assertSame('1 second', $interval->forHumans(['parts' => 3])); } public function testMinimumUnitHours() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::fromString('1 hour 1 second 114 milliseconds'); $this->assertSame('1 hour', $interval->forHumans(['parts' => 3, 'minimumUnit' => 'hour'])); } public function testMinimumUnitMillisecondsShort() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::fromString('1 second 114 milliseconds'); $this->assertSame('1s 114ms', $interval->forHumans(['parts' => 3, 'short' => true, 'minimumUnit' => 'ms'])); } public function testMinimumUnitMicroseconds() { CarbonInterval::setLocale('fr'); $interval = CarbonInterval::fromString('1s 114ms 584µs'); $this->assertEquals( '1 seconde, 114 millisecondes et 584 microsecondes', $interval->forHumans(['parts' => 3, 'join' => true, 'minimumUnit' => 'µs']), ); } public function testMinimumUnitMillisecondsInFrenchAndGerman() { $interval = CarbonInterval::fromString('98756 milliseconds')->cascade(); $this->assertEquals( 'une minute, 38 secondes et 756 millisecondes', $interval->locale('fr')->forHumans(['parts' => 3, 'minimumUnit' => 'ms', 'join' => true, 'aUnit' => true]), ); $this->assertEquals( 'eine Minute, 38 Sekunden und 756 Millisekunden', $interval->locale('de')->forHumans(['parts' => 3, 'minimumUnit' => 'ms', 'join' => true, 'aUnit' => true]), ); } public function testMinimumUnitNoInterval() { CarbonInterval::setLocale('en'); $interval = CarbonInterval::fromString('1 second 114 milliseconds'); // Test with and without NO_ZERO_DIFF $this->assertSame('1 hour', $interval->forHumans(['parts' => 3, 'minimumUnit' => 'hour', 'options' => CarbonInterface::NO_ZERO_DIFF])); $this->assertSame('0 hours', $interval->forHumans(['parts' => 3, 'minimumUnit' => 'hour', 'options' => 0])); } } ================================================ FILE: tests/CarbonInterval/FromStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Generator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class FromStringTest extends AbstractTestCase { #[DataProvider('dataForValidStrings')] public function testReturnsInterval(string $string, CarbonInterval $expected) { $result = CarbonInterval::fromString($string); $this->assertEquals($expected->optimize(), $result->optimize(), "'$string' does not return expected interval."); } public static function dataForValidStrings(): Generator { // zero interval yield ['', new CarbonInterval(0)]; // single values yield ['1y', new CarbonInterval(1)]; yield ['1mo', new CarbonInterval(0, 1)]; yield ['1w', new CarbonInterval(0, 0, 1)]; yield ['1d', new CarbonInterval(0, 0, 0, 1)]; yield ['1h', new CarbonInterval(0, 0, 0, 0, 1)]; yield ['1m', new CarbonInterval(0, 0, 0, 0, 0, 1)]; yield ['1s', new CarbonInterval(0, 0, 0, 0, 0, 0, 1)]; yield ['1ms', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 1000)]; yield ['1µs', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 1)]; // single values with space yield ['1 y', new CarbonInterval(1)]; yield ['1 mo', new CarbonInterval(0, 1)]; yield ['1 w', new CarbonInterval(0, 0, 1)]; // fractions with integer result yield ['0.571428571429w', new CarbonInterval(0, 0, 0, 4)]; yield ['0.5d', new CarbonInterval(0, 0, 0, 0, 12)]; yield ['0.5h', new CarbonInterval(0, 0, 0, 0, 0, 30)]; yield ['0.5m', new CarbonInterval(0, 0, 0, 0, 0, 0, 30)]; // fractions with float result yield ['1.5w', new CarbonInterval(0, 0, 1, 3, 12)]; yield ['2.34d', new CarbonInterval(0, 0, 0, 2, 8, 9, 36)]; yield ['3.12h', new CarbonInterval(0, 0, 0, 0, 3, 7, 12)]; yield ['3.129h', new CarbonInterval(0, 0, 0, 0, 3, 7, 44, 400000)]; yield ['4.24m', new CarbonInterval(0, 0, 0, 0, 0, 4, 14, 400000)]; yield ['3.56s', new CarbonInterval(0, 0, 0, 0, 0, 0, 3, 560000)]; yield ['3.56ms', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 3560)]; // combinations yield ['2w 3d', new CarbonInterval(0, 0, 0, 17)]; yield ['1y 2mo 1.5w 3d', new CarbonInterval(1, 2, 1, 6, 12)]; // multi same values yield ['1y 2y', new CarbonInterval(3)]; yield ['1mo 20mo', new CarbonInterval(0, 21)]; yield ['1w 2w 3w', new CarbonInterval(0, 0, 6)]; yield ['10d 20d 30d', new CarbonInterval(0, 0, 0, 60)]; yield ['5h 15h 25h', new CarbonInterval(0, 0, 0, 0, 45)]; yield ['3m 3m 3m 1m', new CarbonInterval(0, 0, 0, 0, 0, 10)]; yield ['55s 45s 1s 2s 3s 4s', new CarbonInterval(0, 0, 0, 0, 0, 0, 110)]; yield ['1500ms 1623555µs', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 3123555)]; yield ['430 milli', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 430000)]; // multi same values with space yield ['1 y 2 y', new CarbonInterval(3)]; yield ['1 mo 20 mo', new CarbonInterval(0, 21)]; yield ['1 w 2 w 3 w', new CarbonInterval(0, 0, 6)]; // no-space values yield ['2w3d', new CarbonInterval(0, 0, 0, 17)]; yield ['1y2mo3w4d5h6m7s', new CarbonInterval(1, 2, 3, 4, 5, 6, 7)]; // written-out units yield ['1year 2month 3week 4day 5hour 6minute 7second', new CarbonInterval(1, 2, 3, 4, 5, 6, 7)]; yield ['1 year 2 month 3 week', new CarbonInterval(1, 2, 3)]; yield ['2 Years 3 Months 4 Weeks', new CarbonInterval(2, 3, 4)]; yield ['5 Days 6 Hours 7 Minutes 8 Seconds', new CarbonInterval(0, 0, 0, 5, 6, 7, 8)]; // ignore invalid format; parse only [num][char-format] or [num] [char-format] yield ['Hello! Please add 1y2w to ...', new CarbonInterval(1, 0, 2)]; yield ['nothing to parse :(', new CarbonInterval(0)]; // case insensitive yield ['1Y 3MO 1W 3D 12H 23M 42S', new CarbonInterval(1, 3, 1, 3, 12, 23, 42)]; // big numbers yield ['1999999999999.5 hours', new CarbonInterval(0, 0, 0, 0, 1999999999999, 30, 0)]; yield [(0x7fffffffffffffff).' days', new CarbonInterval(0, 0, 0, 0x7fffffffffffffff, 0, 0, 0)]; yield ['1999999999999.5 hours -85 minutes', new CarbonInterval(0, 0, 0, 0, 1999999999999, -55, 0)]; yield ['2.333 seconds', new CarbonInterval(0, 0, 0, 0, 0, 0, 2, 333000)]; } #[TestWith(['1q', '1q'])] #[TestWith(['about 12..14m', '12..'])] #[TestWith(['4h 13', '13'])] public function testThrowsExceptionForUnknownValues(string $string, string $part) { $message = null; try { CarbonInterval::fromString($string); } catch (InvalidArgumentException $exception) { $message = $exception->getMessage(); } $this->assertStringContainsString($part, $message); } } ================================================ FILE: tests/CarbonInterval/GettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\Translator; use DateTimeZone; use InvalidArgumentException; use Tests\AbstractTestCase; class GettersTest extends AbstractTestCase { public function testGettersThrowExceptionOnUnknownGetter() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown getter \'doesNotExit\'', )); /** @var mixed $interval */ $interval = CarbonInterval::year(); $interval->doesNotExit; } public function testGet() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(4, $ci->get('years')); } public function testYearsGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(4, $ci->years); } public function testMonthsGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(5, $ci->months); } public function testWeeksGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(6, $ci->weeks); } public function testDayzExcludingWeeksGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(5, $ci->daysExcludeWeeks); $this->assertSame(5, $ci->dayzExcludeWeeks); } public function testDayzGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(6 * 7 + 5, $ci->dayz); } public function testHoursGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(8, $ci->hours); } public function testMinutesGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(9, $ci->minutes); } public function testSecondsGetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $this->assertSame(10, $ci->seconds); } public function testStartAndEnd() { $interval = Carbon::parse('2020-08-10')->diff('2020-09-30'); $this->assertSame('2020-08-10 00:00:00', $interval->start()->format('Y-m-d H:i:s')); $this->assertSame('2020-09-30 00:00:00', $interval->end()->format('Y-m-d H:i:s')); $interval = CarbonInterval::fromString('1 month 20 days'); $this->assertNull($interval->start()); $this->assertNull($interval->end()); } public function testDebugInfo() { $ci = CarbonInterval::create(4, 0, 6, 5, 0, 9, 10); $this->assertSame([ 'y' => 4, 'd' => 47, 'i' => 9, 's' => 10, ], $ci->__debugInfo()); $ci->locale('it_IT'); $this->assertSame([ 'localTranslator' => Translator::get('it_IT'), 'y' => 4, 'd' => 47, 'i' => 9, 's' => 10, ], $ci->__debugInfo()); } public function testGetTimezone() { $this->assertNull(CarbonInterval::day()->tzName); $this->assertSame( 'America/New_York', CarbonInterval::day()->setTimezone('America/New_York')->tzName, ); $this->assertSame( 'America/New_York', CarbonInterval::day()->setTimezone( new DateTimeZone('America/New_York'), )->tzName, ); $this->assertSame( '+05:00', CarbonInterval::day()->setTimezone(5)->tzName, ); } } ================================================ FILE: tests/CarbonInterval/MacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCaseWithOldNow; use Tests\CarbonInterval\Fixtures\Mixin; use Tests\CarbonInterval\Fixtures\MixinTrait; class MacroTest extends AbstractTestCaseWithOldNow { public function testCarbonIsMacroableWhenNotCalledStatically() { CarbonInterval::macro('twice', function () { /** @var CarbonInterval $interval */ $interval = $this; return $interval->times(2); }); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame('2 days', $interval->twice()->forHumans()); CarbonInterval::macro('repeatInvert', function ($count = 0) { /** @var CarbonInterval $interval */ $interval = $this; return $count % 2 ? $interval->invert() : $interval; }); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame(0, $interval->repeatInvert()->invert); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame(1, $interval->repeatInvert(3)->invert); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame(0, $interval->repeatInvert(4)->invert); CarbonInterval::macro('otherParameterName', function ($other = true) { return $other; }); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertTrue($interval->otherParameterName()); } public function testCarbonIsMacroableWhenNotCalledStaticallyUsingThis() { CarbonInterval::macro('repeatInvert2', function ($count = 0) { /** @var CarbonInterval $interval */ $interval = $this; return $count % 2 ? $interval->invert() : $interval; }); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame(0, $interval->repeatInvert2()->invert); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame(1, $interval->repeatInvert2(3)->invert); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame(0, $interval->repeatInvert2(4)->invert); } public function testCarbonIsMacroableWhenCalledStatically() { CarbonInterval::macro('quarter', function () { return CarbonInterval::months(3); }); $this->assertSame('3 months', CarbonInterval::quarter()->forHumans()); CarbonInterval::macro('quarterIfEven', function ($value = 0) { return $value % 2 ? CarbonInterval::day() : CarbonInterval::months(3); }); $this->assertSame('3 months', CarbonInterval::quarterIfEven()->forHumans()); $this->assertSame('1 day', CarbonInterval::quarterIfEven(7)->forHumans()); $this->assertSame('3 months', CarbonInterval::quarterIfEven(-6)->forHumans()); } public function testCarbonIsMacroableWithNonClosureCallables() { CarbonInterval::macro('lower', 'strtolower'); /** @var mixed $interval */ $interval = CarbonInterval::day(); $this->assertSame('abc', $interval->lower('ABC')); $this->assertSame('abc', CarbonInterval::lower('ABC')); } public function testCarbonIsMixinable() { include_once __DIR__.'/Fixtures/Mixin.php'; $mixin = new Mixin(); CarbonInterval::mixin($mixin); CarbonInterval::setFactor(3); /** @var mixed $interval */ $interval = CarbonInterval::hours(2); $this->assertSame('6 hours', $interval->doMultiply()->forHumans()); } public function testMixinInstance() { include_once __DIR__.'/Fixtures/MixinTrait.php'; CarbonInterval::mixin(MixinTrait::class); $input = CarbonInterval::days(2); $copy = $input->copyAndAgain(); $this->assertSame('2 days', $input->forHumans()); $mutated = $input->andAgain(); $this->assertSame('4 days', $input->forHumans()); $this->assertSame('4 days', $mutated->forHumans()); $this->assertSame('4 days', $copy->forHumans()); $this->assertSame($input, $mutated); $this->assertNotSame($copy, $mutated); } } ================================================ FILE: tests/CarbonInterval/MultiplyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class MultiplyTest extends AbstractTestCase { public function testMultiplySimple() { $ci = CarbonInterval::hours(3)->minutes(43)->multiply(4); $this->assertCarbonInterval($ci, 0, 0, 0, 14, 52, 00); } public function testMultiplyMoreThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->multiply(2.75); $this->assertCarbonInterval($ci, 11, 10, 3, 20, 13, 0); } public function testMultiplyOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->multiply(1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); } public function testMultiplyLessThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->multiply(0.333); $this->assertCarbonInterval($ci, 1, 1, 6, 8, 53, 51); } public function testMultiplyZero() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->multiply(0); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); } public function testMultiplyLessThanZero() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->multiply(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(1, $ci->invert); } public function testMultiplyLessThanZeroWithInvertedInterval() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11); $ci->invert = 1; $ci->multiply(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(0, $ci->invert); } } ================================================ FILE: tests/CarbonInterval/ParseFromLocaleTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Generator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class ParseFromLocaleTest extends AbstractTestCase { #[DataProvider('dataForValidStrings')] public function testReturnsInterval(string $string, string $locale, CarbonInterval $expected) { $result = CarbonInterval::parseFromLocale($string, $locale); $this->assertEquals($expected->optimize(), $result->optimize(), "'{$string}' does not return expected interval."); } public static function dataForValidStrings(): Generator { // zero interval yield ['', 'en', new CarbonInterval(0)]; // single values yield ['1y', 'en', new CarbonInterval(1)]; yield ['1mo', 'en', new CarbonInterval(0, 1)]; yield ['1w', 'en', new CarbonInterval(0, 0, 1)]; yield ['1d', 'en', new CarbonInterval(0, 0, 0, 1)]; yield ['1h', 'en', new CarbonInterval(0, 0, 0, 0, 1)]; yield ['1m', 'en', new CarbonInterval(0, 0, 0, 0, 0, 1)]; yield ['1s', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 1)]; yield ['1ms', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 1000)]; yield ['1µs', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 1)]; // single values with space yield ['1 y', 'en', new CarbonInterval(1)]; yield ['1 mo', 'en', new CarbonInterval(0, 1)]; yield ['1 w', 'en', new CarbonInterval(0, 0, 1)]; // fractions with integer result yield ['0.571428571429w', 'en', new CarbonInterval(0, 0, 0, 4)]; yield ['0.5d', 'en', new CarbonInterval(0, 0, 0, 0, 12)]; yield ['0.5h', 'en', new CarbonInterval(0, 0, 0, 0, 0, 30)]; yield ['0.5m', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 30)]; // fractions with float result yield ['1.5w', 'en', new CarbonInterval(0, 0, 1, 3, 12)]; yield ['2.34d', 'en', new CarbonInterval(0, 0, 0, 2, 8, 9, 36)]; yield ['3.12h', 'en', new CarbonInterval(0, 0, 0, 0, 3, 7, 12)]; yield ['3.129h', 'en', new CarbonInterval(0, 0, 0, 0, 3, 7, 44, 400000)]; yield ['4.24m', 'en', new CarbonInterval(0, 0, 0, 0, 0, 4, 14, 400000)]; yield ['3.56s', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 3, 560000)]; yield ['3.56ms', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 3560)]; // combinations yield ['2w 3d', 'en', new CarbonInterval(0, 0, 0, 17)]; yield ['1y 2mo 1.5w 3d', 'en', new CarbonInterval(1, 2, 1, 6, 12)]; // multi same values yield ['1y 2y', 'en', new CarbonInterval(3)]; yield ['1mo 20mo', 'en', new CarbonInterval(0, 21)]; yield ['1w 2w 3w', 'en', new CarbonInterval(0, 0, 6)]; yield ['10d 20d 30d', 'en', new CarbonInterval(0, 0, 0, 60)]; yield ['5h 15h 25h', 'en', new CarbonInterval(0, 0, 0, 0, 45)]; yield ['3m 3m 3m 1m', 'en', new CarbonInterval(0, 0, 0, 0, 0, 10)]; yield ['55s 45s 1s 2s 3s 4s', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 110)]; yield ['1500ms 1623555µs', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 3123555)]; yield ['430 milli', 'en', new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 430000)]; // multi same values with space yield ['1 y 2 y', 'en', new CarbonInterval(3)]; yield ['1 mo 20 mo', 'en', new CarbonInterval(0, 21)]; yield ['1 w 2 w 3 w', 'en', new CarbonInterval(0, 0, 6)]; // no-space values yield ['2w3d', 'en', new CarbonInterval(0, 0, 0, 17)]; yield ['1y2mo3w4d5h6m7s', 'en', new CarbonInterval(1, 2, 3, 4, 5, 6, 7)]; // written-out units yield ['1year 2month 3week 4day 5hour 6minute 7second', 'en', new CarbonInterval(1, 2, 3, 4, 5, 6, 7)]; yield ['1 year 2 month 3 week', 'en', new CarbonInterval(1, 2, 3)]; yield ['2 Years 3 Months 4 Weeks', 'en', new CarbonInterval(2, 3, 4)]; yield ['5 Days 6 Hours 7 Minutes 8 Seconds', 'en', new CarbonInterval(0, 0, 0, 5, 6, 7, 8)]; // ignore invalid format; parse only [num][char-format] or [num] [char-format] yield ['Hello! Please add 1y2w to ...', 'en', new CarbonInterval(1, 0, 2)]; yield ['nothing to parse :(', 'en', new CarbonInterval(0)]; // case insensitive yield ['1Y 3MO 1W 3D 12H 23M 42S', 'en', new CarbonInterval(1, 3, 1, 3, 12, 23, 42)]; // Example for the ticket (#1756) yield ['2 jours 3 heures', 'fr', new CarbonInterval(0, 0, 0, 2, 3, 0, 0)]; } #[TestWith(['1q', '1q', 'en'])] #[TestWith(['about 12..14m', '12..', 'en'])] #[TestWith(['4h 13', '13', 'en'])] public function testThrowsExceptionForUnknownValues(string $string, string $part, string $locale) { $message = null; try { CarbonInterval::parseFromLocale($string, $locale); } catch (InvalidArgumentException $exception) { $message = $exception->getMessage(); } $this->assertStringContainsString($part, $message); } } ================================================ FILE: tests/CarbonInterval/RoundingTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonInterval; use DateInterval; use InvalidArgumentException; use Tests\AbstractTestCase; class RoundingTest extends AbstractTestCase { public function testThrowsExceptionForCompositeInterval() { $this->expectExceptionObject(new InvalidArgumentException( 'Rounding is only possible with single unit intervals.', )); CarbonInterval::days(2)->round('2 hours 50 minutes'); } public function testFloor() { $this->assertSame(21.0, CarbonInterval::days(21)->floorWeeks()->totalDays); $this->assertSame(21.0, CarbonInterval::days(24)->floorWeeks()->totalDays); $this->assertSame(21.0, CarbonInterval::days(25)->floorWeeks()->totalDays); $this->assertSame(21.0, CarbonInterval::days(27)->floorWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(28)->floorWeeks()->totalDays); $this->assertSame(1000.0, CarbonInterval::milliseconds(1234)->floor()->totalMilliseconds); $this->assertSame(1000.0, CarbonInterval::milliseconds(1834)->floor()->totalMilliseconds); $this->assertSame(20.0, CarbonInterval::days(21)->floor('2 days')->totalDays); $this->assertSame(18.0, CarbonInterval::days(21)->floor(CarbonInterval::days(6))->totalDays); $this->assertSame(18.0, CarbonInterval::days(22)->floorUnit('day', 6)->totalDays); } public function testRound() { $this->assertSame(21.0, CarbonInterval::days(21)->roundWeeks()->totalDays); $this->assertSame(21.0, CarbonInterval::days(24)->roundWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(25)->roundWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(27)->roundWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(28)->roundWeeks()->totalDays); $this->assertSame(-7.0, CarbonInterval::make('7 days 23 hours 34 minutes')->invert()->roundWeeks()->totalDays); $this->assertSame(-7.0, CarbonInterval::make('-7 days 23 hours 34 minutes')->roundWeeks()->totalDays); $this->assertSame(7.0, CarbonInterval::make('-7 days 23 hours 34 minutes')->invert()->roundWeeks()->totalDays); $this->assertSame(1000.0, CarbonInterval::milliseconds(1234)->round()->totalMilliseconds); $this->assertSame(2000.0, CarbonInterval::milliseconds(1834)->round()->totalMilliseconds); $this->assertSame(20.0, CarbonInterval::days(20)->round('2 days')->totalDays); $this->assertSame(18.0, CarbonInterval::days(20)->round(CarbonInterval::days(6))->totalDays); $this->assertSame(22.0, CarbonInterval::days(21)->round('2 days')->totalDays); $this->assertSame(24.0, CarbonInterval::days(21)->round(CarbonInterval::days(6))->totalDays); $this->assertSame(22.0, CarbonInterval::days(22)->round('2 days')->totalDays); $this->assertSame(24.0, CarbonInterval::days(22)->round(CarbonInterval::days(6))->totalDays); $this->assertSame(24.0, CarbonInterval::days(22)->roundUnit('day', 6)->totalDays); } public function testTotalAfterRound() { $this->assertSame(19, CarbonInterval::make('43h3m6s')->roundMinutes()->hours); $this->assertSame(43.05, CarbonInterval::make('43h3m6s')->roundMinutes()->totalHours); } public function testWithCascadeFactors() { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'millisecond' => [1000, 'microseconds'], 'second' => [1000, 'milliseconds'], 'minute' => [60, 'seconds'], 'hour' => [60, 'minutes'], ]); $this->assertVeryClose( 43.166666666666664, CarbonInterval::make('43h3m6s') ->ceilMinutes(10) ->totalHours, ); $this->assertSame( 43.0, CarbonInterval::make('43h3m6s') ->floorMinutes(6) ->totalHours ); $this->assertSame( 43.05, CarbonInterval::make('43h3m6s') ->roundMinutes() ->totalHours ); $this->assertVeryClose( 43.05833333333333, CarbonInterval::make('43h3m26s') ->roundMinutes(0.5) ->totalHours, ); $this->assertSame( -43.05, CarbonInterval::make('43h3m6s') ->invert() ->roundMinutes(0.5) ->totalHours ); CarbonInterval::setCascadeFactors($cascades); } public function testCeil() { $this->assertSame(21.0, CarbonInterval::days(21)->ceilWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(24)->ceilWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(25)->ceilWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(27)->ceilWeeks()->totalDays); $this->assertSame(28.0, CarbonInterval::days(28)->ceilWeeks()->totalDays); $this->assertSame(2000.0, CarbonInterval::milliseconds(1234)->ceil()->totalMilliseconds); $this->assertSame(2000.0, CarbonInterval::milliseconds(1834)->ceil()->totalMilliseconds); $this->assertSame(20.0, CarbonInterval::days(20)->ceil('2 days')->totalDays); $this->assertSame(24.0, CarbonInterval::days(20)->ceil(CarbonInterval::days(6))->totalDays); $this->assertSame(22.0, CarbonInterval::days(21)->ceil('2 days')->totalDays); $this->assertSame(24.0, CarbonInterval::days(21)->ceil(CarbonInterval::days(6))->totalDays); $this->assertSame(22.0, CarbonInterval::days(22)->ceil('2 days')->totalDays); $this->assertSame(24.0, CarbonInterval::days(22)->ceil(CarbonInterval::days(6))->totalDays); $this->assertSame(24.0, CarbonInterval::days(22)->ceilUnit('day', 6)->totalDays); } public function testRoundCarbonInstanceToIntervalInNonDefaultLocale() { $interval15m = CarbonInterval::fromString('PT15M')->locale('es'); $this->assertSame( '19:30', Carbon::parse('2024-04-15T19:36:12')->floor($interval15m)->format('H:i') ); $this->assertSame( '19:45', Carbon::parse('2024-04-15T19:36:12')->ceil($interval15m)->format('H:i') ); $this->assertSame('15 minutos', $interval15m->forHumans()); $interval1h = DateInterval::createFromDateString('1 hour'); Carbon::setLocale('zh'); $this->assertSame('1小时', CarbonInterval::make($interval1h)->forHumans()); $this->assertSame( '19:00', Carbon::parse('2024-04-15T19:36:12')->floor($interval1h)->format('H:i') ); $this->assertSame( '20:00', Carbon::parse('2024-04-15T19:36:12')->ceil($interval1h)->format('H:i') ); } } ================================================ FILE: tests/CarbonInterval/SetStateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class SetStateTest extends AbstractTestCase { public function testEvaluatingVarExportReturnsCarbonIntervalInstance() { $export = var_export(CarbonInterval::minutes(3), true); $this->assertInstanceOfCarbonInterval(eval("return $export;")); } public function testStateIsPreserved() { $serializedInterval = CarbonInterval::minutes(3); $export = var_export($serializedInterval, true); /** @var CarbonInterval $deserializedInterval */ $deserializedInterval = eval("return $export;"); $this->assertTrue($deserializedInterval->eq($serializedInterval)); } } ================================================ FILE: tests/CarbonInterval/SettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterval; use InvalidArgumentException; use Tests\AbstractTestCase; class SettersTest extends AbstractTestCase { public function testSet() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->set('seconds', 34); $this->assertSame(34, $ci->seconds); $ci->set([ 'seconds' => 59, 'minutes' => 33, ]); $this->assertSame(59, $ci->seconds); $this->assertSame(33, $ci->minutes); } public function testYearsSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->years = 2; $this->assertSame(2, $ci->years); $ci->years(5); $this->assertSame(5, $ci->years); } public function testMonthsSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->months = 11; $this->assertSame(11, $ci->months); $ci->months(8); $this->assertSame(8, $ci->months); } public function testWeeksSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->weeks = 11; $this->assertSame(11, $ci->weeks); $this->assertSame(7 * 11, $ci->dayz); $ci->weeks(4); $this->assertSame(4, $ci->weeks); } public function testDayzSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->dayz = 11; $this->assertSame(11, $ci->dayz); $this->assertSame(1, $ci->weeks); $this->assertSame(4, $ci->dayzExcludeWeeks); $ci->days(1); $this->assertSame(1, $ci->dayz); $ci->day(3); $this->assertSame(3, $ci->dayz); $diff = (new Carbon('2024-07-15 00:00'))->diff('2024-08-12 23:15'); $this->assertSame('4 weeks 23 hours 15 minutes', $diff->forHumans()); $this->assertSame(PHP_VERSION_ID < 8_02_00 ? false : 28, $diff->days); $this->assertSame(28, $diff->dayz); $this->assertSame(28, $diff->d); // Setting days to false has no effect $diff->days(false); $this->assertSame(PHP_VERSION_ID < 8_02_00 ? false : 28, $diff->days); $this->assertSame(28, $diff->dayz); $this->assertSame(28, $diff->d); // Setting days to integer affects days and d, but not "days" (bolt-on by parent DateInterval class) $diff->days(14); $this->assertSame(PHP_VERSION_ID < 8_02_00 ? false : 28, $diff->days); $this->assertSame(14, $diff->dayz); $this->assertSame(14, $diff->d); } public function testHoursSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->hours = 12; $this->assertSame(12, $ci->hours); $ci->hours(0); $this->assertSame(0, $ci->hours); } public function testMinutesSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->minutes = 11; $this->assertSame(11, $ci->minutes); $ci->minutes(9); $this->assertSame(9, $ci->minutes); } public function testSecondsSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->seconds = 34; $this->assertSame(34, $ci->seconds); $ci->seconds(59); $this->assertSame(59, $ci->seconds); $ci->second(1); $this->assertSame(1, $ci->seconds); } public function testMillisecondsSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->milliseconds = 34; $this->assertSame(34, $ci->milliseconds); $ci->milliseconds(59); $this->assertSame(59, $ci->milliseconds); $ci->millisecond(1); $this->assertSame(1, $ci->milliseconds); } public function testMicrosecondsSetter() { $ci = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); $ci->microseconds = 34; $this->assertSame(34, $ci->microseconds); $ci->microseconds(59); $this->assertSame(59, $ci->microseconds); $ci->microsecond(1); $this->assertSame(1, $ci->microseconds); } public function testFluentSetters() { $ci = CarbonInterval::years(4)->months(2)->dayz(5)->hours(3)->minute()->seconds(59); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 4, 2, 5, 3, 1, 59); $ci = CarbonInterval::years(4)->months(2)->weeks(2)->hours(3)->minute()->seconds(59); $this->assertInstanceOfCarbonInterval($ci); $this->assertCarbonInterval($ci, 4, 2, 14, 3, 1, 59); } public function testFluentSettersDaysOverwritesWeeks() { $ci = CarbonInterval::weeks(3)->days(5); $this->assertCarbonInterval($ci, 0, 0, 5, 0, 0, 0); } public function testFluentSettersWeeksOverwritesDays() { $ci = CarbonInterval::days(5)->weeks(3); $this->assertCarbonInterval($ci, 0, 0, 3 * 7, 0, 0, 0); } public function testFluentSettersWeeksAndDaysIsCumulative() { $ci = CarbonInterval::year(5)->weeksAndDays(2, 6); $this->assertCarbonInterval($ci, 5, 0, 20, 0, 0, 0); $this->assertSame(20, $ci->dayz); $this->assertSame(2, $ci->weeks); $this->assertSame(6, $ci->dayzExcludeWeeks); } public function testInvert() { $ci = new CarbonInterval(); $this->assertSame($ci, $ci->invert()); $this->assertSame(1, $ci->invert); $this->assertSame($ci, $ci->invert()); $this->assertSame(0, $ci->invert); $this->assertSame($ci, $ci->invert(true)); $this->assertSame(1, $ci->invert); $this->assertSame($ci, $ci->invert(true)); $this->assertSame(1, $ci->invert); $this->assertSame($ci, $ci->invert(false)); $this->assertSame(0, $ci->invert); $this->assertSame($ci, $ci->invert(false)); $this->assertSame(0, $ci->invert); } public function testAbsolute() { $ci = CarbonInterval::day(); $this->assertSame($ci, $ci->absolute()); $this->assertSame(1.0, $ci->totalDays); $this->assertSame(1.0, $ci->invert()->absolute()->totalDays); $this->assertSame(-1.0, $ci->invert()->absolute(false)->totalDays); $this->assertSame(1.0, $ci->invert()->abs(true)->totalDays); $this->assertSame(-1.0, $ci->invert()->abs(false)->totalDays); } public function testInvalidSetter() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown setter \'doesNotExit\'', )); /** @var mixed $ci */ $ci = new CarbonInterval(); $ci->doesNotExit = 123; } public function testInvalidFluentSetter() { $this->expectExceptionObject(new BadMethodCallException( 'Unknown fluent setter \'doesNotExist\'', )); /** @var mixed $ci */ $ci = new CarbonInterval(); $ci->doesNotExist(123); } public function testInvalidStaticFluentSetter() { $this->expectExceptionObject(new BadMethodCallException( 'Unknown fluent constructor \'doesNotExist\'', )); CarbonInterval::doesNotExist(123); } public function testLocale() { /** @var CarbonInterval $interval */ $interval = CarbonInterval::hour()->locale('de'); $this->assertSame('de', $interval->locale); } public function testShiftTimezone() { $interval = CarbonInterval::hour()->shiftTimezone('America/Toronto'); $this->assertSame('America/Toronto', $interval->getSettings()['timezone']); /** @var CarbonInterval $interval */ $interval = CarbonInterval::diff( Carbon::parse('2020-02-02 20:20 Asia/Tokyo'), Carbon::parse('2020-02-03 22:22 Europe/Madrid'), )->shiftTimezone('America/Toronto'); $this->assertSame('America/Toronto', $interval->getSettings()['timezone']); $this->assertSame('2020-02-02 20:20 America/Toronto', $interval->start()->format('Y-m-d H:i e')); $this->assertSame('2020-02-03 22:22 America/Toronto', $interval->end()->format('Y-m-d H:i e')); } public function testSetTimezone() { /** @var CarbonInterval $interval */ $interval = CarbonInterval::hour()->setTimezone('America/Toronto'); $this->assertSame('America/Toronto', $interval->tzname); $this->assertSame('America/Toronto', $interval->tz_name); $this->assertSame('America/Toronto', $interval->getSettings()['timezone']); /** @var CarbonInterval $interval */ $interval = CarbonInterval::diff( Carbon::parse('2020-02-02 20:20 Asia/Tokyo'), Carbon::parse('2020-02-03 22:22 Europe/Madrid'), )->setTimezone('America/Toronto'); $this->assertSame('America/Toronto', $interval->getSettings()['timezone']); $this->assertSame('2020-02-02 06:20 America/Toronto', $interval->start()->format('Y-m-d H:i e')); $this->assertSame('2020-02-03 16:22 America/Toronto', $interval->end()->format('Y-m-d H:i e')); /** @var CarbonInterval $interval */ $interval = CarbonInterval::hour(); $next = $interval->set(' * foobar', 'biz'); $this->assertSame($next, $interval); $this->assertSame('1 hour', $interval->forHumans()); } } ================================================ FILE: tests/CarbonInterval/SharesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class SharesTest extends AbstractTestCase { public function testSharesMoreThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->shares(1 / 2.75); $this->assertCarbonInterval($ci, 11, 8, 52, 14, 28, 30); } public function testSharesOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->shares(1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); } public function testSharesLessThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->shares(3); $this->assertCarbonInterval($ci, 1, 1, 6, 2, 3, 4); } public function testSharesLessThanZero() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->shares(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(1, $ci->invert); } public function testSharesLessThanZeroWithInvertedInterval() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11); $ci->invert = 1; $ci->shares(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(0, $ci->invert); } } ================================================ FILE: tests/CarbonInterval/SpecTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use DateInterval; use Tests\AbstractTestCase; class SpecTest extends AbstractTestCase { public function testZeroInterval() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 0, 0); $this->assertSame('PT0S', $ci->spec()); $ci = new CarbonInterval(); $this->assertSame('PT0S', $ci->spec()); $ci = CarbonInterval::create(); $this->assertSame('PT0S', $ci->spec()); } public function testYearInterval() { $ci = new CarbonInterval(1); $this->assertSame('P1Y', $ci->spec()); $ci = CarbonInterval::create(1); $this->assertSame('P1Y', $ci->spec()); } public function testMonthInterval() { $ci = new CarbonInterval(0, 1); $this->assertSame('P1M', $ci->spec()); } public function testWeekInterval() { $ci = new CarbonInterval(0, 0, 1); $this->assertSame('P7D', $ci->spec()); } public function testDayInterval() { $ci = new CarbonInterval(0, 0, 0, 1); $this->assertSame('P1D', $ci->spec()); } public function testMixedDateInterval() { $ci = new CarbonInterval(1, 2, 0, 3); $this->assertSame('P1Y2M3D', $ci->spec()); } public function testHourInterval() { $ci = new CarbonInterval(0, 0, 0, 0, 1); $this->assertSame('PT1H', $ci->spec()); } public function testMinuteInterval() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 1); $this->assertSame('PT1M', $ci->spec()); } public function testSecondInterval() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 0, 1); $this->assertSame('PT1S', $ci->spec()); } public function testMicrosecondsInterval() { $ci = new CarbonInterval(0, 0, 0, 0, 0, 0, 0, 12300); $this->assertSame('PT0.012300S', $ci->spec(true)); } public function testMixedTimeInterval() { $ci = new CarbonInterval(0, 0, 0, 0, 1, 2, 3); $this->assertSame('PT1H2M3S', $ci->spec()); } public function testMixedDateAndTimeInterval() { $ci = new CarbonInterval(1, 2, 0, 3, 4, 5, 6); $this->assertSame('P1Y2M3DT4H5M6S', $ci->spec()); } public function testCreatingInstanceEquals() { $ci = new CarbonInterval(1, 2, 0, 3, 4, 5, 6); $this->assertEquals($ci->optimize(), CarbonInterval::instance(new DateInterval($ci->spec()))->optimize()); } } ================================================ FILE: tests/CarbonInterval/StrictModeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterval; use InvalidArgumentException; use Tests\AbstractTestCase; class StrictModeTest extends AbstractTestCase { public function testSetWithStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown setter \'foobar\'', )); /** @var mixed $interval */ $interval = CarbonInterval::day(); $interval->foobar = 'biz'; } public function testGetWithStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown getter \'foobar\'', )); /** @var mixed $interval */ $interval = CarbonInterval::day(); $interval->foobar; } public function testSetAndGetWithoutStrictMode() { Carbon::useStrictMode(false); /** @var mixed $interval */ $interval = CarbonInterval::day(); @$interval->foobar = 'biz'; $this->assertSame('biz', $interval->foobar); } public function testStaticCallWithStrictMode() { $this->expectExceptionObject(new BadMethodCallException( 'Unknown fluent constructor \'foobar\'', )); CarbonInterval::foobar(); } public function testStaticCallWithoutStrictMode() { Carbon::useStrictMode(false); $this->assertNull(CarbonInterval::foobar()); } } ================================================ FILE: tests/CarbonInterval/TimesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class TimesTest extends AbstractTestCase { public function testTimesMoreThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->times(2.75); $this->assertCarbonInterval($ci, 11, 8, 52, 14, 28, 30); } public function testTimesOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->times(1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); } public function testTimesLessThanOne() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->times(0.333); $this->assertCarbonInterval($ci, 1, 1, 6, 2, 3, 4); } public function testTimesZero() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->times(0); $this->assertCarbonInterval($ci, 0, 0, 0, 0, 0, 0); } public function testTimesLessThanZero() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11)->times(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(1, $ci->invert); } public function testTimesLessThanZeroWithInvertedInterval() { $ci = CarbonInterval::create(4, 3, 2, 5, 5, 10, 11); $ci->invert = 1; $ci->times(-1); $this->assertCarbonInterval($ci, 4, 3, 19, 5, 10, 11); $this->assertSame(0, $ci->invert); } } ================================================ FILE: tests/CarbonInterval/ToDateIntervalTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use DateInterval; use DateTime; use InvalidArgumentException; use Tests\AbstractTestCase; class ToDateIntervalTest extends AbstractTestCase { public function testConvertToDateInterval() { $interval = CarbonInterval::days(5)->hours(3)->minutes(50)->microseconds(123456)->invert()->toDateInterval(); $this->assertSame(DateInterval::class, \get_class($interval)); $this->assertSame(1, $interval->invert); $this->assertSame(5, $interval->d); $this->assertSame(3, $interval->h); $this->assertSame(50, $interval->i); $this->assertSame(0, $interval->s); $this->assertSame(0.123456, $interval->f); } public function testCastToDateInterval() { $interval = CarbonInterval::days(5)->hours(3)->minutes(50)->microseconds(123456)->invert()->cast(DateInterval::class); $this->assertSame(DateInterval::class, \get_class($interval)); $this->assertSame(1, $interval->invert); $this->assertSame(5, $interval->d); $this->assertSame(3, $interval->h); $this->assertSame(50, $interval->i); $this->assertSame(0, $interval->s); $this->assertSame(0.123456, $interval->f); } public function testBadCast() { $this->expectExceptionObject(new InvalidArgumentException( 'DateTime is not a sub-class of DateInterval.', )); CarbonInterval::days(5)->hours(3)->minutes(50)->microseconds(123456)->invert()->cast(DateTime::class); } } ================================================ FILE: tests/CarbonInterval/ToPeriodTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\Exceptions\InvalidFormatException; use DateTimeZone; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class ToPeriodTest extends AbstractTestCase { #[DataProvider('dataForToPeriodParameters')] public function testConvertToDatePeriod($interval, $arguments, $expected) { $period = ([$interval, 'toPeriod'])(...$arguments); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame($expected, $period->spec()); } public static function dataForToPeriodParameters(): Generator { yield [ CarbonInterval::days(3), ['2017-10-15', 4], 'R4/2017-10-15T00:00:00-04:00/P3D', ]; yield [ CarbonInterval::hours(7), ['2017-10-15', '2017-10-17'], '2017-10-15T00:00:00-04:00/PT7H/2017-10-17T00:00:00-04:00', ]; yield [ CarbonInterval::months(3)->days(2)->hours(10)->minutes(20), ['2017-10-15'], '2017-10-15T00:00:00-04:00/P3M2DT10H20M', ]; yield [ CarbonInterval::minutes(30), [new Carbon('2018-05-14 17:30 UTC'), new Carbon('2018-05-14 18:00 Europe/Oslo')], '2018-05-14T17:30:00+00:00/PT30M/2018-05-14T18:00:00+02:00', ]; } public function testToDatePeriodWithTimezone(): void { $period = CarbonInterval::minutes(30) ->setTimezone('Asia/Tokyo') ->toPeriod('2021-08-14 00:00', '2021-08-14 02:00'); $this->assertSame('2021-08-14 00:00 Asia/Tokyo', $period->start()->format('Y-m-d H:i e')); $this->assertSame('2021-08-14 02:00 Asia/Tokyo', $period->end()->format('Y-m-d H:i e')); $period = CarbonInterval::minutes(30) ->setTimezone(new DateTimeZone('America/New_York')) ->toPeriod('2021-08-14 00:00', '2021-08-14 02:00'); $this->assertSame('2021-08-14 00:00 America/New_York', $period->start()->format('Y-m-d H:i e')); $this->assertSame('2021-08-14 02:00 America/New_York', $period->end()->format('Y-m-d H:i e')); } public function testStepBy(): void { $days = []; foreach (Carbon::parse('2020-08-29')->diff('2020-09-02')->stepBy('day') as $day) { $days[] = "$day"; } $this->assertSame([ '2020-08-29 00:00:00', '2020-08-30 00:00:00', '2020-08-31 00:00:00', '2020-09-01 00:00:00', '2020-09-02 00:00:00', ], $days); $times = []; foreach (Carbon::parse('2020-08-29')->diff('2020-08-31')->stepBy('12 hours') as $time) { $times[] = "$time"; } $this->assertSame([ '2020-08-29 00:00:00', '2020-08-29 12:00:00', '2020-08-30 00:00:00', '2020-08-30 12:00:00', '2020-08-31 00:00:00', ], $times); $days = []; /** @var CarbonPeriod $period */ $period = Carbon::parse('2020-08-29')->diff('2020-09-02')->stepBy('day'); foreach ($period->excludeEndDate() as $day) { $days[] = "$day"; } $this->assertSame([ '2020-08-29 00:00:00', '2020-08-30 00:00:00', '2020-08-31 00:00:00', '2020-09-01 00:00:00', ], $days); Carbon::setTestNow('2020-08-12 06:00:50'); $days = []; foreach (CarbonInterval::week()->stepBy('day') as $day) { $days[] = "$day"; } $this->assertSame([ '2020-08-12 06:00:50', '2020-08-13 06:00:50', '2020-08-14 06:00:50', '2020-08-15 06:00:50', '2020-08-16 06:00:50', '2020-08-17 06:00:50', '2020-08-18 06:00:50', '2020-08-19 06:00:50', ], $days); Carbon::setTestNow(null); } public function testStepByError() { $this->expectExceptionObject(new InvalidFormatException( 'Could not create interval from: '.var_export('1/2 days', true), )); CarbonInterval::week()->stepBy('1/2 days'); } } ================================================ FILE: tests/CarbonInterval/ToStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\CarbonInterval; use Tests\AbstractTestCase; class ToStringTest extends AbstractTestCase { public function testDefault() { CarbonInterval::setLocale('en'); $ci = CarbonInterval::create(11, 1, 2, 5, 22, 33, 55); $this->assertSame('11 years 1 month 2 weeks 5 days 22 hours 33 minutes 55 seconds:abc', $ci.':abc'); } public function testDefaultWithMicroseconds() { CarbonInterval::setLocale('en'); $ci = CarbonInterval::create(11, 1, 2, 5, 22, 33, 55, 12345); $this->assertSame('11 years 1 month 2 weeks 5 days 22 hours 33 minutes 55 seconds:abc', $ci.':abc'); } public function testOverrideSimple() { $ci = CarbonInterval::create(0, 0, 0, 0, 22, 33, 55); $ci->settings(['toStringFormat' => '%H:%I:%S']); $this->assertSame('22:33:55:abc', $ci.':abc'); } public function testOverrideWithMicroseconds() { $ci = CarbonInterval::create(11, 1, 2, 5, 22, 33, 55, 12345); $ci->settings(['toStringFormat' => '%R%Y-%M-%D %H:%I:%S.%F']); $this->assertSame('+11-01-19 22:33:55.012345:abc', $ci.':abc'); } public function testOverrideWithInvert() { $ci = CarbonInterval::create(11, 1, 2, 5, 22, 33, 55)->invert(); $ci->settings(['toStringFormat' => '%R%Y-%M-%D %H:%I:%S']); $this->assertSame('-11-01-19 22:33:55:abc', $ci.':abc'); } public function testClosure() { $ci = CarbonInterval::create(11); $this->assertSame('11 years:abc', $ci.':abc'); CarbonInterval::setToStringFormat('%Y'); $this->assertSame('11:abc', $ci.':abc'); $ci->settings(['toStringFormat' => static function (CarbonInterval $interval) { return 'Y'.($interval->years * 2); }]); $this->assertSame('Y22:abc', $ci.':abc'); CarbonInterval::resetToStringFormat(); } } ================================================ FILE: tests/CarbonInterval/TotalTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonInterval; use Carbon\Carbon; use Carbon\CarbonInterval; use DateTimeImmutable; use Generator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class TotalTest extends AbstractTestCase { #[DataProvider('dataForIntervalSpecs')] public function testReturnsTotalValue($spec, $unit, $expected) { $this->assertSame( (float) $expected, CarbonInterval::fromString($spec)->total($unit), "$spec as $unit did not get the expected total", ); } public static function dataForIntervalSpecs(): Generator { yield ['10s', 'seconds', 10]; yield ['100s', 'seconds', 100]; yield ['2d 4h 17m 35s', 'seconds', ((2 * 24 + 4) * 60 + 17) * 60 + 35]; yield ['1y', 'Seconds', 12 * 4 * 7 * 24 * 60 * 60]; yield ['1000y', 'SECONDS', 1000 * 12 * 4 * 7 * 24 * 60 * 60]; yield ['235s', 'minutes', 235 / 60]; yield ['3h 14m 235s', 'minutes', 3 * 60 + 14 + 235 / 60]; yield ['27h 150m 4960s', 'hours', 27 + (150 + 4960 / 60) / 60]; yield ['1w', 'days', 7]; yield ['2w 15d', 'weeks', 29 / 7]; yield ['5mo 54d 185h 7680m', 'days', 5 * 4 * 7 + 54 + (185 + 7680 / 60) / 24]; yield ['4y 2mo', 'days', (4 * 12 + 2) * 4 * 7]; yield ['165d', 'weeks', 165 / 7]; yield ['5mo', 'weeks', 5 * 4]; yield ['6897d', 'months', 6897 / 7 / 4]; yield ['35mo', 'years', 35 / 12]; } public function testThrowsExceptionForInvalidUnits() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown unit \'foo\'.', )); CarbonInterval::create()->total('foo'); } public function testGetTotalsViaGetters() { $interval = CarbonInterval::create(0, 0, 0, 0, 150, 0, 0); $this->assertSame(150.0 * 60 * 60 * 1000 * 1000, $interval->totalMicroseconds); $this->assertSame(150.0 * 60 * 60 * 1000, $interval->totalMilliseconds); $this->assertSame(150.0 * 60 * 60, $interval->totalSeconds); $this->assertSame(150.0 * 60, $interval->totalMinutes); $this->assertSame(150.0, $interval->totalHours); $this->assertSame(150.0 / 24, $interval->totalDays); $this->assertSame(150.0 / 24 / 7, $interval->totalWeeks); $this->assertSame(150.0 / 24 / 7 / 4, $interval->totalMonths); $this->assertSame(150.0 / 24 / 7 / 4 / 12, $interval->totalYears); $interval = CarbonInterval::milliseconds(12312); $this->assertSame(12312000.0, $interval->totalMicroseconds); $this->assertSame(12312.0, $interval->totalMilliseconds); $interval = CarbonInterval::milliseconds(-12312); $this->assertSame(-12312000.0, $interval->totalMicroseconds); $this->assertSame(-12312.0, $interval->totalMilliseconds); } public static function dataForNegativeIntervals(): Generator { yield [-1, CarbonInterval::hours(0)->hours(-150)]; yield [-1, CarbonInterval::hours(150)->invert()]; yield [1, CarbonInterval::hours(0)->hours(-150)->invert()]; } #[DataProvider('dataForNegativeIntervals')] public function testGetNegativeTotalsViaGetters($factor, $interval) { $this->assertSame($factor * 150.0 * 60 * 60 * 1000 * 1000, $interval->totalMicroseconds); $this->assertSame($factor * 150.0 * 60 * 60 * 1000, $interval->totalMilliseconds); $this->assertSame($factor * 150.0 * 60 * 60, $interval->totalSeconds); $this->assertSame($factor * 150.0 * 60, $interval->totalMinutes); $this->assertSame($factor * 150.0, $interval->totalHours); $this->assertSame($factor * 150.0 / 24, $interval->totalDays); $this->assertSame($factor * 150.0 / 24 / 7, $interval->totalWeeks); $this->assertSame($factor * 150.0 / 24 / 7 / 4, $interval->totalMonths); $this->assertSame($factor * 150.0 / 24 / 7 / 4 / 12, $interval->totalYears); } public function testTotalsWithCustomFactors() { $factors = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minute' => [60, 'seconds'], 'hour' => [60, 'minutes'], 'day' => [8, 'hours'], 'week' => [5, 'days'], ]); $this->assertSame(1.0, CarbonInterval::make('1d')->totalDays); $this->assertSame(5.0, CarbonInterval::make('1w')->totalDays); $this->assertSame(1.0, CarbonInterval::make('1w')->totalWeeks); CarbonInterval::setCascadeFactors($factors); } public function testFloatHoursFactors() { $factors = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minute' => [60, 'seconds'], 'hour' => [60, 'minutes'], 'day' => [7.5, 'hours'], 'week' => [5, 'days'], ]); $this->assertSame( '2 weeks 1 day 5 hours 45 minutes', CarbonInterval::minutes(11 * (7.5 * 60) + (5 * 60) + 45)->cascade()->forHumans() ); CarbonInterval::setCascadeFactors($factors); } public function testFloatDaysFactors() { $factors = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minute' => [60, 'seconds'], 'hour' => [60, 'minutes'], 'day' => [8, 'hours'], 'week' => [5.5, 'days'], ]); $this->assertSame( '3 weeks 1 day 5 hours 45 minutes', CarbonInterval::minutes(17.5 * (8 * 60) + (5 * 60) + 45)->cascade()->forHumans() ); CarbonInterval::setCascadeFactors($factors); } public function testFloatInMultipleFactors() { $factors = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minute' => [23.2, 'seconds'], 'hour' => [25.662, 'minutes'], 'day' => [10 / 3, 'hours'], 'week' => [pi(), 'days'], ]); $interval = CarbonInterval::minutes(50000)->cascade(); $this->assertSame( '185 weeks 2 days 3 hours 35 minutes 35 seconds', $interval->forHumans() ); // Show how we (approximately) get back to initial values $this->assertEqualsWithDelta( 50000 * 23.2, 35 + (35 * 23.2) + (3 * 25.662 * 23.2) + (2 * (10 / 3) * 25.662 * 23.2) + (185 * pi() * (10 / 3) * 25.662 * 23.2), 3 ); // Show how total uncascade $this->assertEqualsWithDelta(50000 / 25.662, $interval->totalHours, 0.05); $this->assertEqualsWithDelta(50000, $interval->totalMinutes, 0.1); $this->assertEqualsWithDelta(50000 * 23.2, $interval->totalSeconds, 1); CarbonInterval::setCascadeFactors($factors); } public function testGetTotalsViaGettersWithCustomFactors() { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'], 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], 'days' => [8, 'hours'], 'weeks' => [5, 'days'], ]); $interval = CarbonInterval::create(0, 0, 0, 0, 150, 0, 0); $totalSeconds = $interval->totalSeconds; $totalMinutes = $interval->totalMinutes; $totalHours = $interval->totalHours; $totalDays = $interval->totalDays; $totalWeeks = $interval->totalWeeks; $monthsError = null; try { $interval->totalMonths; } catch (InvalidArgumentException $exception) { $monthsError = $exception->getMessage(); } $yearsError = null; try { $interval->totalYears; } catch (InvalidArgumentException $exception) { $yearsError = $exception->getMessage(); } CarbonInterval::setCascadeFactors($cascades); $this->assertSame(150.0 * 60 * 60, $totalSeconds); $this->assertSame(150.0 * 60, $totalMinutes); $this->assertSame(150.0, $totalHours); $this->assertSame(150.0 / 8, $totalDays); $this->assertSame(150.0 / 8 / 5, $totalWeeks); $this->assertSame('Unit months have no configuration to get total from other units.', $monthsError); $this->assertSame('Unit years have no configuration to get total from other units.', $yearsError); } public function testGetTotalsViaGettersWithFalseFactor() { $cascades = CarbonInterval::getCascadeFactors(); CarbonInterval::setCascadeFactors([ 'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'], 'hours' => [Carbon::MINUTES_PER_HOUR, 'minutes'], 'days' => [false, 'hours'], // soft break 'months' => [30, 'days'], 'years' => [Carbon::MONTHS_PER_YEAR, 'months'], ]); $interval = CarbonInterval::create(3, 2, 0, 6, 150, 0, 0); $totalSeconds = $interval->totalSeconds; $totalMinutes = $interval->totalMinutes; $totalHours = $interval->totalHours; $totalDays = $interval->totalDays; $totalMonths = $interval->totalMonths; $totalYears = $interval->totalYears; CarbonInterval::setCascadeFactors($cascades); $this->assertSame(150.0 * 60 * 60, $totalSeconds); $this->assertSame(150.0 * 60, $totalMinutes); $this->assertSame(150.0, $totalHours); $this->assertSame(1146.0, $totalDays); $this->assertSame(1146.0 / 30, $totalMonths); $this->assertSame(1146.0 / 30 / 12, $totalYears); } public function testMicrosecondsInterval() { $interval = CarbonInterval::milliseconds(500); $this->assertSame(0.5, $interval->totalSeconds); $this->assertSame(1 / 2 / 60, $interval->totalMinutes); $this->assertSame(1 / 2 / 3600, $interval->totalHours); $interval = CarbonInterval::milliseconds(600000)->cascade(); $this->assertSame(600000000.0, $interval->totalMicroseconds); $this->assertSame(600000.0, $interval->totalMilliseconds); $this->assertSame(600.0, $interval->totalSeconds); $this->assertSame(10.0, $interval->totalMinutes); $this->assertSame(1 / 6, $interval->totalHours); } public function testWithDiffInterval() { $this->assertSame(51.0, Carbon::parse('2020-08-10')->diff('2020-09-30')->totalDays); } public function testAlterationAfterDiff() { $t1 = Carbon::now(); $t2 = $t1->copy()->addMinutes(2); $p = $t1->diffAsCarbonInterval($t2); $p->addSeconds(10); $this->assertSame(130.0, $p->totalSeconds); } public function testAbsoluteDiff() { Carbon::setTestNowAndTimezone(new DateTimeImmutable('now UTC')); $diff = Carbon::now()->addDays(15)->diff('now'); $this->assertSame(-1296000000000.0, $diff->totalMicroseconds); $this->assertTrue($diff->lte(CarbonInterval::minutes(30))); $diff = Carbon::now()->addDays(15)->diff('now', true); $this->assertSame(1296000000000.0, $diff->totalMicroseconds); $this->assertFalse($diff->lte(CarbonInterval::minutes(30))); } } ================================================ FILE: tests/CarbonPeriod/AliasTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use InvalidArgumentException; use Tests\AbstractTestCase; class AliasTest extends AbstractTestCase { public function testSetStartDate() { $periodClass = static::$periodClass; $period = $periodClass::start($date = '2017-09-13 12:30:45', false); $this->assertEquals(Carbon::parse($date), $period->getStartDate()); $this->assertEquals(Carbon::parse($date), $period->start()); if (PHP_VERSION < 8.2) { $this->assertEquals(Carbon::parse($date), $period->start); } $this->assertPeriodOptions($periodClass::EXCLUDE_START_DATE, $period); $period = $period->since($date = '2014-10-12 15:42:34', true); $this->assertEquals(Carbon::parse($date), $period->getStartDate()); $this->assertPeriodOptions(0, $period); $period = $period->sinceNow(false); $this->assertEquals(Carbon::now(), $period->getStartDate()); $this->assertPeriodOptions($periodClass::EXCLUDE_START_DATE, $period); } public function testSetStartDateWithNamedParameters() { $periodClass = static::$periodClass; $date = '2017-09-13 12:30:45'; /** @var CarbonPeriod $period */ $period = $periodClass::start(date: $date, inclusive: false); $this->assertEquals(Carbon::parse($date), $period->getStartDate()); $this->assertEquals(Carbon::parse($date), $period->start()); if (PHP_VERSION < 8.2) { $this->assertEquals(Carbon::parse($date), $period->start); } $this->assertPeriodOptions(CarbonPeriod::EXCLUDE_START_DATE, $period); /** @var CarbonPeriod $period */ $period = $periodClass::start(date: $date); $this->assertEquals(Carbon::parse($date), $period->getStartDate()); $this->assertEquals(Carbon::parse($date), $period->start()); if (PHP_VERSION < 8.2) { $this->assertEquals(Carbon::parse($date), $period->start); } $this->assertPeriodOptions(0, $period); $date = '2014-10-12 15:42:34'; $period = $period->since(date: $date, inclusive: true); $this->assertEquals(Carbon::parse($date), $period->getStartDate()); $this->assertPeriodOptions(0, $period); $period = $period->sinceNow(inclusive: false); $this->assertEquals(Carbon::now(), $period->getStartDate()); $this->assertPeriodOptions($periodClass::EXCLUDE_START_DATE, $period); $period = $periodClass::sinceNow(); $this->assertEquals(Carbon::now(), $period->getStartDate()); $this->assertPeriodOptions(0, $period); } public function testSetEndDate() { $periodClass = static::$periodClass; $period = $periodClass::end($date = '2017-09-13 12:30:45', false); $this->assertEquals(Carbon::parse($date), $period->getEndDate()); $this->assertEquals(Carbon::parse($date), $period->end()); if (PHP_VERSION < 8.2) { $this->assertEquals(Carbon::parse($date), $period->end); } $this->assertPeriodOptions(CarbonPeriod::EXCLUDE_END_DATE, $period); $period = $period->until($date = '2014-10-12 15:42:34', true); $this->assertEquals(Carbon::parse($date), $period->getEndDate()); $this->assertPeriodOptions(0, $period); $period = $period->untilNow(false); $this->assertEquals(Carbon::now(), $period->getEndDate()); $this->assertPeriodOptions($periodClass::EXCLUDE_END_DATE, $period); $period = $period->end(null); $this->assertNull($period->getEndDate()); } public function testSetEndDateWithNamedParameters() { $periodClass = static::$periodClass; $date = '2017-09-13 12:30:45'; /** @var CarbonPeriod $period */ $period = $periodClass::end(date: $date, inclusive: false); $this->assertEquals(Carbon::parse($date), $period->getEndDate()); $this->assertEquals(Carbon::parse($date), $period->end()); if (PHP_VERSION < 8.2) { $this->assertEquals(Carbon::parse($date), $period->end); } $this->assertPeriodOptions(CarbonPeriod::EXCLUDE_END_DATE, $period); $date = '2014-10-12 15:42:34'; $period = $period->until(date: $date, inclusive: true); $this->assertEquals(Carbon::parse($date), $period->getEndDate()); $this->assertPeriodOptions(0, $period); $period = $period->untilNow(inclusive: false); $this->assertEquals(Carbon::now(), $period->getEndDate()); $this->assertPeriodOptions($periodClass::EXCLUDE_END_DATE, $period); } public function testManageFilters() { $filter = function () { return true; }; $periodClass = static::$periodClass; $period = $periodClass::filter($filter, 'foo'); $this->assertSame([[$filter, 'foo']], $period->getFilters()); $this->assertSame([[$filter, 'foo']], $period->filters()); $period = $period->push($filter, 'bar'); $this->assertSame([[$filter, 'foo'], [$filter, 'bar']], $period->getFilters()); $period = $period->prepend($filter, 'pre'); $this->assertSame([[$filter, 'pre'], [$filter, 'foo'], [$filter, 'bar']], $period->getFilters()); $period = $period->filters([]); $this->assertSame([], $period->getFilters()); $period = $period->filters($filters = [[$filter, null]]); $this->assertSame($filters, $period->getFilters()); } public function testSetRecurrences() { $periodClass = static::$periodClass; $period = $periodClass::recurrences(5); $this->assertSame(5, $period->getRecurrences()); $this->assertSame(5, $period->recurrences()); if (PHP_VERSION < 8.2) { $this->assertSame(5, $period->recurrences); } $period = $period->times(3); $this->assertSame(3, $period->getRecurrences()); $period = $period->recurrences(null); $this->assertNull($period->getRecurrences()); } public function testManageOptions() { $periodClass = static::$periodClass; $start = $periodClass::EXCLUDE_START_DATE; $end = $periodClass::EXCLUDE_END_DATE; $period = $periodClass::options($start); $this->assertSame($start, $period->getOptions()); $period = $period->toggle($start | $end); $this->assertSame($start | $end, $period->getOptions()); $period = $period->toggle($end, false); $this->assertSame($start, $period->getOptions()); $this->assertSame($start, $period->options()); $period = $period->options(null); $this->assertSame(0, $period->getOptions()); } public function testSetDates() { $periodClass = static::$periodClass; $period = $periodClass::dates($start = '2014-10-12 15:42:34', $end = '2017-09-13 12:30:45'); $this->assertEquals(Carbon::parse($start), $period->getStartDate()); $this->assertEquals(Carbon::parse($end), $period->getEndDate()); $period = $period->dates(Carbon::now()); $this->assertEquals(Carbon::now(), $period->getStartDate()); $this->assertNull($period->getEndDate()); } public function testManageInterval() { $periodClass = static::$periodClass; $period = $periodClass::interval('PT6H'); $this->assertEquals(CarbonInterval::create('PT6H')->optimize(), $period->getDateInterval()->optimize()); $this->assertEquals(CarbonInterval::create('PT6H')->optimize(), $period->interval()->optimize()); if (PHP_VERSION < 8.2) { $this->assertEquals(CarbonInterval::create('PT6H')->optimize(), $period->interval->optimize()); } } public function testInvertInterval() { $periodClass = static::$periodClass; $period = $periodClass::invert(); $this->assertEquals( CarbonInterval::create('P1D')->invert()->optimize(), $period->getDateInterval()->optimize(), ); } public function testModifyIntervalPlural() { $periodClass = static::$periodClass; $period = $periodClass::weeks(2); $this->assertSame('P14D', $period->getDateInterval()->spec()); $period = $period->years(2)->months(3)->days(4)->hours(5)->minutes(30)->seconds(15); $this->assertSame('P2Y3M4DT5H30M15S', $period->getDateInterval()->spec()); $period = $period->years(0)->months(0)->dayz(0)->hours(0)->minutes(0)->seconds(1); $this->assertSame('PT1S', $period->getDateInterval()->spec()); $period = $periodClass::create(); $this->assertSame('P1D', $period->getDateInterval()->spec()); $period = $periodClass::create()->hours(12); $this->assertSame('PT12H', $period->getDateInterval()->spec()); $period = $periodClass::day()->hours(12); $this->assertSame('P1DT12H', $period->getDateInterval()->spec()); $period = $periodClass::day()->resetDateInterval()->hours(12); $this->assertSame('PT12H', $period->getDateInterval()->spec()); } public function testModifyIntervalSingular() { $periodClass = static::$periodClass; $period = $periodClass::week(); $this->assertSame('P7D', $period->getDateInterval()->spec()); $period = $period->year()->month()->day()->hour()->minute()->second(); $this->assertSame('P1Y1M1DT1H1M1S', $period->getDateInterval()->spec()); $period = $period->year(2)->month(3)->day(4)->hour(5)->minute(6)->second(7); $this->assertSame('P2Y3M4DT5H6M7S', $period->getDateInterval()->spec()); } public function testChainAliases() { $periodClass = static::$periodClass; Carbon::setTestNow('2018-05-15'); $period = $periodClass::days(3)->hours(5)->invert() ->sinceNow()->until(Carbon::now()->subDays(10)) ->options($periodClass::EXCLUDE_START_DATE) ->times(2); $this->assertSame( $this->standardizeDates([ Carbon::now()->subDays(3)->subHours(5), Carbon::now()->subDays(6)->subHours(10), ]), $this->standardizeDates($period), ); } public function testCallInvalidAlias() { $this->expectExceptionObject(new BadMethodCallException( 'Method foobar does not exist.', )); $periodClass = static::$periodClass; $periodClass::foobar(); } public function testOverrideDefaultInterval() { $periodClass = static::$periodClass; $period = $periodClass::hours(5); $this->assertSame('PT5H', $period->getDateInterval()->spec()); $period = $periodClass::create()->hours(5); $this->assertSame('PT5H', $period->getDateInterval()->spec()); $period = $periodClass::create('P1D')->hours(5); $this->assertSame('P1DT5H', $period->getDateInterval()->spec()); } public function testModifyIntoEmptyDateInterval() { $this->expectExceptionObject(new InvalidArgumentException( 'Empty interval is not accepted.', )); $periodClass = static::$periodClass; $periodClass::days(0); } public function testNamedParameters() { $periodClass = static::$periodClass; $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12'); $this->assertEquals('2022-09-13', $period->getStartDate()->format('Y-m-d')); $this->assertEquals('2022-10-12', $period->getEndDate()->format('Y-m-d')); $period = $period->years(years: 5); $this->assertEquals('5 years', (string) $period->getDateInterval()); $period = $period->interval(interval: \Carbon\CarbonInterval::year(years: 3)); $this->assertEquals('3 years', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12')->months(months: 5); $this->assertEquals('5 months', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12')->weeks(weeks: 5); $this->assertEquals('5 weeks', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12')->days(days: 5); $this->assertEquals('5 days', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12')->hours(hours: 5); $this->assertEquals('5 hours', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12')->minutes(minutes: 5); $this->assertEquals('5 minutes', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12')->seconds(seconds: 5); $this->assertEquals('5 seconds', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12') ->days(days: 5) ->floorDays(precision: 2); $this->assertEquals('4 days', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12') ->days(days: 5) ->roundDays(precision: 7); $this->assertEquals('1 week', (string) $period->getDateInterval()); $period = $periodClass::between(start: '2022-09-13', end: '2022-10-12') ->days(days: 5) ->ceilDays(precision: 2); $this->assertEquals('6 days', (string) $period->getDateInterval()); } } ================================================ FILE: tests/CarbonPeriod/CloneTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Tests\AbstractTestCase; class CloneTest extends AbstractTestCase { public function testClone() { $periodClass = static::$periodClass; $period = $periodClass::create('R4/2012-07-01T00:00:00/P7D'); $clone = $period->clone(); $this->assertSame((string) $period, (string) $clone); $this->assertNotSame($period, $clone); $this->assertEquals($period, $clone); } public function testCopy() { $periodClass = static::$periodClass; $period = $periodClass::create('R4/2012-07-01T00:00:00/P7D'); $clone = $period->copy(); $this->assertSame((string) $period, (string) $clone); $this->assertNotSame($period, $clone); $this->assertEquals($period, $clone); } } ================================================ FILE: tests/CarbonPeriod/ComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use DateInterval; use DatePeriod; use DateTime; use DateTimeImmutable; use Tests\AbstractTestCase; class ComparisonTest extends AbstractTestCase { public function testEqualToTrue() { $periodClass = static::$periodClass; $period = $periodClass::create('2010-01-01', '2010-02-01'); $this->assertTrue($period->equalTo($period)); $this->assertTrue($period->eq($period)); $this->assertTrue($period->eq($periodClass::create('2010-01-01', '2010-02-01'))); $this->assertTrue($period->eq($periodClass::create('R3/2010-01-01/P1D/2010-02-01'))); $this->assertTrue($period->eq(Carbon::parse('2010-01-01')->daysUntil('2010-02-01'))); $this->assertTrue($period->eq( new DatePeriod(new DateTime('2010-01-01'), CarbonInterval::day(), new DateTime('2010-02-01')) )); $period = $periodClass::create('2010-01-01', '2010-02-01', 'P2D'); $this->assertTrue($period->eq($periodClass::create('2010-01-01', '2010-02-01', 'P2D'))); $this->assertTrue($period->eq($periodClass::create('2010-01-01', '2010-02-01', CarbonInterval::day(2)))); $this->assertTrue($period->eq($periodClass::create('2010-01-01', '2010-02-01')->setDateInterval('P2D'))); $this->assertTrue($period->eq($periodClass::create('R3/2010-01-01/P2D/2010-02-01'))); $period = $periodClass::create('2010-01-01', '2010-02-01', $periodClass::EXCLUDE_START_DATE); $this->assertTrue($period->eq($periodClass::create('2010-01-01', '2010-02-01', $periodClass::EXCLUDE_START_DATE))); $this->assertTrue($period->eq($periodClass::create('2010-01-01', '2010-02-01')->setOptions($periodClass::EXCLUDE_START_DATE))); } public function testEqualToFalse() { $periodClass = static::$periodClass; $period = $periodClass::create('2010-01-01', '2010-02-01'); $this->assertFalse($period->equalTo($periodClass::create('2010-01-02', '2010-02-01'))); $this->assertFalse($period->eq($periodClass::create('2010-01-02', '2010-02-01'))); $this->assertFalse($period->eq($periodClass::create('2010-01-01', '2010-02-02'))); $this->assertFalse($period->eq($periodClass::create('2010-01-01', '2010-02-02', 'P2D'))); $this->assertFalse($period->eq($periodClass::create('2010-01-01', '2010-02-02', $periodClass::EXCLUDE_START_DATE))); } public function testNotEqualToTrue() { $periodClass = static::$periodClass; $period = $periodClass::create('2010-01-01', '2010-02-01'); $this->assertTrue($period->notEqualTo($periodClass::create('2010-01-02', '2010-02-01'))); $this->assertTrue($period->ne($periodClass::create('2010-01-02', '2010-02-01'))); $this->assertTrue($period->ne($periodClass::create('2010-01-01', '2010-02-02'))); $this->assertTrue($period->ne($periodClass::create('2010-01-01', '2010-02-02', 'P2D'))); $this->assertTrue($period->ne($periodClass::create('2010-01-01', '2010-02-02', $periodClass::EXCLUDE_START_DATE))); } public function testNotEqualToFalse() { $periodClass = static::$periodClass; $period = $periodClass::create('2010-01-01', '2010-02-01'); $this->assertFalse($period->notEqualTo($period)); $this->assertFalse($period->ne($period)); $this->assertFalse($period->ne($periodClass::create('2010-01-01', '2010-02-01'))); $this->assertFalse($period->ne($periodClass::create('R3/2010-01-01/P1D/2010-02-01'))); $this->assertFalse($period->ne(Carbon::parse('2010-01-01')->daysUntil('2010-02-01'))); $this->assertFalse($period->ne( new DatePeriod(new DateTime('2010-01-01'), CarbonInterval::day(), new DateTime('2010-02-01')) )); $period = $periodClass::create('2010-01-01', '2010-02-01', 'P2D'); $this->assertFalse($period->ne($periodClass::create('2010-01-01', '2010-02-01', 'P2D'))); $this->assertFalse($period->ne($periodClass::create('2010-01-01', '2010-02-01', CarbonInterval::day(2)))); $this->assertFalse($period->ne($periodClass::create('2010-01-01', '2010-02-01')->setDateInterval('P2D'))); $this->assertFalse($period->ne($periodClass::create('R3/2010-01-01/P2D/2010-02-01'))); $period = $periodClass::create('2010-01-01', '2010-02-01', $periodClass::EXCLUDE_START_DATE); $this->assertFalse($period->ne($periodClass::create('2010-01-01', '2010-02-01', $periodClass::EXCLUDE_START_DATE))); $this->assertFalse($period->ne($periodClass::create('2010-01-01', '2010-02-01')->setOptions($periodClass::EXCLUDE_START_DATE))); } public function testStartComparisons() { $periodClass = static::$periodClass; Carbon::setTestNow('2020-01-01'); CarbonImmutable::setTestNow('2020-01-01'); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsBefore($periodClass::create('2019-12-05', '2020-02-01'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsBefore($periodClass::create('2020-01-07', '2020-01-08'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsBefore(CarbonInterval::days(2))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsBefore(CarbonInterval::days(4))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsBeforeOrAt(CarbonInterval::days(4))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsBefore(CarbonInterval::days(5))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsAfter($periodClass::create('2019-12-05', '2020-02-01'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsAfter($periodClass::create('2020-01-07', '2020-01-08'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsAfter(CarbonInterval::days(2))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsAfter(CarbonInterval::days(4))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsAfterOrAt(CarbonInterval::days(4))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsAfter(CarbonInterval::days(5))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->startsAt('2020-02-01')); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->startsAt('2020-01-05')); } public function testEndComparisons() { $periodClass = static::$periodClass; Carbon::setTestNow('2020-02-05'); CarbonImmutable::setTestNow('2020-02-05'); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsBefore($periodClass::create('2019-12-05', '2020-02-01'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsBefore($periodClass::create('2020-01-07', '2020-01-08'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsBefore($periodClass::create('2020-02-01', '2020-02-08'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsBeforeOrAt($periodClass::create('2020-02-01', '2020-02-08'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsBefore($periodClass::create('2020-02-03', '2020-02-08'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsBefore(CarbonInterval::days(2)->invert())); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsBefore(CarbonInterval::days(4)->invert())); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsBeforeOrAt(CarbonInterval::days(4)->invert())); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsBefore(CarbonInterval::days(5)->invert())); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsAfter($periodClass::create('2019-12-05', '2020-02-01'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsAfter($periodClass::create('2020-01-07', '2020-01-08'))); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsAfterOrAt($periodClass::create('2020-02-01', '2020-01-08'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsAfter($periodClass::create('2020-02-01', '2020-01-08'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsAfter($periodClass::create('2020-02-02', '2020-01-08'))); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsAfter(CarbonInterval::days(2)->invert())); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsAfter(CarbonInterval::days(4)->invert())); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsAfterOrAt(CarbonInterval::days(4)->invert())); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsAfter(CarbonInterval::days(5)->invert())); $this->assertTrue($periodClass::create('2020-01-05', '2020-02-01')->endsAt('2020-02-01')); $this->assertFalse($periodClass::create('2020-01-05', '2020-02-01')->endsAt('2020-01-05')); } public function testContains() { $periodClass = static::$periodClass; $period = $periodClass::create('2019-08-01', '2019-08-10'); $this->assertFalse($period->contains('2019-07-31 23:59:59')); $this->assertTrue($period->contains('2019-08-01')); $this->assertTrue($period->contains('2019-08-02')); $this->assertTrue($period->contains('2019-08-10')); $this->assertFalse($period->contains('2019-08-10 00:00:01')); $period = $periodClass::create('2019-08-01', '2019-08-10', $periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE); $this->assertFalse($period->contains('2019-08-01')); $this->assertTrue($period->contains('2019-08-01 00:00:01')); $this->assertTrue($period->contains('2019-08-02')); $this->assertTrue($period->contains('2019-08-09 23:59:59')); $this->assertFalse($period->contains('2019-08-10')); } public function testConsecutivePeriods() { $periodClass = static::$periodClass; $july = $periodClass::create('2019-07-29', '2019-07-31'); $august = $periodClass::create('2019-08-01', '2019-08-12'); $this->assertFalse($july->follows($august)); $this->assertTrue($august->follows($july)); $this->assertTrue($july->isFollowedBy($august)); $this->assertFalse($august->isFollowedBy($july)); $this->assertTrue($july->isConsecutiveWith($august)); $this->assertTrue($august->isConsecutiveWith($july)); $this->assertFalse($july->follows('2019-08-01', '2019-08-12')); $this->assertTrue($august->follows('2019-07-29', '2019-07-31')); $this->assertTrue($july->isFollowedBy('2019-08-01', '2019-08-12')); $this->assertFalse($august->isFollowedBy('2019-07-29', '2019-07-31')); $this->assertTrue($july->isConsecutiveWith('2019-08-01', '2019-08-12')); $this->assertTrue($august->isConsecutiveWith('2019-07-29', '2019-07-31')); $july2 = new DatePeriod( new DateTimeImmutable('2019-07-29'), new DateInterval('P1D'), new DateTimeImmutable('2019-07-31'), ); $august2 = new DatePeriod( new DateTimeImmutable('2019-08-01'), new DateInterval('P1D'), new DateTimeImmutable('2019-08-12'), ); $this->assertFalse($july->follows($august2)); $this->assertTrue($august->follows($july2)); $this->assertTrue($july->isFollowedBy($august2)); $this->assertFalse($august->isFollowedBy($july2)); $this->assertTrue($july->isConsecutiveWith($august2)); $this->assertTrue($august->isConsecutiveWith($july2)); $july = $periodClass::create('2019-07-29', '2019-08-01'); $august = $periodClass::create('2019-08-01', '2019-08-12'); $this->assertFalse($july->follows($august)); $this->assertFalse($august->follows($july)); $this->assertFalse($july->isFollowedBy($august)); $this->assertFalse($august->isFollowedBy($july)); $this->assertFalse($july->isConsecutiveWith($august)); $this->assertFalse($august->isConsecutiveWith($july)); $july = $periodClass::create('2019-07-29', '2019-07-31', $periodClass::EXCLUDE_END_DATE); $august = $periodClass::create('2019-08-01', '2019-08-12', $periodClass::EXCLUDE_START_DATE); $this->assertFalse($july->follows($august)); $this->assertFalse($august->follows($july)); $this->assertFalse($july->isFollowedBy($august)); $this->assertFalse($august->isFollowedBy($july)); $this->assertFalse($july->isConsecutiveWith($august)); $this->assertFalse($august->isConsecutiveWith($july)); } public function testConsecutivePeriodsWithExclusion() { $periodClass = static::$periodClass; $july = $periodClass::create('2019-07-29', '2019-08-01', $periodClass::EXCLUDE_END_DATE); $august = $periodClass::create('2019-07-31', '2019-08-12', $periodClass::EXCLUDE_START_DATE); $this->assertFalse($july->follows($august)); $this->assertTrue($august->follows($july)); $this->assertTrue($july->isFollowedBy($august)); $this->assertFalse($august->isFollowedBy($july)); $this->assertTrue($july->isConsecutiveWith($august)); $this->assertTrue($august->isConsecutiveWith($july)); } public function testConsecutivePeriodsWithDynamicEnd() { $periodClass = static::$periodClass; $july = $periodClass::create('2019-07-29', '1 day', 4); $august = $periodClass::create('2019-08-02', '2019-08-12'); $this->assertFalse($july->follows($august)); $this->assertTrue($august->follows($july)); $this->assertTrue($july->isFollowedBy($august)); $this->assertFalse($august->isFollowedBy($july)); $this->assertTrue($july->isConsecutiveWith($august)); $this->assertTrue($august->isConsecutiveWith($july)); } } ================================================ FILE: tests/CarbonPeriod/CreateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\CarbonPeriodImmutable; use Carbon\Exceptions\InvalidPeriodParameterException; use Carbon\Exceptions\NotAPeriodException; use Carbon\Month; use Carbon\Unit; use DateInterval; use DatePeriod; use DateTime; use Generator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use stdClass; use Tests\AbstractTestCase; class CreateTest extends AbstractTestCase { #[DataProvider('dataForIso8601String')] public function testCreateFromIso8601String($arguments, $expected) { $periodClass = static::$periodClass; [$iso, $options] = array_pad($arguments, 2, null); $period = $periodClass::create($iso, $options); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertInstanceOf(DatePeriod::class, $period); $this->assertSame( $this->standardizeDates($expected), $this->standardizeDates($period), ); } public static function dataForIso8601String(): Generator { yield [ ['R4/2012-07-01T00:00:00/P7D'], ['2012-07-01', '2012-07-08', '2012-07-15', '2012-07-22'], ]; yield [ ['R4/2012-07-01T00:00:00/P7D', CarbonPeriod::EXCLUDE_START_DATE], ['2012-07-08', '2012-07-15', '2012-07-22', '2012-07-29'], ]; yield [ ['2012-07-01/P2D/2012-07-07'], ['2012-07-01', '2012-07-03', '2012-07-05', '2012-07-07'], ]; yield [ ['2012-07-01/2012-07-04', CarbonPeriod::EXCLUDE_END_DATE], ['2012-07-01', '2012-07-02', '2012-07-03'], ]; yield [ ['R2/2012-07-01T10:30:45Z/P2D'], ['2012-07-01 10:30:45 UTC', '2012-07-03 10:30:45 UTC'], ]; } public function testCreateFromIso8601StringWithUnboundedRecurrences() { $periodClass = static::$periodClass; $period = $periodClass::create('R/2012-07-01T00:00:00/P7D'); $this->assertSame('2012-07-01', $period->getStartDate()->toDateString()); $this->assertSame('P7D', $period->getDateInterval()->spec()); $this->assertNull($period->getEndDate()); $this->assertNull($period->getRecurrences()); } public function testCreateFromIso8601StringWithInfiniteRecurrences() { $periodClass = static::$periodClass; $period = $periodClass::create('RINF/2012-07-01T00:00:00/P7D'); $this->assertSame('2012-07-01', $period->getStartDate()->toDateString()); $this->assertSame('P7D', $period->getDateInterval()->spec()); $this->assertNull($period->getEndDate()); $this->assertInfinite($period->getRecurrences()); } #[DataProvider('dataForPartialIso8601String')] public function testCreateFromPartialIso8601String($iso, $from, $to) { $periodClass = static::$periodClass; $period = $periodClass::create($iso); $this->assertSame( $this->standardizeDates([$from, $to]), $this->standardizeDates([$period->getStartDate(), $period->getEndDate()]), ); $period = new $periodClass($iso); $this->assertSame( $this->standardizeDates([$from, $to]), $this->standardizeDates([$period->getStartDate(), $period->getEndDate()]), ); } public static function dataForPartialIso8601String(): Generator { yield ['2008-02-15/03-14', '2008-02-15', '2008-03-14']; yield ['2007-12-14T13:30/15:30', '2007-12-14 13:30', '2007-12-14 15:30']; } #[DataProvider('dataForInvalidIso8601String')] public function testCreateFromInvalidIso8601String($iso) { $this->expectExceptionObject(new InvalidArgumentException( "Invalid ISO 8601 specification: $iso", )); $periodClass = static::$periodClass; $periodClass::create($iso); } public static function dataForInvalidIso8601String(): Generator { yield ['R2/R4']; yield ['2008-02-15/2008-02-16/2008-02-17']; yield ['P1D/2008-02-15/P2D']; yield ['2008-02-15/R5']; yield ['P2D/R2']; yield ['/']; } #[DataProvider('dataForStartDateAndEndDate')] public function testCreateFromStartDateAndEndDate($arguments, $expected) { $periodClass = static::$periodClass; [$start, $end, $options] = array_pad($arguments, 3, null); $start = Carbon::parse($start); $end = Carbon::parse($end); $period = $periodClass::create($start, $end, $options); $this->assertSame( $this->standardizeDates($expected), $this->standardizeDates($period), ); } public static function dataForStartDateAndEndDate(): Generator { yield [ ['2015-09-30', '2015-10-03'], ['2015-09-30', '2015-10-01', '2015-10-02', '2015-10-03'], ]; yield [ ['2015-09-30', '2015-10-03', CarbonPeriod::EXCLUDE_START_DATE], ['2015-10-01', '2015-10-02', '2015-10-03'], ]; yield [ ['2015-09-30', '2015-10-03', CarbonPeriod::EXCLUDE_END_DATE], ['2015-09-30', '2015-10-01', '2015-10-02'], ]; yield [ ['2015-09-30', '2015-10-03', CarbonPeriod::EXCLUDE_START_DATE | CarbonPeriod::EXCLUDE_END_DATE], ['2015-10-01', '2015-10-02'], ]; yield [ ['2015-10-02', '2015-10-03', CarbonPeriod::EXCLUDE_START_DATE | CarbonPeriod::EXCLUDE_END_DATE], [], ]; yield [ ['2015-10-02', '2015-10-02'], ['2015-10-02'], ]; yield [ ['2015-10-02', '2015-10-02', CarbonPeriod::EXCLUDE_START_DATE], [], ]; yield [ ['2015-10-02', '2015-10-02', CarbonPeriod::EXCLUDE_END_DATE], [], ]; } #[DataProvider('dataForStartDateAndIntervalAndEndDate')] public function testCreateFromStartDateAndIntervalAndEndDate($arguments, $expected) { $periodClass = static::$periodClass; [$start, $interval, $end, $options] = array_pad($arguments, 4, null); $start = Carbon::parse($start); $interval = CarbonInterval::create($interval); $end = Carbon::parse($end); $period = $periodClass::create($start, $interval, $end, $options); $this->assertSame( $this->standardizeDates($expected), $this->standardizeDates($period), ); } public static function dataForStartDateAndIntervalAndEndDate(): Generator { yield [ ['2018-04-21', 'P3D', '2018-04-26'], ['2018-04-21', '2018-04-24'], ]; yield [ ['2018-04-21 16:15', 'PT15M', '2018-04-21 16:59:59'], ['2018-04-21 16:15', '2018-04-21 16:30', '2018-04-21 16:45'], ]; yield [ ['2018-04-21 16:15', 'PT15M', '2018-04-21 17:00'], ['2018-04-21 16:15', '2018-04-21 16:30', '2018-04-21 16:45', '2018-04-21 17:00'], ]; yield [ ['2018-04-21 17:00', 'PT45S', '2018-04-21 17:02', CarbonPeriod::EXCLUDE_START_DATE], ['2018-04-21 17:00:45', '2018-04-21 17:01:30'], ]; yield [ ['2017-12-31 22:00', 'PT2H', '2018-01-01 4:00', CarbonPeriod::EXCLUDE_END_DATE], ['2017-12-31 22:00', '2018-01-01 0:00', '2018-01-01 2:00'], ]; yield [ [ '2017-12-31 23:59', 'PT30S', '2018-01-01 0:01', CarbonPeriod::EXCLUDE_START_DATE | CarbonPeriod::EXCLUDE_END_DATE, ], ['2017-12-31 23:59:30', '2018-01-01 0:00', '2018-01-01 0:00:30'], ]; yield [ ['2018-04-21', 'P1D', '2018-04-21'], ['2018-04-21'], ]; yield [ ['2018-04-21', 'P1D', '2018-04-20 23:59:59'], [], ]; } #[DataProvider('dataForStartDateAndIntervalAndRecurrences')] public function testCreateFromStartDateAndIntervalAndRecurrences($arguments, $expected) { $periodClass = static::$periodClass; [$start, $interval, $recurrences, $options] = array_pad($arguments, 4, null); $start = Carbon::parse($start); $interval = CarbonInterval::create($interval); $period = $periodClass::create($start, $interval, $recurrences, $options); $this->assertSame( $this->standardizeDates($expected), $this->standardizeDates($period), ); } public static function dataForStartDateAndIntervalAndRecurrences(): Generator { yield [ ['2018-04-16', 'P2D', 3], ['2018-04-16', '2018-04-18', '2018-04-20'], ]; yield [ ['2018-04-30', 'P2M', 2, CarbonPeriod::EXCLUDE_START_DATE], ['2018-06-30', '2018-08-30'], ]; } #[DataProvider('dataForStartDateAndRecurrences')] public function testCreateFromStartDateAndRecurrences($arguments, $expected) { $periodClass = static::$periodClass; [$start, $recurrences, $options] = array_pad($arguments, 4, null); $start = Carbon::parse($start); $period = $periodClass::create($start, $recurrences, $options); $this->assertSame( $this->standardizeDates($expected), $this->standardizeDates($period), ); } public static function dataForStartDateAndRecurrences(): Generator { yield [ ['2018-04-16', 2], ['2018-04-16', '2018-04-17'], ]; yield [ ['2018-04-30', 1], ['2018-04-30'], ]; yield [ ['2018-04-30', 1, CarbonPeriod::EXCLUDE_START_DATE], ['2018-05-01'], ]; yield [ ['2018-05-17', 0], [], ]; } public function testCreateFromBaseClasses() { $periodClass = static::$periodClass; $period = $periodClass::create( new DateTime('2018-04-16'), new DateInterval('P1M'), new DateTime('2018-07-15'), ); $this->assertSame( [ '2018-04-16 00:00:00 -04:00', '2018-05-16 00:00:00 -04:00', '2018-06-16 00:00:00 -04:00', ], $this->standardizeDates($period), ); } #[DataProvider('dataForInvalidParameters')] public function testCreateFromInvalidParameters(...$arguments) { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid constructor parameters.', )); $periodClass = static::$periodClass; $periodClass::create(...$arguments); } public static function dataForInvalidParameters(): Generator { yield [new stdClass(), CarbonInterval::days(1), Carbon::tomorrow()]; yield [Carbon::now(), new stdClass(), Carbon::tomorrow()]; yield [Carbon::now(), CarbonInterval::days(1), new stdClass()]; yield [Carbon::yesterday(), Carbon::now(), Carbon::tomorrow()]; yield [CarbonInterval::day(), CarbonInterval::hour()]; yield [5, CarbonPeriod::EXCLUDE_START_DATE, CarbonPeriod::EXCLUDE_END_DATE]; yield ['2017-10-15/P3D', CarbonInterval::hour()]; } public function testCreateOnDstForwardChange() { $periodClass = static::$periodClass; $period = $periodClass::create( '2018-03-25 1:30 Europe/Oslo', 'PT30M', '2018-03-25 3:30 Europe/Oslo', ); $this->assertSame( [ '2018-03-25 01:30:00 +01:00', '2018-03-25 03:00:00 +02:00', '2018-03-25 03:30:00 +02:00', ], $this->standardizeDates($period), ); } /** * Incorrect behaviour is caused by a bug in DateTime handling of DST backward change. * It was fixed by incrementing date casted to UTC, but offsets are still kind of wrong. * * @see https://bugs.php.net/bug.php?id=72255 * @see https://bugs.php.net/bug.php?id=74274 * @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time */ public function testCreateOnDstBackwardChange() { $periodClass = static::$periodClass; $period = $periodClass::create( '2018-10-28 1:30 Europe/Oslo', 'PT30M', '2018-10-28 3:30 Europe/Oslo', ); $this->assertSame( [ '2018-10-28 01:30:00 +02:00', '2018-10-28 02:00:00 +02:00', '2018-10-28 02:30:00 +02:00', '2018-10-28 02:00:00 +01:00', '2018-10-28 02:30:00 +01:00', '2018-10-28 03:00:00 +01:00', '2018-10-28 03:30:00 +01:00', ], $this->standardizeDates($period), ); } public function testInternalVariablesCannotBeIndirectlyModified() { $periodClass = static::$periodClass; $period = $periodClass::create( $start = new DateTime('2018-04-16'), $interval = new DateInterval('P1M'), $end = new DateTime('2018-07-15'), ); $start->modify('-5 days'); $interval->d = 15; $end->modify('+5 days'); $this->assertSame('2018-04-16', $period->getStartDate()->toDateString()); $this->assertSame('P1M', $period->getDateInterval()->spec()); $this->assertSame('2018-07-15', $period->getEndDate()->toDateString()); $period = $periodClass::create( $start = new Carbon('2018-04-16'), $interval = new CarbonInterval('P1M'), $end = new Carbon('2018-07-15'), ); $start->subDays(5); $interval->days(15); $end->addDays(5); $this->assertSame('2018-04-16', $period->getStartDate()->toDateString()); $this->assertSame('P1M', $period->getDateInterval()->spec()); $this->assertSame('2018-07-15', $period->getEndDate()->toDateString()); } public function testCreateFromArray() { $periodClass = static::$periodClass; $period = $periodClass::createFromArray([ '2018-03-25', 'P2D', '2018-04-01', $periodClass::EXCLUDE_END_DATE, ]); $this->assertSame('2018-03-25', $period->getStartDate()->toDateString()); $this->assertSame('P2D', $period->getDateInterval()->spec()); $this->assertSame('2018-04-01', $period->getEndDate()->toDateString()); $this->assertPeriodOptions($periodClass::EXCLUDE_END_DATE, $period); } public function testCreateFromIso() { $periodClass = static::$periodClass; $period = $periodClass::createFromIso('R3/2018-03-25/P2D/2018-04-01', $periodClass::EXCLUDE_END_DATE); $this->assertSame('2018-03-25', $period->getStartDate()->toDateString()); $this->assertSame('P2D', $period->getDateInterval()->spec()); $this->assertSame('2018-04-01', $period->getEndDate()->toDateString()); $this->assertSame(3, $period->getRecurrences()); $this->assertPeriodOptions($periodClass::EXCLUDE_END_DATE, $period); } public function testCreateEmpty() { $periodClass = static::$periodClass; $period = new $periodClass(); $this->assertEquals(new Carbon(), $period->getStartDate()); $this->assertSame('P1D', $period->getDateInterval()->spec()); $this->assertNull($period->getEndDate()); $this->assertNull($period->getRecurrences()); $this->assertPeriodOptions(0, $period); } public function testCreateFromDateStringsWithTimezones() { $periodClass = static::$periodClass; $periodClass = \Carbon\CarbonPeriodImmutable::class; $period = $periodClass::create( $start = '2018-03-25 10:15:30 Europe/Oslo', $end = '2018-03-28 17:25:30 Asia/Kamchatka', ); $this->assertSame('2018-03-25 10:15:30 Europe/Oslo', $period->first()->format('Y-m-d H:i:s e')); $this->assertSame('2018-03-27 10:15:30 Europe/Oslo', $period->last()->format('Y-m-d H:i:s e')); $this->assertSame($start, $period->getStartDate()->format('Y-m-d H:i:s e')); $this->assertSame($end, $period->getEndDate()->format('Y-m-d H:i:s e')); $period = $periodClass::create( '2024-01-01', '2024-01-05', \Carbon\CarbonTimeZone::create('Australia/Melbourne'), ); $this->assertSame('Australia/Melbourne', $period->first()->timezone->getName()); $this->assertSame('Australia/Melbourne', $period->last()->timezone->getName()); $this->assertSame('Australia/Melbourne', $period->getStartDate()->timezone->getName()); $this->assertSame('Australia/Melbourne', $period->getEndDate()->timezone->getName()); $this->assertSame('2024-01-01 00:00:00 Australia/Melbourne', $period->first()->format('Y-m-d H:i:s e')); $this->assertSame('2024-01-05 00:00:00 Australia/Melbourne', $period->last()->format('Y-m-d H:i:s e')); $this->assertSame('2024-01-01 00:00:00 Australia/Melbourne', $period->getStartDate()->format('Y-m-d H:i:s e')); $this->assertSame('2024-01-05 00:00:00 Australia/Melbourne', $period->getEndDate()->format('Y-m-d H:i:s e')); $period = $periodClass::create( '2024-01-01', '2024-01-05', 'Australia/Melbourne', ); $this->assertSame('Australia/Melbourne', $period->first()->timezone->getName()); $this->assertSame('Australia/Melbourne', $period->last()->timezone->getName()); $this->assertSame('Australia/Melbourne', $period->getStartDate()->timezone->getName()); $this->assertSame('Australia/Melbourne', $period->getEndDate()->timezone->getName()); $this->assertSame('2024-01-01 00:00:00 Australia/Melbourne', $period->first()->format('Y-m-d H:i:s e')); $this->assertSame('2024-01-05 00:00:00 Australia/Melbourne', $period->last()->format('Y-m-d H:i:s e')); $this->assertSame('2024-01-01 00:00:00 Australia/Melbourne', $period->getStartDate()->format('Y-m-d H:i:s e')); $this->assertSame('2024-01-05 00:00:00 Australia/Melbourne', $period->getEndDate()->format('Y-m-d H:i:s e')); } public function testCreateWithIntervalInFromStringFormat() { $periodClass = static::$periodClass; $period = $periodClass::create( '2018-03-25 12:00', '2 days 10 hours', '2018-04-01 13:30', ); $this->assertSame( $this->standardizeDates(['2018-03-25 12:00', '2018-03-27 22:00', '2018-03-30 08:00']), $this->standardizeDates($period), ); $period = $periodClass::create( '2018-04-21', '3 days', '2018-04-27', ); $this->assertSame( $this->standardizeDates(['2018-04-21 00:00', '2018-04-24 00:00', '2018-04-27 00:00']), $this->standardizeDates($period), ); } public function testCreateFromRelativeDates() { $periodClass = static::$periodClass; $period = $periodClass::create( $start = 'previous friday', $end = '+6 days', ); $this->assertEquals(new Carbon($start), $period->getStartDate()); $this->assertEquals(new Carbon($end), $period->getEndDate()); } public function testCreateFromCarbonInstances() { $date1 = Carbon::parse('2018-06-01'); $date2 = Carbon::parse('2018-06-10'); $period = $date1->toPeriod($date2, 'P1D'); $this->assertSame(24.0, $period->getDateInterval()->totalHours); $this->assertInstanceOf(Carbon::class, $period->getStartDate()); $this->assertSame('2018-06-01', $period->getStartDate()->format('Y-m-d')); $this->assertInstanceOf(Carbon::class, $period->getEndDate()); $this->assertSame('2018-06-10', $period->getEndDate()->format('Y-m-d')); $period = Carbon::create('2019-01-02')->toPeriod(7); $this->assertSame(24.0, $period->getDateInterval()->totalHours); $this->assertInstanceOf(Carbon::class, $period->getStartDate()); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertNull($period->getEndDate()); $this->assertSame(7, $period->getRecurrences()); $end = $period->calculateEnd(); $this->assertInstanceOf(Carbon::class, $end); $this->assertSame('2019-01-08', $end->format('Y-m-d')); $period = Carbon::create('2019-01-02')->toPeriod('2019-02-05'); $this->assertNull($period->getRecurrences()); $this->assertSame(24.0, $period->getDateInterval()->totalHours); $this->assertInstanceOf(Carbon::class, $period->getStartDate()); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertInstanceOf(Carbon::class, $period->getEndDate()); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $period = Carbon::create('2019-01-02')->range('2019-02-05'); $this->assertInstanceOf(Carbon::class, $period->getStartDate()); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertInstanceOf(Carbon::class, $period->getEndDate()); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $period = Carbon::create('2019-01-02')->daysUntil('2019-02-05'); $this->assertSame(24.0, $period->getDateInterval()->totalHours); $this->assertInstanceOf(Carbon::class, $period->getStartDate()); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertInstanceOf(Carbon::class, $period->getEndDate()); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $period = CarbonImmutable::create('2019-01-02')->daysUntil('2019-02-05'); $this->assertInstanceOf(CarbonImmutable::class, $period->getStartDate()); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertInstanceOf(CarbonImmutable::class, $period->getEndDate()); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $period = CarbonImmutable::create('2019-01-02')->daysUntil(Carbon::parse('2019-02-05')); $this->assertSame(CarbonImmutable::class, $period->getDateClass()); $this->assertInstanceOf(CarbonImmutable::class, $period->getStartDate()); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertInstanceOf(CarbonImmutable::class, $period->getEndDate()); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $period = Carbon::create('2019-01-02')->hoursUntil('2019-02-05'); $this->assertSame(1.0, $period->getDateInterval()->totalHours); $this->assertSame('1 minute', Carbon::create('2019-01-02')->minutesUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('3 minutes', Carbon::create('2019-01-02')->minutesUntil('2019-02-05', 3)->getDateInterval()->forHumans()); $this->assertSame('3 seconds', Carbon::create('2019-01-02')->range('2019-02-05', 3, 'seconds')->getDateInterval()->forHumans()); $this->assertSame('1 second', Carbon::create('2019-01-02')->secondsUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame(1.0, Carbon::create('2019-01-02')->millisecondsUntil('2019-02-05')->getDateInterval()->totalMilliseconds); $this->assertSame(1.0, Carbon::create('2019-01-02')->microsecondsUntil('2019-02-05')->getDateInterval()->totalMicroseconds); $this->assertSame('1 week', Carbon::create('2019-01-02')->weeksUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('1 month', Carbon::create('2019-01-02')->monthsUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('3 months', Carbon::create('2019-01-02')->quartersUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('1 year', Carbon::create('2019-01-02')->yearsUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('10 years', Carbon::create('2019-01-02')->decadesUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('100 years', Carbon::create('2019-01-02')->centuriesUntil('2019-02-05')->getDateInterval()->forHumans()); $this->assertSame('1000 years', Carbon::create('2019-01-02')->millenniaUntil('2019-02-05')->getDateInterval()->forHumans()); } public function testCreateFromCarbonInstanceInvalidMethod() { $this->expectExceptionObject(new BadMethodCallException( 'Method unknownUnitsUntil does not exist.', )); /** @var object $date */ $date = Carbon::create('2019-01-02'); $date->unknownUnitsUntil('2019-02-05'); } public function testInstance() { $periodClass = static::$periodClass; $source = new DatePeriod( new DateTime('2012-07-01'), CarbonInterval::days(2), new DateTime('2012-07-07'), ); $period = $periodClass::instance($source); $this->assertInstanceOf($periodClass, $period); $this->assertSame('2012-07-01', $period->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period->getDateInterval()->d); $this->assertSame('2012-07-07', $period->getEndDate()->format('Y-m-d')); $period2 = $periodClass::instance($period); $this->assertInstanceOf($periodClass, $period2); $this->assertSame('2012-07-01', $period2->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period2->getDateInterval()->d); $this->assertSame('2012-07-07', $period2->getEndDate()->format('Y-m-d')); $this->assertNotSame($period, $period2); $period3 = new $periodClass($source); $this->assertInstanceOf($periodClass, $period3); $this->assertSame('2012-07-01', $period3->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period3->getDateInterval()->d); $this->assertSame('2012-07-07', $period3->getEndDate()->format('Y-m-d')); $this->assertNotSame($period, $period3); $period4 = new $periodClass($period); $this->assertInstanceOf($periodClass, $period4); $this->assertSame('2012-07-01', $period4->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period4->getDateInterval()->d); $this->assertSame('2012-07-07', $period4->getEndDate()->format('Y-m-d')); $this->assertNotSame($period, $period4); } public function testCreateFromCarbonInstancesNamedParameters() { $periodClass = static::$periodClass; $carbonClass = $periodClass === CarbonPeriodImmutable::class ? CarbonImmutable::class : Carbon::class; $period = $carbonClass::create('2019-01-02')->daysUntil(endDate: '2019-02-05'); $this->assertInstanceOf($periodClass, $period); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $this->assertSame('1 day', (string) $period->getDateInterval()); $period = $carbonClass::create('2019-01-02')->hoursUntil(endDate: '2019-02-05', factor: 12); $this->assertInstanceOf($periodClass, $period); $this->assertSame('2019-01-02', $period->getStartDate()->format('Y-m-d')); $this->assertSame('2019-02-05', $period->getEndDate()->format('Y-m-d')); $this->assertSame('12 hours', (string) $period->getDateInterval()); } public function testCast() { $periodClass = static::$periodClass; $period = $periodClass === CarbonPeriodImmutable::class ? (new class('2012-07-01', CarbonInterval::days(2), '2012-07-07') extends CarbonPeriodImmutable { public function foo() { return $this->getStartDate()->format('j').' '. $this->getDateInterval()->format('%d').' '. $this->getEndDate()->format('j'); } }) : (new class('2012-07-01', CarbonInterval::days(2), '2012-07-07') extends CarbonPeriod { public function foo() { return $this->getStartDate()->format('j').' '. $this->getDateInterval()->format('%d').' '. $this->getEndDate()->format('j'); } }); $subClass = \get_class($period); $this->assertInstanceOf($periodClass, $period); $this->assertNotSame($periodClass, $subClass); $this->assertSame('1 2 7', $period->foo()); /** @var object $period */ $period = $periodClass::create('2010-08-24', CarbonInterval::weeks(2), '2012-07-19') ->cast($subClass); $this->assertInstanceOf($subClass, $period); $this->assertSame('24 14 19', $period->foo()); } public function testBadCast() { $this->expectExceptionObject(new InvalidArgumentException( 'DateTime has not the instance() method needed to cast the date.', )); $periodClass = static::$periodClass; $periodClass::create('2010-08-24', CarbonInterval::weeks(2), '2012-07-19') ->cast(DateTime::class); } public function testMake() { $periodClass = static::$periodClass; $period = $periodClass::make(new DatePeriod( new DateTime('2012-07-01'), CarbonInterval::days(2), new DateTime('2012-07-07'), )); $this->assertInstanceOf($periodClass, $period); $this->assertSame('2012-07-01', $period->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period->getDateInterval()->d); $this->assertSame('2012-07-07', $period->getEndDate()->format('Y-m-d')); $period2 = $periodClass::make($period); $this->assertInstanceOf($periodClass, $period2); $this->assertSame('2012-07-01', $period2->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period2->getDateInterval()->d); $this->assertSame('2012-07-07', $period2->getEndDate()->format('Y-m-d')); $this->assertNotSame($period, $period2); $period2 = $periodClass::make('2012-07-01/P2D/2012-07-07'); $this->assertInstanceOf($periodClass, $period2); $this->assertSame('2012-07-01', $period2->getStartDate()->format('Y-m-d')); $this->assertSame(2, $period2->getDateInterval()->d); $this->assertSame('2012-07-07', $period2->getEndDate()->format('Y-m-d')); } public function testInstanceInvalidType() { $this->expectExceptionObject(new NotAPeriodException( 'Argument 1 passed to '.static::$periodClass.'::instance() '. 'must be an instance of DatePeriod or '.static::$periodClass.', string given.', )); $periodClass = static::$periodClass; $periodClass::instance('hello'); } public function testInstanceInvalidInstance() { $this->expectExceptionObject(new NotAPeriodException( 'Argument 1 passed to '.static::$periodClass.'::instance() '. 'must be an instance of DatePeriod or '.static::$periodClass.', instance of Carbon\Carbon given.', )); $periodClass = static::$periodClass; $periodClass::instance(Carbon::now()); } public function testMutability() { $this->assertSame( [Carbon::class, Carbon::class, Carbon::class], iterator_to_array( CarbonPeriod::between(Carbon::today(), Carbon::today()->addDays(2))->map('get_class'), ), ); $this->assertSame( [Carbon::class, Carbon::class, Carbon::class], iterator_to_array( CarbonPeriod::between(CarbonImmutable::today(), CarbonImmutable::today()->addDays(2))->map('get_class'), ), ); $this->assertSame( [Carbon::class, Carbon::class, Carbon::class], iterator_to_array( CarbonPeriod::between('today', 'today + 2 days')->map('get_class'), ), ); $this->assertSame( [CarbonImmutable::class, CarbonImmutable::class, CarbonImmutable::class], iterator_to_array( CarbonPeriodImmutable::between(Carbon::today(), Carbon::today()->addDays(2))->map(get_class(...)), ), ); $this->assertSame( [CarbonImmutable::class, CarbonImmutable::class, CarbonImmutable::class], iterator_to_array( CarbonPeriodImmutable::between(CarbonImmutable::today(), CarbonImmutable::today()->addDays(2))->map('get_class'), ), ); $this->assertSame( [CarbonImmutable::class, CarbonImmutable::class, CarbonImmutable::class], iterator_to_array( CarbonPeriodImmutable::between('today', 'today + 2 days')->map('get_class'), ), ); } public function testEnums() { $periodClass = static::$periodClass; $immutable = ($periodClass === CarbonPeriodImmutable::class); /** @var CarbonPeriod $period */ $period = $periodClass::create(Month::January, Unit::Month, Month::June); $this->assertTrue($period->isStartIncluded()); $this->assertTrue($period->isEndIncluded()); $carbonClass = $immutable ? CarbonImmutable::class : Carbon::class; $this->assertSame( array_fill(0, 6, $carbonClass), iterator_to_array($period->map(get_class(...))), ); $this->assertSame( ['01-01', '02-01', '03-01', '04-01', '05-01', '06-01'], iterator_to_array($period->map(static fn (CarbonInterface $date) => $date->format('m-d'))), ); $result = $period->setDateInterval(Unit::Week); if ($immutable) { $this->assertSame(6, $period->count()); $period = $result; } $this->assertSame(22, $period->count()); $result = $period->setDateInterval(3, Unit::Week); if ($immutable) { $this->assertSame(22, $period->count()); $period = $result; } $this->assertSame(8, $period->count()); $result = $period->setDateInterval(Unit::Quarter); if ($immutable) { $this->assertSame(8, $period->count()); $period = $result; } $this->assertSame(2, $period->count()); } public function testStartAndEndFallback() { Carbon::setTestNow('2024-06-15'); $this->assertSame([ '2024-09-01', '2024-09-30', ], [ Carbon::parse('Sep 1')->toPeriod('Sep 30')->start->format('Y-m-d'), Carbon::parse('Sep 1')->toPeriod('Sep 30')->end->format('Y-m-d'), ]); $periodClass = static::$periodClass; $period = new $periodClass('Sep 1', 'Sep 30'); $this->assertSame([ '2024-09-01', '2024-09-30', ], [ $period->start->format('Y-m-d'), $period->end->format('Y-m-d'), ]); $period = new $periodClass('Sep 1'); $this->assertSame([ '2024-09-01', null, ], [ $period->start->format('Y-m-d'), $period->end?->format('Y-m-d'), ]); } public function testSlashFormat() { $periodClass = static::$periodClass; $period = $periodClass::create('2024-09-01/3 days/2024-09-30'); $this->assertSame('+3', $period->interval->format('%R%d')); $this->assertSame('3 days', $period->dateInterval->forHumans()); $this->assertSame([ '2024-09-01', '2024-09-30', ], [ $period->start->format('Y-m-d'), $period->end->format('Y-m-d'), ]); } public function testInvalidTimezone() { $this->expectExceptionObject(new InvalidPeriodParameterException( 'Invalid constructor parameters.', )); $periodClass = static::$periodClass; new $periodClass('2024-09-01', '3 days', '2024-09-30', 'America/Tokyo'); } } ================================================ FILE: tests/CarbonPeriod/DynamicIntervalTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Tests\AbstractTestCase; class DynamicIntervalTest extends AbstractTestCase { public function testDynamicIntervalInPeriod() { $periodClass = static::$periodClass; $weekDayStep = function (Carbon $date, bool $negated = false): Carbon { if ($negated) { return $date->previousWeekDay(); } return $date->nextWeekDay(); }; $period = $periodClass::create('2020-06-01', $weekDayStep, '2020-06-14'); $dates = []; foreach ($period as $date) { $dates[] = $date->day; } $this->assertCount(10, $period); $this->assertSame(array_merge(range(1, 5), range(8, 12)), $dates); } } ================================================ FILE: tests/CarbonPeriod/FilterTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\CarbonPeriodImmutable; use DateInterval; use DateTime; use RuntimeException; use Tests\AbstractTestCase; use Tests\CarbonPeriod\Fixtures\CarbonPeriodFactory; use Tests\CarbonPeriod\Fixtures\FooFilters; class FilterTest extends AbstractTestCase { public function dummyFilter() { return function () { return true; }; } public function testGetAndSetFilters() { $periodClass = static::$periodClass; $period = new $periodClass(); $this->assertSame([], $period->getFilters()); $result = $period->setFilters($filters = [ [$this->dummyFilter(), null], ]); $this->assertSame($filters, $result->getFilters()); $this->assertMutatorResult($period, $result); } public function testUpdateInternalStateWhenBuiltInFiltersAreRemoved() { $periodClass = static::$periodClass; $period = new $periodClass( $start = new DateTime('2018-04-16'), $end = new DateTime('2018-07-15'), ); $result = $period->setRecurrences($recurrences = 3); $this->assertMutatorResult($period, $result); $result = $result->setFilters($result->getFilters()); $this->assertMutatorResult($result, $period); $this->assertEquals($end, $result->getEndDate()); $this->assertSame($recurrences, $result->getRecurrences()); $result = $result->setFilters([]); $this->assertMutatorResult($result, $period); $this->assertNull($result->getEndDate()); $this->assertNull($result->getRecurrences()); } public function testResetFilters() { $periodClass = static::$periodClass; $period = new $periodClass( $start = new DateTime('2018-04-16'), $end = new DateTime('2018-07-15'), ); $result = $period->addFilter($this->dummyFilter()) ->prependFilter($this->dummyFilter()); $this->assertMutatorResult($period, $result); $result2 = $result->resetFilters(); $this->assertMutatorResult($result2, $result); $this->assertSame([ [$periodClass::END_DATE_FILTER, null], ], $period->getFilters()); } public function testAddAndPrependFilters() { $periodClass = static::$periodClass; $period = new $periodClass(); $result = $period->addFilter($filter1 = $this->dummyFilter()) ->addFilter($filter2 = $this->dummyFilter()) ->prependFilter($filter3 = $this->dummyFilter()); $this->assertMutatorResult($result, $period); $this->assertSame([ [$filter3, null], [$filter1, null], [$filter2, null], ], $result->getFilters()); } public function testRemoveFilterByInstance() { $periodClass = static::$periodClass; $period = new $periodClass(); $result = $period->addFilter($filter1 = $this->dummyFilter()) ->addFilter($filter2 = $this->dummyFilter()) ->addFilter($filter3 = $this->dummyFilter()); $this->assertMutatorResult($result, $period); $this->assertSame([ [$filter1, null], [$filter2, null], [$filter3, null], ], $result->getFilters()); $result = $result->removeFilter($filter2); $this->assertMutatorResult($result, $period); $this->assertSame([ [$filter1, null], [$filter3, null], ], $result->getFilters()); } public function testRemoveFilterByName() { $periodClass = static::$periodClass; $period = new $periodClass(); $result = $period->addFilter($filter1 = $this->dummyFilter()) ->addFilter($filter2 = $this->dummyFilter(), 'foo') ->addFilter($filter3 = $this->dummyFilter()) ->addFilter($filter4 = $this->dummyFilter(), 'foo') ->addFilter($filter5 = $this->dummyFilter()); $this->assertSame([ [$filter1, null], [$filter2, 'foo'], [$filter3, null], [$filter4, 'foo'], [$filter5, null], ], $result->getFilters()); $result = $result->removeFilter('foo'); $this->assertMutatorResult($result, $period); $this->assertSame([ [$filter1, null], [$filter3, null], [$filter5, null], ], $result->getFilters()); } public function testAcceptOnlyWeekdays() { $periodClass = static::$periodClass; Carbon::setWeekendDays([ Carbon::SATURDAY, Carbon::SUNDAY, ]); $period = $periodClass::create('R4/2018-04-14T00:00:00/P4D'); $result = $period->addFilter(function ($date) { return $date->isWeekday(); }); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-04-18', '2018-04-26', '2018-04-30', '2018-05-04']), $this->standardizeDates($result), ); } /** * @throws \Exception */ public function testAcceptOnlySingleYear() { $periodClass = static::$periodClass; $period = new $periodClass( new DateTime('2017-04-16'), new DateInterval('P5M'), new DateTime('2019-07-15'), ); $result = $period->addFilter(function ($date) { return $date->year === 2018; }); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-02-16', '2018-07-16', '2018-12-16']), $this->standardizeDates($result), ); } /** * @throws \Exception */ public function testEndIteration() { $periodClass = static::$periodClass; $period = new $periodClass( new DateTime('2018-04-16'), new DateInterval('P3D'), new DateTime('2018-07-15'), ); $result = $period->addFilter(function ($date) use ($periodClass) { return $date->month === 5 ? $periodClass::END_ITERATION : true; }); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-04-16', '2018-04-19', '2018-04-22', '2018-04-25', '2018-04-28']), $this->standardizeDates($result), ); } public function testRecurrences() { $periodClass = static::$periodClass; $period = new $periodClass( new DateTime('2018-04-16'), new DateTime('2018-07-15'), ); $period = $period->setRecurrences(2); $this->assertSame( $this->standardizeDates(['2018-04-16', '2018-04-17']), $this->standardizeDates($period), ); $result = $period->setOptions($periodClass::EXCLUDE_START_DATE); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-04-17', '2018-04-18']), $this->standardizeDates($result), ); $result = $result->setOptions($periodClass::EXCLUDE_END_DATE); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-04-16', '2018-04-17']), $this->standardizeDates($result), ); } public function testChangeNumberOfRecurrences() { $periodClass = static::$periodClass; $period = new $periodClass( new DateTime('2018-04-16'), new DateTime('2018-07-15'), ); $period = $period->setRecurrences(7) ->setRecurrences(1) ->setRecurrences(3); $this->assertSame( $this->standardizeDates(['2018-04-16', '2018-04-17', '2018-04-18']), $this->standardizeDates($period), ); } public function testCallbackArguments() { $periodClass = static::$periodClass; $period = new $periodClass( new DateTime('2018-04-16'), 1, ); $wasCalled = false; $test = $this; $period = $period->addFilter(function ($current, $key, $iterator) use (&$wasCalled, $period, $test) { $test->assertInstanceOfCarbon($current); $test->assertIsInt($key); $test->assertMutatorResult($period, $iterator); return $wasCalled = true; }); iterator_to_array($period); $this->assertTrue($wasCalled); } public function testThrowExceptionWhenNextValidDateCannotBeFound() { $this->expectExceptionObject(new RuntimeException( 'Could not find next valid date.', )); $periodClass = static::$periodClass; $period = $periodClass::create( new Carbon('2000-01-01'), new CarbonInterval('PT1S'), new Carbon('2000-12-31'), ); $period = $period->addFilter(function () { return false; }); iterator_to_array($period); } public function testRemoveBuildInFilters() { $periodClass = static::$periodClass; $period = $periodClass::create(new DateTime('2018-04-16'), new DateTime('2018-07-15'))->setRecurrences(3); $result = $period->setEndDate(null)->setRecurrences(null); $this->assertMutatorResult($result, $period); $this->assertSame([], $result->getFilters()); } public function testAcceptEveryOther() { $periodClass = static::$periodClass; $period = new $periodClass( new DateTime('2018-04-16'), new DateTime('2018-04-20'), ); // Note: Without caching validation results the dates would be unpredictable // as we cannot know how many calls to the filter will occur per iteration. $result = $period->addFilter(static function () { static $accept; return $accept = !$accept; }); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-04-16', '2018-04-18', '2018-04-20']), $this->standardizeDates($result), ); } public function testEndIterationFilter() { $periodClass = static::$periodClass; $period = new $periodClass('2018-04-16', 5); $result = $period->addFilter($periodClass::END_ITERATION); $this->assertMutatorResult($result, $period); $this->assertSame([], $this->standardizeDates($result)); } public function testAcceptOnlyEvenDays() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertSame( $this->standardizeDates(['2012-07-04', '2012-07-10', '2012-07-16']), $this->standardizeDates($period), ); } public function testAddFilterFromCarbonMethod() { $periodClass = static::$periodClass; $period = $periodClass::create('2018-01-01', '2018-06-01'); $result = $period->addFilter('isLastOfMonth'); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-01-31', '2018-02-28', '2018-03-31', '2018-04-30', '2018-05-31']), $this->standardizeDates($result), ); } public function testAddFilterFromCarbonMacro() { $periodClass = static::$periodClass; $period = $periodClass::create('2018-01-01', '2018-06-01'); Carbon::macro('isTenDay', function () { /** @var Carbon $date */ $date = $this; return $date->day === 10; }); $result = $period->addFilter('isTenDay'); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2018-01-10', '2018-02-10', '2018-03-10', '2018-04-10', '2018-05-10']), $this->standardizeDates($result), ); } public function testAddFilterFromCarbonMethodWithArguments() { $periodClass = static::$periodClass; $period = $periodClass::create('2017-01-01', 'P2M16D', '2018-12-31'); $result = $period->addFilter('isSameAs', 'm', new Carbon('2018-06-01')); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['2017-06-02', '2018-06-20']), $this->standardizeDates($result), ); } public function testRemoveFilterFromCarbonMethod() { $periodClass = static::$periodClass; $period = $periodClass::create('1970-01-01', '1970-01-03')->addFilter('isFuture'); $result = $period->removeFilter('isFuture'); $this->assertMutatorResult($result, $period); $this->assertSame( $this->standardizeDates(['1970-01-01', '1970-01-02', '1970-01-03']), $this->standardizeDates($result), ); } public function testInvalidCarbonMethodShouldNotBeConvertedToCallback() { $periodClass = static::$periodClass; $period = new $periodClass(); $result = $period->addFilter('toDateTimeString'); $this->assertMutatorResult($result, $period); $this->assertSame([ ['toDateTimeString', null], ], $result->getFilters()); } public function testAddCallableFilters() { $periodClass = static::$periodClass; $period = new $periodClass(); $result = $period->addFilter($string = 'date_offset_get') ->addFilter($array = [new DateTime(), 'getOffset']); $this->assertMutatorResult($result, $period); $this->assertSame([ [$string, null], [$array, null], ], $result->getFilters()); } public function testRemoveCallableFilters() { $periodClass = static::$periodClass; $period = new $periodClass(); $result = $period->setFilters([ [$string = 'date_offset_get', null], [$array = [new DateTime(), 'getOffset'], null], ]); $this->assertMutatorResult($result, $period); $result = $period->removeFilter($string)->removeFilter($array); $this->assertMutatorResult($result, $period); $this->assertSame([], $result->getFilters()); } public function testRunCallableFilters() { include_once 'Fixtures/filters.php'; $periodClass = static::$periodClass; $period = new $periodClass('2017-03-10', '2017-03-19'); $callable = [new FooFilters(), 'bar']; $this->assertFalse($period->hasFilter($callable)); $this->assertFalse($period->hasFilter('foobar_filter')); $this->assertFalse($period->hasFilter('not_callable')); $result = $period->addFilter($callable)->addFilter('foobar_filter'); $this->assertMutatorResult($result, $period); $this->assertTrue($result->hasFilter($callable)); $this->assertTrue($result->hasFilter('foobar_filter')); $this->assertFalse($result->hasFilter('not_callable')); $this->assertSame( $this->standardizeDates(['2017-03-10', '2017-03-12', '2017-03-16', '2017-03-18']), $this->standardizeDates($result), ); } protected function assertMutatorResult(CarbonPeriod $a, CarbonPeriod $b): void { if (static::$periodClass === CarbonPeriodImmutable::class) { $this->assertNotSame($a, $b); return; } $this->assertSame($a, $b); } } ================================================ FILE: tests/CarbonPeriod/Fixtures/AbstractCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod\Fixtures; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use DateTime; use ReturnTypeWillChange; abstract class AbstractCarbon extends DateTime implements CarbonInterface { public function __construct($time = null, $timezone = null) { parent::__construct($time, $timezone); } public static function __set_state($dump): static { return new static($dump); } #[ReturnTypeWillChange] public function add($unit, $value = 1, ?bool $overflow = null): static { return parent::add($unit); } #[ReturnTypeWillChange] public function sub($unit, $value = 1, ?bool $overflow = null): static { return parent::sub($unit); } #[ReturnTypeWillChange] public function diff($date = null, $absolute = false): CarbonInterval { return CarbonInterval::instance(parent::diff($date, $absolute)); } #[ReturnTypeWillChange] public function modify($modify) { return parent::modify($modify); } public function setDate(int $year, int $month, int $day): static { return parent::setDate($year, $month, $day); } public function setISODate(int $year, int $week, int $day = 1): static { return parent::setISODate($year, $week, $day); } public function setTime($hour, $minute, $second = 0, $microsecond = 0): static { return parent::setTime($hour, $minute, $second, $microsecond); } public function setTimestamp(int|string|float $timestamp): static { return parent::setTimestamp($timestamp); } public function setTimezone(\DateTimeZone|string|int $timeZone): static { return parent::setTimezone($timeZone); } public static function createFromFormat($format, $time, $tz = null): static { return parent::createFromFormat($format, $time, $tz); } } ================================================ FILE: tests/CarbonPeriod/Fixtures/CarbonPeriodFactory.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod\Fixtures; use Carbon\CarbonPeriod; class CarbonPeriodFactory { /** * @template T of CarbonPeriod * * @param class-string $periodClass * * @return T */ public static function withStartIntervalEnd(string $periodClass) { return $periodClass::create( '2012-07-01 17:30:00', 'P3DT5H', '2012-07-15 11:15:00', ); } /** * @template T of CarbonPeriod * * @param class-string $periodClass * * @return T */ public static function withEvenDaysFilter(string $periodClass) { $period = $periodClass::create( '2012-07-01', 'P3D', '2012-07-22', $periodClass::EXCLUDE_END_DATE, ); return $period->addFilter(function ($date) { return $date->day % 2 == 0; }); } /** * @template T of CarbonPeriod * * @param class-string $periodClass * * @return T */ public static function withCounter(string $periodClass, &$counter) { $counter = 0; $period = $periodClass::create( '2012-10-01', 3, ); return $period->addFilter(function () use (&$counter) { $counter++; return true; }); } /** * @template T of CarbonPeriod * * @param class-string $periodClass * * @return T */ public static function withStackFilter(string $periodClass) { $period = $periodClass::create( '2001-01-01', ); $stack = [ true, false, true, $periodClass::END_ITERATION, false, false, true, true, $periodClass::END_ITERATION, ]; return $period->addFilter(function () use (&$stack) { return array_shift($stack); }); } } ================================================ FILE: tests/CarbonPeriod/Fixtures/FooFilters.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod\Fixtures; class FooFilters { public function bar($date) { return $date->day % 2 === 0; } } ================================================ FILE: tests/CarbonPeriod/Fixtures/MacroableClass.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod\Fixtures; use BadMethodCallException; use Carbon\Traits\LocalFactory; use Carbon\Traits\Macro; use Closure; class MacroableClass { use LocalFactory; use Macro; public $endDate; protected array $localMacros = []; public function getEndDate() { return $this->endDate; } public function setEndDate($endDate) { $this->endDate = $endDate; return $this; } public function cast($className) { $new = new $className(); return $new->setEndDate($this->endDate); } public function __call($method, $parameters) { $macro = static::getMacro($method) ?? null; if ($macro instanceof Closure) { return $macro->call($this); } throw new BadMethodCallException("$method not found"); } } ================================================ FILE: tests/CarbonPeriod/Fixtures/Mixin.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod\Fixtures; class Mixin { public $foo; public function setFoo() { $mixin = $this; return function ($value) use ($mixin) { $mixin->foo = $value; }; } public function getFoo() { $mixin = $this; return function () use ($mixin) { return $mixin->foo; }; } } ================================================ FILE: tests/CarbonPeriod/Fixtures/MixinTrait.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod\Fixtures; trait MixinTrait { public function oneMoreDay() { return $this->setEndDate($this->endNextDay()); } public function endNextDay() { return $this->getEndDate()->addDay(); } public function copyOneMoreDay() { return $this->copy()->oneMoreDay(); } } ================================================ FILE: tests/CarbonPeriod/Fixtures/filters.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\Carbon; function foobar_filter($date) { return $date < Carbon::parse('2017-03-13') || $date > Carbon::parse('2017-03-14'); } ================================================ FILE: tests/CarbonPeriod/GettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\Exceptions\UnknownGetterException; use Carbon\Exceptions\UnreachableException; use DateTime; use Tests\AbstractTestCase; use Tests\CarbonPeriod\Fixtures\CarbonPeriodFactory; class GettersTest extends AbstractTestCase { public function testGetStartDate() { $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass); $date = $period->getStartDate(); $this->assertInstanceOfCarbon($date); $this->assertSame('2012-07-01 17:30:00', $date->format('Y-m-d H:i:s')); } public function testGetEndDate() { $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass); $date = $period->getEndDate(); $this->assertInstanceOfCarbon($date); $this->assertSame('2012-07-15 11:15:00', $date->format('Y-m-d H:i:s')); } public function testGetDateInterval() { $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass); $interval = $period->getDateInterval(); $this->assertInstanceOfCarbonInterval($interval); $this->assertSame('P3DT5H', $interval->spec()); } public function testGetRecurrences() { $periodClass = static::$periodClass; $recurrences = $periodClass::create(new DateTime(), 5)->getRecurrences(); $this->assertSame(5, $recurrences); $period = $periodClass::create('2024-09-01/3 days/2024-09-30'); $this->assertNull($period->get('recurrences')); $period = $periodClass::create('R3/2024-09-01/3 days'); $this->assertSame(3, $period->get('recurrences')); } public function testGetDefaultDateInterval() { $periodClass = static::$periodClass; $period = $periodClass::create(Carbon::parse('2015-09-30'), Carbon::parse('2015-10-03')); $this->assertInstanceOfCarbonInterval($period->getDateInterval()); $this->assertSame('P1D', $period->getDateInterval()->spec()); } public function testModifyStartDate() { $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass); $period->getStartDate()->subDays(3); $this->assertSame('2012-07-01', $period->getStartDate()->format('Y-m-d')); } public function testModifyEndDate() { $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass); $period->getEndDate()->addDays(3); $this->assertSame('2012-07-15', $period->getEndDate()->format('Y-m-d')); } public function testModifyDateInterval() { $period = CarbonPeriodFactory::withStartIntervalEnd(static::$periodClass); $period->getDateInterval()->days(5)->hours(0); $this->assertSame('P3DT5H', $period->getDateInterval()->spec()); } public function testGetOptions() { $periodClass = static::$periodClass; $period = new $periodClass(); $this->assertPeriodOptions(0, $period); $this->assertTrue($period->isStartIncluded()); $this->assertTrue($period->isEndIncluded()); if (PHP_VERSION < 8.2) { $this->assertTrue($period->include_start_date); $this->assertTrue($period->include_end_date); } $period = new $periodClass(new DateTime(), new DateTime(), $options = $periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE); $this->assertPeriodOptions($options, $period); $this->assertFalse($period->isStartIncluded()); $this->assertFalse($period->isEndIncluded()); if (PHP_VERSION < 8.2) { $this->assertFalse($period->include_start_date); $this->assertFalse($period->include_end_date); } } public function testOverlaps() { $periodClass = static::$periodClass; $range1 = $periodClass::create('2019-01-26', '2019-03-03'); $range2 = $periodClass::create('2019-02-15', '2019-04-01'); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26', '2019-02-13'); $range2 = $periodClass::create('2019-02-15', '2019-04-01'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26', '2019-02-15'); $range2 = $periodClass::create('2019-02-15', '2019-04-01'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26', '2019-02-15 00:00:01'); $range2 = $periodClass::create('2019-02-15', '2019-04-01'); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26', '2019-02-15 00:00:01'); $range2 = $periodClass::create('2019-02-15 00:00:01', '2019-04-01'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', '2019-01-26 13:30:12'); $range2 = $periodClass::create('2019-01-26 10:30:05', '2019-01-26 13:32:12'); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', INF); $range2 = $periodClass::create('2999-01-26 10:30:05', '2999-01-26 13:32:12'); $this->assertFalse($range1->calculateEnd()->isStartOfTime()); $this->assertTrue($range1->calculateEnd()->isEndOfTime()); $this->assertFalse($range2->calculateEnd()->isStartOfTime()); $this->assertFalse($range2->calculateEnd()->isEndOfTime()); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(-1), INF); $range2 = $periodClass::create('2999-01-26 10:30:05', '2999-01-26 13:32:12'); $this->assertTrue($range1->calculateEnd()->isStartOfTime()); $this->assertFalse($range1->calculateEnd()->isEndOfTime()); $this->assertFalse($range2->calculateEnd()->isStartOfTime()); $this->assertFalse($range2->calculateEnd()->isEndOfTime()); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', INF); $range2 = $periodClass::create('1975-01-26 10:30:05', '1975-01-26 13:32:12'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(-1), INF); $range2 = $periodClass::create('1975-01-26 10:30:05', '1975-01-26 13:32:12'); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', INF); $range2 = $periodClass::create('2999-01-26 10:30:05', INF); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(-1), INF); $range2 = $periodClass::create('2999-01-26 10:30:05', INF); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', INF); $range2 = $periodClass::create('1975-01-26 10:30:05', INF); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', INF); $range2 = $periodClass::create('1975-01-26 10:30:05', CarbonInterval::day(-1), INF); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(-1), INF); $range2 = $periodClass::create('1975-01-26 10:30:05', INF); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(), 365, $periodClass::EXCLUDE_START_DATE); $range2 = $periodClass::create('2020-01-26 10:30:05', '2020-01-27 10:30:05'); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(), 365, $periodClass::EXCLUDE_START_DATE); $range2 = $periodClass::create('2020-01-26 10:30:20', '2020-01-27 10:30:20'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(), 365); $range2 = $periodClass::create('2020-01-27 10:30:20', '2020-01-28 10:30:20'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(), INF); (function () { $this->dateInterval->subDays(1); })->call($range1); $range2 = $periodClass::create('2999-01-26 10:30:05', '2999-01-26 13:32:12'); $this->assertFalse($range1->overlaps($range2)); $this->assertFalse($range2->overlaps($range1)); $range1 = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::day(), INF); (function () { $this->dateInterval->subDays(1); })->call($range1); $range2 = $periodClass::create('2018-01-26 10:30:05', '2019-01-26 13:32:12'); $this->assertTrue($range1->overlaps($range2)); $this->assertTrue($range2->overlaps($range1)); } public function testOverlapsErrorForNullEnd() { $periodClass = static::$periodClass; $this->expectExceptionObject(new UnreachableException( "Could not calculate period end without either explicit end or recurrences.\n". "If you're looking for a forever-period, use ->setRecurrences(INF).", )); $periodClass::create('2019-01-26 10:30:12', null)->overlaps('R2/2019-01-31T10:30:45Z/P2D'); } public function testOverlapsErrorForMaxAttempts() { $periodClass = static::$periodClass; $this->expectExceptionObject(new UnreachableException( 'Could not calculate period end after iterating 10000 times.', )); $period = $periodClass::create('2019-01-26 10:30:12', CarbonInterval::minute(), 98282828); $period = $period->addFilter(function ($date) { return $date->minute % 2; }); $period->overlaps('R2/2019-01-31T10:30:45Z/P2D'); } public function testOverlapsCalculated() { $periodClass = static::$periodClass; $this->assertTrue($periodClass::create('2019-01-27', '2019-02-02')->overlaps('R2/2019-01-31T10:30:45Z/P2D')); $this->assertTrue($periodClass::create('2019-01-27', '2019-02-02')->overlaps('2018-12-31/2019-02-01')); $this->assertFalse($periodClass::create('2019-01-27', '2019-02-02')->overlaps('R6/2018-12-31/P3D')); $this->assertTrue($periodClass::create('2019-01-27', '2019-02-02')->overlaps('R6/2018-12-31/P6D')); $this->assertFalse($periodClass::create('R6/2018-12-31/P1D')->overlaps('R3/2019-01-05/PT3H')); $this->assertTrue($periodClass::create('R7/2018-12-31/P1D')->overlaps('R3/2019-01-05/PT3H')); } public function testOverlapsWithDatesCouple() { $periodClass = static::$periodClass; $carbonClass = $periodClass === CarbonPeriod::class ? Carbon::class : CarbonImmutable::class; $this->assertTrue($carbonClass::parse('2019-01-26')->toPeriod('2019-03-03')->overlaps('2019-02-15', '2019-04-01')); $this->assertTrue($carbonClass::parse('2019-02-15')->toPeriod('2019-04-01')->overlaps('2019-02-15', '2019-04-01')); $this->assertTrue($periodClass::create('2019-01-26', '2019-03-03')->overlaps('2019-02-15', '2019-04-01')); $this->assertTrue($periodClass::create('2019-01-26', '2019-03-03')->overlaps($carbonClass::parse('2019-02-15')->toPeriod('2019-04-01'))); $this->assertTrue($carbonClass::parse('2019-01-26')->toPeriod('2019-03-03')->overlaps($carbonClass::parse('2019-02-15'), '2019-04-01')); $this->assertTrue(Carbon::parse('2019-02-15')->toPeriod('2019-04-01')->overlaps('2019-02-15', CarbonImmutable::parse('2019-04-01'))); $this->assertTrue(CarbonImmutable::parse('2019-02-15')->toPeriod('2019-04-01')->overlaps('2019-02-15', Carbon::parse('2019-04-01'))); $this->assertTrue($periodClass::create('2019-01-26', '2019-03-03')->overlaps(new DateTime('2019-02-15'), new DateTime('2019-04-01'))); $this->assertFalse($carbonClass::parse('2018-01-26')->toPeriod('2018-03-03')->overlaps('2019-02-15', '2019-04-01')); $this->assertFalse($carbonClass::parse('2018-02-15')->toPeriod('2018-04-01')->overlaps('2019-02-15', '2019-04-01')); $this->assertFalse($periodClass::create('2018-01-26', '2018-02-13')->overlaps('2019-02-15', '2019-04-01')); $this->assertFalse($periodClass::create('2018-01-26', '2018-02-13')->overlaps($carbonClass::parse('2019-02-15')->toPeriod('2019-04-01'))); $this->assertFalse($carbonClass::parse('2018-01-26')->toPeriod('2018-03-03')->overlaps($carbonClass::parse('2019-02-15'), '2019-04-01')); $this->assertFalse(Carbon::parse('2018-02-15')->toPeriod('2018-04-01')->overlaps('2019-02-15', CarbonImmutable::parse('2019-04-01'))); $this->assertFalse($periodClass::create('2018-01-26', '2018-02-13')->overlaps(new DateTime('2019-02-15'), new DateTime('2019-04-01'))); } public function testIsStarted() { $periodClass = static::$periodClass; Carbon::setTestNow('2019-08-03 11:47:00'); $this->assertFalse($periodClass::create('2019-08-03 11:47:01', '2019-08-03 12:00:00')->isStarted()); $this->assertFalse($periodClass::create('2020-01-01', '2020-07-01')->isStarted()); $this->assertTrue($periodClass::create('2019-08-03 01:00:00', '2019-08-03 09:00:00')->isStarted()); $this->assertTrue($periodClass::create('2019-01-01', '2019-07-01')->isStarted()); $this->assertTrue($periodClass::create('2019-08-01', '2019-08-15')->isStarted()); $this->assertTrue($periodClass::create('2019-08-03 11:47:00', '2019-08-15 11:47:00')->isStarted()); } public function testIsEnded() { $periodClass = static::$periodClass; Carbon::setTestNow('2019-08-03 11:47:00'); $this->assertFalse($periodClass::create('2019-08-03 11:47:01', '2019-08-03 12:00:00')->isEnded()); $this->assertFalse($periodClass::create('2020-01-01', '2020-07-01')->isEnded()); $this->assertFalse($periodClass::create('2019-08-01', '2019-08-15')->isEnded()); $this->assertFalse($periodClass::create('2019-08-03 11:47:00', '2019-08-15 11:47:00')->isEnded()); $this->assertTrue($periodClass::create('2019-08-03 01:00:00', '2019-08-03 09:00:00')->isEnded()); $this->assertTrue($periodClass::create('2019-01-01', '2019-07-01')->isEnded()); $this->assertTrue($periodClass::create('2019-08-02 11:47:00', '2019-08-03 11:47:00')->isEnded()); } public function testIsInProgress() { $periodClass = static::$periodClass; Carbon::setTestNow('2019-08-03 11:47:00'); $this->assertFalse($periodClass::create('2019-08-03 11:47:01', '2019-08-03 12:00:00')->isInProgress()); $this->assertFalse($periodClass::create('2020-01-01', '2020-07-01')->isInProgress()); $this->assertFalse($periodClass::create('2019-08-03 01:00:00', '2019-08-03 09:00:00')->isInProgress()); $this->assertFalse($periodClass::create('2019-01-01', '2019-07-01')->isInProgress()); $this->assertFalse($periodClass::create('2019-08-02 11:47:00', '2019-08-03 11:47:00')->isInProgress()); $this->assertTrue($periodClass::create('2019-08-03 11:47:00', '2019-08-15 11:47:00')->isInProgress()); $this->assertTrue($periodClass::create('2019-08-01', '2019-08-15')->isInProgress()); } public function testIsset() { $periodClass = static::$periodClass; $this->assertTrue(isset($periodClass::create('2019-08-01', '2019-08-15')->startDate)); $this->assertFalse(isset($periodClass::create('2019-08-01', '2019-08-15')->middleDate)); } public function testMagicGet() { $periodClass = static::$periodClass; $this->assertSame( '2019-08-01', $periodClass::create('2019-08-01', '2019-08-15')->startDate->format('Y-m-d'), ); $this->assertSame( 'en', $periodClass::create('2019-08-01', '2019-08-15')->locale, ); $this->assertSame( 'fi', $periodClass::create('2019-08-01', '2019-08-15')->locale('fi')->locale, ); } public function testGet() { $periodClass = static::$periodClass; $this->assertSame( '2019-08-01', $periodClass::create('2019-08-01', '2019-08-15')->get('start')->format('Y-m-d'), ); } public function testUnknownGetter() { $periodClass = static::$periodClass; $this->expectExceptionObject(new UnknownGetterException('middle')); $periodClass::create('2019-08-01', '2019-08-15')->get('middle'); } public function testGetEnd() { $periodClass = static::$periodClass; $period = $periodClass::create('2024-09-01/3 days/2024-09-30'); $this->assertSame('2024-09-30 00:00:00', $period->end->format('Y-m-d H:i:s')); $this->assertSame('2024-09-30 00:00:00', $period->endDate->format('Y-m-d H:i:s')); } public function testGetCurrent() { $periodClass = static::$periodClass; $period = $periodClass::create('2024-09-01/3 days/2024-09-30'); $this->assertSame('2024-09-01 00:00:00', $period->get('current')->format('Y-m-d H:i:s')); $period->next(); $this->assertSame('2024-09-04 00:00:00', $period->get('current')->format('Y-m-d H:i:s')); } public function testGetInclude() { $periodClass = static::$periodClass; $period = $periodClass::create('2024-09-01/3 days/2024-09-30'); $this->assertTrue($period->includeStartDate); $this->assertTrue($period->includeEndDate); $period = $periodClass::create('2024-09-01/3 days/2024-09-30')->excludeStartDate()->excludeEndDate(); $this->assertFalse($period->includeStartDate); $this->assertFalse($period->includeEndDate); } } ================================================ FILE: tests/CarbonPeriod/IterationMethodsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Tests\AbstractTestCase; class IterationMethodsTest extends AbstractTestCase { public function testForEach() { $result = ''; Carbon::create('2020-12-22')->daysUntil('2020-12-24')->forEach(function (Carbon $date) use (&$result) { $result .= $date->diffInDays('2020-12-25')." days before Christmas!\n"; }); $this->assertSame("3 days before Christmas!\n". "2 days before Christmas!\n". "1 days before Christmas!\n", $result, ); } public function testMap() { $result = iterator_to_array(Carbon::create('2020-12-22')->daysUntil('2020-12-24')->map(function (Carbon $date) { return $date->diffInDays('2020-12-25').' days before Christmas!'; })); $this->assertSame([ '3 days before Christmas!', '2 days before Christmas!', '1 days before Christmas!', ], $result); } } ================================================ FILE: tests/CarbonPeriod/IteratorTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Generator; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; use Tests\CarbonPeriod\Fixtures\CarbonPeriodFactory; class IteratorTest extends AbstractTestCase { protected $iterationLimit = 100; public function testKeyAndCurrentAreCorrectlyInstantiated() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertSame(0, $period->key()); $this->assertInstanceOfCarbon($period->current()); $this->assertSame('2012-07-04 00:00:00', $period->current()->format('Y-m-d H:i:s')); $this->assertTrue($period->valid()); } public function testValidIsCorrectlyInstantiated() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertTrue($period->valid()); } public function testCurrentIsAlwaysCarbonInstance() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); foreach ($period as $current) { $this->assertInstanceOfCarbon($current); $this->assertEquals($current, $period->current()); if (PHP_VERSION < 8.2) { $this->assertEquals($current, $period->current); } } } public function testKeysAreSequential() { $keys = []; $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); foreach ($period as $key => $current) { $this->assertIsInt($keys[] = $key); $this->assertSame($key, $period->key()); } $this->assertSame(array_keys($keys), $keys); } public function testElementsInLoopAreAlwaysValid() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); foreach ($period as $key => $current) { $this->assertTrue($period->valid()); } } public function testKeyAndCurrentAreCorrectlyIterated() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $period->next(); $this->assertSame(1, $period->key()); $this->assertSame('2012-07-10 00:00:00', $period->current()->format('Y-m-d H:i:s')); $this->assertTrue($period->valid()); } public function testKeyAndCurrentAreCorrectlyRewound() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $period->next(); $period->rewind(); $this->assertSame(0, $period->key()); $this->assertSame('2012-07-04 00:00:00', $period->current()->format('Y-m-d H:i:s')); $this->assertTrue($period->valid()); } public function testKeyAndCurrentAreNullAfterIteration() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); foreach ($period as $key => $current) { // } $this->assertNull($period->key()); $this->assertNull($period->current()); $this->assertFalse($period->valid()); } #[DataProvider('dataForIterateBackwardsArguments')] public function testIterateBackwards(array $arguments, array $expected) { $periodClass = static::$periodClass; $period = $periodClass::create(...$arguments); $interval = new CarbonInterval('P3D'); $interval->invert = 1; $period = $period->setDateInterval($interval); $this->assertSame( $this->standardizeDates($expected), $this->standardizeDates($period), ); } public static function dataForIterateBackwardsArguments(): Generator { yield [ ['2015-10-15', '2015-10-06'], ['2015-10-15', '2015-10-12', '2015-10-09', '2015-10-06'], ]; yield [ ['2015-10-15', '2015-10-06', CarbonPeriod::EXCLUDE_START_DATE], ['2015-10-12', '2015-10-09', '2015-10-06'], ]; yield [ ['2015-10-15', '2015-10-06', CarbonPeriod::EXCLUDE_END_DATE], ['2015-10-15', '2015-10-12', '2015-10-09'], ]; yield [ ['2015-10-15', '2015-10-06', CarbonPeriod::EXCLUDE_START_DATE | CarbonPeriod::EXCLUDE_END_DATE], ['2015-10-12', '2015-10-09'], ]; yield [ ['2015-10-15', 3], ['2015-10-15', '2015-10-12', '2015-10-09'], ]; } public function testChangingParametersShouldNotCauseInfiniteLoop() { $periodClass = static::$periodClass; $period = $periodClass::create() ->setStartDate($start = '2012-07-01') ->setEndDate($end = '2012-07-20') ->setDateInterval($interval = 'P1D') ->setRecurrences($recurrences = 10) ->setOptions($options = $periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE) ->addFilter($filter = function () { return true; }); $counter = 0; foreach ($period as $current) { if (++$counter >= $this->iterationLimit) { break; } $period->removeFilter($filter) ->prependFilter($filter) ->setFilters([]) ->setStartDate($start) ->setEndDate($end) ->invertDateInterval() ->setDateInterval($interval) ->setRecurrences($recurrences) ->setOptions($options) ->resetFilters() ->addFilter($filter); } $this->assertLessThan($this->iterationLimit, $counter, 'Changing parameters during the iteration caused an infinite loop.'); } public function testChangeEndDateDuringIteration() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $results = []; foreach ($period as $key => $current) { $results[] = \sprintf('%s => %s', $key, $current->toDateString()); if ($current->toDateString() === '2012-07-16') { $period = $period->setEndDate($current); // Note: Current is no longer valid, because it is now equal to end, which is excluded. $this->assertNull($period->key()); $this->assertNull($period->current()); $this->assertFalse($period->valid()); } if (\count($results) >= $this->iterationLimit) { $this->fail('Infinite loop detected when traversing the period.'); } } $this->assertSame( ['0 => 2012-07-04', '1 => 2012-07-10', '2 => 2012-07-16'], $results, ); } public function testKeepIncreasingRecurrencesDuringIteration() { $period = new CarbonPeriod('2012-07-01', $recurrences = 1); $results = []; foreach ($period as $key => $current) { $results[] = \sprintf('%s => %s', $key, $current->toDateString()); if ($recurrences < 4) { $period->setRecurrences(++$recurrences); // Note: Current is still valid, because we simply extended the period. $this->assertSame($key, $period->key()); $this->assertEquals($current, $period->current()); $this->assertTrue($period->valid()); } if (\count($results) >= $this->iterationLimit) { $this->fail('Infinite loop detected when traversing the period.'); } } $this->assertSame( ['0 => 2012-07-01', '1 => 2012-07-02', '2 => 2012-07-03', '3 => 2012-07-04'], $results, ); } public function testChangeStartDateDuringIteration() { $period = new CarbonPeriod('2012-07-01', '2012-07-04'); $results = []; $newStart = new Carbon('2012-07-03'); foreach ($period as $key => $current) { $results[] = \sprintf('%s => %s', $key, $current->toDateString()); if ($current < $newStart) { $period->setStartDate($newStart); // Note: Current is still valid, because start date is used only for initialization. $this->assertEquals($key, $period->key()); $this->assertEquals($current, $period->current()); $this->assertTrue($period->valid()); } if (\count($results) >= $this->iterationLimit) { $this->fail('Infinite loop detected when traversing the period.'); } } $this->assertSame( // Note: Results are not affected, because start date is used only for initialization. ['0 => 2012-07-01', '1 => 2012-07-02', '2 => 2012-07-03', '3 => 2012-07-04'], $results, ); } public function testChangeDateIntervalDuringIteration() { $period = new CarbonPeriod('2012-07-01', 3); $results = []; foreach ($period as $key => $current) { $results[] = \sprintf('%s => %s', $key, $current->toDateString()); $period->setDateInterval('P3D'); // Note: Current is still valid, because changed interval changes only subsequent items. $this->assertSame($key, $period->key()); $this->assertEquals($current, $period->current()); $this->assertTrue($period->valid()); if (\count($results) >= $this->iterationLimit) { $this->fail('Infinite loop detected when traversing the period.'); } } $this->assertSame( ['0 => 2012-07-01', '1 => 2012-07-04', '2 => 2012-07-07'], $results, ); } public function testValidateOncePerIteration() { $period = CarbonPeriodFactory::withCounter(static::$periodClass, $counter); $period->key(); $period->current(); $period->valid(); $this->assertSame(1, $counter); $period->next(); $this->assertSame(2, $counter); $period->key(); $period->current(); $period->valid(); $this->assertSame(2, $counter); } public function testInvalidateCurrentAfterChangingParameters() { $periodClass = static::$periodClass; $period = $periodClass::create('2012-10-01'); $this->assertInstanceOfCarbon($period->current()); $period = $period->addFilter($periodClass::END_ITERATION); $this->assertNull($period->current()); } public function testTraversePeriodDynamically() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $results = []; while ($current = $period->current()) { $results[] = $current; $period->next(); if (\count($results) >= $this->iterationLimit) { $this->fail('Infinite loop detected when traversing the period.'); } } $this->assertSame( $this->standardizeDates(['2012-07-04', '2012-07-10', '2012-07-16']), $this->standardizeDates($results), ); } public function testExtendCompletedIteration() { $periodClass = static::$periodClass; $period = $periodClass::create('2018-10-10', '2018-10-11'); $results = []; while ($period->valid()) { $results[] = $period->current(); $period->next(); } $period = $period->setEndDate('2018-10-13'); while ($period->valid()) { $results[] = $period->current(); $period->next(); } $this->assertSame( $this->standardizeDates(['2018-10-10', '2018-10-11', '2018-10-12', '2018-10-13']), $this->standardizeDates($results), ); } public function testRevalidateCurrentAfterChangeOfParameters() { $periodClass = static::$periodClass; $period = $periodClass::create()->setStartDate($start = new Carbon('2018-10-28')); $this->assertEquals($start, $period->current()); $this->assertNotSame($start, $period->current()); $period = $period->addFilter($excludeStart = function ($date) use ($start) { return $date != $start; }); $this->assertNull($period->current()); $period = $period->removeFilter($excludeStart); $this->assertEquals($start, $period->current()); $this->assertNotSame($start, $period->current()); } public function testRevalidateCurrentAfterEndOfIteration() { $periodClass = static::$periodClass; $period = $periodClass::create()->setStartDate($start = new Carbon('2018-10-28')); $this->assertEquals($start, $period->current()); $this->assertNotSame($start, $period->current()); $period = $period->addFilter($periodClass::END_ITERATION); $this->assertNull($period->current()); $period = $period->removeFilter($periodClass::END_ITERATION); $this->assertEquals($start, $period->current()); $this->assertNotSame($start, $period->current()); } public function testChangeStartDateBeforeIteration() { $periodClass = static::$periodClass; $period = $periodClass::create(new Carbon('2018-10-05'), 3) ->setStartDate(new Carbon('2018-10-13')) ->toggleOptions($periodClass::EXCLUDE_START_DATE, true); $this->assertEquals(new Carbon('2018-10-14'), $period->current()); } public function testChangeStartDateAfterStartedIteration() { $periodClass = static::$periodClass; $period = $periodClass::create(new Carbon('2018-10-05'), 3); $current = $period->current(); $period->toggleOptions($periodClass::EXCLUDE_START_DATE, true); $period->setStartDate(new Carbon('2018-10-13')); $this->assertEquals($current, $period->current()); } public function testInvertDateIntervalDuringIteration() { $periodClass = static::$periodClass; $period = new $periodClass('2018-04-11', 5); $results = []; foreach ($period as $key => $date) { $results[] = $date; if ($key === 2) { $period->invertDateInterval(); } } $this->assertSame( $this->standardizeDates(['2018-04-11', '2018-04-12', '2018-04-13', '2018-04-12', '2018-04-11']), $this->standardizeDates($results), ); } public function testManualIteration() { $period = CarbonPeriodFactory::withStackFilter(static::$periodClass); $period->rewind(); $str = ''; while ($period->valid()) { if ($period->key()) { $str .= ', '; } $str .= $period->current()->format('m-d'); $period->next(); } $this->assertSame('01-01, 01-03', $str); } public function testSkip() { $periodClass = static::$periodClass; $period = $periodClass::create('2018-05-30', '2018-07-13'); $output = []; foreach ($period as $day) { /* @var Carbon $day */ $output[] = $day->format('Y-m-d'); if ($day->isSunday()) { $this->assertTrue($period->skip(7)); $output[] = '...'; } } $this->assertSame([ '2018-05-30', '2018-05-31', '2018-06-01', '2018-06-02', '2018-06-03', '...', '2018-06-11', '2018-06-12', '2018-06-13', '2018-06-14', '2018-06-15', '2018-06-16', '2018-06-17', '...', '2018-06-25', '2018-06-26', '2018-06-27', '2018-06-28', '2018-06-29', '2018-06-30', '2018-07-01', '...', '2018-07-09', '2018-07-10', '2018-07-11', '2018-07-12', '2018-07-13', ], $output); $this->assertFalse($period->skip()); $this->assertFalse($period->skip(7)); } public function testLocale() { /** @var CarbonPeriod $period */ $period = CarbonPeriodFactory::withStackFilter(static::$periodClass)->locale('de'); $str = ''; foreach ($period as $key => $date) { if ($key) { $str .= ', '; } $str .= $date->isoFormat('MMMM dddd'); } $this->assertSame('Januar Montag, Januar Mittwoch', $str); } public function testTimezone() { $period = CarbonPeriodFactory::withStackFilter(static::$periodClass)->shiftTimezone('America/Toronto'); $str = null; foreach ($period as $key => $date) { $str = $date->format('H e'); break; } $this->assertSame('00 America/Toronto', $str); } } ================================================ FILE: tests/CarbonPeriod/MacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use BadMethodCallException; use Carbon\Carbon; use Carbon\CarbonPeriod; use Carbon\CarbonPeriodImmutable; use ReflectionClass; use Tests\AbstractTestCase; use Tests\CarbonPeriod\Fixtures\MacroableClass; use Tests\CarbonPeriod\Fixtures\Mixin; use Tests\CarbonPeriod\Fixtures\MixinTrait; class MacroTest extends AbstractTestCase { protected function tearDown(): void { (new ReflectionClass(static::$periodClass)) ->setStaticPropertyValue('macros', []); parent::tearDown(); } public function testCallMacro() { $periodClass = static::$periodClass; $periodClass::macro('onlyWeekdays', function () { /** @var CarbonPeriod $period */ $period = $this; return $period->addFilter(function ($date) { return !\in_array($date->dayOfWeek, [Carbon::SATURDAY, Carbon::SUNDAY], true); }); }); /** @var mixed $period */ $period = $periodClass::create('2018-05-10', '2018-05-14'); $result = $period->onlyWeekdays(); $this->assertSame( $periodClass === CarbonPeriod::class, $period === $result, 'Must be same object if mutable' ); $this->assertSame( $this->standardizeDates(['2018-05-10', '2018-05-11', '2018-05-14']), $this->standardizeDates($result), ); } public function testParameterOtherThanSelfIsNotGivenPeriodInstance() { $periodClass = static::$periodClass; $periodClass::macro('foobar', function ($param = 123) { return $param; }); /** @var mixed $period */ $period = $periodClass::create(); $this->assertSame(123, $period->foobar()); } public function testPassPeriodInstanceAfterOptionalParameters() { $periodClass = static::$periodClass; $periodClass::macro('formatStartDate', function ($format = 'l, j F Y') { /** @var CarbonPeriod $period */ $period = $this; return $period->getStartDate()->format($format); }); /** @var mixed $period */ $period = $periodClass::start('2016-09-11'); $this->assertSame( 'Sunday, 11 September 2016', $period->formatStartDate(), ); } public function testMacroIsBindedToDatePeriodInstance() { $periodClass = static::$periodClass; $periodClass::macro('myself', function () { return $this; }); /** @var mixed $period */ $period = new $periodClass(); $this->assertInstanceOf($periodClass, $period->myself()); $this->assertSame($period, $period->myself()); } public function testCallMacroStatically() { $periodClass = static::$periodClass; $periodClass::macro('countWeekdaysBetween', function ($from, $to) use ($periodClass) { return $periodClass::create($from, $to) ->addFilter(function ($date) { return !\in_array($date->dayOfWeek, [Carbon::SATURDAY, Carbon::SUNDAY], true); }) ->count(); }); $this->assertSame( 3, $periodClass::countWeekdaysBetween('2018-05-10', '2018-05-14'), ); } public function testMacroIsBoundToDatePeriodClass() { $periodClass = static::$periodClass; $periodClass::macro('newMyself', function () { return new static(); }); $this->assertInstanceOf($periodClass, $periodClass::newMyself()); } public function testRegisterNonClosureMacro() { $periodClass = static::$periodClass; $periodClass::macro('lower', 'strtolower'); /** @var mixed $period */ $period = new $periodClass(); $this->assertSame('abc', $period->lower('ABC')); $this->assertSame('abc', $periodClass::lower('ABC')); } public function testRegisterMixin() { $periodClass = static::$periodClass; $periodClass::mixin(new Mixin()); $this->assertNull($periodClass::getFoo()); $periodClass::setFoo('bar'); $this->assertSame('bar', $periodClass::getFoo()); } public function testCallNonExistingMacro() { $this->expectExceptionObject(new BadMethodCallException( 'Method nonExistingMacro does not exist.', )); $periodClass = static::$periodClass; /** @var mixed $period */ $period = $periodClass::create(); $period->nonExistingMacro(); } public function testCallNonExistingMacroStatically() { $this->expectExceptionObject(new BadMethodCallException( 'Method nonExistingMacro does not exist.', )); $periodClass = static::$periodClass; $periodClass::nonExistingMacro(); } public function testOverrideAlias() { $periodClass = static::$periodClass; $periodClass::macro('recurrences', function () { return 'foo'; }); $this->assertSame('foo', $periodClass::recurrences()); } public function testInstantiateViaStaticMacroCall() { $periodClass = static::$periodClass; $periodClass::macro('fromTomorrow', function () { /** @var CarbonPeriod $period */ $period = $this; return $period->setStartDate(Carbon::tomorrow()); }); $period = $periodClass::fromTomorrow(); $this->assertEquals(Carbon::tomorrow(), $period->getStartDate()); } public function testMixinInstance() { require_once __DIR__.'/Fixtures/MixinTrait.php'; require_once __DIR__.'/Fixtures/MacroableClass.php'; $periodClass = static::$periodClass; $periodClass::mixin(MixinTrait::class); $period = $periodClass::create('2023-06-10', '2023-06-12'); $copy = $period->copyOneMoreDay(); $this->assertSame('Every 1 day from 2023-06-10 to 2023-06-12', (string) $period); $this->assertSame('Every 1 day from 2023-06-10 to 2023-06-13', (string) $copy); $mutated = $period->oneMoreDay(); $immutable = (static::$periodClass === CarbonPeriodImmutable::class); $expectedEnd = $immutable ? '2023-06-12' : '2023-06-13'; $this->assertSame('Every 1 day from 2023-06-10 to 2023-06-13', (string) $mutated); $this->assertSame("Every 1 day from 2023-06-10 to $expectedEnd", (string) $period); $expectedResult = $immutable ? 'a new instance' : 'the same instance'; $this->assertSame( $immutable, ($mutated !== $period), "{static::$periodClass}::oneMoreDay() should return $expectedResult" ); $this->assertNotSame($copy, $period); $this->assertSame('2023-06-14', $mutated->endNextDay()->format('Y-m-d')); $this->assertSame(static::$periodClass === CarbonPeriodImmutable::class ? '2023-06-13' : '2023-06-14', $period->endNextDay()->format('Y-m-d')); MacroableClass::mixin(MixinTrait::class); $obj = new MacroableClass(); $result = $obj ->setEndDate(Carbon::parse('2023-06-01')) ->oneMoreDay(); $endDate = $result->getEndDate(); $this->assertInstanceOf(MacroableClass::class, $result); $this->assertNotSame(MacroableClass::class, \get_class($result)); $this->assertSame(Carbon::class, \get_class($endDate)); $this->assertSame('2023-06-02', $endDate->format('Y-m-d')); } } ================================================ FILE: tests/CarbonPeriod/RoundingTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\CarbonInterval; use InvalidArgumentException; use Tests\AbstractTestCase; class RoundingTest extends AbstractTestCase { public function testThrowsExceptionForCompositeInterval() { $this->expectExceptionObject(new InvalidArgumentException( 'Rounding is only possible with single unit intervals.', )); $periodClass = static::$periodClass; $periodClass::days(2)->round('2 hours 50 minutes'); } public function testFloor() { $periodClass = static::$periodClass; $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->floor(); $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 00:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 00:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '1 hour')->floor(); $this->assertSame('2019-02-01 12:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->floor(); $this->assertSame('2019-02-01 12:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 02:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->floor('hour'); $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 12:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '140 minutes')->floor('hour'); $this->assertSame('00 02:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 12:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '1 hour')->floor(CarbonInterval::minutes(15)); $this->assertSame('2019-02-01 12:45:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->floorUnit('minute', 10); $this->assertSame('2019-02-01 12:50:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:10:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->floorMinutes(10); $this->assertSame('2019-02-01 12:50:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:10:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); } public function testCeil() { $periodClass = static::$periodClass; $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->ceil(); $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-02 00:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-13 00:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '1 hour')->ceil(); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 04:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->ceil(); $this->assertSame('2019-02-01 14:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 04:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->ceil('hour'); $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 04:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '140 minutes')->ceil('hour'); $this->assertSame('00 03:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 04:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '1 hour')->ceil(CarbonInterval::minutes(15)); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:15:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->ceilUnit('minute', 10); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:20:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->ceilMinutes(10); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:20:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); } public function testRound() { $periodClass = static::$periodClass; $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->round(); $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-02 00:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 00:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '1 hour')->round(); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->round(); $this->assertSame('2019-02-01 12:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 04:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817')->round('hour'); $this->assertSame('01 00:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '140 minutes')->round('hour'); $this->assertSame('00 02:00:00.000000', $period->getDateInterval()->format('%D %H:%I:%S.%F')); $this->assertSame('2019-02-01 13:00:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:00:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '1 hour')->round(CarbonInterval::minutes(15)); $this->assertSame('2019-02-01 12:45:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:15:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->roundUnit('minute', 10); $this->assertSame('2019-02-01 12:50:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:10:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23', '2019-12-12 03:12:44.817', '2 hours')->roundMinutes(10); $this->assertSame('2019-02-01 12:50:00.000000', $period->getStartDate()->format('Y-m-d H:i:s.u')); $this->assertSame('2019-12-12 03:10:00.000000', $period->getEndDate()->format('Y-m-d H:i:s.u')); } public function testRoundCalculatedEnd() { $periodClass = static::$periodClass; $period = $periodClass::create('2019-02-01 12:52:23.123456', '3 hours')->setRecurrences(3); $this->assertSame('2019-02-01 18:00:00.000000', $period->calculateEnd('round')->format('Y-m-d H:i:s.u')); $this->assertSame('2019-02-01 18:52:23.123456', $period->calculateEnd()->format('Y-m-d H:i:s.u')); $period = $periodClass::create('2019-02-01 12:52:23.123456', '3 hours') ->setRecurrences(3) ->addFilter(function ($date) { return $date->hour % 2; }); $this->assertSame('2019-02-02 03:00:00.000000', $period->calculateEnd('round')->format('Y-m-d H:i:s.u')); $this->assertSame('2019-02-02 03:52:23.123456', $period->calculateEnd()->format('Y-m-d H:i:s.u')); } } ================================================ FILE: tests/CarbonPeriod/SerializationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class SerializationTest extends AbstractTestCase { public function testSerializationFromV2(): void { $data = "O:19:\"Carbon\CarbonPeriod\":24:{s:12:\"\0*\0dateClass\";s:13:\"Carbon\Carbon\";s:15:\"\0*\0dateInterval\";O:21:\"Carbon\CarbonInterval\":22:{s:1:\"y\";i:0;s:1:\"m\";i:0;s:1:\"d\";i:3;s:1:\"h\";i:0;s:1:\"i\";i:0;s:1:\"s\";i:0;s:1:\"f\";d:0;s:6:\"invert\";i:0;s:4:\"days\";b:0;s:11:\"from_string\";b:0;s:9:\"\0*\0tzName\";N;s:7:\"\0*\0step\";N;s:22:\"\0*\0localMonthsOverflow\";N;s:21:\"\0*\0localYearsOverflow\";N;s:25:\"\0*\0localStrictModeEnabled\";N;s:24:\"\0*\0localHumanDiffOptions\";N;s:22:\"\0*\0localToStringFormat\";N;s:18:\"\0*\0localSerializer\";N;s:14:\"\0*\0localMacros\";N;s:21:\"\0*\0localGenericMacros\";N;s:22:\"\0*\0localFormatFunction\";N;s:18:\"\0*\0localTranslator\";N;}s:14:\"\0*\0constructed\";b:1;s:20:\"\0*\0isDefaultInterval\";b:0;s:10:\"\0*\0filters\";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:19:\"Carbon\CarbonPeriod\";i:1;s:13:\"filterEndDate\";}i:1;N;}}s:12:\"\0*\0startDate\";O:13:\"Carbon\Carbon\":3:{s:4:\"date\";s:26:\"2018-04-21 00:00:00.000000\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}s:10:\"\0*\0endDate\";O:13:\"Carbon\Carbon\":3:{s:4:\"date\";s:26:\"2018-04-27 00:00:00.000000\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}s:14:\"\0*\0recurrences\";N;s:10:\"\0*\0options\";i:0;s:6:\"\0*\0key\";N;s:10:\"\0*\0current\";N;s:11:\"\0*\0timezone\";N;s:19:\"\0*\0validationResult\";N;s:9:\"\0*\0tzName\";N;s:22:\"\0*\0localMonthsOverflow\";N;s:21:\"\0*\0localYearsOverflow\";N;s:25:\"\0*\0localStrictModeEnabled\";N;s:24:\"\0*\0localHumanDiffOptions\";N;s:22:\"\0*\0localToStringFormat\";N;s:18:\"\0*\0localSerializer\";N;s:14:\"\0*\0localMacros\";N;s:21:\"\0*\0localGenericMacros\";N;s:22:\"\0*\0localFormatFunction\";N;s:18:\"\0*\0localTranslator\";N;}"; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame(Carbon::class, $period->getDateClass()); $this->assertSame(0, $period->getOptions()); $this->assertNull($period->getRecurrences()); $this->assertDate('2018-04-21', $period->getStartDate()); $this->assertDate('2018-04-27', $period->getEndDate()); $this->assertIntervalDuration('3 days', $period->getDateInterval()); $this->assertSame('UTC', $period->current()->tzName); } public function testSerializationFromV2WithImmutableStart(): void { $data = "O:19:\"Carbon\CarbonPeriod\":24:{s:12:\"\0*\0dateClass\";s:13:\"Carbon\Carbon\";s:15:\"\0*\0dateInterval\";O:21:\"Carbon\CarbonInterval\":22:{s:1:\"y\";i:0;s:1:\"m\";i:0;s:1:\"d\";i:3;s:1:\"h\";i:0;s:1:\"i\";i:0;s:1:\"s\";i:0;s:1:\"f\";d:0;s:6:\"invert\";i:0;s:4:\"days\";b:0;s:11:\"from_string\";b:0;s:9:\"\0*\0tzName\";N;s:7:\"\0*\0step\";N;s:22:\"\0*\0localMonthsOverflow\";N;s:21:\"\0*\0localYearsOverflow\";N;s:25:\"\0*\0localStrictModeEnabled\";N;s:24:\"\0*\0localHumanDiffOptions\";N;s:22:\"\0*\0localToStringFormat\";N;s:18:\"\0*\0localSerializer\";N;s:14:\"\0*\0localMacros\";N;s:21:\"\0*\0localGenericMacros\";N;s:22:\"\0*\0localFormatFunction\";N;s:18:\"\0*\0localTranslator\";N;}s:14:\"\0*\0constructed\";b:1;s:20:\"\0*\0isDefaultInterval\";b:0;s:10:\"\0*\0filters\";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:19:\"Carbon\CarbonPeriod\";i:1;s:13:\"filterEndDate\";}i:1;N;}}s:12:\"\0*\0startDate\";O:22:\"Carbon\CarbonImmutable\":3:{s:4:\"date\";s:26:\"2018-04-21 00:00:00.000000\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}s:10:\"\0*\0endDate\";O:13:\"Carbon\Carbon\":3:{s:4:\"date\";s:26:\"2018-04-27 00:00:00.000000\";s:13:\"timezone_type\";i:3;s:8:\"timezone\";s:3:\"UTC\";}s:14:\"\0*\0recurrences\";N;s:10:\"\0*\0options\";i:0;s:6:\"\0*\0key\";N;s:10:\"\0*\0current\";N;s:11:\"\0*\0timezone\";N;s:19:\"\0*\0validationResult\";N;s:9:\"\0*\0tzName\";N;s:22:\"\0*\0localMonthsOverflow\";N;s:21:\"\0*\0localYearsOverflow\";N;s:25:\"\0*\0localStrictModeEnabled\";N;s:24:\"\0*\0localHumanDiffOptions\";N;s:22:\"\0*\0localToStringFormat\";N;s:18:\"\0*\0localSerializer\";N;s:14:\"\0*\0localMacros\";N;s:21:\"\0*\0localGenericMacros\";N;s:22:\"\0*\0localFormatFunction\";N;s:18:\"\0*\0localTranslator\";N;}"; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame(Carbon::class, $period->getDateClass()); $this->assertSame(0, $period->getOptions()); $this->assertNull($period->getRecurrences()); $this->assertDate('2018-04-21', $period->getStartDate(), CarbonImmutable::class); $this->assertDate('2018-04-27', $period->getEndDate()); $this->assertIntervalDuration('3 days', $period->getDateInterval()); $this->assertSame('UTC', $period->current()->tzName); } public function testSerializationFromV2WithRecurrences(): void { $data = 'O:19:"Carbon\\CarbonPeriod":24:{s:12:"'."\0".'*'."\0".'dateClass";s:13:"Carbon\\Carbon";s:15:"'."\0".'*'."\0".'dateInterval";O:21:"Carbon\\CarbonInterval":22:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:1;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:0;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;s:9:"'."\0".'*'."\0".'tzName";N;s:7:"'."\0".'*'."\0".'step";N;s:22:"'."\0".'*'."\0".'localMonthsOverflow";N;s:21:"'."\0".'*'."\0".'localYearsOverflow";N;s:25:"'."\0".'*'."\0".'localStrictModeEnabled";N;s:24:"'."\0".'*'."\0".'localHumanDiffOptions";N;s:22:"'."\0".'*'."\0".'localToStringFormat";N;s:18:"'."\0".'*'."\0".'localSerializer";N;s:14:"'."\0".'*'."\0".'localMacros";N;s:21:"'."\0".'*'."\0".'localGenericMacros";N;s:22:"'."\0".'*'."\0".'localFormatFunction";N;s:18:"'."\0".'*'."\0".'localTranslator";N;}s:14:"'."\0".'*'."\0".'constructed";b:1;s:20:"'."\0".'*'."\0".'isDefaultInterval";b:0;s:10:"'."\0".'*'."\0".'filters";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:19:"Carbon\\CarbonPeriod";i:1;s:17:"filterRecurrences";}i:1;N;}}s:12:"'."\0".'*'."\0".'startDate";O:13:"Carbon\\Carbon":3:{s:4:"date";s:26:"2018-05-13 10:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:11:"Europe/Kyiv";}s:10:"'."\0".'*'."\0".'endDate";N;s:14:"'."\0".'*'."\0".'recurrences";i:3;s:10:"'."\0".'*'."\0".'options";i:3;s:6:"'."\0".'*'."\0".'key";N;s:10:"'."\0".'*'."\0".'current";N;s:11:"'."\0".'*'."\0".'timezone";s:11:"Europe/Kyiv";s:19:"'."\0".'*'."\0".'validationResult";N;s:9:"'."\0".'*'."\0".'tzName";s:11:"Europe/Kyiv";s:22:"'."\0".'*'."\0".'localMonthsOverflow";N;s:21:"'."\0".'*'."\0".'localYearsOverflow";N;s:25:"'."\0".'*'."\0".'localStrictModeEnabled";N;s:24:"'."\0".'*'."\0".'localHumanDiffOptions";N;s:22:"'."\0".'*'."\0".'localToStringFormat";N;s:18:"'."\0".'*'."\0".'localSerializer";N;s:14:"'."\0".'*'."\0".'localMacros";N;s:21:"'."\0".'*'."\0".'localGenericMacros";N;s:22:"'."\0".'*'."\0".'localFormatFunction";N;s:18:"'."\0".'*'."\0".'localTranslator";N;}'; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame(Carbon::class, $period->getDateClass()); $this->assertSame(3, $period->getOptions()); $this->assertSame(3, $period->getRecurrences()); $this->assertDate('2018-05-13T10:30:00+03:00', $period->getStartDate()); $this->assertNull($period->getEndDate()); $this->assertIntervalDuration('1 hour', $period->getDateInterval()); $this->assertSame('Europe/Kyiv', $period->current()->tzName); } public function testSerializationFromV2WithTimezone(): void { $data = 'O:19:"Carbon\\CarbonPeriod":24:{s:12:"'."\0".'*'."\0".'dateClass";s:13:"Carbon\\Carbon";s:15:"'."\0".'*'."\0".'dateInterval";O:21:"Carbon\\CarbonInterval":22:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:1;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:0;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;s:9:"'."\0".'*'."\0".'tzName";N;s:7:"'."\0".'*'."\0".'step";N;s:22:"'."\0".'*'."\0".'localMonthsOverflow";N;s:21:"'."\0".'*'."\0".'localYearsOverflow";N;s:25:"'."\0".'*'."\0".'localStrictModeEnabled";N;s:24:"'."\0".'*'."\0".'localHumanDiffOptions";N;s:22:"'."\0".'*'."\0".'localToStringFormat";N;s:18:"'."\0".'*'."\0".'localSerializer";N;s:14:"'."\0".'*'."\0".'localMacros";N;s:21:"'."\0".'*'."\0".'localGenericMacros";N;s:22:"'."\0".'*'."\0".'localFormatFunction";N;s:18:"'."\0".'*'."\0".'localTranslator";N;}s:14:"'."\0".'*'."\0".'constructed";b:1;s:20:"'."\0".'*'."\0".'isDefaultInterval";b:0;s:10:"'."\0".'*'."\0".'filters";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:19:"Carbon\\CarbonPeriod";i:1;s:17:"filterRecurrences";}i:1;N;}}s:12:"'."\0".'*'."\0".'startDate";O:13:"Carbon\\Carbon":3:{s:4:"date";s:26:"2018-05-13 10:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:11:"Europe/Kyiv";}s:10:"'."\0".'*'."\0".'endDate";N;s:14:"'."\0".'*'."\0".'recurrences";i:8;s:10:"'."\0".'*'."\0".'options";i:3;s:6:"'."\0".'*'."\0".'key";i:1;s:10:"'."\0".'*'."\0".'current";O:13:"Carbon\\Carbon":3:{s:4:"date";s:26:"2018-05-13 09:30:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}s:11:"'."\0".'*'."\0".'timezone";O:21:"Carbon\\CarbonTimeZone":2:{s:13:"timezone_type";i:3;s:8:"timezone";s:11:"Europe/Kyiv";}s:19:"'."\0".'*'."\0".'validationResult";b:1;s:9:"'."\0".'*'."\0".'tzName";s:11:"Europe/Kyiv";s:22:"'."\0".'*'."\0".'localMonthsOverflow";N;s:21:"'."\0".'*'."\0".'localYearsOverflow";N;s:25:"'."\0".'*'."\0".'localStrictModeEnabled";N;s:24:"'."\0".'*'."\0".'localHumanDiffOptions";N;s:22:"'."\0".'*'."\0".'localToStringFormat";N;s:18:"'."\0".'*'."\0".'localSerializer";N;s:14:"'."\0".'*'."\0".'localMacros";N;s:21:"'."\0".'*'."\0".'localGenericMacros";N;s:22:"'."\0".'*'."\0".'localFormatFunction";N;s:18:"'."\0".'*'."\0".'localTranslator";N;}'; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame(Carbon::class, $period->getDateClass()); $this->assertSame(3, $period->getOptions()); $this->assertSame(8, $period->getRecurrences()); $this->assertDate('2018-05-13T10:30:00+03:00', $period->getStartDate()); $this->assertNull($period->getEndDate()); $this->assertIntervalDuration('1 hour', $period->getDateInterval()); $this->assertSame('Europe/Kyiv', $period->current()->tzName); } public function testSerializationFromV2WithCurrent(): void { $data = 'O:19:"Carbon\\CarbonPeriod":24:{s:12:"'."\0".'*'."\0".'dateClass";s:22:"Carbon\\CarbonImmutable";s:15:"'."\0".'*'."\0".'dateInterval";O:21:"Carbon\\CarbonInterval":22:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:1;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:0;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;s:9:"'."\0".'*'."\0".'tzName";N;s:7:"'."\0".'*'."\0".'step";N;s:22:"'."\0".'*'."\0".'localMonthsOverflow";N;s:21:"'."\0".'*'."\0".'localYearsOverflow";N;s:25:"'."\0".'*'."\0".'localStrictModeEnabled";N;s:24:"'."\0".'*'."\0".'localHumanDiffOptions";N;s:22:"'."\0".'*'."\0".'localToStringFormat";N;s:18:"'."\0".'*'."\0".'localSerializer";N;s:14:"'."\0".'*'."\0".'localMacros";N;s:21:"'."\0".'*'."\0".'localGenericMacros";N;s:22:"'."\0".'*'."\0".'localFormatFunction";N;s:18:"'."\0".'*'."\0".'localTranslator";N;}s:14:"'."\0".'*'."\0".'constructed";b:1;s:20:"'."\0".'*'."\0".'isDefaultInterval";b:0;s:10:"'."\0".'*'."\0".'filters";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:19:"Carbon\\CarbonPeriod";i:1;s:13:"filterEndDate";}i:1;N;}}s:12:"'."\0".'*'."\0".'startDate";O:13:"Carbon\\Carbon":3:{s:4:"date";s:26:"2030-01-02 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}s:10:"'."\0".'*'."\0".'endDate";O:13:"Carbon\\Carbon":3:{s:4:"date";s:26:"2030-01-21 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}s:14:"'."\0".'*'."\0".'recurrences";N;s:10:"'."\0".'*'."\0".'options";i:4;s:6:"'."\0".'*'."\0".'key";N;s:10:"'."\0".'*'."\0".'current";N;s:11:"'."\0".'*'."\0".'timezone";N;s:19:"'."\0".'*'."\0".'validationResult";N;s:9:"'."\0".'*'."\0".'tzName";N;s:22:"'."\0".'*'."\0".'localMonthsOverflow";N;s:21:"'."\0".'*'."\0".'localYearsOverflow";N;s:25:"'."\0".'*'."\0".'localStrictModeEnabled";N;s:24:"'."\0".'*'."\0".'localHumanDiffOptions";N;s:22:"'."\0".'*'."\0".'localToStringFormat";N;s:18:"'."\0".'*'."\0".'localSerializer";N;s:14:"'."\0".'*'."\0".'localMacros";N;s:21:"'."\0".'*'."\0".'localGenericMacros";N;s:22:"'."\0".'*'."\0".'localFormatFunction";N;s:18:"'."\0".'*'."\0".'localTranslator";N;}'; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame(CarbonImmutable::class, $period->getDateClass()); $this->assertNull($period->getRecurrences()); $this->assertDate('2030-01-02T00:00:00-05:00', $period->getStartDate()); $this->assertDate('2030-01-21T00:00:00-05:00', $period->getEndDate()); $this->assertIntervalDuration('1 day', $period->getDateInterval()); $this->assertSame('America/Toronto', $period->current()->tzName); } public function testSerializationFromV2WithDateTimeObject(): void { $data = 'O:19:"Carbon\\CarbonPeriod":7:{s:5:"start";O:8:"DateTime":3:{s:4:"date";s:26:"2030-01-02 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}s:7:"current";N;s:3:"end";O:8:"DateTime":3:{s:4:"date";s:26:"2030-01-21 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}s:8:"interval";O:12:"DateInterval":10:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:1;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:0;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;}s:11:"recurrences";i:1;s:18:"include_start_date";b:1;s:16:"include_end_date";b:0;}'; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertSame(Carbon::class, $period->getDateClass()); $this->assertNull($period->getRecurrences()); $this->assertDate('2030-01-02T00:00:00-05:00', $period->getStartDate()); $this->assertDate('2030-01-21T00:00:00-05:00', $period->getEndDate()); $this->assertIntervalDuration('1 day', $period->getDateInterval()); $this->assertNull($period->current()); } public function testSerializationFromV2WithDateTimeImmutableObject(): void { $data = 'O:19:"Carbon\\CarbonPeriod":7:{s:5:"start";O:17:"DateTimeImmutable":3:{s:4:"date";s:26:"2030-01-02 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}s:7:"current";N;s:3:"end";O:17:"DateTimeImmutable":3:{s:4:"date";s:26:"2030-01-21 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"America/Toronto";}s:8:"interval";O:12:"DateInterval":10:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:1;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:0;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;}s:11:"recurrences";i:1;s:18:"include_start_date";b:1;s:16:"include_end_date";b:0;}'; $period = unserialize($data); /** @var CarbonPeriod $period */ $period = unserialize(serialize($period)); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertNull($period->getRecurrences()); $this->assertDate('2030-01-02T00:00:00-05:00', $period->getStartDate(), CarbonImmutable::class); $this->assertDate('2030-01-21T00:00:00-05:00', $period->getEndDate(), CarbonImmutable::class); $this->assertIntervalDuration('1 day', $period->getDateInterval()); $this->assertNull($period->current()); } #[DataProvider('getCarbonPeriods')] public function testSerialization(CarbonPeriod $period): void { $this->assertSerializationWorks($period); } /** * @SuppressWarnings(MissingImport) */ public function testUnserializeError(): void { $this->expectExceptionMessage( PHP_VERSION_ID < 8_02_00 ? 'Disallowed' : 'Invalid serialization data for DatePeriod object', ); if (!class_exists('CarbonDisallowingToDateTime')) { eval(' class CarbonDisallowingToDateTime extends \Carbon\Carbon { public function toDateTime(): DateTime { throw new LogicException("Disallowed"); } } '); } $periodClass = static::$periodClass; /** @var CarbonPeriod $period */ $period = new $periodClass(); $period->__unserialize([ /* @phpstan-ignore-next-line */ 'start' => new CarbonDisallowingToDateTime('2030-01-02 UTC'), /* @phpstan-ignore-next-line */ 'end' => new CarbonDisallowingToDateTime('2030-01-10 UTC'), 'interval' => new DateInterval('PT12H'), ]); } public static function getCarbonPeriods(): array { $periodClass = static::$periodClass; return [ 'new' => [new $periodClass()], 'range string' => [$periodClass::createFromIso('2023-07-01T00:00:00Z/P7D/2023-11-01T00:00:00Z')], 'include start and end' => [$periodClass::options(0)], 'exclude start and end' => [$periodClass::options($periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE)], 'with timezone' => [ $periodClass::createFromIso('2023-07-01T00:00:00Z/P7D/2023-11-01T00:00:00Z') ->setTimezone('Europe/Kyiv'), ], ]; } public function testSerializationWithRecurrences(): void { $periodClass = static::$periodClass; $period = $periodClass::createFromISO8601String('R4/2023-07-01T00:00:00Z/P7D'); $this->assertInstanceOf(CarbonPeriod::class, $period); $this->assertDate('2023-07-01', $period->getStartDate()); $this->assertNull($period->getEndDate()); $this->assertSame(4, $period->getRecurrences()); $this->assertIntervalDuration('1 week', $period->getDateInterval()); $periodCopy = unserialize(serialize($period)); $this->assertEquivalentPeriods($period, $periodCopy); $this->assertDate('2023-07-01', $periodCopy->getStartDate()); $this->assertNull($periodCopy->getEndDate()); $this->assertSame(4, $periodCopy->getRecurrences()); $this->assertIntervalDuration('1 week', $periodCopy->getDateInterval()); } private function assertIntervalDuration(string $duration, mixed $interval): void { $this->assertInstanceOf(CarbonInterval::class, $interval); $this->assertSame($duration, $interval->forHumans()); } private function assertDate(string $date, mixed $value, string $class = Carbon::class): void { if (\strlen($date) === 10) { $date .= 'T00:00:00'; } if (\strlen($date) === 19) { $date .= '+00:00'; } $this->assertInstanceOf($class, $value); $this->assertSame($date, $value->toIso8601String()); } private function assertSerializationWorks(CarbonPeriod $period): void { $periodCopy = unserialize(serialize($period)); $this->assertEquivalentPeriods($period, $periodCopy); } private function assertEquivalentPeriods(mixed $a, mixed $b): void { $this->assertInstanceOf(CarbonPeriod::class, $b); $this->assertSame($a::class, $b::class); if (PHP_VERSION_ID >= 8_02_00) { $this->assertEquals($a, $b); return; } $this->assertEquals($a->getStartDate(), $b->getStartDate()); $this->assertEquals($a->getDateInterval(), $b->getDateInterval()); $this->assertEquals($a->getEndDate(), $b->getEndDate()); $this->assertEquals($a->getRecurrences(), $b->getRecurrences()); $this->assertEquals($a->getOptions(), $b->getOptions()); } } ================================================ FILE: tests/CarbonPeriod/SettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use DateInterval; use DateTime; use InvalidArgumentException; use Tests\AbstractTestCase; use Tests\CarbonPeriod\Fixtures\AbstractCarbon; class SettersTest extends AbstractTestCase { public function testSetStartDate() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setStartDate('2018-03-25'); $this->assertSame('2018-03-25', $period->getStartDate()->toDateString()); } public function testSetEndDate() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setEndDate('2018-04-25'); $this->assertSame('2018-04-25', $period->getEndDate()->toDateString()); } public function testSetDateInterval() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setDateInterval('P3D'); $this->assertSame('P3D', $period->getDateInterval()->spec()); } public function testSetDateIntervalFromStringFormat() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setDateInterval('1w 3d 4h 32m 23s'); $this->assertSame('P10DT4H32M23S', $period->getDateInterval()->spec()); } public function testSetRecurrences() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setRecurrences(5); $this->assertSame(5, $period->getRecurrences()); } public function testSetDates() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setDates('2019-04-12', '2019-04-19'); $this->assertSame('2019-04-12', $period->getStartDate()->toDateString()); $this->assertSame('2019-04-19', $period->getEndDate()->toDateString()); } public function testSetOptions() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setOptions($options = $periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE); $this->assertSame($options, $period->getOptions()); } public function testSetDateClass() { $periodClass = static::$periodClass; $period = new $periodClass('2001-01-01', '2001-01-02'); $period = $period->setDateClass(CarbonImmutable::class); $this->assertSame($periodClass::IMMUTABLE, $period->getOptions()); $this->assertInstanceOf(CarbonImmutable::class, $period->toArray()[0]); $period = $period->setDateClass(Carbon::class); $this->assertSame(0, $period->getOptions()); $this->assertInstanceOf(Carbon::class, $period->toArray()[0]); $period = $period->toggleOptions($periodClass::IMMUTABLE, true); $this->assertSame(CarbonImmutable::class, $period->getDateClass()); $this->assertInstanceOf(CarbonImmutable::class, $period->toArray()[0]); $period = $period->toggleOptions($periodClass::IMMUTABLE, false); $this->assertSame(Carbon::class, $period->getDateClass()); $this->assertInstanceOf(Carbon::class, $period->toArray()[0]); if (PHP_VERSION < 8.4) { $period = $period->setDateClass(AbstractCarbon::class); $this->assertSame(AbstractCarbon::class, $period->getDateClass()); } } public function testSetDateClassInvalidArgumentException() { $this->expectExceptionObject(new InvalidArgumentException( 'Given class does not implement Carbon\CarbonInterface: Carbon\CarbonInterval', )); $periodClass = static::$periodClass; $period = new $periodClass('2001-01-01', '2001-01-02'); $period->setDateClass(CarbonInterval::class); } public function testInvalidInterval() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid interval.', )); $periodClass = static::$periodClass; $periodClass::create()->setDateInterval(new DateTime()); } public function testEmptyInterval() { $this->expectExceptionObject(new InvalidArgumentException( 'Empty interval is not accepted.', )); $periodClass = static::$periodClass; $periodClass::create()->setDateInterval(new DateInterval('P0D')); } public function testInvalidNegativeNumberOfRecurrences() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid number of recurrences.', )); $periodClass = static::$periodClass; $periodClass::create()->setRecurrences(-4); } public function testInvalidConstructorParameters() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid constructor parameters.', )); $periodClass = static::$periodClass; $periodClass::create([]); } public function testInvalidStartDate() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid start date.', )); $periodClass = static::$periodClass; $periodClass::create()->setStartDate(new DateInterval('P1D')); } public function testInvalidEndDate() { $this->expectExceptionObject(new InvalidArgumentException( 'Invalid end date.', )); $periodClass = static::$periodClass; $periodClass::create()->setEndDate(new DateInterval('P1D')); } public function testToggleOptions() { $periodClass = static::$periodClass; $start = $periodClass::EXCLUDE_START_DATE; $end = $periodClass::EXCLUDE_END_DATE; $period = new $periodClass(); $period = $period->toggleOptions($start, true); $this->assertPeriodOptions($start, $period); $period = $period->toggleOptions($end, true); $this->assertPeriodOptions($start | $end, $period); $period = $period->toggleOptions($start, false); $this->assertPeriodOptions($end, $period); $period = $period->toggleOptions($end, false); $this->assertPeriodOptions(0, $period); } public function testToggleOptionsOnAndOff() { $periodClass = static::$periodClass; $start = $periodClass::EXCLUDE_START_DATE; $end = $periodClass::EXCLUDE_END_DATE; $period = new $periodClass(); $period = $period->toggleOptions($start); $this->assertPeriodOptions($start, $period); $period = $period->toggleOptions($start); $this->assertPeriodOptions(0, $period); $period = $period->setOptions($start); $period = $period->toggleOptions($start | $end); $this->assertSame($start | $end, $period->getOptions()); $period = $period->toggleOptions($end); $this->assertSame($start, $period->getOptions()); $period = $period->toggleOptions($end); $this->assertSame($start | $end, $period->getOptions()); $period = $period->toggleOptions($start | $end); $this->assertSame(0, $period->getOptions()); } public function testSetStartDateInclusiveOrExclusive() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setStartDate('2018-03-25'); $this->assertFalse($period->isStartExcluded()); $period = $period->setStartDate('2018-03-25', false); $this->assertTrue($period->isStartExcluded()); $period = $period->setStartDate('2018-03-25', true); $this->assertFalse($period->isStartExcluded()); } public function testSetEndDateInclusiveOrExclusive() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setEndDate('2018-04-25'); $this->assertFalse($period->isEndExcluded()); $period = $period->setEndDate('2018-04-25', false); $this->assertTrue($period->isEndExcluded()); $period = $period->setEndDate('2018-04-25', true); $this->assertFalse($period->isEndExcluded()); } public function testInvertDateInterval() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->invertDateInterval(); $this->assertSame(1, $period->getDateInterval()->invert); $period = $period->invertDateInterval(); $this->assertSame(0, $period->getDateInterval()->invert); $period = $periodClass::create('2018-04-29', 7); $dates = []; foreach ($period as $key => $date) { if ($key === 3) { $period->invert()->start($date); } $dates[] = $date->format('m-d'); } $this->assertSame([ '04-29', '04-30', '05-01', '05-02', '05-01', '04-30', '04-29', ], $dates); } public function testExcludeStartDate() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->excludeStartDate(); $this->assertPeriodOptions($periodClass::EXCLUDE_START_DATE, $period); $period = $period->excludeStartDate(true); $this->assertPeriodOptions($periodClass::EXCLUDE_START_DATE, $period); $period = $period->excludeStartDate(false); $this->assertPeriodOptions(0, $period); } public function testExcludeEndDate() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->excludeEndDate(); $this->assertPeriodOptions($periodClass::EXCLUDE_END_DATE, $period); $period = $period->excludeEndDate(true); $this->assertPeriodOptions($periodClass::EXCLUDE_END_DATE, $period); $period = $period->excludeEndDate(false); $this->assertPeriodOptions(0, $period); } public function testSetRelativeDates() { $periodClass = static::$periodClass; $period = new $periodClass(); $period = $period->setDates('first monday of may 2018', 'last day of may 2018 noon'); $this->assertSame('2018-05-07 00:00:00', $period->getStartDate()->toDateTimeString()); $this->assertSame('2018-05-31 12:00:00', $period->getEndDate()->toDateTimeString()); } public function testFluentSetters() { $periodClass = static::$periodClass; Carbon::setTestNowAndTimezone(Carbon::now('UTC')); $period = CarbonInterval::days(3)->toPeriod()->since('2018-04-21')->until('2018-04-27'); $dates = []; foreach ($period as $date) { $dates[] = $date->format('m-d'); } $this->assertSame(['04-21', '04-24', '04-27'], $dates); $period = CarbonInterval::days(3)->toPeriod('2018-04-21', '2018-04-27'); $dates = []; foreach ($period as $date) { $dates[] = $date->format('m-d'); } $this->assertSame(['04-21', '04-24', '04-27'], $dates); $someDateTime = new DateTime('2010-05-06 02:00:00'); $someCarbon = new Carbon('2010-05-06 13:00:00'); $period = $periodClass::every('2 hours')->between($someDateTime, $someCarbon)->options($periodClass::EXCLUDE_START_DATE); $hours = []; foreach ($period as $date) { $hours[] = $date->format('H'); } $this->assertSame(['04', '06', '08', '10', '12'], $hours); $period = $periodClass::options($periodClass::EXCLUDE_START_DATE)->stepBy(CarbonInterval::hours(2))->since('yesterday 19:00')->until('tomorrow 03:30'); $hours = []; foreach ($period as $date) { $hours[] = $date->format('j H'); } $d1 = Carbon::yesterday()->day; $d2 = Carbon::today()->day; $d3 = Carbon::tomorrow()->day; $this->assertSame([ "$d1 21", "$d1 23", "$d2 01", "$d2 03", "$d2 05", "$d2 07", "$d2 09", "$d2 11", "$d2 13", "$d2 15", "$d2 17", "$d2 19", "$d2 21", "$d2 23", "$d3 01", "$d3 03", ], $hours); $period = $periodClass::between('first day of january this year', 'first day of next month')->interval('1 week'); $this->assertEquals(new Carbon('first day of january this year'), $period->getStartDate()); $this->assertEquals(new Carbon('first day of next month'), $period->getEndDate()); $this->assertSame('1 week', $period->getDateInterval()->forHumans()); $opt = $periodClass::EXCLUDE_START_DATE; $int = '20 days'; $start = '2000-01-03'; $end = '2000-03-15'; $inclusive = false; $period = $periodClass::options($opt)->setDateInterval($int)->setStartDate($start, $inclusive)->setEndDate($end, $inclusive); $this->assertSame($start, $period->getStartDate()->format('Y-m-d')); $this->assertSame($end, $period->getEndDate()->format('Y-m-d')); $this->assertSame(20, $period->getDateInterval()->dayz); $this->assertSame($periodClass::EXCLUDE_START_DATE | $periodClass::EXCLUDE_END_DATE, $period->getOptions()); $inclusive = true; $period = $periodClass::options($opt)->setDateInterval($int)->setStartDate($start, $inclusive)->setEndDate($end, $inclusive); $this->assertSame($start, $period->getStartDate()->format('Y-m-d')); $this->assertSame($end, $period->getEndDate()->format('Y-m-d')); $this->assertSame(20, $period->getDateInterval()->dayz); $this->assertSame(0, $period->getOptions()); $period = $periodClass::options($opt)->setDateInterval($int)->setDates($start, $end); $this->assertSame($start, $period->getStartDate()->format('Y-m-d')); $this->assertSame($end, $period->getEndDate()->format('Y-m-d')); $this->assertSame(20, $period->getDateInterval()->dayz); $this->assertSame($opt, $period->getOptions()); } public function testSetTimezone(): void { $periodClass = static::$periodClass; $period = $periodClass::create( '2018-03-25 00:00 America/Toronto', 'PT1H', '2018-03-25 12:00 Europe/London', )->setTimezone('Europe/Oslo'); $this->assertSame('2018-03-25 06:00 Europe/Oslo', $period->getStartDate()->format('Y-m-d H:i e')); $this->assertSame('2018-03-25 13:00 Europe/Oslo', $period->getEndDate()->format('Y-m-d H:i e')); $period = $periodClass::create( '2018-03-25 00:00 America/Toronto', 'PT1H', 5, )->setTimezone('Europe/Oslo'); $this->assertSame('2018-03-25 06:00 Europe/Oslo', $period->getStartDate()->format('Y-m-d H:i e')); $this->assertNull($period->getEndDate()); $this->assertSame('2018-03-25 10:00 Europe/Oslo', $period->calculateEnd()->format('Y-m-d H:i e')); } public function testShiftTimezone(): void { $periodClass = static::$periodClass; $period = $periodClass::create( '2018-03-25 00:00 America/Toronto', 'PT1H', '2018-03-25 12:00 Europe/London', )->shiftTimezone('Europe/Oslo'); $this->assertSame('2018-03-25 00:00 Europe/Oslo', $period->getStartDate()->format('Y-m-d H:i e')); $this->assertSame('2018-03-25 12:00 Europe/Oslo', $period->getEndDate()->format('Y-m-d H:i e')); $period = $periodClass::create( '2018-03-26 00:00 America/Toronto', 'PT1H', 5, )->shiftTimezone('Europe/Oslo'); $this->assertSame('2018-03-26 00:00 Europe/Oslo', $period->getStartDate()->format('Y-m-d H:i e')); $this->assertNull($period->getEndDate()); $this->assertSame('2018-03-26 04:00 Europe/Oslo', $period->calculateEnd()->format('Y-m-d H:i e')); } } ================================================ FILE: tests/CarbonPeriod/StrictModeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use BadMethodCallException; use Carbon\Carbon; use Tests\AbstractTestCase; class StrictModeTest extends AbstractTestCase { public function testCallWithStrictMode() { $this->expectExceptionObject(new BadMethodCallException( 'Method foobar does not exist.', )); $periodClass = static::$periodClass; /** @var mixed $period */ $period = $periodClass::create(); $period->foobar(); } public function testCallWithoutStrictMode() { Carbon::useStrictMode(false); $periodClass = static::$periodClass; /** @var mixed $period */ $period = $periodClass::create(); $this->assertSame($period, $period->foobar()); } } ================================================ FILE: tests/CarbonPeriod/ToArrayTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\CarbonPeriodImmutable; use Carbon\Exceptions\EndLessPeriodException; use DateTimeInterface; use Tests\AbstractTestCase; use Tests\CarbonPeriod\Fixtures\CarbonPeriodFactory; class ToArrayTest extends AbstractTestCase { public function testToArrayIsNotEmptyArray() { $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray(); $this->assertIsArray($result); $this->assertNotEmpty($result); } public function testToArrayHasCorrectCount() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertCount(3, $period->toArray()); } public function testToArrayValuesAreCarbonInstances() { $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray(); foreach ($result as $key => $current) { $this->assertInstanceOfCarbon($current); } } public function testToArrayKeysAreSequential() { $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray(); $this->assertSame([0, 1, 2], array_keys($result)); } public function testToArrayHasCorrectValues() { $result = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)->toArray(); $this->assertSame( $this->standardizeDates(['2012-07-04', '2012-07-10', '2012-07-16']), $this->standardizeDates($result), ); } public function testJsonSerialize() { $result = json_encode(CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass)); $this->assertSame('["2012-07-04T04:00:00.000000Z","2012-07-10T04:00:00.000000Z","2012-07-16T04:00:00.000000Z"]', $result); } public function testCountEmptyPeriod() { $periodClass = static::$periodClass; $assertThrow = function (CarbonPeriod $period) { $message = null; try { $period->count(); } catch (EndLessPeriodException $exception) { $message = $exception->getMessage(); } $this->assertSame("Endless period can't be converted to array nor counted.", $message); }; $period = new $periodClass(); $this->assertTrue($period->isUnfilteredAndEndLess()); $assertThrow($period); $this->assertSame(Carbon::now()->format('Y-m-d H:i:s'), $period->first()->format('Y-m-d H:i:s')); foreach ($period as $date) { break; } $date ??= null; $this->assertInstanceOfCarbon($date); $this->assertSame(Carbon::now()->format('Y-m-d H:i:s'), $date->format('Y-m-d H:i:s')); $period = new $periodClass(INF); $this->assertTrue($period->isUnfilteredAndEndLess()); $assertThrow($period); $period = new $periodClass('2022-05-18', '1 day'); $this->assertTrue($period->isUnfilteredAndEndLess()); $assertThrow($period); $period = new $periodClass('2022-05-18', '1 day', CarbonImmutable::endOfTime()); $this->assertTrue($period->isUnfilteredAndEndLess()); $assertThrow($period); $period = new $periodClass('2022-05-18', '1 day'); $period->setDateClass(CarbonImmutable::class); $period->setEndDate(CarbonImmutable::endOfTime()); $this->assertTrue($period->isUnfilteredAndEndLess()); $assertThrow($period); $period = new $periodClass(3); $this->assertFalse($period->isUnfilteredAndEndLess()); $this->assertSame(3, $period->count()); $period = new $periodClass('2022-05-18', '2022-05-23'); $this->assertFalse($period->isUnfilteredAndEndLess()); $this->assertSame(6, $period->count()); $period = new $periodClass('2022-05-18', INF); $period = $period->addFilter(static function (DateTimeInterface $date) use ($periodClass) { if ($date->format('Y-m-d') > '2022-05-20') { return $periodClass::END_ITERATION; } return true; }); $this->assertFalse($period->isUnfilteredAndEndLess()); $this->assertSame(3, $period->count()); } public function testCountByMethod() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertSame(3, $period->count()); } public function testCountByFunction() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertCount(3, $period); } public function testFirst() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertEquals(new Carbon('2012-07-04'), $period->first()); } public function testLast() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $this->assertEquals(new Carbon('2012-07-16'), $period->last()); } public function testToArrayOfEmptyPeriod() { $periodClass = static::$periodClass; $result = $periodClass::create(0)->toArray(); $this->assertSame([], $result); } public function testCountOfEmptyPeriod() { $periodClass = static::$periodClass; $period = $periodClass::create(0); $this->assertSame(0, $period->count()); } public function testFirstOfEmptyPeriod() { $periodClass = static::$periodClass; $period = $periodClass::create(0); $this->assertNull($period->first()); $period = new class(0) extends CarbonPeriod { public function isUnfilteredAndEndLess(): bool { return true; } }; $this->assertNull($period->first()); } public function testLastOfEmptyPeriod() { $periodClass = static::$periodClass; $period = $periodClass::create(0); $this->assertNull($period->last()); } public function testRestoreIterationStateAfterCallingToArray() { $period = CarbonPeriodFactory::withEvenDaysFilter(static::$periodClass); $key = $period->key(); $current = $period->current(); $this->assertSame(0, $key); $this->assertEquals(new Carbon('2012-07-04'), $current); $period->next(); $this->assertSame( $this->standardizeDates(['2012-07-04', '2012-07-10', '2012-07-16']), $this->standardizeDates($period->toArray()), ); $this->assertSame(1, $period->key()); $this->assertEquals(new Carbon('2012-07-10'), $period->current()); $period->next(); $this->assertSame(2, $period->key()); $this->assertEquals(new Carbon('2012-07-16'), $period->current()); } public function testToArrayResultsAreInTheExpectedTimezone() { $periodClass = static::$periodClass; $period = $periodClass::create('2018-05-13 12:00 Asia/Kabul', 'PT1H', 3); $expected = [ '2018-05-13 12:00:00 +04:30', '2018-05-13 13:00:00 +04:30', '2018-05-13 14:00:00 +04:30', ]; $this->assertSame($expected, $this->standardizeDates($period->toArray())); } public function testDebugInfo() { $periodClass = static::$periodClass; $dateClass = $periodClass === CarbonPeriodImmutable::class ? CarbonImmutable::class : Carbon::class; $period = $periodClass::create('2018-05-13 12:00 Asia/Kabul', 'PT1H', 3); $expected = [ 'dateClass' => $dateClass, 'dateInterval' => CarbonInterval::hour()->optimize(), 'filters' => [ [ $periodClass::RECURRENCES_FILTER, null, ], ], 'startDate' => $dateClass::parse('2018-05-13 12:00 Asia/Kabul'), 'recurrences' => 3, ...($this->initialOptions ? ['options' => $this->initialOptions] : []), ]; $actual = $period->__debugInfo(); $actual = array_combine(array_map( static fn (string $key): string => preg_replace('/^\000\*\000/', '', $key), array_keys($actual), ), $actual); $interval = $actual['dateInterval'] ?? null; $interval?->optimize(); $this->assertEquals($expected, $actual); $period = $period->setRecurrences(5); $actual = $period->__debugInfo(); $this->assertSame(5, $actual['recurrences']); } } ================================================ FILE: tests/CarbonPeriod/ToDatePeriodTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\Translator; use DatePeriod; use DateTime; use DateTimeImmutable; use ReflectionMethod; use Tests\AbstractTestCase; class ToDatePeriodTest extends AbstractTestCase { public function testToArrayIsNotEmptyArray() { $periodClass = static::$periodClass; $period = $periodClass::create('2021-01-05', '2021-02-15'); $result = $period->toDatePeriod(); $this->assertFalse($period->isEndExcluded()); $this->assertSame(DatePeriod::class, \get_class($result)); $this->assertSame('2021-01-05', $result->getStartDate()->format('Y-m-d')); $this->assertSame('2021-02-15', $result->getEndDate()->format('Y-m-d')); // CarbonPeriod includes end date by default while DatePeriod will always exclude it $dates = iterator_to_array($result); $this->assertSame('2021-02-14', end($dates)->format('Y-m-d')); $this->assertTrue($period->equalTo($periodClass::instance($result))); $period = $periodClass::create('2021-01-05', '2021-02-15', $periodClass::EXCLUDE_END_DATE); $result = $period->toDatePeriod(); $newInstance = $periodClass::instance($result); $this->assertTrue($period->isEndExcluded()); $this->assertSame(DatePeriod::class, \get_class($result)); $this->assertSame('2021-01-05', $result->getStartDate()->format('Y-m-d')); $this->assertSame('2021-02-14', $result->getEndDate()->format('Y-m-d')); $dates = iterator_to_array($result); $this->assertSame('2021-02-13', end($dates)->format('Y-m-d')); $this->assertSame('2021-01-05', $newInstance->getStartDate()->format('Y-m-d')); $this->assertSame('2021-02-14', $newInstance->getEndDate()->format('Y-m-d')); $period = $periodClass::create('2021-01-05', 3); $result = $period->toDatePeriod(); $newInstance = $periodClass::instance($result); $this->assertSame(DatePeriod::class, \get_class($result)); $this->assertSame('2021-01-05', $result->getStartDate()->format('Y-m-d')); $this->assertNull($result->getEndDate()); $dates = iterator_to_array($result); $this->assertSame('2021-01-08', end($dates)->format('Y-m-d')); $this->assertSame('2021-01-05', $newInstance->getStartDate()->format('Y-m-d')); $this->assertSame(3, $newInstance->getRecurrences()); } public function testWithIntervalLocalized() { CarbonInterval::setLocale('fr'); $periodClass = static::$periodClass; $period = $periodClass::create('2021-01-05', 3); $result = $period->floor()->toDatePeriod(); $this->assertSame(DatePeriod::class, \get_class($result)); $this->assertSame('2021-01-05', $result->getStartDate()->format('Y-m-d')); $this->assertNull($result->getEndDate()); if (method_exists($result, 'getRecurrences')) { $this->assertSame(3, $result->getRecurrences()); } CarbonInterval::setLocale('en'); } public function testWithModifiedEnglish() { $periodClass = static::$periodClass; $translator = Translator::get('en'); $translator->setTranslations([ 'day' => ':count boring day|:count boring days', ]); $period = $periodClass::create('2021-01-05', 3); $result = $period->floor()->toDatePeriod(); $this->assertSame(DatePeriod::class, \get_class($result)); $this->assertSame('2021-01-05', $result->getStartDate()->format('Y-m-d')); $this->assertNull($result->getEndDate()); if (method_exists($result, 'getRecurrences')) { $this->assertSame(3, $result->getRecurrences()); } $translator->resetMessages(); } public function testRawDate() { $periodClass = static::$periodClass; $period = new $periodClass(); $method = new ReflectionMethod($periodClass, 'rawDate'); $this->assertNull($method->invoke($period, false)); $this->assertNull($method->invoke($period, null)); $date = new DateTime(); $this->assertSame($date, $method->invoke($period, $date)); $date = new DateTimeImmutable(); $this->assertSame($date, $method->invoke($period, $date)); $date = new Carbon(); $raw = $method->invoke($period, $date); $this->assertInstanceOf(DateTime::class, $raw); $this->assertEquals($date, $raw); $date = new CarbonImmutable(); $raw = $method->invoke($period, $date); $this->assertInstanceOf(DateTimeImmutable::class, $raw); $this->assertEquals($date, $raw); $date = new class() extends DateTime { // void }; $raw = $method->invoke($period, $date); $this->assertInstanceOf(DateTime::class, $raw); $this->assertEquals($date, $raw); $date = new class() extends DateTimeImmutable { // void }; $raw = $method->invoke($period, $date); $this->assertInstanceOf(DateTimeImmutable::class, $raw); $this->assertEquals($date, $raw); } } ================================================ FILE: tests/CarbonPeriod/ToStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriod; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCase; class ToStringTest extends AbstractTestCase { #[DataProvider('dataForToString')] public function testToString($period, $expected) { Carbon::setLocale('en'); Carbon::setTestNowAndTimezone(new Carbon('2015-09-01', 'America/Toronto')); $this->assertSame( $expected, $period->toString(), ); } public static function dataForToString(): array { $periodClass = static::$periodClass; Carbon::setTestNowAndTimezone(new Carbon('2015-09-01', 'America/Toronto')); $set = [ [ $periodClass::create('R4/2012-07-01T12:00:00/P7D'), '4 times every 1 week from 2012-07-01 12:00:00', ], [ $periodClass::create( Carbon::parse('2015-09-30'), Carbon::parse('2015-10-03'), ), 'Every 1 day from 2015-09-30 to 2015-10-03', ], [ $periodClass::create( Carbon::parse('2015-09-30 12:50'), CarbonInterval::days(3)->hours(5), Carbon::parse('2015-10-03 19:00'), ), 'Every 3 days and 5 hours from 2015-09-30 12:50:00 to 2015-10-03 19:00:00', ], [ $periodClass::create('2015-09-30 17:30'), 'Every 1 day from 2015-09-30 17:30:00', ], [ $periodClass::create('P1M14D'), 'Every 1 month and 2 weeks from 2015-09-01', ], [ $periodClass::create('2015-09-30 13:30', 'P17D')->setRecurrences(1), 'Once every 2 weeks and 3 days from 2015-09-30 13:30:00', ], [ $periodClass::create('2015-10-01', '2015-10-05', 'PT30M'), 'Every 30 minutes from 2015-10-01 to 2015-10-05', ], ]; Carbon::setTestNowAndTimezone(); return array_combine( array_column($set, 1), $set, ); } public function testMagicToString() { $periodClass = static::$periodClass; $period = $periodClass::create( Carbon::parse('2015-09-30 12:50'), CarbonInterval::days(3)->hours(5), Carbon::parse('2015-10-03 19:00'), ); $this->assertSame( 'Every 3 days and 5 hours from 2015-09-30 12:50:00 to 2015-10-03 19:00:00', (string) $period, ); } #[DataProvider('dataForToIso8601String')] public function testToIso8601String($period, $expected) { Carbon::setTestNowAndTimezone(new Carbon('2015-09-01', 'America/Toronto')); $this->assertSame( $expected, $period->toIso8601String(), ); } public static function dataForToIso8601String(): array { $periodClass = static::$periodClass; Carbon::setTestNowAndTimezone(new Carbon('2015-09-01', 'America/Toronto')); $set = [ [ $periodClass::create('R4/2012-07-01T00:00:00-04:00/P7D'), 'R4/2012-07-01T00:00:00-04:00/P7D', ], [ $periodClass::create( Carbon::parse('2015-09-30', 'America/Toronto'), CarbonInterval::day(), Carbon::parse('2015-10-03', 'America/Toronto'), ), '2015-09-30T00:00:00-04:00/P1D/2015-10-03T00:00:00-04:00', ], [ $periodClass::createFromIso( '2015-09-30T00:00:00-04:00/P1D/2015-10-03T00:00:00-04:00' ), '2015-09-30T00:00:00-04:00/P1D/2015-10-03T00:00:00-04:00', ], [ $periodClass::createFromIso( '2015-09-30T00:00:00-04:00/2015-10-03T00:00:00-04:00', ), '2015-09-30T00:00:00-04:00/2015-10-03T00:00:00-04:00', ], [ $periodClass::create( Carbon::parse('2015-09-30', 'America/Toronto'), Carbon::parse('2015-10-03', 'America/Toronto'), ), '2015-09-30T00:00:00-04:00/2015-10-03T00:00:00-04:00', ], [ $periodClass::create( Carbon::parse('2015-09-30', 'America/Toronto'), CarbonInterval::day(), Carbon::parse('2015-10-03', 'America/Toronto'), )->resetDateInterval(), '2015-09-30T00:00:00-04:00/2015-10-03T00:00:00-04:00', ], [ $periodClass::create( Carbon::parse('2015-09-30 12:50', 'America/Toronto'), CarbonInterval::days(3)->hours(5), Carbon::parse('2015-10-03 19:00', 'America/Toronto'), ), '2015-09-30T12:50:00-04:00/P3DT5H/2015-10-03T19:00:00-04:00', ], [ $periodClass::create( Carbon::parse('2015-09-30 12:50', 'America/Toronto'), CarbonInterval::days(3), ), '2015-09-30T12:50:00-04:00/P3D', ], [ $periodClass::create('1 day'), '2015-09-01T00:00:00-04:00/P1D', ], [ $periodClass::create(), '2015-09-01T00:00:00-04:00', ], ]; Carbon::setTestNowAndTimezone(); return array_combine( array_column($set, 1), $set, ); } public function testSpec() { $periodClass = static::$periodClass; $period = $periodClass::create( Carbon::parse('2015-09-30'), CarbonInterval::days(3)->hours(5), Carbon::parse('2015-10-03'), ); $this->assertSame( '2015-09-30T00:00:00-04:00/P3DT5H/2015-10-03T00:00:00-04:00', $period->spec(), ); } public function testStartOfWeekForPeriod() { $periodClass = static::$periodClass; $sunday = CarbonImmutable::parse('2019-12-01'); $period = $periodClass::create($sunday->startOfWeek(), '1 week', $sunday->endOfWeek())->toArray(); $formattedSunday = $sunday->startOfWeek()->format('Y-m-d H:i:s'); $this->assertSame( '2019-11-25 00:00:00', $formattedSunday, ); $this->assertSame( $formattedSunday, $period[0]->toImmutable()->startOfWeek()->format('Y-m-d H:i:s'), ); } public function testToStringCustomization() { $periodClass = static::$periodClass; $sunday = CarbonImmutable::parse('2019-12-01'); $period = $periodClass::create($sunday->startOfWeek(), '1 week', $sunday->endOfWeek()); $this->assertSame( 'Every 1 week from 2019-11-25 00:00:00 to 2019-12-01 23:59:59!!', $period.'!!' ); $periodClass::setToStringFormat('m/d'); $this->assertSame( 'Every 1 week from 11/25 to 12/01!!', $period.'!!' ); $period->settings(['toStringFormat' => static function (CarbonPeriod $period) { return $period->toIso8601String(); }]); $this->assertSame( '2019-11-25T00:00:00-05:00/P7D/2019-12-01T23:59:59-05:00!!', $period.'!!' ); $periodClass::resetToStringFormat(); } } ================================================ FILE: tests/CarbonPeriodImmutable/AliasTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class AliasTest extends \Tests\CarbonPeriod\AliasTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/CloneTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class CloneTest extends \Tests\CarbonPeriod\CloneTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/ComparisonTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class ComparisonTest extends \Tests\CarbonPeriod\ComparisonTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/CreateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class CreateTest extends \Tests\CarbonPeriod\CreateTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/DynamicIntervalTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class DynamicIntervalTest extends \Tests\CarbonPeriod\DynamicIntervalTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/FilterTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class FilterTest extends \Tests\CarbonPeriod\FilterTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/GettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class GettersTest extends \Tests\CarbonPeriod\GettersTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/IterationMethodsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class IterationMethodsTest extends \Tests\CarbonPeriod\IterationMethodsTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/IteratorTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class IteratorTest extends \Tests\CarbonPeriod\IteratorTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/MacroTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class MacroTest extends \Tests\CarbonPeriod\MacroTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/RoundingTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class RoundingTest extends \Tests\CarbonPeriod\RoundingTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/SettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class SettersTest extends \Tests\CarbonPeriod\SettersTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/StrictModeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class StrictModeTest extends \Tests\CarbonPeriod\StrictModeTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/ToArrayTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class ToArrayTest extends \Tests\CarbonPeriod\ToArrayTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/ToDatePeriodTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class ToDatePeriodTest extends \Tests\CarbonPeriod\ToDatePeriodTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonPeriodImmutable/ToStringTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonPeriodImmutable; use Carbon\CarbonPeriodImmutable; class ToStringTest extends \Tests\CarbonPeriod\ToStringTest { protected static string $periodClass = CarbonPeriodImmutable::class; } ================================================ FILE: tests/CarbonTimeZone/ConversionsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonTimeZone; use Carbon\Carbon; use Carbon\CarbonTimeZone; use DateTimeZone; use Generator; use InvalidArgumentException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Medium; use stdClass; use Tests\AbstractTestCaseWithOldNow; #[Medium] class ConversionsTest extends AbstractTestCaseWithOldNow { public function testToString() { $this->assertSame('+06:00', (string) (new CarbonTimeZone(6))); $this->assertSame('Europe/Paris', (string) (new CarbonTimeZone('Europe/Paris'))); } public function testToRegionName() { $this->assertSame('America/Chicago', (new CarbonTimeZone(-5))->toRegionName()); $this->assertSame('America/Toronto', (new CarbonTimeZone('America/Toronto'))->toRegionName()); $this->assertSame('America/New_York', (new CarbonTimeZone('America/Toronto'))->toOffsetTimeZone()->toRegionName()); $this->assertNull((new CarbonTimeZone(-15))->toRegionName()); $date = Carbon::parse('2018-12-20'); $this->assertSame('America/Chicago', (new CarbonTimeZone('America/Toronto'))->toOffsetTimeZone($date)->toRegionName($date)); $date = Carbon::parse('2020-06-11T12:30:00-02:30'); $this->assertSame('America/St_Johns', $date->getTimezone()->toRegionName($date)); } public function testToRegionTimeZone() { $this->assertSame('America/Chicago', (new CarbonTimeZone(-5))->toRegionTimeZone()->getName()); $this->assertSame('America/Toronto', (new CarbonTimeZone('America/Toronto'))->toRegionTimeZone()->getName()); $this->assertSame('America/New_York', (new CarbonTimeZone('America/Toronto'))->toOffsetTimeZone()->toRegionTimeZone()->getName()); $date = Carbon::parse('2018-12-20'); $this->assertSame('America/Chicago', (new CarbonTimeZone('America/Toronto'))->toOffsetTimeZone($date)->toRegionTimeZone($date)->getName()); } public static function dataForToOffsetName(): Generator { // timezone - number yield ['2018-12-20', '-05:00', -5]; yield ['2018-06-20', '-05:00', -5]; // timezone - use offset yield ['2018-12-20', '-05:00', '-05:00']; yield ['2018-06-20', '-05:00', '-05:00']; // timezone - by name - with daylight time yield ['2018-12-20', '-05:00', 'America/Toronto']; yield ['2018-06-20', '-04:00', 'America/Toronto']; // timezone - by name - without daylight time yield ['2018-12-20', '+03:00', 'Asia/Baghdad']; yield ['2018-06-20', '+03:00', 'Asia/Baghdad']; // timezone - no full hour - the same time yield ['2018-12-20', '-09:30', 'Pacific/Marquesas']; yield ['2018-06-20', '-09:30', 'Pacific/Marquesas']; // timezone - no full hour - yield ['2018-12-20', '-03:30', 'America/St_Johns']; yield ['2018-06-20', '-02:30', 'America/St_Johns']; // timezone - no full hour + yield ['2018-12-20', '+13:45', 'Pacific/Chatham']; yield ['2018-06-20', '+12:45', 'Pacific/Chatham']; // timezone - UTC yield ['2018-12-20', '+00:00', 'UTC']; yield ['2018-06-20', '+00:00', 'UTC']; } #[DataProvider('dataForToOffsetName')] public function testToOffsetName(string $date, string $expectedOffset, string|int $timezone) { Carbon::setTestNow(Carbon::parse($date)); $offset = (new CarbonTimeZone($timezone))->toOffsetName(); $this->assertSame($expectedOffset, $offset); } #[DataProvider('dataForToOffsetName')] public function testToOffsetNameDateAsParam(string $date, string $expectedOffset, string|int $timezone) { $offset = (new CarbonTimeZone($timezone))->toOffsetName(Carbon::parse($date)); $this->assertSame($expectedOffset, $offset); } public function testToOffsetNameFromDifferentCreationMethods() { $summer = Carbon::parse('2020-06-15'); $winter = Carbon::parse('2018-12-20'); $this->assertSame('+02:00', (new CarbonTimeZone('Europe/Paris'))->toOffsetName()); $this->assertSame('+05:30', $this->firstValidTimezoneAmong(['Asia/Kolkata', 'Asia/Calcutta'])->toOffsetName()); $this->assertSame('+13:45', CarbonTimeZone::create('Pacific/Chatham')->toOffsetName($winter)); $this->assertSame('+12:00', CarbonTimeZone::create('Pacific/Auckland')->toOffsetName($summer)); $this->assertSame('-05:15', CarbonTimeZone::createFromHourOffset(-5.25)->toOffsetName()); $this->assertSame('-02:30', CarbonTimeZone::createFromMinuteOffset(-150)->toOffsetName()); $this->assertSame('-08:45', CarbonTimeZone::create('-8:45')->toOffsetName()); $this->assertSame('-09:30', CarbonTimeZone::create('Pacific/Marquesas')->toOffsetName()); } public function testCast() { $tz = (new CarbonTimeZone('America/Toronto'))->cast(DateTimeZone::class); $this->assertSame(DateTimeZone::class, \get_class($tz)); $this->assertSame('America/Toronto', $tz->getName()); $obj = new class('UTC') extends CarbonTimeZone { }; $class = \get_class($obj); $tz = (new CarbonTimeZone('America/Toronto'))->cast($class); $this->assertSame($class, \get_class($tz)); $this->assertSame('America/Toronto', $tz->getName()); } public function testCastException() { $this->expectExceptionObject(new InvalidArgumentException( 'stdClass has not the instance() method needed to cast the date.', )); (new CarbonTimeZone('America/Toronto'))->cast(stdClass::class); } public function testInvalidRegionForOffset() { Carbon::useStrictMode(false); $this->assertNull((new CarbonTimeZone(-15))->toRegionTimeZone()); } public function testInvalidRegionForOffsetInStrictMode() { $this->expectExceptionObject(new InvalidArgumentException( 'Unknown timezone for offset -54000 seconds.', )); (new CarbonTimeZone(-15))->toRegionTimeZone(); } } ================================================ FILE: tests/CarbonTimeZone/CreateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonTimeZone; use Carbon\CarbonTimeZone; use Carbon\Exceptions\InvalidTimeZoneException; use DateTimeZone; use Tests\AbstractTestCase; use Tests\CarbonTimeZone\Fixtures\UnknownZone; class CreateTest extends AbstractTestCase { public function testCreate() { $tz = new CarbonTimeZone(6); $this->assertInstanceOf(CarbonTimeZone::class, $tz); $this->assertInstanceOf(DateTimeZone::class, $tz); $this->assertSame('+06:00', $tz->getName()); $tz = CarbonTimeZone::create(6); $this->assertSame('+06:00', $tz->getName()); $tz = CarbonTimeZone::create('+01'); $this->assertSame('+01:00', $tz->getName()); $tz = new CarbonTimeZone('+01'); $this->assertSame('+01:00', $tz->getName()); $tz = CarbonTimeZone::create('-01'); $this->assertSame('-01:00', $tz->getName()); $tz = new CarbonTimeZone('-01'); $this->assertSame('-01:00', $tz->getName()); } public function testInstance() { $tz = new CarbonTimeZone('UTC'); $this->assertSame($tz, CarbonTimeZone::instance($tz)); } public function testUnknown() { $tz = new UnknownZone('UTC'); $this->assertSame('unknown', $tz->getAbbreviatedName()); } public function testSafeCreateDateTimeZoneWithoutStrictMode() { $this->expectExceptionObject(new InvalidTimeZoneException( 'Absolute timezone offset cannot be greater than 99.', )); new CarbonTimeZone(-15e15); } } ================================================ FILE: tests/CarbonTimeZone/Fixtures/UnknownZone.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonTimeZone\Fixtures; use Carbon\CarbonTimeZone; use ReturnTypeWillChange; class UnknownZone extends CarbonTimeZone { #[ReturnTypeWillChange] public function getName() { return 'foobar'; } } ================================================ FILE: tests/CarbonTimeZone/GettersTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CarbonTimeZone; use Carbon\CarbonTimeZone; use Carbon\FactoryImmutable; use DateTimeImmutable; use Tests\AbstractTestCase; class GettersTest extends AbstractTestCase { public function testGetAbbr(): void { $tz = new CarbonTimeZone('Europe/London'); $this->assertSame('BST', $tz->getAbbr(true)); $this->assertSame('GMT', $tz->getAbbr(false)); } public function testGetAbbreviatedName(): void { $tz = new CarbonTimeZone('Europe/London'); $this->assertSame('BST', $tz->getAbbreviatedName(true)); $this->assertSame('GMT', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Europe/Athens'); $this->assertSame('EEST', $tz->getAbbreviatedName(true)); $this->assertSame('EET', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Pacific/Auckland'); $this->assertSame('NZST', $tz->getAbbreviatedName(true)); $this->assertSame('NZMT', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('America/Toronto'); $this->assertSame('EDT', $tz->getAbbreviatedName(true)); $this->assertSame('EST', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Arctic/Longyearbyen'); $this->assertSame('CEST', $tz->getAbbreviatedName(true)); $this->assertSame('CET', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Atlantic/Faroe'); $this->assertSame('WEST', $tz->getAbbreviatedName(true)); $this->assertSame('WET', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Africa/Ceuta'); $this->assertSame('CEST', $tz->getAbbreviatedName(true)); $this->assertSame('CET', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Canada/Yukon'); $this->assertSame('PDT', $tz->getAbbreviatedName(true)); $this->assertSame('PST', $tz->getAbbreviatedName(false)); $tz = CarbonTimeZone::create('Asia/Pontianak'); $this->assertSame('unknown', $tz->getAbbreviatedName(true)); $this->assertSame('WIB', $tz->getAbbreviatedName(false)); } public function testToRegionName(): void { $summer = new DateTimeImmutable('2024-08-19 12:00 UTC'); $tz = new CarbonTimeZone('Europe/London'); $this->assertSame('Europe/London', $tz->toRegionName($summer)); $tz = new CarbonTimeZone('+05:00'); $this->assertSame('Antarctica/Mawson', $tz->toRegionName($summer)); $tz = new CarbonTimeZone('+05:00'); $this->assertSame('Antarctica/Mawson', $tz->toRegionName($summer)); $factory = new FactoryImmutable(); $factory->setTestNowAndTimezone('2024-01-19 12:00 UTC'); $this->assertSame('-06:00', $factory->now('America/Chicago')->getTimezone()->toOffsetName()); // The 2 assertions below are the current behavior // but it's questionable, as current time is in winter, -6 should give Chicago // @TODO Check this deeper $this->assertSame('America/Chicago', $factory->now('-05:00')->getTimezone()->toRegionName()); $this->assertSame('America/Denver', $factory->now('-06:00')->getTimezone()->toRegionName()); $factory->setTestNowAndTimezone('2024-08-19 12:00 UTC'); $this->assertSame('-05:00', $factory->now('America/Chicago')->getTimezone()->toOffsetName()); $this->assertSame('America/Chicago', $factory->now('-05:00')->getTimezone()->toRegionName()); } } ================================================ FILE: tests/Cli/Cli.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; class Cli { public static $lastParameters = []; public function __invoke(...$parameters) { static::$lastParameters = $parameters; return true; } } ================================================ FILE: tests/Cli/InvokerTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Cli; use Carbon\Cli; use Carbon\Cli\Invoker; use Tests\AbstractTestCase; class InvokerTest extends AbstractTestCase { public function testInvoke() { $invoker = new Invoker(); $lastCommand = null; $exec = function ($command) use (&$lastCommand) { $lastCommand = $command; }; ob_start(); $return = $invoker('file', 'install', $exec); $contents = ob_get_contents(); ob_end_clean(); $this->assertSame('composer require carbon-cli/carbon-cli --no-interaction', $lastCommand); $this->assertSame('Installation succeeded.', $contents); $this->assertTrue($return); include_once __DIR__.'/Cli.php'; $invoker = new Invoker(); $lastCommand = null; ob_start(); $return = $invoker('file', 'install', $exec); $contents = ob_get_contents(); ob_end_clean(); $this->assertNull($lastCommand); $this->assertSame('', $contents); $this->assertTrue($return); $this->assertSame(['file', 'install', $exec], Cli::$lastParameters); } } ================================================ FILE: tests/CommonTraits/MacroContextNestingTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\CommonTraits; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use PHPUnit\Framework\Attributes\DataProvider; use Tests\AbstractTestCaseWithOldNow; class MacroContextNestingTest extends AbstractTestCaseWithOldNow { public static function dataForMacroableClassesWithReference(): array { return [ [Carbon::class, Carbon::parse('2010-05-23'), null], [CarbonImmutable::class, CarbonImmutable::parse('2010-05-23'), null], [CarbonInterval::class, CarbonInterval::make('P1M6D'), (string) (CarbonInterval::seconds(0))], [CarbonPeriod::class, CarbonPeriod::create('2010-08-23', '2010-10-02'), null], ]; } public static function dataForMacroableClasses(): array { return array_map( static fn (array $arguments) => \array_slice($arguments, 0, 2), self::dataForMacroableClassesWithReference(), ); } #[DataProvider('dataForMacroableClassesWithReference')] public function testMacroContextNesting(string $class, mixed $sample, ?string $reference): void { $macro1 = 'macro'.(mt_rand(100, 999999) * 2); $class::macro($macro1, static function () { return self::this()->__toString(); }); $macro2 = 'macro'.(mt_rand(100, 999999) * 2 + 1); $class::macro($macro2, static function () use ($macro1, $sample) { $dates = [self::this()->$macro1()]; $dates[] = $sample->$macro1(); $dates[] = self::this()->$macro1(); return $dates; }); $dates = $class::$macro2(); $this->assertSame([ $reference ?: (string) (new $class()), (string) $sample, $reference ?: (string) (new $class()), ], $dates); } /** * @param class-string $class */ #[DataProvider('dataForMacroableClasses')] public function testMacroContextDetectionNesting(string $class, mixed $sample) { $macro1 = 'macro'.(mt_rand(100, 999999) * 2); $class::macro($macro1, static function () { $context = self::context(); return $context ? \get_class($context) : 'null'; }); $macro2 = 'macro'.(mt_rand(100, 999999) * 2 + 1); $class::macro($macro2, static function () use ($macro1, $sample) { $dump = [self::$macro1(), self::this()->$macro1()]; $dump[] = $sample->$macro1(); $dump[] = self::$macro1(); return $dump; }); $dump = $class::$macro2(); $this->assertSame([ 'null', $class, $class, 'null', ], $dump); } } ================================================ FILE: tests/Doctrine/CarbonTypesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Doctrine; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\Doctrine\CarbonImmutableType; use Carbon\Doctrine\CarbonType; use Carbon\Doctrine\CarbonTypeConverter; use Carbon\Doctrine\DateTimeDefaultPrecision; use Carbon\Doctrine\DateTimeImmutableType; use Carbon\Doctrine\DateTimeType; use DateTimeImmutable; use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Platforms\DB2Platform; use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Types\ConversionException; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use Tests\AbstractTestCase; use Tests\Fixtures\CarbonTypeCase; class CarbonTypesTest extends AbstractTestCase { private static ?array $types = null; public static function setUpBeforeClass(): void { foreach (static::dataForTypes() as [$case]) { $case->initialize(); } } public static function dataForTypes(): array { return self::$types ??= self::generateDataForTypes(); } #[Group('doctrine')] #[DataProvider('dataForTypes')] public function testGetSQLDeclaration(CarbonTypeCase $case): void { $type = $case->getType(); $adaptPrecisionToPlatform = method_exists(CarbonTypeConverter::class, 'getMaximumPrecision'); $precision = DateTimeDefaultPrecision::get(); $this->assertSame(6, $precision); $supportZeroPrecision = self::supportsZeroPrecision(); $this->assertSame('DATETIME', $type->getSQLDeclaration($supportZeroPrecision ? [ 'precision' => 0, ] : [ 'precision' => null, 'secondPrecision' => true, ], $this->getMySQLPlatform())); $this->assertSame('DATETIME(3)', $type->getSQLDeclaration([ 'precision' => 3, ], $this->getMySQLPlatform())); $this->assertSame('TIMESTAMP(0)', $type->getSQLDeclaration($supportZeroPrecision ? [ 'precision' => 0, ] : [ 'precision' => null, 'secondPrecision' => true, ], new DB2Platform())); $this->assertSame('TIMESTAMP(6)', $type->getSQLDeclaration([ 'precision' => null, ], new DB2Platform())); $this->assertSame('TIMESTAMP(6)', $type->getSQLDeclaration($supportZeroPrecision ? [ 'precision' => null, ] : [ 'precision' => 0, ], new DB2Platform())); $this->assertSame('DATETIME(6)', $type->getSQLDeclaration($supportZeroPrecision ? [ 'precision' => null, ] : [ 'precision' => 0, ], $this->getMySQLPlatform())); $this->assertSame('DATETIME(6)', $type->getSQLDeclaration([ 'precision' => null, ], $this->getMySQLPlatform())); DateTimeDefaultPrecision::set(4); $this->assertSame('DATETIME(4)', $type->getSQLDeclaration([ 'precision' => null, ], $this->getMySQLPlatform())); DateTimeDefaultPrecision::set(9); $this->assertSame($adaptPrecisionToPlatform ? 'DATETIME(6)' : 'DATETIME(9)', $type->getSQLDeclaration([ 'precision' => null, ], $this->getMySQLPlatform())); DateTimeDefaultPrecision::set(0); $this->assertSame('DATETIME', $type->getSQLDeclaration([ 'precision' => null, ], $this->getMySQLPlatform())); DateTimeDefaultPrecision::set($precision); } #[Group('doctrine')] #[DataProvider('dataForTypes')] public function testConvertToPHPValue(CarbonTypeCase $case): void { $type = $case->getType(); $this->assertNull($type->convertToPHPValue(null, $this->getMySQLPlatform())); $date = $type->convertToPHPValue(Carbon::parse('2020-06-23 18:47'), $this->getMySQLPlatform()); $this->assertInstanceOf($case->class, $date); $this->assertSame('2020-06-23 18:47:00.000000', $date->format('Y-m-d H:i:s.u')); $date = $type->convertToPHPValue(new DateTimeImmutable('2020-06-23 18:47'), $this->getMySQLPlatform()); $this->assertInstanceOf($case->class, $date); $this->assertSame('2020-06-23 18:47:00.000000', $date->format('Y-m-d H:i:s.u')); $date = $type->convertToPHPValue('2020-06-23 18:47', $this->getMySQLPlatform()); $this->assertInstanceOf($case->class, $date); $this->assertSame('2020-06-23 18:47:00.000000', $date->format('Y-m-d H:i:s.u')); } #[Group('doctrine')] #[DataProvider('dataForTypes')] public function testConvertToPHPValueFailure(CarbonTypeCase $case): void { $conversion = version_compare(self::getDbalVersion(), '4.0.0', '>=') ? "to \"$case->typeClass\" as an error was triggered by the unserialization: " : "\"2020-0776-23 18:47\" to Doctrine Type $case->name. Expected format: "; $this->expectExceptionObject(new ConversionException( 'Could not convert database value '.$conversion. "Y-m-d H:i:s.u or any format supported by $case->class::parse()", )); $case->getType()->convertToPHPValue('2020-0776-23 18:47', $this->getMySQLPlatform()); } #[Group('doctrine')] #[DataProvider('dataForTypes')] public function testConvertToDatabaseValue(CarbonTypeCase $case): void { $type = $case->getType(); $this->assertNull($type->convertToDatabaseValue(null, $this->getMySQLPlatform())); $this->assertSame( '2020-06-23 18:47:00.000000', $type->convertToDatabaseValue(new DateTimeImmutable('2020-06-23 18:47'), $this->getMySQLPlatform()), ); } #[Group('doctrine')] #[DataProvider('dataForTypes')] public function testConvertToDatabaseValueFailure(CarbonTypeCase $case): void { $quote = class_exists('Doctrine\\DBAL\\Version') ? "'" : ''; $conversion = version_compare(self::getDbalVersion(), '4.0.0', '>=') ? "array to type $case->typeClass. " : "{$quote}array{$quote} to type {$quote}$case->name{$quote}. "; $this->expectExceptionObject(new ConversionException( 'Could not convert PHP value of type '.$conversion. 'Expected one of the following types: null, DateTime, Carbon', )); $case->getType()->convertToDatabaseValue([2020, 06, 23], $this->getMySQLPlatform()); } #[Group('doctrine')] #[DataProvider('dataForTypes')] public function testRequiresSQLCommentHint(CarbonTypeCase $case): void { if (version_compare(self::getDbalVersion(), '4.0.0', '>=')) { $this->markTestSkipped('requiresSQLCommentHint dropped since DBAL 4'); } $this->assertSame( $case->hintRequired, $case->getType()->requiresSQLCommentHint($this->getMySQLPlatform()), ); } private static function getDbalVersion(): string { static $dbalVersion = null; if ($dbalVersion === null) { $installed = require __DIR__.'/../../vendor/composer/installed.php'; $dbalVersion = $installed['versions']['doctrine/dbal']['version'] ?? '2.0.0'; } return $dbalVersion; } private static function supportsZeroPrecision(): bool { return version_compare(self::getDbalVersion(), '3.7.0', '>='); } private function getMySQLPlatform(): AbstractMySQLPlatform { return class_exists(MySQLPlatform::class) ? new MySQLPlatform() : new MySQL57Platform(); } private static function generateDataForTypes(): array { $supportZeroPrecision = self::supportsZeroPrecision(); $types = [ [new CarbonTypeCase($supportZeroPrecision ? 'date_time' : 'datetime', Carbon::class, DateTimeType::class, false)], [new CarbonTypeCase($supportZeroPrecision ? 'date_time_immutable' : 'datetime_immutable', CarbonImmutable::class, DateTimeImmutableType::class, true)], [new CarbonTypeCase('carbon', Carbon::class, CarbonType::class, !$supportZeroPrecision)], [new CarbonTypeCase('carbon_immutable', CarbonImmutable::class, CarbonImmutableType::class, true)], ]; return array_combine(array_column($types, 0), $types); } } ================================================ FILE: tests/Factory/CallbackTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Factory; use Carbon\Callback; use Carbon\CarbonInterface; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\CarbonTimeZone; use DateInterval; use DatePeriod; use DateTimeImmutable; use DateTimeZone; use Tests\AbstractTestCase; class CallbackTest extends AbstractTestCase { public function testGetReflectionFunction(): void { $closure = static fn () => 4; $callback = Callback::fromClosure($closure); $function = $callback->getReflectionFunction(); $this->assertSame($function, $callback->getReflectionFunction()); $this->assertSame($closure, $function->getClosure()); } public function testCall(): void { $closure = static function (CarbonInterface $date, CarbonInterval $interval, string $text, ?CarbonTimeZone $timezone, CarbonPeriod $period): string { return implode(', ', [$text, $date->monthName, $interval->seconds, $timezone?->getName(), $period->getRecurrences()]); }; $callback = Callback::fromClosure($closure); $result = $callback->call( new DateTimeImmutable('2024-01-18'), new DateInterval('PT1M30S'), 'foo', new DateTimeZone('CET'), new DatePeriod( new DateTimeImmutable('2012-07-01T00:00:00'), new DateInterval('P1D'), 7, ), ); $this->assertSame('foo, January, 30, CET, 7', $result); $result = $callback->call( interval: new DateInterval('PT1M21S'), date: new DateTimeImmutable('2024-02-18'), period: new DatePeriod( new DateTimeImmutable('2012-07-01T00:00:00'), new DateInterval('P1D'), 4, ), timezone: null, text: 'bar', ); $this->assertSame('bar, February, 21, , 4', $result); } public function testParameter(): void { $closure = static function (CarbonInterface $date, CarbonInterval $interval, string $text, ?CarbonTimeZone $timezone, CarbonPeriod $period): string { return implode(', ', [$text, $date->monthName, $interval->seconds, $timezone?->getName(), $period->getRecurrences()]); }; $interval = new DateInterval('P1D'); $this->assertSame($interval, Callback::parameter($closure, $interval)); $this->assertSame($interval, Callback::parameter($closure, $interval, 0)); $this->assertSame($interval, Callback::parameter($closure, $interval, 5)); $this->assertSame($interval, Callback::parameter($closure, $interval, 'diff')); $this->assertSame($interval, Callback::parameter($closure, $interval, 'date')); $this->assertSame($interval, Callback::parameter($interval, $interval, 1)); $this->assertSame($interval, Callback::parameter(static fn (FooBar $foo) => 42, $interval)); $result = Callback::parameter($closure, $interval, 'interval'); $this->assertSame(CarbonInterval::class, $result::class); $this->assertSame('1 day', $result->forHumans()); $result = Callback::parameter($closure, $interval, 1); $this->assertSame(CarbonInterval::class, $result::class); $this->assertSame('1 day', $result->forHumans()); } } ================================================ FILE: tests/Factory/FactoryTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Factory; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; use Carbon\Factory; use Carbon\FactoryImmutable; use DateTimeImmutable; use Psr\Clock\ClockInterface; use ReflectionFunction; use RuntimeException; use Tests\AbstractTestCase; use Tests\Carbon\Fixtures\MyCarbon; class FactoryTest extends AbstractTestCase { public function testFactory() { $factory = new Factory(); $this->assertInstanceOf(Carbon::class, $factory->parse('2018-01-01')); $this->assertSame('01/01/2018', $factory->parse('2018-01-01')->format('d/m/Y')); $factory = new Factory([ 'locale' => 'fr', ]); $this->assertSame('fr', $factory->parse('2018-01-01')->locale); $factory = new Factory([ 'locale' => 'fr', ], MyCarbon::class); $this->assertInstanceOf(MyCarbon::class, $factory->parse('2018-01-01')); $this->assertSame('01/01/2018', $factory->parse('2018-01-01')->format('d/m/Y')); $factory = new FactoryImmutable([ 'locale' => 'fr', ]); $this->assertInstanceOf(CarbonImmutable::class, $factory->parse('2018-01-01')); $this->assertSame('01/01/2018', $factory->parse('2018-01-01')->format('d/m/Y')); } public function testFactoryModification() { $factory = new Factory(); $this->assertSame(Carbon::class, $factory->className()); $this->assertSame($factory, $factory->className(MyCarbon::class)); $this->assertSame(MyCarbon::class, $factory->className()); $this->assertSame([], $factory->settings()); $this->assertSame($factory, $factory->settings([ 'locale' => 'fr', ])); $this->assertSame([ 'locale' => 'fr', ], $factory->settings()); $this->assertSame($factory, $factory->mergeSettings([ 'timezone' => 'Europe/Paris', ])); $this->assertSame([ 'locale' => 'fr', 'timezone' => 'Europe/Paris', ], $factory->settings()); $this->assertSame($factory, $factory->settings([ 'timezone' => 'Europe/Paris', ])); $this->assertSame([ 'timezone' => 'Europe/Paris', ], $factory->settings()); } public function testFactoryTimezone() { Carbon::setTestNowAndTimezone(Carbon::parse('2020-09-04 03:39:04.123456', 'UTC')); $factory = new Factory(); $date = $factory->now(); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame('2020-09-04 03:39:04.123456 UTC', $date->format('Y-m-d H:i:s.u e')); $factory = new Factory([ 'timezone' => 'Europe/Paris', ]); $this->assertSame('2020-09-04 05:39:04.123456 Europe/Paris', $factory->now()->format('Y-m-d H:i:s.u e')); $this->assertSame('2020-09-04 00:00:00.000000 Europe/Paris', $factory->today()->format('Y-m-d H:i:s.u e')); $this->assertSame('2020-09-05 00:00:00.000000 Europe/Paris', $factory->tomorrow()->format('Y-m-d H:i:s.u e')); $this->assertSame('2020-09-04 09:39:04.123456 Europe/Paris', $factory->parse('2020-09-04 09:39:04.123456')->format('Y-m-d H:i:s.u e')); $factory = new Factory([ 'timezone' => 'America/Toronto', ]); $this->assertSame('2020-09-03 23:39:04.123456 America/Toronto', $factory->now()->format('Y-m-d H:i:s.u e')); $this->assertSame('2020-09-03 00:00:00.000000 America/Toronto', $factory->today()->format('Y-m-d H:i:s.u e')); $this->assertSame('2020-09-04 00:00:00.000000 America/Toronto', $factory->tomorrow()->format('Y-m-d H:i:s.u e')); $this->assertSame('2020-09-04 09:39:04.123456 America/Toronto', $factory->parse('2020-09-04 09:39:04.123456')->format('Y-m-d H:i:s.u e')); $factory = new Factory([ 'timezone' => 'Asia/Shanghai', ]); $baseDate = Carbon::parse('2021-08-01 08:00:00', 'UTC'); $date = $factory->createFromTimestamp($baseDate->getTimestamp()); $this->assertSame('2021-08-01T16:00:00+08:00', $date->format('c')); $date = $factory->make('2021-08-01 08:00:00'); $this->assertSame('2021-08-01T08:00:00+08:00', $date->format('c')); $date = $factory->make($baseDate); $this->assertSame('2021-08-01T16:00:00+08:00', $date->format('c')); $date = $factory->create($baseDate); $this->assertSame('2021-08-01T16:00:00+08:00', $date->format('c')); $date = $factory->parse($baseDate); $this->assertSame('2021-08-01T16:00:00+08:00', $date->format('c')); $date = $factory->instance($baseDate); $this->assertSame('2021-08-01T16:00:00+08:00', $date->format('c')); $date = $factory->make('2021-08-01 08:00:00+00:20'); $this->assertSame('2021-08-01T08:00:00+00:20', $date->format('c')); $date = $factory->parse('2021-08-01T08:00:00Z'); $this->assertSame('2021-08-01T08:00:00+00:00', $date->format('c')); $date = $factory->create('2021-08-01 08:00:00 UTC'); $this->assertSame('2021-08-01T08:00:00+00:00', $date->format('c')); $date = $factory->make('2021-08-01 08:00:00 Europe/Paris'); $this->assertSame('2021-08-01T08:00:00+02:00', $date->format('c')); } public function testPsrClock() { FactoryImmutable::setCurrentClock(null); FactoryImmutable::getDefaultInstance()->setTestNow(null); $initial = Carbon::now('UTC'); $factory = new FactoryImmutable(); $factory->setTestNow($initial); $this->assertInstanceOf(ClockInterface::class, $factory); $this->assertInstanceOf(DateTimeImmutable::class, $factory->now()); $this->assertInstanceOf(CarbonImmutable::class, $factory->now()); $this->assertSame('America/Toronto', $factory->now()->tzName); $this->assertSame('UTC', $factory->now('UTC')->tzName); $timezonedFactory = $factory->withTimeZone('Asia/Tokyo'); $this->assertInstanceOf(CarbonImmutable::class, $timezonedFactory->now()); $this->assertSame('Asia/Tokyo', $timezonedFactory->now()->tzName); $this->assertSame('America/Toronto', $timezonedFactory->now('America/Toronto')->tzName); $this->assertSame( $initial->format('Y-m-d H:i:s.u'), $factory->now('UTC')->format('Y-m-d H:i:s.u'), ); $before = microtime(true); $factory->sleep(5); $factory->sleep(20); $after = microtime(true); $this->assertLessThan(0.1, $after - $before); $this->assertSame( $initial->copy()->addSeconds(25)->format('Y-m-d H:i:s.u'), $factory->now('UTC')->format('Y-m-d H:i:s.u'), ); $factory = new FactoryImmutable(); $factory->setTestNow(null); $before = new DateTimeImmutable('now UTC'); $now = $factory->now('UTC'); $after = new DateTimeImmutable('now UTC'); $this->assertGreaterThanOrEqual($before, $now); $this->assertLessThanOrEqual($after, $now); $before = new DateTimeImmutable('now UTC'); $factory->sleep(0.5); $after = new DateTimeImmutable('now UTC'); $this->assertSame( 5, (int) round(10 * ((float) $after->format('U.u') - ((float) $before->format('U.u')))), ); } public function testIsolation(): void { CarbonImmutable::setTestNow('1990-07-31 23:59:59'); $libAFactory = new FactoryImmutable(); $libAFactory->setTestNow('2000-02-05 15:20:00'); $libBFactory = new FactoryImmutable(); $libBFactory->setTestNow('2050-12-01 00:00:00'); $this->assertSame('2000-02-05 15:20:00', (string) $libAFactory->now()); $this->assertSame('2050-12-01 00:00:00', (string) $libBFactory->now()); $this->assertSame('1990-07-31 23:59:59', (string) CarbonImmutable::now()); CarbonImmutable::setTestNow(); } public function testClosureMock(): void { $factory = new Factory(); $now = Carbon::parse('2024-01-18 00:00:00'); $factory->setTestNow(static fn () => $now); $result = $factory->now(); $this->assertNotSame($now, $result); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $result->format('Y-m-d H:i:s.u e')); } public function testClosureMockTypeFailure(): void { $factory = new Factory(); $closure = static fn () => 42; $factory->setTestNow($closure); $function = new ReflectionFunction($closure); $this->expectExceptionObject(new RuntimeException( 'The test closure defined in '.$function->getFileName(). ' at line '.$function->getStartLine().' returned integer'. '; expected '.CarbonInterface::class.'|null', )); $factory->now(); } } ================================================ FILE: tests/Factory/WrapperClockTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Factory; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\Factory; use Carbon\FactoryImmutable; use Carbon\WrapperClock; use DateTime; use DateTimeImmutable; use DateTimeZone; use Psr\Clock\ClockInterface; use RuntimeException; use Tests\AbstractTestCase; class WrapperClockTest extends AbstractTestCase { public function testWrapperClock(): void { $now = new DateTimeImmutable('now UTC'); $clock = new WrapperClock($now); $this->assertSame($now, $clock->now()); $this->assertSame($now, $clock->unwrap()); $carbon = $clock->getFactory()->now(); $this->assertSame(CarbonImmutable::class, $carbon::class); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $carbon->format('Y-m-d H:i:s.u e')); $carbon = $clock->nowAs(Carbon::class, 'Europe/Berlin'); $this->assertSame(Carbon::class, $carbon::class); $this->assertSame( $now->setTimezone(new DateTimeZone('Europe/Berlin'))->format('Y-m-d H:i:s.u e'), $carbon->format('Y-m-d H:i:s.u e'), ); $carbon = $clock->nowAsCarbon(); $this->assertSame(CarbonImmutable::class, $carbon::class); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $carbon->format('Y-m-d H:i:s.u e')); $clock = new WrapperClock($carbon); $this->assertSame($clock->nowAsCarbon(), $carbon); } public function testWrapperClockMutable(): void { $now = new DateTime('now UTC'); $clock = new WrapperClock($now); $result = $clock->now(); $unwrapped = $clock->unwrap(); $this->assertNotSame($now, $result); $this->assertSame($now, $unwrapped); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $result->format('Y-m-d H:i:s.u e')); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $unwrapped->format('Y-m-d H:i:s.u e')); $carbon = $clock->getFactory()->now(); $this->assertSame(Carbon::class, $carbon::class); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $carbon->format('Y-m-d H:i:s.u e')); } public function testWrapperClockPsrLink(): void { $now = new DateTimeImmutable('now UTC'); $psrClock = new class($now) implements ClockInterface { public function __construct(private readonly DateTimeImmutable $currentTime) { } public function now(): DateTimeImmutable { return $this->currentTime; } }; $clock = new WrapperClock($psrClock); $result = $clock->now(); $unwrapped = $clock->unwrap(); $unwrappedNow = $unwrapped->now(); $this->assertSame($now, $result); $this->assertSame($psrClock, $unwrapped); $this->assertSame($now, $unwrappedNow); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $result->format('Y-m-d H:i:s.u e')); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $unwrappedNow->format('Y-m-d H:i:s.u e')); $carbon = $clock->getFactory()->now(); $this->assertSame(CarbonImmutable::class, $carbon::class); $this->assertSame($now->format('Y-m-d H:i:s.u e'), $carbon->format('Y-m-d H:i:s.u e')); } public function testSleep(): void { $factory = new FactoryImmutable(); $factory->setTestNowAndTimezone(new DateTimeImmutable('2024-01-18 00:00 UTC')); $clock = new WrapperClock($factory); $clock->sleep(2.5); $carbon = $clock->now(); $this->assertSame(CarbonImmutable::class, $carbon::class); $this->assertSame('2024-01-18 00:00:02.500000 UTC', $carbon->format('Y-m-d H:i:s.u e')); $present = new DateTimeImmutable('2024-01-18 00:00 UTC'); $clock = new WrapperClock($present); $clock->sleep(2.5); $now = $clock->now(); $this->assertSame(DateTimeImmutable::class, $now::class); $this->assertSame('2024-01-18 00:00:02.500000 UTC', $now->format('Y-m-d H:i:s.u e')); $future = new DateTimeImmutable('2224-01-18 00:00 UTC'); $seconds = $future->getTimestamp() - $present->getTimestamp() + 0.000_001; $clock->sleep($seconds); $now = $clock->now(); $this->assertSame('2224-01-18 00:00:02.500001 UTC', $now->format('Y-m-d H:i:s.u e')); $present = new DateTime('2024-01-18 00:00 UTC'); $clock = new WrapperClock($present); $clock->sleep(2.5); $now = $clock->now(); $this->assertSame(CarbonImmutable::class, $now::class); $this->assertSame('2024-01-18 00:00:02.500000 UTC', $now->format('Y-m-d H:i:s.u e')); $this->assertSame('2024-01-18 00:00:00.000000 UTC', $present->format('Y-m-d H:i:s.u e')); $clock->sleep(0); $clock->sleep(0.0); $now = $clock->now(); $this->assertSame('2024-01-18 00:00:02.500000 UTC', $now->format('Y-m-d H:i:s.u e')); $clock = new WrapperClock(new class() implements ClockInterface { public function now(): DateTimeImmutable { return new DateTimeImmutable('2024-01-18 00:00 UTC'); } }); $clock->sleep(2.5); $now = $clock->now(); $this->assertSame(DateTimeImmutable::class, $now::class); $this->assertSame('2024-01-18 00:00:02.500000 UTC', $now->format('Y-m-d H:i:s.u e')); } public function testSleepNegative(): void { $this->expectExceptionObject(new RuntimeException( 'Expected positive number of seconds, -1.0E-6 given', )); $present = new DateTimeImmutable('2024-01-18 00:00 UTC'); $clock = new WrapperClock($present); $clock->sleep(-0.000_001); } public function testWithTimezoneOnFactory(): void { $factory = new FactoryImmutable(); $factory->setTestNowAndTimezone(new DateTimeImmutable('2024-01-18 00:00 UTC')); $clock = new WrapperClock($factory); $clock->sleep(2.5); $carbon = $clock->now(); $this->assertSame(CarbonImmutable::class, $carbon::class); $this->assertSame('2024-01-18 00:00:02.500000 UTC', $carbon->format('Y-m-d H:i:s.u e')); } public function testWithTimezone(): void { $factory = new FactoryImmutable(); $factory->setTestNowAndTimezone(new DateTimeImmutable('2024-01-18 00:00 UTC')); $clock = new WrapperClock($factory); $now = $clock->withTimeZone('Pacific/Auckland')->now(); $this->assertSame(CarbonImmutable::class, $now::class); $this->assertSame( '2024-01-18 13:00:00.000000 Pacific/Auckland', $now->format('Y-m-d H:i:s.u e'), ); $factory = new Factory(); $factory->setTestNowAndTimezone(Carbon::parse('2024-01-18 00:00 UTC')); $clock = new WrapperClock($factory); $now = $clock->withTimeZone('Pacific/Auckland')->now(); $this->assertSame(CarbonImmutable::class, $now::class); $this->assertSame( '2024-01-18 13:00:00.000000 Pacific/Auckland', $now->format('Y-m-d H:i:s.u e'), ); $clock = new WrapperClock(new DateTimeImmutable('2024-01-18 00:00 UTC')); $now = $clock->withTimeZone('Pacific/Auckland')->now(); $this->assertSame(DateTimeImmutable::class, $now::class); $this->assertSame( '2024-01-18 13:00:00.000000 Pacific/Auckland', $now->format('Y-m-d H:i:s.u e'), ); } } ================================================ FILE: tests/Fixtures/CarbonTimezoneTrait.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonInterface; trait CarbonTimezoneTrait { public function toAppTz(bool $shift = false, string $tz = 'UTC'): CarbonInterface { return $shift ? $this->shiftTimezone($tz) : $this->timezone($tz); } public function copyWithAppTz(bool $shift = false, string $tz = 'UTC'): CarbonInterface { return ($shift ? $this->shiftTimezone($tz) : $this->timezone($tz) )->copy(); } } ================================================ FILE: tests/Fixtures/CarbonTypeCase.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Fixtures; use Doctrine\DBAL\Types\Type; final class CarbonTypeCase { public function __construct( public readonly string $name, public readonly string $class, public readonly string $typeClass, public readonly bool $hintRequired, ) { } public function initialize(): void { Type::hasType($this->name) ? Type::overrideType($this->name, $this->typeClass) : Type::addType($this->name, $this->typeClass); } public function getType(): Type { return Type::getType($this->name); } public function __toString(): string { $hintRequired = json_encode($this->hintRequired); return "CarbonTypeCase('$this->name', '$this->class', '$this->typeClass', $hintRequired)"; } } ================================================ FILE: tests/Fixtures/DateMalformedIntervalStringException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ class DateMalformedIntervalStringException extends Exception { } ================================================ FILE: tests/Fixtures/DateMalformedStringException.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ class DateMalformedStringException extends Exception { } ================================================ FILE: tests/Fixtures/SubCarbon.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\Carbon; class SubCarbon extends Carbon { } ================================================ FILE: tests/Fixtures/SubCarbonImmutable.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonImmutable; class SubCarbonImmutable extends CarbonImmutable { } ================================================ FILE: tests/Fixtures/dynamicInterval.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonInterval; return new CarbonInterval(function (DateTimeInterface $date, bool $negated = false): DateTime { $sign = $negated ? '-' : '+'; $days = $date->format('j'); return new DateTime( $date->modify("$sign $days days") ->format('Y-m-d H:i:s'), ); }); ================================================ FILE: tests/Jenssegers/DateTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; use Carbon\Carbon; use DateTimeImmutable; class DateTest extends TestCaseBase { public function testConstructFromString() { Carbon::setTestNow(); $date = new Carbon('2013-01-31'); $this->assertSame(1359590400, $date->getTimestamp()); $before = (new DateTimeImmutable())->getTimestamp(); $date = new Carbon('1 day ago'); $after = (new DateTimeImmutable())->getTimestamp(); $this->assertGreaterThanOrEqual($before - 86400, $date->getTimestamp()); $this->assertLessThanOrEqual($after - 86400, $date->getTimestamp()); } public function testConstructTimestamp() { $date = new Carbon('@1367186296'); $this->assertSame(1367186296, $date->getTimestamp()); } public function testMake() { $date1 = Carbon::make('Sunday 28 April 2013 21:58:16'); $date2 = new Carbon('Sunday 28 April 2013 21:58:16'); $this->assertEquals($date1, $date2); } public function testCreateFromCarbon() { // Preferred way $date = Carbon::make(Carbon::createFromFormat('U', '1367186296')); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(1367186296, $date->getTimestamp()); // Accepted for backward-compatibility with some libraries $date = Carbon::make(Carbon::createFromFormat('!U', 1367186296)); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(1367186296, $date->getTimestamp()); // Deprecated usage $date = Carbon::make(Carbon::createFromFormat('!md', 1225)); $this->assertInstanceOf(Carbon::class, $date); $this->assertSame(30931200, $date->getTimestamp()); } public function testManipulation() { $now = Carbon::now(); $this->assertSame(86400, $now->copy()->add('1 day')->getTimestamp() - $now->getTimestamp()); $this->assertSame(4 * 86400, $now->copy()->add('4 day')->getTimestamp() - $now->getTimestamp()); $this->assertSame(-86400, $now->copy()->sub('1 day')->getTimestamp() - $now->getTimestamp()); $this->assertSame(-4 * 86400, $now->copy()->sub('4 day')->getTimestamp() - $now->getTimestamp()); $this->assertSame(10 * 86400, $now->copy()->add('P10D')->getTimestamp() - $now->getTimestamp()); $this->assertSame(-10 * 86400, $now->copy()->sub('P10D')->getTimestamp() - $now->getTimestamp()); } public function testFormat() { $date = new Carbon('@1367186296'); $this->assertSame('Sunday 28 April 2013 21:58:16', $date->format('l j F Y H:i:s')); } public function testAge() { // Age test can't work on February 29th if (Carbon::now()->format('m-d') === '02-29') { Carbon::setTestNow(Carbon::now()->subDay()); } $date = Carbon::parse('-5 years'); $this->assertSame(5, $date->age); } public function testAgo() { // Ago test can't work on February 29th if (Carbon::now()->format('m-d') === '02-29') { Carbon::setTestNow(Carbon::now()->subDay()); } $date = Carbon::parse('-5 years'); $this->assertSame('5 years ago', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(5); $this->assertSame('5 months ago', $date->ago()); $date = Carbon::parse('-32 days'); $this->assertSame('1 month ago', $date->ago()); $date = Carbon::parse('-4 days'); $this->assertSame('4 days ago', $date->ago()); $date = Carbon::parse('-1 day'); $this->assertSame('1 day ago', $date->ago()); $date = Carbon::parse('-3 hours'); $this->assertSame('3 hours ago', $date->ago()); $date = Carbon::parse('-1 hour'); $this->assertSame('1 hour ago', $date->ago()); $date = Carbon::parse('-2 minutes'); $this->assertSame('2 minutes ago', $date->ago()); $date = Carbon::parse('-1 minute'); $this->assertSame('1 minute ago', $date->ago()); $date = Carbon::parse('-50 second'); $this->assertSame('50 seconds ago', $date->ago()); $date = Carbon::parse('-1 second'); $this->assertSame('1 second ago', $date->ago()); $date = Carbon::parse('+5 days'); $this->assertSame('5 days from now', $date->ago()); $date = Carbon::parse('+5 days'); $this->assertSame('5 days after', $date->ago(Carbon::now())); $date = Carbon::parse('-5 days'); $this->assertSame('5 days before', $date->ago(Carbon::now())); } public function testAbsoluteAgo() { $date = Carbon::parse('-5 days'); $this->assertSame('5 days', $date->ago(Carbon::now(), true)); $date = Carbon::parse('+5 days'); $this->assertSame('5 days', $date->ago(Carbon::now(), true)); } public function testDiffForHumans() { // Diff for humans test can't work on February 29th if (Carbon::now()->format('m-d') === '02-29') { Carbon::setTestNow(Carbon::now()->subDay()); } $date = Carbon::parse('-5 years'); $this->assertSame('5 years ago', $date->diffForHumans()); $date = Carbon::parse('-15 days'); $this->assertSame('2 weeks ago', $date->diffForHumans()); $date = Carbon::parse('-13 days'); $this->assertSame('1 week ago', $date->diffForHumans()); $date = Carbon::parse('-13 days'); $this->assertSame('1 week', $date->diffForHumans(null, true)); $date = JenssegersDate::now()->subMonthsNoOverflow(3); $this->assertSame('3 months', $date->diffForHumans(null, true)); $date = Carbon::parse('-1 week'); $future = Carbon::parse('+1 week'); $this->assertSame('2 weeks after', $future->diffForHumans($date)); $this->assertSame('2 weeks before', $date->diffForHumans($future)); } public function testTimespan() { $date = new Carbon('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 months, 1 week, 1 day, 3 hours, 20 minutes', $date->timespan('@1403619368')); } public function testTranslateTimeString() { Carbon::setLocale('ru'); $date = Carbon::translateTimeString('понедельник 21 март 2015'); $this->assertSame('monday 21 march 2015', mb_strtolower($date)); $date = Carbon::translateTimeString('ПОНЕДЕЛЬНИК 21 МАРТ 2015'); $this->assertSame('monday 21 march 2015', mb_strtolower($date)); Carbon::setLocale('de'); $date = Carbon::translateTimeString('Montag 21 März 2015'); $this->assertSame('monday 21 march 2015', mb_strtolower($date)); Carbon::setLocale('el'); $date = Carbon::translateTimeString('3 Ιανουαρίου 2026'); $this->assertSame('3 january 2026', mb_strtolower($date)); $date = Carbon::translateTimeString('3 ιανουάριος 2026'); $this->assertSame('3 january 2026', mb_strtolower($date)); $this->assertSame('Foobar', Carbon::translateTimeString('Foobar', 'xx')); } public function testSlovenianMonthTranslation() { Carbon::setLocale('sl'); $this->assertSame('marec', Carbon::parse('2025-03-15')->getTranslatedMonthName()); $this->assertSame('marec', Carbon::parse('2025-03-15')->monthName); $this->assertSame('marec', Carbon::parse('2025-03-15')->isoFormat('MMMM')); $this->assertSame('marec 2025', Carbon::parse('2025-03-15')->isoFormat('MMMM YYYY')); $this->assertSame('15. marca', Carbon::parse('2025-03-15')->isoFormat('D. MMMM')); $this->assertSame('15. marca 2025', Carbon::parse('2025-03-15')->isoFormat('LL')); } public function testFallbackLocaleMonthTranslation() { Carbon::setLocale('fr'); Carbon::setFallbackLocale('pl'); $this->assertSame('mars', Carbon::parse('2025-03-15')->getTranslatedMonthName()); $this->assertSame('mars', Carbon::parse('2025-03-15')->monthName); $this->assertSame('mars', Carbon::parse('2025-03-15')->isoFormat('MMMM')); $this->assertSame('mars 2025', Carbon::parse('2025-03-15')->isoFormat('MMMM YYYY')); $this->assertSame('15 mars', Carbon::parse('2025-03-15')->isoFormat('D MMMM')); $this->assertSame('15 mars 2025', Carbon::parse('2025-03-15')->isoFormat('LL')); } public function testFallbackLocaleMeridiemTranslation() { Carbon::setFallbackLocale('sv'); Carbon::setLocale('en'); $now = Carbon::parse('2025-10-02 08:00:00'); $this->assertSame('AM', $now->isoFormat('A')); $this->assertSame('am', $now->isoFormat('a')); } public function testTranslateTimeStringWithOrdinalWords() { $date = Carbon::translateTimeString('Premier lundi de mai', 'fr', 'en'); $this->assertSame('first monday of may', mb_strtolower($date)); $date = Carbon::translateTimeString('Premier lundi de mai', 'fr', 'es'); $this->assertSame('primer lunes de mayo', mb_strtolower($date)); } } ================================================ FILE: tests/Jenssegers/JenssegersDate.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; use Carbon\Carbon; class JenssegersDate extends Carbon { /** * Function to call instead of format. * * @var string|callable|null */ protected static $formatFunction = 'jngFormat'; /** * Function to call instead of createFromFormat. * * @var string|callable|null */ protected static $createFromFormatFunction = 'jngCreateFromFormat'; /** * Function to call instead of parse. * * @var string|callable|null */ protected static $parseFunction = 'jngParse'; public static function jngParse($time = null, $tz = null) { if (\is_string($time)) { $time = static::translateTimeString($time, static::getLocale(), 'en'); } return parent::rawParse($time, $tz); } public static function jngCreateFromFormat($format, $time = null, $tz = null) { if (\is_string($time)) { $time = static::translateTimeString($time, static::getLocale(), 'en'); } return parent::rawCreateFromFormat($format, $time, $tz); } public function jngFormat($format) { return $this->translatedFormat($format); } } ================================================ FILE: tests/Jenssegers/TestCaseBase.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; use Carbon\Carbon; use PHPUnit\Framework\TestCase; abstract class TestCaseBase extends TestCase { public const LOCALE = 'en'; protected function setUp(): void { parent::setUp(); date_default_timezone_set('UTC'); Carbon::setLocale(static::LOCALE); // Freeze the time for the test duration Carbon::setTestNow(Carbon::now()); } } ================================================ FILE: tests/Jenssegers/TranslationElTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; class TranslationElTest extends TestCaseBase { public const LOCALE = 'el'; public function testTimespanTranslated() { $date = new JenssegersDate('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 μήνες, 1 εβδομάδα, 1 μέρα, 3 ώρες, 20 λεπτά', $date->timespan('@1403619368')); } public function testCreateFromFormat() { $date = JenssegersDate::createFromFormat('d F Y', '1 Ιανουαρίου 2015'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); $date = JenssegersDate::createFromFormat('D d F Y', 'Σάββατο 21 Μαρτίου 2015'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } public function testAgoTranslated() { // Ago test can't work on February 29th if (JenssegersDate::now()->format('m-d') === '02-29') { JenssegersDate::setTestNow(JenssegersDate::now()->subDay()); } $date = JenssegersDate::parse('-21 hours'); $this->assertSame('πριν 21 ώρες', $date->ago()); $date = JenssegersDate::parse('-5 days'); $this->assertSame('πριν 5 μέρες', $date->ago()); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('πριν 3 εβδομάδες', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('πριν 6 μήνες', $date->ago()); $date = JenssegersDate::parse('-10 years'); $this->assertSame('πριν 10 χρόνια', $date->ago()); } public function testFormatDeclensions() { $date = new JenssegersDate('10 march 2015'); $this->assertSame('Μάρτιος 2015', $date->format('F Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 Μαρτίου 2015', $date->format('j F Y')); } public function testFormatShortNotation() { $date = new JenssegersDate('10 january 2015'); $this->assertSame('10 Ιαν 2015', $date->format('j M Y')); $date = new JenssegersDate('10 february 2015'); $this->assertSame('10 Φεβ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 Μαρ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 april 2015'); $this->assertSame('10 Απρ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 may 2015'); $this->assertSame('10 Μαϊ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 june 2015'); $this->assertSame('10 Ιουν 2015', $date->format('j M Y')); $date = new JenssegersDate('10 july 2015'); $this->assertSame('10 Ιουλ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 august 2015'); $this->assertSame('10 Αυγ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 september 2015'); $this->assertSame('10 Σεπ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 october 2015'); $this->assertSame('10 Οκτ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 november 2015'); $this->assertSame('10 Νοε 2015', $date->format('j M Y')); $date = new JenssegersDate('10 december 2015'); $this->assertSame('10 Δεκ 2015', $date->format('j M Y')); } public function testAfterTranslated() { $date = JenssegersDate::parse('+21 hours'); $this->assertSame('σε 21 ώρες', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('σε 5 μέρες', $date->ago()); $date = JenssegersDate::parse('+3 weeks'); $this->assertSame('σε 3 εβδομάδες', $date->ago()); $date = JenssegersDate::parse('+6 months'); $this->assertSame('σε 6 μήνες', $date->ago()); $date = JenssegersDate::parse('+10 years'); $this->assertSame('σε 10 χρόνια', $date->ago()); } } ================================================ FILE: tests/Jenssegers/TranslationHuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; use Carbon\Translator; use Symfony\Component\Translation\Loader\ArrayLoader; class TranslationHuTest extends TestCaseBase { public const LOCALE = 'hu'; public function testGetsAndSetsTranslator() { $translator = new Translator('hu'); $translator->addLoader('array', new ArrayLoader()); $this->assertNotEquals($translator, JenssegersDate::getTranslator()); JenssegersDate::setTranslator($translator); $this->assertEquals($translator, JenssegersDate::getTranslator()); } public function testTimespanTranslated() { $date = new JenssegersDate('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 hónap, 1 hét, 1 nap, 3 óra, 20 perc', $date->timespan('@1403619368')); } public function testAgoTranslated() { $date = JenssegersDate::parse('-1 minute'); $this->assertSame('1 perce', $date->ago()); $date = JenssegersDate::parse('-21 hours'); $this->assertSame('21 órája', $date->ago()); $date = JenssegersDate::parse('-5 days'); $this->assertSame('5 napja', $date->ago()); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('3 hete', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('6 hónapja', $date->ago()); $date = JenssegersDate::now()->subYearsNoOverflow(10); $this->assertSame('10 éve', $date->ago()); } public function testFromNowTranslated() { $date = JenssegersDate::parse('+1 minute'); $this->assertSame('1 perc múlva', $date->ago()); $date = JenssegersDate::parse('+21 hours'); $this->assertSame('21 óra múlva', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('5 nap múlva', $date->ago()); $date = JenssegersDate::parse('+3 weeks'); $this->assertSame('3 hét múlva', $date->ago()); $date = JenssegersDate::parse('+6 months'); $this->assertSame('6 hónap múlva', $date->ago()); $date = JenssegersDate::parse('+10 years'); $this->assertSame('10 év múlva', $date->ago()); } public function testAfterTranslated() { $date = JenssegersDate::parse('+21 hours'); $this->assertSame('21 órával később', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('+5 days'); $this->assertSame('5 nappal később', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('+3 weeks'); $this->assertSame('3 héttel később', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('+6 months'); $this->assertSame('6 hónappal később', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('+10 years'); $this->assertSame('10 évvel később', $date->ago(JenssegersDate::now())); } public function testBeforeTranslated() { $date = JenssegersDate::parse('-21 hours'); $this->assertSame('21 órával korábban', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('-5 days'); $this->assertSame('5 nappal korábban', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('3 héttel korábban', $date->ago(JenssegersDate::now())); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('6 hónappal korábban', $date->ago(JenssegersDate::now())); $date = JenssegersDate::now()->subYearsNoOverflow(10); $this->assertSame('10 évvel korábban', $date->ago(JenssegersDate::now())); } public function testCreateFromFormat() { $date = JenssegersDate::createFromFormat('Y. F d.', '2015. január 1.'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); $date = JenssegersDate::createFromFormat('Y. F d., D', '2015. március 21., szombat'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } } ================================================ FILE: tests/Jenssegers/TranslationJaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; class TranslationJaTest extends TestCaseBase { public const LOCALE = 'ja'; public function testItCanTranslateMonth() { $jan = JenssegersDate::createFromFormat('m-d', '01-01'); $feb = JenssegersDate::createFromFormat('m-d', '02-01'); $mar = JenssegersDate::createFromFormat('m-d', '03-01'); $apr = JenssegersDate::createFromFormat('m-d', '04-01'); $may = JenssegersDate::createFromFormat('m-d', '05-01'); $jun = JenssegersDate::createFromFormat('m-d', '06-01'); $jul = JenssegersDate::createFromFormat('m-d', '07-01'); $aug = JenssegersDate::createFromFormat('m-d', '08-01'); $sep = JenssegersDate::createFromFormat('m-d', '09-01'); $oct = JenssegersDate::createFromFormat('m-d', '10-01'); $nov = JenssegersDate::createFromFormat('m-d', '11-01'); $dec = JenssegersDate::createFromFormat('m-d', '12-01'); $this->assertSame('1月', $jan->format('F')); $this->assertSame('2月', $feb->format('F')); $this->assertSame('3月', $mar->format('F')); $this->assertSame('4月', $apr->format('F')); $this->assertSame('5月', $may->format('F')); $this->assertSame('6月', $jun->format('F')); $this->assertSame('7月', $jul->format('F')); $this->assertSame('8月', $aug->format('F')); $this->assertSame('9月', $sep->format('F')); $this->assertSame('10月', $oct->format('F')); $this->assertSame('11月', $nov->format('F')); $this->assertSame('12月', $dec->format('F')); } public function testItCanTranslateWeekdays() { $mon = JenssegersDate::parse('next monday'); $tue = JenssegersDate::parse('next tuesday'); $wed = JenssegersDate::parse('next wednesday'); $thu = JenssegersDate::parse('next thursday'); $fri = JenssegersDate::parse('next friday'); $sat = JenssegersDate::parse('next saturday'); $sun = JenssegersDate::parse('next sunday'); $this->assertSame('月曜日', $mon->format('l')); $this->assertSame('火曜日', $tue->format('l')); $this->assertSame('水曜日', $wed->format('l')); $this->assertSame('木曜日', $thu->format('l')); $this->assertSame('金曜日', $fri->format('l')); $this->assertSame('土曜日', $sat->format('l')); $this->assertSame('日曜日', $sun->format('l')); } public function testItCanTranslateWeekdaysShortForm() { $mon = JenssegersDate::parse('next monday'); $tue = JenssegersDate::parse('next tuesday'); $wed = JenssegersDate::parse('next wednesday'); $thu = JenssegersDate::parse('next thursday'); $fri = JenssegersDate::parse('next friday'); $sat = JenssegersDate::parse('next saturday'); $sun = JenssegersDate::parse('next sunday'); $this->assertSame('月', $mon->format('D')); $this->assertSame('火', $tue->format('D')); $this->assertSame('水', $wed->format('D')); $this->assertSame('木', $thu->format('D')); $this->assertSame('金', $fri->format('D')); $this->assertSame('土', $sat->format('D')); $this->assertSame('日', $sun->format('D')); } public function testItCanTranslateSecondsAgo() { $oneSecondAgo = JenssegersDate::parse('-1 second'); $fiveSecondsAgo = JenssegersDate::parse('-5 seconds'); $this->assertSame('1秒前', $oneSecondAgo->ago()); $this->assertSame('5秒前', $fiveSecondsAgo->ago()); } public function testItCanTranslateMinutesAgo() { $oneMinuteAgo = JenssegersDate::parse('-1 minute'); $fiveMinutesAgo = JenssegersDate::parse('-5 minutes'); $this->assertSame('1分前', $oneMinuteAgo->ago()); $this->assertSame('5分前', $fiveMinutesAgo->ago()); } public function testItCanTranslateHoursAgo() { $oneHourAgo = JenssegersDate::parse('-1 hour'); $fiveHoursAgo = JenssegersDate::parse('-5 hours'); $this->assertSame('1時間前', $oneHourAgo->ago()); $this->assertSame('5時間前', $fiveHoursAgo->ago()); } public function testItCanTranslateDaysAgo() { $oneDayAgo = JenssegersDate::parse('-1 day'); $threeDaysAgo = JenssegersDate::parse('-3 days'); $this->assertSame('1日前', $oneDayAgo->ago()); $this->assertSame('3日前', $threeDaysAgo->ago()); } public function testItCanTranslateWeeksAgo() { $oneWeekAgo = JenssegersDate::parse('-1 week'); $threeWeeksAgo = JenssegersDate::parse('-3 weeks'); $this->assertSame('1週間前', $oneWeekAgo->ago()); $this->assertSame('3週間前', $threeWeeksAgo->ago()); } public function testItCanTranslateMonthsAgo() { JenssegersDate::setTestNow('2019-03-27'); $oneMonthAgo = JenssegersDate::now()->subMonthNoOverflow(); $twoMonthsAgo = JenssegersDate::now()->subMonthsNoOverflow(2); $this->assertSame('1ヶ月前', $oneMonthAgo->ago()); $this->assertSame('2ヶ月前', $twoMonthsAgo->ago()); } public function testItCanTranslateYearsAgo() { $oneYearAgo = JenssegersDate::parse('-1 year'); $towYearsAgo = JenssegersDate::parse('-2 years'); $this->assertSame('1年前', $oneYearAgo->ago()); $this->assertSame('2年前', $towYearsAgo->ago()); } public function testItCanTranslateSecondsFromNow() { $oneSecondFromNow = JenssegersDate::parse('1 second'); $fiveSecondsFromNow = JenssegersDate::parse('5 seconds'); $this->assertSame('1秒後', $oneSecondFromNow->diffForHumans()); $this->assertSame('5秒後', $fiveSecondsFromNow->diffForHumans()); } public function testItCanTranslateMinutesFromNow() { $oneMinuteFromNow = JenssegersDate::parse('1 minute'); $fiveMinutesFromNow = JenssegersDate::parse('5 minutes'); $this->assertSame('1分後', $oneMinuteFromNow->diffForHumans()); $this->assertSame('5分後', $fiveMinutesFromNow->diffForHumans()); } public function testItCanTranslateHoursFromNow() { $oneHourFromNow = JenssegersDate::parse('1 hour'); $fiveHoursFromNow = JenssegersDate::parse('5 hours'); $this->assertSame('1時間後', $oneHourFromNow->diffForHumans()); $this->assertSame('5時間後', $fiveHoursFromNow->diffForHumans()); } public function testItCanTranslateDaysFromNow() { $oneDayFromNow = JenssegersDate::parse('1 day'); $threeDaysFromNow = JenssegersDate::parse('3 days'); $this->assertSame('1日後', $oneDayFromNow->diffForHumans()); $this->assertSame('3日後', $threeDaysFromNow->diffForHumans()); } public function testItCanTranslateWeeksFromNow() { $oneWeekFromNow = JenssegersDate::parse('1 week'); $threeWeeksFromNow = JenssegersDate::parse('3 weeks'); $this->assertSame('1週間後', $oneWeekFromNow->diffForHumans()); $this->assertSame('3週間後', $threeWeeksFromNow->diffForHumans()); } public function testItCanTranslateMonthsFromNow() { $oneMonthFromNow = JenssegersDate::parse('1 month'); $twoMonthsFromNow = JenssegersDate::parse('2 months'); $this->assertSame('1ヶ月後', $oneMonthFromNow->diffForHumans()); $this->assertSame('2ヶ月後', $twoMonthsFromNow->diffForHumans()); } public function testItCanTranslateYearsFromNow() { $oneYearFromNow = JenssegersDate::parse('1 year'); $towYearsFromNow = JenssegersDate::parse('2 years'); $this->assertSame('1年後', $oneYearFromNow->diffForHumans()); $this->assertSame('2年後', $towYearsFromNow->diffForHumans()); } } ================================================ FILE: tests/Jenssegers/TranslationKaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; class TranslationKaTest extends TestCaseBase { public const LOCALE = 'ka'; public function testTimespanTranslated() { $date = new JenssegersDate('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 თვე, 1 კვირა, 1 დღე, 3 საათი, 20 წუთი', $date->timespan('@1403619368')); } public function testCreateFromFormat() { $date = JenssegersDate::createFromFormat('d F Y', '1 იანვარი 2015'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); $date = JenssegersDate::createFromFormat('D d F Y', 'შაბათი 21 მარტი 2015'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } public function testAgoTranslated() { $date = JenssegersDate::parse('-21 hours'); $this->assertSame('21 საათის წინ', $date->ago()); $date = JenssegersDate::parse('-5 days'); $this->assertSame('5 დღის წინ', $date->ago()); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('3 კვირის წინ', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('6 თვის წინ', $date->ago()); $date = JenssegersDate::parse('-10 years'); $this->assertSame('10 წლის წინ', $date->ago()); } public function testFormatDeclensions() { $date = new JenssegersDate('10 march 2015'); $this->assertSame('მარტს 2015', $date->format('F Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 მარტი 2015', $date->format('j F Y')); } public function testAfterTranslated() { $date = JenssegersDate::parse('+21 hours'); $this->assertSame('21 საათში', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('5 დღეში', $date->ago()); $date = JenssegersDate::parse('+3 weeks'); $this->assertSame('3 კვირაში', $date->ago()); $date = JenssegersDate::parse('+6 months'); $this->assertSame('6 თვეში', $date->ago()); $date = JenssegersDate::parse('+10 years'); $this->assertSame('10 წელიწადში', $date->ago()); } } ================================================ FILE: tests/Jenssegers/TranslationTaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; class TranslationTaTest extends TestCaseBase { public const LOCALE = 'ta'; public function testItTranslatesMonth() { $jan = JenssegersDate::createFromFormat('m-d', '01-01'); $feb = JenssegersDate::createFromFormat('m-d', '02-01'); $mar = JenssegersDate::createFromFormat('m-d', '03-01'); $apr = JenssegersDate::createFromFormat('m-d', '04-01'); $may = JenssegersDate::createFromFormat('m-d', '05-01'); $jun = JenssegersDate::createFromFormat('m-d', '06-01'); $jul = JenssegersDate::createFromFormat('m-d', '07-01'); $aug = JenssegersDate::createFromFormat('m-d', '08-01'); $sep = JenssegersDate::createFromFormat('m-d', '09-01'); $oct = JenssegersDate::createFromFormat('m-d', '10-01'); $nov = JenssegersDate::createFromFormat('m-d', '11-01'); $dec = JenssegersDate::createFromFormat('m-d', '12-01'); $this->assertSame('ஜனவரி', $jan->format('F')); $this->assertSame('பிப்ரவரி', $feb->format('F')); $this->assertSame('மார்ச்', $mar->format('F')); $this->assertSame('ஏப்ரல்', $apr->format('F')); $this->assertSame('மே', $may->format('F')); $this->assertSame('ஜூன்', $jun->format('F')); $this->assertSame('ஜூலை', $jul->format('F')); $this->assertSame('ஆகஸ்ட்', $aug->format('F')); $this->assertSame('செப்டெம்பர்', $sep->format('F')); $this->assertSame('அக்டோபர்', $oct->format('F')); $this->assertSame('நவம்பர்', $nov->format('F')); $this->assertSame('டிசம்பர்', $dec->format('F')); } public function testItTranslatesWeekdays() { $mon = JenssegersDate::parse('next monday'); $tue = JenssegersDate::parse('next tuesday'); $wed = JenssegersDate::parse('next wednesday'); $thu = JenssegersDate::parse('next thursday'); $fri = JenssegersDate::parse('next friday'); $sat = JenssegersDate::parse('next saturday'); $sun = JenssegersDate::parse('next sunday'); $this->assertSame('திங்கட்கிழமை', $mon->format('l')); $this->assertSame('செவ்வாய்கிழமை', $tue->format('l')); $this->assertSame('புதன்கிழமை', $wed->format('l')); $this->assertSame('வியாழக்கிழமை', $thu->format('l')); $this->assertSame('வெள்ளிக்கிழமை', $fri->format('l')); $this->assertSame('சனிக்கிழமை', $sat->format('l')); $this->assertSame('ஞாயிற்றுக்கிழமை', $sun->format('l')); } public function testItTranslatesWeekdaysShortform() { $mon = JenssegersDate::parse('next monday'); $tue = JenssegersDate::parse('next tuesday'); $wed = JenssegersDate::parse('next wednesday'); $thu = JenssegersDate::parse('next thursday'); $fri = JenssegersDate::parse('next friday'); $sat = JenssegersDate::parse('next saturday'); $sun = JenssegersDate::parse('next sunday'); $this->assertSame('திங்கள்', $mon->format('D')); $this->assertSame('செவ்வாய்', $tue->format('D')); $this->assertSame('புதன்', $wed->format('D')); $this->assertSame('வியாழன்', $thu->format('D')); $this->assertSame('வெள்ளி', $fri->format('D')); $this->assertSame('சனி', $sat->format('D')); $this->assertSame('ஞாயிறு', $sun->format('D')); } public function testItTranslatesAgo() { JenssegersDate::setTestNow('2019-03-27'); $oneAgo = JenssegersDate::parse('-1 second'); $fiveAgo = JenssegersDate::parse('-5 seconds'); $this->assertSame('1 சில விநாடிகள் முன்', $oneAgo->ago()); $this->assertSame('5 விநாடிகள் முன்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('-1 minute'); $fiveAgo = JenssegersDate::parse('-5 minutes'); $this->assertSame('1 நிமிடம் முன்', $oneAgo->ago()); $this->assertSame('5 நிமிடங்கள் முன்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('-1 hour'); $fiveAgo = JenssegersDate::parse('-5 hours'); $this->assertSame('1 மணி நேரம் முன்', $oneAgo->ago()); $this->assertSame('5 மணி நேரம் முன்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('-1 day'); $fiveAgo = JenssegersDate::parse('-5 days'); $this->assertSame('1 நாள் முன்', $oneAgo->ago()); $this->assertSame('5 நாட்கள் முன்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('-1 week'); $fiveAgo = JenssegersDate::parse('-3 weeks'); $this->assertSame('1 வாரம் முன்', $oneAgo->ago()); $this->assertSame('3 வாரங்கள் முன்', $fiveAgo->ago()); $oneAgo = JenssegersDate::now()->subMonthNoOverflow(); $threeAgo = JenssegersDate::now()->subMonthsNoOverflow(3); $this->assertSame('1 மாதம் முன்', $oneAgo->ago()); $this->assertSame('3 மாதங்கள் முன்', $threeAgo->ago()); $oneAgo = JenssegersDate::parse('-1 year'); $fiveAgo = JenssegersDate::parse('-3 years'); $this->assertSame('1 வருடம் முன்', $oneAgo->ago()); $this->assertSame('3 ஆண்டுகள் முன்', $fiveAgo->ago()); } public function testItTranslatesFromNow() { $oneAgo = JenssegersDate::parse('1 second'); $fiveAgo = JenssegersDate::parse('5 seconds'); $this->assertSame('1 சில விநாடிகள் இல்', $oneAgo->ago()); $this->assertSame('5 விநாடிகள் இல்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('1 minute'); $fiveAgo = JenssegersDate::parse('5 minutes'); $this->assertSame('1 நிமிடம் இல்', $oneAgo->ago()); $this->assertSame('5 நிமிடங்கள் இல்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('1 hour'); $fiveAgo = JenssegersDate::parse('5 hours'); $this->assertSame('1 மணி நேரம் இல்', $oneAgo->ago()); $this->assertSame('5 மணி நேரம் இல்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('1 day'); $fiveAgo = JenssegersDate::parse('5 days'); $this->assertSame('1 நாள் இல்', $oneAgo->ago()); $this->assertSame('5 நாட்கள் இல்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('1 week'); $fiveAgo = JenssegersDate::parse('3 weeks'); $this->assertSame('1 வாரம் இல்', $oneAgo->ago()); $this->assertSame('3 வாரங்கள் இல்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('1 month'); $fiveAgo = JenssegersDate::parse('3 months'); $this->assertSame('1 மாதம் இல்', $oneAgo->ago()); $this->assertSame('3 மாதங்கள் இல்', $fiveAgo->ago()); $oneAgo = JenssegersDate::parse('1 year'); $fiveAgo = JenssegersDate::parse('3 years'); $this->assertSame('1 வருடம் இல்', $oneAgo->ago()); $this->assertSame('3 ஆண்டுகள் இல்', $fiveAgo->ago()); } } ================================================ FILE: tests/Jenssegers/TranslationTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; use Carbon\Translator; use Symfony\Component\Translation\Loader\ArrayLoader; class TranslationTest extends TestCaseBase { public function testGetsAndSetsTranslator() { $translator = new Translator('nl'); $translator->addLoader('array', new ArrayLoader()); $this->assertNotEquals($translator, JenssegersDate::getTranslator()); JenssegersDate::setTranslator($translator); $this->assertEquals($translator, JenssegersDate::getTranslator()); } public function testFallback() { JenssegersDate::setLocale('xx'); $date = JenssegersDate::parse('-5 years'); $this->assertSame('5 years ago', $date->ago()); } public function testFallbackWithRegion() { JenssegersDate::setFallbackLocale('en_US'); JenssegersDate::setLocale('xx'); $date = JenssegersDate::parse('-5 years'); $this->assertSame('5 years ago', $date->ago()); } public function testMultiplePluralForms() { JenssegersDate::setLocale('hr'); $date = JenssegersDate::parse('-1 years'); $this->assertSame('prije 1 godinu', $date->ago()); $date = JenssegersDate::parse('-2 years'); $this->assertSame('prije 2 godine', $date->ago()); $date = JenssegersDate::parse('-3 years'); $this->assertSame('prije 3 godine', $date->ago()); $date = JenssegersDate::parse('-5 years'); $this->assertSame('prije 5 godina', $date->ago()); } public function testCustomSuffix() { JenssegersDate::setLocale('de'); // If we use -1 month, we have the chance of it being converted to 4 weeks. $date = JenssegersDate::parse('-40 days'); $this->assertSame('vor 1 Monat', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(5); $this->assertSame('vor 5 Monaten', $date->ago()); $date = JenssegersDate::parse('-5 seconds'); $this->assertSame('vor 5 Sekunden', $date->ago()); } public function testTimespanTranslated() { JenssegersDate::setLocale('nl'); $date = new JenssegersDate('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 maanden, 1 week, 1 dag, 3 uur, 20 minuten', $date->timespan('@1403619368')); } public function testParse() { JenssegersDate::setLocale('nl'); $date = JenssegersDate::parse('1 januari 2015'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); JenssegersDate::setLocale('nl'); $date = JenssegersDate::parse('zaterdag 21 maart 2015'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } public function testCreateFromFormat() { JenssegersDate::setLocale('nl'); $date = JenssegersDate::createFromFormat('d F Y', '1 januari 2015'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); JenssegersDate::setLocale('nl'); $date = JenssegersDate::createFromFormat('D d F Y', 'zaterdag 21 maart 2015'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } public function testAgoTranslated() { JenssegersDate::setLocale('nl'); JenssegersDate::setTestNow(JenssegersDate::now()); $date = JenssegersDate::parse('-5 years'); $this->assertSame('5 jaar geleden', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(5); $this->assertSame('5 maanden geleden', $date->ago()); $date = JenssegersDate::parse('-32 days'); $this->assertSame('1 maand geleden', $date->ago()); $date = JenssegersDate::parse('-4 days'); $this->assertSame('4 dagen geleden', $date->ago()); $date = JenssegersDate::parse('-1 day'); $this->assertSame('1 dag geleden', $date->ago()); $date = JenssegersDate::parse('-3 hours'); $this->assertSame('3 uur geleden', $date->ago()); $date = JenssegersDate::parse('-1 hour'); $this->assertSame('1 uur geleden', $date->ago()); $date = JenssegersDate::parse('-2 minutes'); $this->assertSame('2 minuten geleden', $date->ago()); $date = JenssegersDate::parse('-1 minute'); $this->assertSame('1 minuut geleden', $date->ago()); $date = JenssegersDate::parse('-50 second'); $this->assertSame('50 seconden geleden', $date->ago()); $date = JenssegersDate::parse('-1 second'); $this->assertSame('1 seconde geleden', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('over 5 dagen', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('5 dagen later', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('-5 days'); $this->assertSame('5 dagen eerder', $date->ago(JenssegersDate::now())); JenssegersDate::setLocale('ru'); $date = JenssegersDate::parse('-21 hours'); $this->assertSame('21 час до', $date->ago(JenssegersDate::now())); $date = JenssegersDate::parse('-11 hours'); $this->assertSame('11 часов до', $date->ago(JenssegersDate::now())); } public function testFormatTranslated() { JenssegersDate::setLocale('nl'); $date = new JenssegersDate('@1367186296'); $this->assertSame('zondag 28 april 2013 21:58:16', $date->format('l j F Y H:i:s')); $date = new JenssegersDate('@1367186296'); $this->assertSame('l 28 F 2013 21:58:16', $date->format('\l j \F Y H:i:s')); $date = new JenssegersDate('@1367186296'); $this->assertSame('zo. 28 apr. 2013 21:58:16', $date->format('D j M Y H:i:s')); } public function testFormatDeclensions() { JenssegersDate::setLocale('ru'); $date = new JenssegersDate('10 march 2015'); $this->assertSame('март 2015', $date->format('F Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 марта 2015', $date->format('j F Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10. марта 2015', $date->format('j. F Y')); } public function testTranslateTimeString() { JenssegersDate::setLocale('ru'); $date = JenssegersDate::translateTimeString('понедельник 21 март 2015'); $this->assertSame('monday 21 march 2015', mb_strtolower($date)); JenssegersDate::setLocale('de'); $date = JenssegersDate::translateTimeString('Montag 21 März 2015'); $this->assertSame('monday 21 march 2015', mb_strtolower($date)); } } ================================================ FILE: tests/Jenssegers/TranslationThTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; class TranslationThTest extends TestCaseBase { public const LOCALE = 'th'; public function testTimespanTranslated() { $date = new JenssegersDate('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 เดือน, 1 สัปดาห์, 1 วัน, 3 ชั่วโมง, 20 นาที', $date->timespan('@1403619368')); } public function testCreateFromFormat() { $date = JenssegersDate::createFromFormat('d F Y', '1 มกราคม 2015'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); $date = JenssegersDate::createFromFormat('D d F Y', 'เสาร์ 21 มีนาคม 2015'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } public function testAgoTranslated() { $date = JenssegersDate::parse('-21 hours'); $this->assertSame('21 ชั่วโมงที่แล้ว', $date->ago()); $date = JenssegersDate::parse('-5 days'); $this->assertSame('5 วันที่แล้ว', $date->ago()); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('3 สัปดาห์ที่แล้ว', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('6 เดือนที่แล้ว', $date->ago()); $date = JenssegersDate::parse('-10 years'); $this->assertSame('10 ปีที่แล้ว', $date->ago()); } public function testFormatDeclensions() { $date = new JenssegersDate('10 march 2015'); $this->assertSame('มีนาคม 2015', $date->format('F Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 มีนาคม 2015', $date->format('j F Y')); } public function testAfterTranslated() { $date = JenssegersDate::parse('+21 hours'); $this->assertSame('อีก 21 ชั่วโมง', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('อีก 5 วัน', $date->ago()); $date = JenssegersDate::parse('+3 weeks'); $this->assertSame('อีก 3 สัปดาห์', $date->ago()); $date = JenssegersDate::parse('+6 months'); $this->assertSame('อีก 6 เดือน', $date->ago()); $date = JenssegersDate::parse('+10 years'); $this->assertSame('อีก 10 ปี', $date->ago()); } } ================================================ FILE: tests/Jenssegers/TranslationUkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Jenssegers; class TranslationUkTest extends TestCaseBase { public const LOCALE = 'uk'; public function testTimespanTranslated() { $date = new JenssegersDate('@1403619368'); $date = $date->sub('-100 days -3 hours -20 minutes'); $this->assertSame('3 місяці, 1 тиждень, 1 день, 3 години, 20 хвилин', $date->timespan('@1403619368')); } public function testCreateFromFormat() { $date = JenssegersDate::createFromFormat('d F Y', '01 січня 2015'); $this->assertSame('2015-01-01', $date->format('Y-m-d')); $date = JenssegersDate::createFromFormat('D d F Y', 'сб 21 березня 2015'); $this->assertSame('2015-03-21', $date->format('Y-m-d')); } public function testAgoTranslated() { // Ago test can't work on February 29th if (JenssegersDate::now()->format('m-d') === '02-29') { JenssegersDate::setTestNow(JenssegersDate::now()->subDay()); } $date = JenssegersDate::parse('-21 hours'); $this->assertSame('21 годину тому', $date->ago()); $date = JenssegersDate::parse('-5 days'); $this->assertSame('5 днів тому', $date->ago()); $date = JenssegersDate::parse('-3 weeks'); $this->assertSame('3 тижні тому', $date->ago()); $date = JenssegersDate::now()->subMonthsNoOverflow(6); $this->assertSame('6 місяців тому', $date->ago()); $date = JenssegersDate::parse('-10 years'); $this->assertSame('10 років тому', $date->ago()); } public function testFormatDeclensions() { $date = new JenssegersDate('10 march 2015'); $this->assertSame('березень 2015', $date->format('F Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 березня 2015', $date->format('j F Y')); } public function testFormatShortNotation() { $date = new JenssegersDate('10 january 2015'); $this->assertSame('10 січ 2015', $date->format('j M Y')); $date = new JenssegersDate('10 february 2015'); $this->assertSame('10 лют 2015', $date->format('j M Y')); $date = new JenssegersDate('10 march 2015'); $this->assertSame('10 бер 2015', $date->format('j M Y')); $date = new JenssegersDate('10 april 2015'); $this->assertSame('10 кві 2015', $date->format('j M Y')); $date = new JenssegersDate('10 may 2015'); $this->assertSame('10 тра 2015', $date->format('j M Y')); } public function testAfterTranslated() { $date = JenssegersDate::parse('+21 hours'); $this->assertSame('за 21 годину', $date->ago()); $date = JenssegersDate::parse('+5 days'); $this->assertSame('за 5 днів', $date->ago()); $date = JenssegersDate::parse('+3 weeks'); $this->assertSame('за 3 тижні', $date->ago()); $date = JenssegersDate::parse('+6 months'); $this->assertSame('за 6 місяців', $date->ago()); $date = JenssegersDate::parse('+10 years'); $this->assertSame('за 10 років', $date->ago()); } } ================================================ FILE: tests/Language/LanguageTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Language; use Carbon\Language; use Tests\AbstractTestCase; class LanguageTest extends AbstractTestCase { public function testAll() { $all = Language::all(); $this->assertIsArray($all); $this->assertArrayHasKey('en', $all); $this->assertIsArray($all['en']); $this->assertArrayHasKey('isoName', $all['en']); $this->assertSame('English', $all['en']['isoName']); } public function testRegions() { $regions = Language::regions(); $this->assertIsArray($regions); $this->assertArrayHasKey('US', $regions); $this->assertSame('United States of America', $regions['US']); } public function testGetNames() { $ar = new Language('ar'); $this->assertSame([ 'isoName' => 'Arabic', 'nativeName' => 'العربية', ], $ar->getNames()); } public function testGetId() { $ar = new Language('ar'); $this->assertSame('ar', $ar->getId()); $ar = new Language('ar_DZ'); $this->assertSame('ar_DZ', $ar->getId()); $ar = new Language('ar_Shakl'); $this->assertSame('ar_Shakl', $ar->getId()); } public function testGetCode() { $ar = new Language('ar'); $this->assertSame('ar', $ar->getCode()); $ar = new Language('ar_DZ'); $this->assertSame('ar', $ar->getCode()); $ar = new Language('ar_Shakl'); $this->assertSame('ar', $ar->getCode()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('sr', $sr->getCode()); } public function testGetVariant() { $ar = new Language('ar'); $this->assertNull($ar->getVariant()); $ar = new Language('ar_DZ'); $this->assertNull($ar->getVariant()); $ar = new Language('ar_Shakl'); $this->assertSame('Shakl', $ar->getVariant()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('Cyrl', $sr->getVariant()); } public function testGetRegion() { $ar = new Language('ar'); $this->assertNull($ar->getRegion()); $ar = new Language('ar_DZ'); $this->assertSame('DZ', $ar->getRegion()); $ar = new Language('ar_Shakl'); $this->assertNull($ar->getRegion()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('ME', $sr->getRegion()); } public function testGetRegionName() { $ar = new Language('ar'); $this->assertNull($ar->getRegionName()); $ar = new Language('ar_DZ'); $this->assertSame('Algeria', $ar->getRegionName()); $ar = new Language('ar_Shakl'); $this->assertNull($ar->getRegionName()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('Montenegro', $sr->getRegionName()); } public function testGetFullIsoName() { $ar = new Language('ca'); $this->assertSame('Catalan, Valencian', $ar->getFullIsoName()); $this->assertSame('Catalan, Valencian', $ar->getFullIsoName()); $ar = new Language('ar_DZ'); $this->assertSame('Arabic', $ar->getFullIsoName()); $gom = new Language('gom_Latn'); $this->assertSame('Konkani, Goan', $gom->getFullIsoName()); $foo = new Language('foo_Latn'); $this->assertSame('foo', $foo->getFullIsoName()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('Serbian', $sr->getFullIsoName()); } public function testGetFullNativeName() { $ar = new Language('ca'); $this->assertSame('català, valencià', $ar->getFullNativeName()); $this->assertSame('català, valencià', $ar->getFullNativeName()); $ar = new Language('ar_DZ'); $this->assertSame('العربية', $ar->getFullNativeName()); $gom = new Language('gom_Latn'); $this->assertSame('ಕೊಂಕಣಿ', $gom->getFullNativeName()); $foo = new Language('foo_Latn'); $this->assertSame('foo', $foo->getFullNativeName()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('српски језик', $sr->getFullNativeName()); } public function testGetIsoName() { $ar = new Language('ca'); $this->assertSame('Catalan', $ar->getIsoName()); $this->assertSame('Catalan', $ar->getIsoName()); $ar = new Language('ar_DZ'); $this->assertSame('Arabic', $ar->getIsoName()); $gom = new Language('gom_Latn'); $this->assertSame('Konkani', $gom->getIsoName()); $foo = new Language('foo_Latn'); $this->assertSame('foo', $foo->getIsoName()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('Serbian', $sr->getIsoName()); } public function testGetNativeName() { $ar = new Language('ca'); $this->assertSame('català', $ar->getNativeName()); $this->assertSame('català', $ar->getNativeName()); $ar = new Language('ar_DZ'); $this->assertSame('العربية', $ar->getNativeName()); $gom = new Language('gom_Latn'); $this->assertSame('ಕೊಂಕಣಿ', $gom->getNativeName()); $foo = new Language('foo_Latn'); $this->assertSame('foo', $foo->getNativeName()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('српски језик', $sr->getNativeName()); } public function testGetIsoDescription() { $ar = new Language('ca'); $this->assertSame('Catalan', $ar->getIsoDescription()); $this->assertSame('Catalan', $ar->getIsoDescription()); $ar = new Language('ar_DZ'); $this->assertSame('Arabic (Algeria)', $ar->getIsoDescription()); $gom = new Language('gom_Latn'); $this->assertSame('Konkani (Latin)', $gom->getIsoDescription()); $foo = new Language('foo_Latn'); $this->assertSame('foo (Latin)', $foo->getIsoDescription()); $foo->setNativeName('Foobar, Barbiz'); $this->assertSame('foo (Latin)', $foo->getIsoDescription()); $foo->setIsoName('Foobar, Barbiz'); $this->assertSame('Foobar (Latin)', $foo->getIsoDescription()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('Serbian (Montenegro) (Cyrillic)', $sr->getIsoDescription()); } public function testGetNativeDescription() { $ar = new Language('ca'); $this->assertSame('català', $ar->getNativeDescription()); $this->assertSame('català', $ar->getNativeDescription()); $ar = new Language('ar_DZ'); $this->assertSame('العربية (Algeria)', $ar->getNativeDescription()); $gom = new Language('gom_Latn'); $this->assertSame('ಕೊಂಕಣಿ (Latin)', $gom->getNativeDescription()); $foo = new Language('foo_Latn'); $this->assertSame('foo (Latin)', $foo->getNativeDescription()); $foo->setIsoName('Foobar, Barbiz'); $this->assertSame('foo (Latin)', $foo->getNativeDescription()); $foo->setNativeName('Foobar, Barbiz'); $this->assertSame('Foobar (Latin)', $foo->getNativeDescription()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('српски језик (Montenegro) (Cyrillic)', $sr->getNativeDescription()); } public function testGetFullIsoDescription() { $ar = new Language('ca'); $this->assertSame('Catalan, Valencian', $ar->getFullIsoDescription()); $this->assertSame('Catalan, Valencian', $ar->getFullIsoDescription()); $ar = new Language('ar_DZ'); $this->assertSame('Arabic (Algeria)', $ar->getFullIsoDescription()); $gom = new Language('gom_Latn'); $this->assertSame('Konkani, Goan (Latin)', $gom->getFullIsoDescription()); $foo = new Language('foo_Latn'); $this->assertSame('foo (Latin)', $foo->getFullIsoDescription()); $foo->setNativeName('Foobar, Barbiz'); $this->assertSame('foo (Latin)', $foo->getFullIsoDescription()); $foo->setIsoName('Foobar, Barbiz'); $this->assertSame('Foobar, Barbiz (Latin)', $foo->getFullIsoDescription()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('Serbian (Montenegro) (Cyrillic)', $sr->getFullIsoDescription()); } public function testGetFullNativeDescription() { $ar = new Language('ca'); $this->assertSame('català, valencià', $ar->getFullNativeDescription()); $this->assertSame('català, valencià', $ar->getFullNativeDescription()); $ar = new Language('ar_DZ'); $this->assertSame('العربية (Algeria)', $ar->getFullNativeDescription()); $gom = new Language('gom_Latn'); $this->assertSame('ಕೊಂಕಣಿ (Latin)', $gom->getFullNativeDescription()); $foo = new Language('foo_Latn'); $this->assertSame('foo (Latin)', $foo->getFullNativeDescription()); $foo->setIsoName('Foobar, Barbiz'); $this->assertSame('foo (Latin)', $foo->getFullNativeDescription()); $foo->setNativeName('Foobar, Barbiz'); $this->assertSame('Foobar, Barbiz (Latin)', $foo->getFullNativeDescription()); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('српски језик (Montenegro) (Cyrillic)', $sr->getFullNativeDescription()); } public function testToString() { $ar = new Language('ar'); $this->assertSame('ar', (string) $ar); $ar = new Language('ar_DZ'); $this->assertSame('ar_DZ', (string) $ar); $ar = new Language('ar_Shakl'); $this->assertSame('ar_Shakl', (string) $ar); } public function testToJson() { $ar = new Language('ca'); $this->assertSame('"Catalan"', json_encode($ar)); $this->assertSame('"Catalan"', json_encode($ar)); $ar = new Language('ar_DZ'); $this->assertSame('"Arabic (Algeria)"', json_encode($ar)); $gom = new Language('gom_Latn'); $this->assertSame('"Konkani (Latin)"', json_encode($gom)); $foo = new Language('foo_Latn'); $this->assertSame('"foo (Latin)"', json_encode($foo)); $foo->setNativeName('Foobar, Barbiz'); $this->assertSame('"foo (Latin)"', json_encode($foo)); $foo->setIsoName('Foobar, Barbiz'); $this->assertSame('"Foobar (Latin)"', json_encode($foo)); $sr = new Language('sr_Cyrl_ME'); $this->assertSame('"Serbian (Montenegro) (Cyrillic)"', json_encode($sr)); } } ================================================ FILE: tests/Language/TranslatorTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Language; use Carbon\AbstractTranslator; use Carbon\Carbon; use Carbon\Exceptions\ImmutableException; use Carbon\Exceptions\NotLocaleAwareException; use Carbon\Translator; use Carbon\TranslatorImmutable; use ReflectionMethod; use Tests\AbstractTestCase; class TranslatorTest extends AbstractTestCase { public function testSetLocale() { $currentLocale = setlocale(LC_TIME, '0'); $currentLocaleAll = setlocale(LC_ALL, '0'); $translator = new Translator('en_FooBar'); $translator->setLocale('auto'); $this->assertSame('en', $translator->getLocale()); $translator = new Translator('en'); $translator->setLocale('en_iso'); $this->assertSame('en_ISO', $translator->getLocale()); $translator = new Translator('fr'); if (setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.utf8', 'en_US', 'en_GB', 'en') === false || setlocale(LC_TIME, 'en_US.UTF-8', 'en_US.utf8', 'en_US', 'en_GB', 'en') === false) { $this->markTestSkipped('testSetLocale test need en_US.UTF-8.'); } $translator->setLocale('auto'); $this->assertStringStartsWith('en', $translator->getLocale()); setlocale(LC_ALL, $currentLocaleAll); setlocale(LC_TIME, $currentLocale); } public function testMethodsPriorities() { Carbon::setLocale('nl'); $text = Carbon::parse('2019-08-06')->locale('en')->isoFormat('dddd D MMMM'); $this->assertSame('Tuesday 6 August', $text); } public function testCompareChunkLists() { $method = new ReflectionMethod(AbstractTranslator::class, 'compareChunkLists'); $this->assertSame(20, $method->invoke(null, ['a', 'b'], ['a', 'b'])); $this->assertSame(10, $method->invoke(null, ['a', 'b'], ['a', 'c'])); $this->assertSame(10, $method->invoke(null, ['a'], ['a', 'c'])); $this->assertSame(11, $method->invoke(null, ['a', 'b'], ['a'])); $this->assertSame(10, $method->invoke(null, ['a'], ['a'])); } public function testNotLocaleAwareException() { $exception = new NotLocaleAwareException('foobar'); $this->assertSame( 'string does neither implements Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.', $exception->getMessage(), ); } public function testTranslatorImmutable() { $this->expectExceptionObject( new ImmutableException('setTranslations not allowed on '.TranslatorImmutable::class) ); TranslatorImmutable::get('en')->setTranslations([]); } public function testSerializationKeepLocale() { $translator = TranslatorImmutable::get('de'); $this->assertEquals('de', unserialize(serialize($translator))->getLocale()); $past = new Carbon('-3 Days'); $today = new Carbon('today'); $interval = $today->diffAsCarbonInterval($past); $translator = $interval->getLocalTranslator(); $this->assertEquals('en', unserialize(serialize($translator))->getLocale()); $past = new Carbon('-3 Days'); $today = new Carbon('today'); $interval = $today->locale('zh')->diffAsCarbonInterval($past); $translator = $interval->getLocalTranslator(); $this->assertEquals('zh', unserialize(serialize($translator))->getLocale()); } public function testUnserializeV2Object() { $interval = unserialize(<<<'EOS' O:21:"Carbon\CarbonInterval":22:{s:1:"y";i:0;s:1:"m";i:2;s:1:"d";i:0;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";d:5.4E-5;s:6:"invert";i:0;s:4:"days";b:0;s:11:"from_string";b:0;s:9:" * tzName";N;s:7:" * step";N;s:22:" * localMonthsOverflow";N;s:21:" * localYearsOverflow";N;s:25:" * localStrictModeEnabled";N;s:24:" * localHumanDiffOptions";N;s:22:" * localToStringFormat";N;s:18:" * localSerializer";N;s:14:" * localMacros";N;s:21:" * localGenericMacros";N;s:22:" * localFormatFunction";N;s:18:" * localTranslator";N;} EOS); $this->assertCarbonInterval($interval, 0, 2, 0, 0, 0, 0, 54); } } ================================================ FILE: tests/Laravel/App.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Laravel; use ArrayAccess; use Symfony\Component\Translation\Translator; class App implements ArrayAccess { /** * @var string */ protected $locale = 'en'; /** * @var string */ protected $fallbackLocale = 'en'; /** * @var string */ protected static $version; /** * @var Translator */ public $translator; /** * @var \Illuminate\Events\EventDispatcher */ public $events; public function register() { include_once __DIR__.'/EventDispatcher.php'; $this->locale = 'de'; $this->fallbackLocale = 'fr'; $this->translator = new Translator($this->locale); } public function setEventDispatcher($dispatcher) { $this->events = $dispatcher; } public static function version($version = null) { if ($version !== null) { static::$version = $version; } return static::$version; } public static function getLocaleChangeEventName() { return version_compare((string) static::version(), '5.5') >= 0 ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed'; } public function setLocaleWithoutEvent(string $locale) { $this->locale = $locale; $this->translator->setLocale($locale); } public function setLocale(string $locale) { $this->setLocaleWithoutEvent($locale); $this->events->dispatch(static::getLocaleChangeEventName()); } public function setFallbackLocale(string $fallbackLocale) { $this->fallbackLocale = $fallbackLocale; } public function getLocale() { return $this->locale; } public function getFallbackLocale() { return $this->fallbackLocale; } public function bound($service) { return isset($this->{$service}); } #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->$offset); } #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->$offset; } #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { // noop } #[\ReturnTypeWillChange] public function offsetUnset($offset) { // noop } public function removeService($offset) { $this->$offset = null; } } ================================================ FILE: tests/Laravel/Dispatcher.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Illuminate\Events; use Tests\Laravel\EventDispatcherBase; class Dispatcher extends EventDispatcherBase { } ================================================ FILE: tests/Laravel/EventDispatcher.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Illuminate\Events; use Tests\Laravel\EventDispatcherBase; class EventDispatcher extends EventDispatcherBase { } ================================================ FILE: tests/Laravel/EventDispatcherBase.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Laravel; class EventDispatcherBase { /** * @var array */ protected $listeners; public function listen($name, $listener) { $this->listeners[$name] ??= []; $this->listeners[$name][] = $listener; } public function dispatch($name, $event = null) { foreach (($this->listeners[$name] ?? []) as $listener) { $listener($event); } } } ================================================ FILE: tests/Laravel/ServiceProvider.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Illuminate\Support; use Illuminate\Events\EventDispatcher; use Tests\Laravel\App; class ServiceProvider { /** * @var App */ public $app; public function __construct($dispatcher = null) { $this->app = new App(); $this->app->setEventDispatcher($dispatcher ?: new EventDispatcher()); } } ================================================ FILE: tests/Laravel/ServiceProviderTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Laravel; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use Carbon\Laravel\ServiceProvider; use Generator; use Illuminate\Events\Dispatcher; use Illuminate\Events\EventDispatcher; use Illuminate\Support\Carbon as SupportCarbon; use Illuminate\Support\Facades\Date; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use stdClass; class ServiceProviderTest extends TestCase { public static function dataForDispatchers(): Generator { if (!class_exists(Dispatcher::class)) { include_once __DIR__.'/Dispatcher.php'; } if (!class_exists(EventDispatcher::class)) { include_once __DIR__.'/EventDispatcher.php'; } yield [new Dispatcher()]; yield [new EventDispatcher()]; } #[DataProvider('dataForDispatchers')] public function testBoot(EventDispatcherBase $dispatcher) { // Reset language Carbon::setLocale('en'); CarbonImmutable::setLocale('en'); CarbonPeriod::setLocale('en'); CarbonInterval::setLocale('en'); Carbon::setFallbackLocale('en'); CarbonImmutable::setFallbackLocale('en'); CarbonPeriod::setFallbackLocale('en'); CarbonInterval::setFallbackLocale('en'); $service = new ServiceProvider($dispatcher); $this->assertSame('en', Carbon::getLocale()); $this->assertSame('en', CarbonImmutable::getLocale()); $this->assertSame('en', CarbonPeriod::getLocale()); $this->assertSame('en', CarbonInterval::getLocale()); $this->assertSame('en', Carbon::getFallbackLocale()); $this->assertSame('en', CarbonImmutable::getFallbackLocale()); $this->assertSame('en', CarbonPeriod::getFallbackLocale()); $this->assertSame('en', CarbonInterval::getFallbackLocale()); $service->boot(); $this->assertSame('en', Carbon::getLocale()); $this->assertSame('en', CarbonImmutable::getLocale()); $this->assertSame('en', CarbonPeriod::getLocale()); $this->assertSame('en', CarbonInterval::getLocale()); $this->assertSame('en', Carbon::getFallbackLocale()); $this->assertSame('en', CarbonImmutable::getFallbackLocale()); $this->assertSame('en', CarbonPeriod::getFallbackLocale()); $this->assertSame('en', CarbonInterval::getFallbackLocale()); $service->app->register(); $service->boot(); $this->assertSame('de', Carbon::getLocale()); $this->assertSame('de', CarbonImmutable::getLocale()); $this->assertSame('de', CarbonPeriod::getLocale()); $this->assertSame('de', CarbonInterval::getLocale()); $this->assertSame('fr', Carbon::getFallbackLocale()); $this->assertSame('fr', CarbonImmutable::getFallbackLocale()); $this->assertSame('fr', CarbonPeriod::getFallbackLocale()); $this->assertSame('fr', CarbonInterval::getFallbackLocale()); $service->app->setLocale('fr'); $this->assertSame('fr', Carbon::getLocale()); $this->assertSame('fr', CarbonImmutable::getLocale()); $this->assertSame('fr', CarbonPeriod::getLocale()); $this->assertSame('fr', CarbonInterval::getLocale()); $this->assertNull($service->register()); // Reset language Carbon::setLocale('en'); Carbon::setFallbackLocale('en'); $service->app->removeService('events'); $this->assertNull($service->boot()); } public function testListenerWithoutLocaleUpdatedClass() { if (class_exists('Illuminate\Foundation\Events\LocaleUpdated')) { $this->markTestSkipped('This test cannot be run with Laravel 5.5 classes available via autoload.'); } $dispatcher = new Dispatcher(); $service = new ServiceProvider($dispatcher); Carbon::setLocale('en'); CarbonImmutable::setLocale('en'); CarbonPeriod::setLocale('en'); CarbonInterval::setLocale('en'); Carbon::setFallbackLocale('en'); CarbonImmutable::setFallbackLocale('en'); CarbonPeriod::setFallbackLocale('en'); CarbonInterval::setFallbackLocale('en'); $service->boot(); $service->app->register(); $service->app->setLocaleWithoutEvent('fr'); $service->app->setFallbackLocale('it'); $dispatcher->dispatch('locale.changed'); $this->assertSame('fr', Carbon::getLocale()); $this->assertSame('fr', CarbonImmutable::getLocale()); $this->assertSame('fr', CarbonPeriod::getLocale()); $this->assertSame('fr', CarbonInterval::getLocale()); $this->assertSame('en', Carbon::getFallbackLocale()); $this->assertSame('en', CarbonImmutable::getFallbackLocale()); $this->assertSame('en', CarbonPeriod::getFallbackLocale()); $this->assertSame('en', CarbonInterval::getFallbackLocale()); } public function testListenerWithLocaleUpdatedClass() { if (!class_exists('Illuminate\Foundation\Events\LocaleUpdated')) { eval('namespace Illuminate\Foundation\Events; class LocaleUpdated {}'); } $dispatcher = new Dispatcher(); $service = new ServiceProvider($dispatcher); Carbon::setLocale('en'); CarbonImmutable::setLocale('en'); CarbonPeriod::setLocale('en'); CarbonInterval::setLocale('en'); Carbon::setFallbackLocale('en'); CarbonImmutable::setFallbackLocale('en'); CarbonPeriod::setFallbackLocale('en'); CarbonInterval::setFallbackLocale('en'); $service->boot(); $service->app->register(); $service->app->setLocaleWithoutEvent('fr'); $service->app->setFallbackLocale('it'); $app = new App(); $app->register(); $app->setLocaleWithoutEvent('de_DE'); $app->setFallbackLocale('es_ES'); $dispatcher->dispatch('Illuminate\Foundation\Events\LocaleUpdated'); $this->assertSame('fr', Carbon::getLocale()); $this->assertSame('fr', CarbonImmutable::getLocale()); $this->assertSame('fr', CarbonPeriod::getLocale()); $this->assertSame('fr', CarbonInterval::getLocale()); $this->assertSame('en', Carbon::getFallbackLocale()); $this->assertSame('en', CarbonImmutable::getFallbackLocale()); $this->assertSame('en', CarbonPeriod::getFallbackLocale()); $this->assertSame('en', CarbonInterval::getFallbackLocale()); $service->setAppGetter(static fn () => $app); $this->assertSame('fr', Carbon::getLocale()); $service->updateLocale(); $this->assertSame('de_DE', Carbon::getLocale()); $service->setLocaleGetter(static fn () => 'ckb'); $this->assertSame('de_DE', Carbon::getLocale()); $service->updateLocale(); $this->assertSame('ckb', Carbon::getLocale()); $service->setLocaleGetter(null); $service->setAppGetter(static fn () => null); $service->updateLocale(); $this->assertSame('ckb', Carbon::getLocale()); $service->setAppGetter(static fn () => $app); $this->assertSame('en', Carbon::getFallbackLocale()); $service->updateFallbackLocale(); $this->assertSame('es_ES', Carbon::getFallbackLocale()); $service->setFallbackLocaleGetter(static fn () => 'ckb'); $this->assertSame('es_ES', Carbon::getFallbackLocale()); $service->updateFallbackLocale(); $this->assertSame('ckb', Carbon::getFallbackLocale()); $service->setFallbackLocaleGetter(null); $service->setAppGetter(static fn () => null); $service->updateFallbackLocale(); $this->assertSame('ckb', Carbon::getFallbackLocale()); } public function testUpdateLocale() { if (class_exists('Illuminate\Support\Carbon')) { $this->markTestSkipped('This test cannot be run with Laravel 5.5 classes available via autoload.'); } eval(' namespace Illuminate\Support; class Carbon { public static $locale; public static $fallbackLocale; public static function setLocale($locale) { static::$locale = $locale; } public static function setFallbackLocale($locale) { static::$fallbackLocale = $locale; } } '); eval(' namespace Illuminate\Support\Facades; use Exception; class Date { public static $locale; public static $fallbackLocale; public static function getFacadeRoot() { return new static(); } public function setLocale($locale) { static::$locale = $locale; if ($locale === "fr") { throw new Exception("stop"); } } public function setFallbackLocale($locale) { static::$fallbackLocale = $locale; if ($locale === "es") { throw new Exception("stop"); } } } '); $dispatcher = new Dispatcher(); $service = new ServiceProvider($dispatcher); $service->boot(); $service->app->register(); $this->assertSame('en', SupportCarbon::$locale); $this->assertSame('en', Date::$locale); $this->assertSame('en', SupportCarbon::$fallbackLocale); $this->assertSame('en', Date::$fallbackLocale); $service->updateLocale(); $this->assertSame('de', SupportCarbon::$locale); $this->assertSame('de', Date::$locale); $this->assertSame('en', SupportCarbon::$fallbackLocale); $this->assertSame('en', Date::$fallbackLocale); $service->updateFallbackLocale(); $this->assertSame('de', SupportCarbon::$locale); $this->assertSame('de', Date::$locale); $this->assertSame('fr', SupportCarbon::$fallbackLocale); $this->assertSame('fr', Date::$fallbackLocale); $service->app->setLocale('fr'); $service->app->setFallbackLocale('gl'); $service->updateLocale(); $this->assertSame('fr', SupportCarbon::$locale); $this->assertSame('fr', Date::$locale); $this->assertSame('fr', SupportCarbon::$fallbackLocale); $this->assertSame('fr', Date::$fallbackLocale); $service->updateFallbackLocale(); $this->assertSame('gl', SupportCarbon::$fallbackLocale); $this->assertSame('gl', Date::$fallbackLocale); eval(' use Illuminate\Events\Dispatcher; use Tests\Laravel\App; function app($id) { $app = new App(); $app->setEventDispatcher(new Dispatcher()); $app->register(); $app->setLocale("it"); return $app; } '); $service->app = new stdClass(); $service->updateLocale(); $this->assertSame('it', SupportCarbon::$locale); $this->assertSame('it', Date::$locale); } } ================================================ FILE: tests/Laravel/Translator.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Illuminate\Translation; class Translator extends \Symfony\Component\Translation\Translator { } ================================================ FILE: tests/Laravel/laravel.12.x.multi-tester.yml ================================================ config: directory: ../.. projects: laravel/framework: source: type: git url: https://github.com/laravel/framework.git reference: 12.x success_only: true install: - composer require "phpunit/phpunit:~12.4.0" "carbonphp/carbon-doctrine-types:*" "psr/clock:^1.0" "symfony/clock:^7.0|^8.0" "symfony/polyfill-mbstring:^1.0" "symfony/translation:^7.0|^8.0" --prefer-dist --no-interaction --prefer-stable - composer update --prefer-dist --no-interaction --prefer-stable script: - vendor/bin/phpunit --no-coverage ================================================ FILE: tests/Laravel/laravel.master.multi-tester.yml ================================================ config: directory: ../.. projects: laravel/framework: source: type: git url: https://github.com/laravel/framework.git reference: master success_only: true install: - composer config version "12.x-dev" - composer require "phpunit/phpunit:~12.4.0" "orchestra/testbench-core:^10" "carbonphp/carbon-doctrine-types:*" "psr/clock:^1.0" "symfony/clock:^7.0|^8.0" "symfony/polyfill-mbstring:^1.0" "symfony/translation:^7.0|^8.0" --prefer-dist --no-interaction --prefer-stable - composer update --prefer-dist --no-interaction --prefer-stable script: # Disable trigger_deprecation() in console/Application.php until Laravel fix the deprecation - sed -i 's/trigger_deprecation/#trigger_deprecation/g' vendor/symfony/console/Application.php - sed -i 's/testRouteCanBeFilteredByAction/skipTestRouteCanBeFilteredByAction/g' tests/Testing/Console/RouteListCommandTest.php # Run the test - vendor/bin/phpunit --no-coverage ================================================ FILE: tests/Localization/AaDjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AaDjTest extends LocalizationTestCase { public const LOCALE = 'aa_DJ'; // Afar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::now()->subDays(2)->calendar() 'Last Acaada at 8:49 carra', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 carra', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 saaku', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 saaku CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 saaku, 12:00 saaku', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 saaku, 1:30 saaku', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 saaku, 2:00 saaku', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 saaku, 6:00 saaku', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 saaku, 10:00 saaku', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 carra, 12:00 carra', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 carra, 5:00 carra', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 carra, 9:30 carra', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 carra, 11:00 carra', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ayti ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ayti ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ayti ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ayti ago', // Carbon::now()->subDays(1)->diffForHumans() '1 saaku ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 saaku ago', // Carbon::now()->subDays(2)->diffForHumans() '2 saaku ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 saaku ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 àlsa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 àlsa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 àlsa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 àlsa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 gaqambo ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 gaqambo ago', // Carbon::now()->subYears(2)->diffForHumans() '2 gaqambo ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 gaqambo ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 gaqambo 3 àlsa 1 saaku 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 gaqambo from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 àlsa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 gaqambo 3 àlsa 1 saaku 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 ayti', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 saaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 saaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 saaku from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 ayti', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ayti from now', // CarbonInterval::days(2)->forHumans() '2 saaku', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 saaku 3 ayti', ]; } ================================================ FILE: tests/Localization/AaErSaahoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AaErSaahoTest extends LocalizationTestCase { public const LOCALE = 'aa_ER@saaho'; // Afar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qunxa Sambat at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Naba Sambat at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sani at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Salus at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabuq at 12:00 saaku', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Camus at 12:00 saaku', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Salus at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabuq at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Camus at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qunxa Sambat at 12:00 saaku', // Carbon::now()->subDays(2)->calendar() 'Last Naba Sambat at 8:49 carra', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 carra', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 saaku', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Salus at 12:00 saaku', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Salus at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sani at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Naba Sambat at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Qunxa Sambat at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumqata at 12:00 saaku', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Camus at 12:00 saaku', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Rabuq at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumqata at 12:00 saaku', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 saaku CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 saaku, 12:00 saaku', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 saaku, 1:30 saaku', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 saaku, 2:00 saaku', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 saaku, 6:00 saaku', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 saaku, 10:00 saaku', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 carra, 12:00 carra', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 carra, 5:00 carra', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 carra, 9:30 carra', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 carra, 11:00 carra', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AaErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AaErTest extends LocalizationTestCase { public const LOCALE = 'aa_ER'; // Afar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::now()->subDays(2)->calendar() 'Last Acaada at 8:49 carra', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 carra', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 saaku', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 saaku CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 saaku, 12:00 saaku', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 saaku, 1:30 saaku', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 saaku, 2:00 saaku', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 saaku, 6:00 saaku', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 saaku, 10:00 saaku', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 carra, 12:00 carra', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 carra, 5:00 carra', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 carra, 9:30 carra', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 carra, 11:00 carra', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AaEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AaEtTest extends LocalizationTestCase { public const LOCALE = 'aa_ET'; // Afar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::now()->subDays(2)->calendar() 'Last Acaada at 8:49 carra', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 carra', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 saaku', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 saaku CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 saaku, 12:00 saaku', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 saaku, 1:30 saaku', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 saaku, 2:00 saaku', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 saaku, 6:00 saaku', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 saaku, 10:00 saaku', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 carra, 12:00 carra', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 carra, 5:00 carra', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 carra, 9:30 carra', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 carra, 11:00 carra', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AaTest extends LocalizationTestCase { public const LOCALE = 'aa'; // Afar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gumqata at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabti at 12:00 saaku', // Carbon::now()->subDays(2)->calendar() 'Last Acaada at 8:49 carra', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 carra', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 saaku', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talaata at 12:00 saaku', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talaata at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Etleeni at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Acaada at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabti at 12:00 saaku', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisi at 12:00 saaku', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Arbaqa at 12:00 saaku', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Gumqata at 12:00 saaku', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 saaku CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 saaku, 12:00 saaku', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 saaku, 1:30 saaku', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 saaku, 2:00 saaku', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 saaku, 6:00 saaku', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 saaku, 10:00 saaku', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 carra, 12:00 carra', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 carra, 5:00 carra', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 carra, 9:30 carra', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 carra, 11:00 carra', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ayti ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ayti ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ayti ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ayti ago', // Carbon::now()->subDays(1)->diffForHumans() '1 saaku ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 saaku ago', // Carbon::now()->subDays(2)->diffForHumans() '2 saaku ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 saaku ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 àlsa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 àlsa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 àlsa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 àlsa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 gaqambo ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 gaqambo ago', // Carbon::now()->subYears(2)->diffForHumans() '2 gaqambo ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 gaqambo ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 gaqambo 3 àlsa 1 saaku 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 gaqambo from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 àlsa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 gaqambo 3 àlsa 1 saaku 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 ayti', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 saaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 saaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 saaku from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 ayti', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ayti from now', // CarbonInterval::days(2)->forHumans() '2 saaku', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 saaku 3 ayti', ]; } ================================================ FILE: tests/Localization/AfNaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AfNaTest extends LocalizationTestCase { public const LOCALE = 'af_NA'; // Afrikaans public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Môre om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Vrydag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Vrydag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'Laas Sondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gister om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Vandag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Vandag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Môre om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Gister om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gister om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Sondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Saterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Vrydag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Laas Donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Laas Woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laas Vrydag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 v CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 v, 12:00 v', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 v, 1:30 v', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 v, 2:00 v', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 v, 6:00 v', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 v, 10:00 v', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 n, 12:00 n', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 n, 5:00 n', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 n, 9:30 n', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 n, 11:00 n', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekond gelede', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. gelede', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekondes gelede', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. gelede', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut gelede', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. gelede', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minute gelede', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. gelede', // Carbon::now()->subHours(1)->diffForHumans() '1 uur gelede', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 u. gelede', // Carbon::now()->subHours(2)->diffForHumans() '2 uur gelede', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 u. gelede', // Carbon::now()->subDays(1)->diffForHumans() '1 dag gelede', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. gelede', // Carbon::now()->subDays(2)->diffForHumans() '2 dae gelede', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. gelede', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week gelede', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 w. gelede', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weke gelede', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 w. gelede', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand gelede', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 maa. gelede', // Carbon::now()->subMonths(2)->diffForHumans() '2 maande gelede', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 maa. gelede', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar gelede', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 j. gelede', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar gelede', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 j. gelede', // Carbon::now()->addSecond()->diffForHumans() 'oor 1 sekond', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'oor 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekond na', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. na', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekond voor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. voor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekond', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'oor 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 sekond', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 maa. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'oor 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 maa. gelede', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 j. 3 maa. 1 d. 1 s. gelede', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dae', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dae', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'oor 1 week en 6 dae', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weke 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'oor \'n uur', // CarbonInterval::days(2)->forHumans() '2 dae', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 u.', ]; } ================================================ FILE: tests/Localization/AfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AfTest extends LocalizationTestCase { public const LOCALE = 'af'; // Afrikaans public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Môre om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Vrydag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Vrydag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'Laas Sondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gister om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Vandag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Vandag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Môre om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Gister om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gister om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Sondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Saterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Vrydag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Laas Donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Laas Woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laas Vrydag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekond gelede', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. gelede', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekondes gelede', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. gelede', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut gelede', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. gelede', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minute gelede', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. gelede', // Carbon::now()->subHours(1)->diffForHumans() '1 uur gelede', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 u. gelede', // Carbon::now()->subHours(2)->diffForHumans() '2 uur gelede', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 u. gelede', // Carbon::now()->subDays(1)->diffForHumans() '1 dag gelede', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. gelede', // Carbon::now()->subDays(2)->diffForHumans() '2 dae gelede', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. gelede', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week gelede', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 w. gelede', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weke gelede', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 w. gelede', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand gelede', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 maa. gelede', // Carbon::now()->subMonths(2)->diffForHumans() '2 maande gelede', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 maa. gelede', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar gelede', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 j. gelede', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar gelede', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 j. gelede', // Carbon::now()->addSecond()->diffForHumans() 'oor 1 sekond', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'oor 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekond na', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. na', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekond voor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. voor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekond', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'oor 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 sekond', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 maa. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'oor 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 maa. gelede', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 j. 3 maa. 1 d. 1 s. gelede', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dae', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dae', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'oor 1 week en 6 dae', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weke 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'oor \'n uur', // CarbonInterval::days(2)->forHumans() '2 dae', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 u.', ]; } ================================================ FILE: tests/Localization/AfZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AfZaTest extends LocalizationTestCase { public const LOCALE = 'af_ZA'; // Afrikaans public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Môre om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Vrydag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Vrydag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'Laas Sondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gister om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Vandag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Vandag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Môre om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Gister om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gister om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Sondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Saterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laas Vrydag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Laas Donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Laas Woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laas Vrydag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekond gelede', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. gelede', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekondes gelede', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. gelede', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut gelede', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. gelede', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minute gelede', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. gelede', // Carbon::now()->subHours(1)->diffForHumans() '1 uur gelede', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 u. gelede', // Carbon::now()->subHours(2)->diffForHumans() '2 uur gelede', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 u. gelede', // Carbon::now()->subDays(1)->diffForHumans() '1 dag gelede', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. gelede', // Carbon::now()->subDays(2)->diffForHumans() '2 dae gelede', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. gelede', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week gelede', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 w. gelede', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weke gelede', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 w. gelede', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand gelede', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 maa. gelede', // Carbon::now()->subMonths(2)->diffForHumans() '2 maande gelede', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 maa. gelede', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar gelede', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 j. gelede', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar gelede', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 j. gelede', // Carbon::now()->addSecond()->diffForHumans() 'oor 1 sekond', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'oor 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekond na', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. na', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekond voor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. voor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekond', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'oor 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 sekond', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 maa. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'oor 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 maa. gelede', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 j. 3 maa. 1 d. 1 s. gelede', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dae', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dae', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'oor 1 week en 6 dae', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weke 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'oor \'n uur', // CarbonInterval::days(2)->forHumans() '2 dae', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 u.', ]; } ================================================ FILE: tests/Localization/AgqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AgqTest extends LocalizationTestCase { public const LOCALE = 'agq'; // Aghem public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tsuʔndzɨkɔʔɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tsuʔntsɨ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tsuʔukpà at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tsuʔughɔe at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tsuʔutɔ̀mlò at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tsuʔumè at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'tsuʔughɨ̂m at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tsuʔughɔe at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tsuʔutɔ̀mlò at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tsuʔumè at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tsuʔughɨ̂m at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tsuʔndzɨkɔʔɔ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last tsuʔntsɨ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tsuʔughɔe at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tsuʔughɔe at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tsuʔukpà at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tsuʔntsɨ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tsuʔndzɨkɔʔɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tsuʔughɨ̂m at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tsuʔumè at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last tsuʔutɔ̀mlò at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last tsuʔughɨ̂m at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.g CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.g, 12:00 a.g', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.g, 1:30 a.g', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.g, 2:00 a.g', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.g, 6:00 a.g', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.g, 10:00 a.g', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.k, 12:00 a.k', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 a.k, 5:00 a.k', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 a.k, 9:30 a.k', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 a.k, 11:00 a.k', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AgrPeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AgrPeTest extends LocalizationTestCase { public const LOCALE = 'agr_PE'; // Aguaruna public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bataetin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuntuamtin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Achutin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saketin at 12:00 VM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Shimpitin at 12:00 VM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Imaptin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saketin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Shimpitin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Imaptin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bataetin at 12:00 VM', // Carbon::now()->subDays(2)->calendar() 'Last Tuntuamtin at 8:49 NM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 NM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 VM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Achutin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuntuamtin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bataetin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Imaptin at 12:00 VM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Shimpitin at 12:00 VM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Saketin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Imaptin at 12:00 VM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 53rd', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 53rd', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 53rd', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 53rd', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 53rd', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 53rd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 1st', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 kuwiš ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 kuwiš ago', // Carbon::now()->subHours(2)->diffForHumans() '2 kuwiš ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 kuwiš ago', // Carbon::now()->subDays(1)->diffForHumans() '1 nayaim ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 nayaim ago', // Carbon::now()->subDays(2)->diffForHumans() '2 nayaim ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 nayaim ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 nantu ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 nantu ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 nantu ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 nantu ago', // Carbon::now()->subYears(1)->diffForHumans() '1 yaya ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 yaya ago', // Carbon::now()->subYears(2)->diffForHumans() '2 yaya ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 yaya ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 yaya 3 nantu 1 nayaim 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 yaya from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 nantu ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 yaya 3 nantu 1 nayaim 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 kuwiš', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 nayaim', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 nayaim', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 nayaim from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 kuwiš', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 kuwiš from now', // CarbonInterval::days(2)->forHumans() '2 nayaim', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 nayaim 3 kuwiš', ]; } ================================================ FILE: tests/Localization/AgrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AgrTest extends LocalizationTestCase { public const LOCALE = 'agr'; // Aguaruna public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bataetin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuntuamtin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Achutin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saketin at 12:00 VM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Shimpitin at 12:00 VM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Imaptin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saketin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Shimpitin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Imaptin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bataetin at 12:00 VM', // Carbon::now()->subDays(2)->calendar() 'Last Tuntuamtin at 8:49 NM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 NM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 VM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kugkuktin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Achutin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuntuamtin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bataetin at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Imaptin at 12:00 VM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Shimpitin at 12:00 VM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Saketin at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Imaptin at 12:00 VM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 53rd', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 53rd', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 53rd', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 53rd', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 53rd', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 53rd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 1st', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 kuwiš ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 kuwiš ago', // Carbon::now()->subHours(2)->diffForHumans() '2 kuwiš ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 kuwiš ago', // Carbon::now()->subDays(1)->diffForHumans() '1 nayaim ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 nayaim ago', // Carbon::now()->subDays(2)->diffForHumans() '2 nayaim ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 nayaim ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 nantu ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 nantu ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 nantu ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 nantu ago', // Carbon::now()->subYears(1)->diffForHumans() '1 yaya ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 yaya ago', // Carbon::now()->subYears(2)->diffForHumans() '2 yaya ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 yaya ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 yaya 3 nantu 1 nayaim 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 yaya from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 nantu ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 yaya 3 nantu 1 nayaim 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 kuwiš', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 nayaim', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 nayaim', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 nayaim from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 kuwiš', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 kuwiš from now', // CarbonInterval::days(2)->forHumans() '2 nayaim', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 nayaim 3 kuwiš', ]; } ================================================ FILE: tests/Localization/AkGhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AkGhTest extends LocalizationTestCase { public const LOCALE = 'ak_GH'; // Akan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Memeneda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kwesida at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dwowda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Benada at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wukuda at 12:00 AN', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Yawda at 12:00 AN', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fida at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Benada at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wukuda at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Yawda at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fida at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Memeneda at 12:00 AN', // Carbon::now()->subDays(2)->calendar() 'Last Kwesida at 8:49 EW', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 EW', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AN', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Benada at 12:00 AN', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Benada at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dwowda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kwesida at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Memeneda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fida at 12:00 AN', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Yawda at 12:00 AN', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wukuda at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fida at 12:00 AN', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 an CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AN, 12:00 an', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AN, 1:30 an', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AN, 2:00 an', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AN, 6:00 an', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AN, 10:00 an', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 EW, 12:00 ew', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 EW, 5:00 ew', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 EW, 9:30 ew', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 EW, 11:00 ew', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ɛda ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ɛda ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ɛda ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ɛda ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 bosume ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 bosume ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 bosume ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 bosume ago', // Carbon::now()->subYears(1)->diffForHumans() '1 afe ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 afe ago', // Carbon::now()->subYears(2)->diffForHumans() '2 afe ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 afe ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 afe 3 bosume 1 ɛda 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 afe from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 bosume ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 afe 3 bosume 1 ɛda 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ɛda', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ɛda', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ɛda from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ɛda', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ɛda 3h', ]; } ================================================ FILE: tests/Localization/AkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AkTest extends LocalizationTestCase { public const LOCALE = 'ak'; // Akan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Memeneda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kwesida at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dwowda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Benada at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wukuda at 12:00 AN', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Yawda at 12:00 AN', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fida at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Benada at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wukuda at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Yawda at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fida at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Memeneda at 12:00 AN', // Carbon::now()->subDays(2)->calendar() 'Last Kwesida at 8:49 EW', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 EW', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AN', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AN', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AN', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Benada at 12:00 AN', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Benada at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dwowda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kwesida at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Memeneda at 12:00 AN', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fida at 12:00 AN', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Yawda at 12:00 AN', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wukuda at 12:00 AN', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fida at 12:00 AN', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 an CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AN, 12:00 an', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AN, 1:30 an', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AN, 2:00 an', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AN, 6:00 an', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AN, 10:00 an', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 EW, 12:00 ew', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 EW, 5:00 ew', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 EW, 9:30 ew', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 EW, 11:00 ew', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ɛda ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ɛda ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ɛda ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ɛda ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 bosume ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 bosume ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 bosume ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 bosume ago', // Carbon::now()->subYears(1)->diffForHumans() '1 afe ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 afe ago', // Carbon::now()->subYears(2)->diffForHumans() '2 afe ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 afe ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 afe 3 bosume 1 ɛda 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 afe from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 bosume ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 afe 3 bosume 1 ɛda 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ɛda', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ɛda', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ɛda from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ɛda', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ɛda 3h', ]; } ================================================ FILE: tests/Localization/AmEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AmEtTest extends LocalizationTestCase { public const LOCALE = 'am_ET'; // Amharic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቅዳሜ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'እሑድ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ረቡዕ at 12:00 ጡዋት', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሐሙስ at 12:00 ጡዋት', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ረቡዕ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሐሙስ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቅዳሜ at 12:00 ጡዋት', // Carbon::now()->subDays(2)->calendar() 'Last እሑድ at 8:49 ከሰዓት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ከሰዓት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ጡዋት', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last እሑድ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቅዳሜ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሐሙስ at 12:00 ጡዋት', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ረቡዕ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ጡዋት CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ጡዋት, 12:00 ጡዋት', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ጡዋት, 1:30 ጡዋት', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ጡዋት, 2:00 ጡዋት', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ጡዋት, 6:00 ጡዋት', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ጡዋት, 10:00 ጡዋት', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ከሰዓት, 12:00 ከሰዓት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ከሰዓት, 5:00 ከሰዓት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ከሰዓት, 9:30 ከሰዓት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ከሰዓት, 11:00 ከሰዓት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'ከ1 ሴኮንድ በፊት', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ከ1 ሴኮንድ በፊት', // Carbon::now()->subSeconds(2)->diffForHumans() 'ከ2 ሴኮንድ በፊት', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ከ2 ሴኮንድ በፊት', // Carbon::now()->subMinutes(1)->diffForHumans() 'ከ1 ደቂቃ በፊት', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ከ1 ደቂቃ በፊት', // Carbon::now()->subMinutes(2)->diffForHumans() 'ከ2 ደቂቃ በፊት', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ከ2 ደቂቃ በፊት', // Carbon::now()->subHours(1)->diffForHumans() 'ከ1 ሰዓት በፊት', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ከ1 ሰዓት በፊት', // Carbon::now()->subHours(2)->diffForHumans() 'ከ2 ሰዓት በፊት', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ከ2 ሰዓት በፊት', // Carbon::now()->subDays(1)->diffForHumans() 'ከ1 ቀን በፊት', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ከ1 ቀን በፊት', // Carbon::now()->subDays(2)->diffForHumans() 'ከ2 ቀን በፊት', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ከ2 ቀን በፊት', // Carbon::now()->subWeeks(1)->diffForHumans() 'ከ1 ሳምንት በፊት', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ከ1 ሳምንት በፊት', // Carbon::now()->subWeeks(2)->diffForHumans() 'ከ2 ሳምንት በፊት', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ከ2 ሳምንት በፊት', // Carbon::now()->subMonths(1)->diffForHumans() 'ከ1 ወር በፊት', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ከ1 ወር በፊት', // Carbon::now()->subMonths(2)->diffForHumans() 'ከ2 ወር በፊት', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ከ2 ወር በፊት', // Carbon::now()->subYears(1)->diffForHumans() 'ከ1 አመት በፊት', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ከ1 አመት በፊት', // Carbon::now()->subYears(2)->diffForHumans() 'ከ2 አመት በፊት', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ከ2 አመት በፊት', // Carbon::now()->addSecond()->diffForHumans() 'በ1 ሴኮንድ ውስጥ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'በ1 ሴኮንድ ውስጥ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ሴኮንድ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ሴኮንድ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ሴኮንድ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ሴኮንድ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ሴኮንድ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ሴኮንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ሴኮንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ሴኮንድ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'በ1 ሴኮንድ ውስጥ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ደቂቃ 1 ሴኮንድ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 አመት 3 ወር 1 ቀን 1 ሴኮንድ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'በ3 አመት ውስጥ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ከ5 ወር በፊት', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ከ2 አመት 3 ወር 1 ቀን 1 ሴኮንድ በፊት', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሳምንት 10 ሰዓት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሳምንት 6 ቀን', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሳምንት 6 ቀን', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'በ1 ሳምንት and 6 ቀን ውስጥ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሳምንት 1 ሰዓት', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'በ1 ሰዓት ውስጥ', // CarbonInterval::days(2)->forHumans() '2 ቀን', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ቀን 3 ሰዓት', ]; } ================================================ FILE: tests/Localization/AmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AmTest extends LocalizationTestCase { public const LOCALE = 'am'; // Amharic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቅዳሜ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'እሑድ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ረቡዕ at 12:00 ጡዋት', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሐሙስ at 12:00 ጡዋት', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ረቡዕ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሐሙስ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቅዳሜ at 12:00 ጡዋት', // Carbon::now()->subDays(2)->calendar() 'Last እሑድ at 8:49 ከሰዓት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ከሰዓት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ጡዋት', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ማክሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኞ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last እሑድ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቅዳሜ at 12:00 ጡዋት', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሐሙስ at 12:00 ጡዋት', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ረቡዕ at 12:00 ጡዋት', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርብ at 12:00 ጡዋት', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ጡዋት CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ጡዋት, 12:00 ጡዋት', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ጡዋት, 1:30 ጡዋት', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ጡዋት, 2:00 ጡዋት', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ጡዋት, 6:00 ጡዋት', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ጡዋት, 10:00 ጡዋት', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ከሰዓት, 12:00 ከሰዓት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ከሰዓት, 5:00 ከሰዓት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ከሰዓት, 9:30 ከሰዓት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ከሰዓት, 11:00 ከሰዓት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'ከ1 ሴኮንድ በፊት', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ከ1 ሴኮንድ በፊት', // Carbon::now()->subSeconds(2)->diffForHumans() 'ከ2 ሴኮንድ በፊት', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ከ2 ሴኮንድ በፊት', // Carbon::now()->subMinutes(1)->diffForHumans() 'ከ1 ደቂቃ በፊት', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ከ1 ደቂቃ በፊት', // Carbon::now()->subMinutes(2)->diffForHumans() 'ከ2 ደቂቃ በፊት', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ከ2 ደቂቃ በፊት', // Carbon::now()->subHours(1)->diffForHumans() 'ከ1 ሰዓት በፊት', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ከ1 ሰዓት በፊት', // Carbon::now()->subHours(2)->diffForHumans() 'ከ2 ሰዓት በፊት', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ከ2 ሰዓት በፊት', // Carbon::now()->subDays(1)->diffForHumans() 'ከ1 ቀን በፊት', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ከ1 ቀን በፊት', // Carbon::now()->subDays(2)->diffForHumans() 'ከ2 ቀን በፊት', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ከ2 ቀን በፊት', // Carbon::now()->subWeeks(1)->diffForHumans() 'ከ1 ሳምንት በፊት', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ከ1 ሳምንት በፊት', // Carbon::now()->subWeeks(2)->diffForHumans() 'ከ2 ሳምንት በፊት', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ከ2 ሳምንት በፊት', // Carbon::now()->subMonths(1)->diffForHumans() 'ከ1 ወር በፊት', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ከ1 ወር በፊት', // Carbon::now()->subMonths(2)->diffForHumans() 'ከ2 ወር በፊት', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ከ2 ወር በፊት', // Carbon::now()->subYears(1)->diffForHumans() 'ከ1 አመት በፊት', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ከ1 አመት በፊት', // Carbon::now()->subYears(2)->diffForHumans() 'ከ2 አመት በፊት', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ከ2 አመት በፊት', // Carbon::now()->addSecond()->diffForHumans() 'በ1 ሴኮንድ ውስጥ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'በ1 ሴኮንድ ውስጥ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ሴኮንድ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ሴኮንድ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ሴኮንድ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ሴኮንድ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ሴኮንድ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ሴኮንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ሴኮንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ሴኮንድ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'በ1 ሴኮንድ ውስጥ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ደቂቃ 1 ሴኮንድ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 አመት 3 ወር 1 ቀን 1 ሴኮንድ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'በ3 አመት ውስጥ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ከ5 ወር በፊት', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ከ2 አመት 3 ወር 1 ቀን 1 ሴኮንድ በፊት', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሳምንት 10 ሰዓት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሳምንት 6 ቀን', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሳምንት 6 ቀን', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'በ1 ሳምንት and 6 ቀን ውስጥ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሳምንት 1 ሰዓት', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'በ1 ሰዓት ውስጥ', // CarbonInterval::days(2)->forHumans() '2 ቀን', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ቀን 3 ሰዓት', ]; } ================================================ FILE: tests/Localization/AnEsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AnEsTest extends LocalizationTestCase { public const LOCALE = 'an_ES'; // Aragonese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabado at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luns at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mierques at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'chueves at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mierques at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'chueves at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabado at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last domingo at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martes at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last luns at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last domingo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabado at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last viernes at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last chueves at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mierques at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last viernes at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segundo ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segundo ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segundo ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segundo ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuto ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuto ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuto ago', // Carbon::now()->subHours(1)->diffForHumans() '1 reloch ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 reloch ago', // Carbon::now()->subHours(2)->diffForHumans() '2 reloch ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 reloch ago', // Carbon::now()->subDays(1)->diffForHumans() '1 día ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 día ago', // Carbon::now()->subDays(2)->diffForHumans() '2 día ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 día ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 semana ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 semana ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 semana ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 semana ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mes ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mes ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mes ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mes ago', // Carbon::now()->subYears(1)->diffForHumans() '1 año ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 año ago', // Carbon::now()->subYears(2)->diffForHumans() '2 año ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 año ago', // Carbon::now()->addSecond()->diffForHumans() '1 segundo from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segundo from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segundo after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segundo before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segundo from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 año 3 mes 1 día 1 segundo', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 año from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mes ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 año 3 mes 1 día 1 segundo ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 reloch', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 semana and 6 día from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semana 1 reloch', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 reloch from now', // CarbonInterval::days(2)->forHumans() '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 día 3 reloch', ]; } ================================================ FILE: tests/Localization/AnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AnTest extends LocalizationTestCase { public const LOCALE = 'an'; // Aragonese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabado at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luns at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mierques at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'chueves at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mierques at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'chueves at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabado at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last domingo at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martes at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last luns at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last domingo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabado at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last viernes at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last chueves at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mierques at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last viernes at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segundo ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segundo ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segundo ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segundo ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuto ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuto ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuto ago', // Carbon::now()->subHours(1)->diffForHumans() '1 reloch ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 reloch ago', // Carbon::now()->subHours(2)->diffForHumans() '2 reloch ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 reloch ago', // Carbon::now()->subDays(1)->diffForHumans() '1 día ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 día ago', // Carbon::now()->subDays(2)->diffForHumans() '2 día ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 día ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 semana ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 semana ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 semana ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 semana ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mes ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mes ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mes ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mes ago', // Carbon::now()->subYears(1)->diffForHumans() '1 año ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 año ago', // Carbon::now()->subYears(2)->diffForHumans() '2 año ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 año ago', // Carbon::now()->addSecond()->diffForHumans() '1 segundo from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segundo from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segundo after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segundo before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segundo from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 año 3 mes 1 día 1 segundo', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 año from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mes ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 año 3 mes 1 día 1 segundo ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 reloch', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 semana and 6 día from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semana 1 reloch', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 reloch from now', // CarbonInterval::days(2)->forHumans() '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 día 3 reloch', ]; } ================================================ FILE: tests/Localization/AnpInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AnpInTest extends LocalizationTestCase { public const LOCALE = 'anp_IN'; // Angika public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AnpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AnpTest extends LocalizationTestCase { public const LOCALE = 'anp'; // Angika public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/ArAeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArAeTest extends LocalizationTestCase { public const LOCALE = 'ar_AE'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArBhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArBhTest extends LocalizationTestCase { public const LOCALE = 'ar_BH'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArDjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArDjTest extends LocalizationTestCase { public const LOCALE = 'ar_DJ'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArDzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArDzTest extends LocalizationTestCase { public const LOCALE = 'ar_DZ'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدا على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت على الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد على الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم على الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم على الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدا على الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'في ثانية', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'في 3 سنوات', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'في أسبوع و 6 أيام', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'في ساعة', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArEgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArEgTest extends LocalizationTestCase { public const LOCALE = 'ar_EG'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArEhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArEhTest extends LocalizationTestCase { public const LOCALE = 'ar_EH'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArErTest extends LocalizationTestCase { public const LOCALE = 'ar_ER'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArIlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArIlTest extends LocalizationTestCase { public const LOCALE = 'ar_IL'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArInTest extends LocalizationTestCase { public const LOCALE = 'ar_IN'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArIqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArIqTest extends LocalizationTestCase { public const LOCALE = 'ar_IQ'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArJoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArJoTest extends LocalizationTestCase { public const LOCALE = 'ar_JO'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArKmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArKmTest extends LocalizationTestCase { public const LOCALE = 'ar_KM'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArKwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArKwTest extends LocalizationTestCase { public const LOCALE = 'ar_KW'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدا على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت على الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد على الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم على الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم على الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدا على الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'في ثانية', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'في 3 سنوات', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'في أسبوع و 6 أيام', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'في ساعة', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArLbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArLbTest extends LocalizationTestCase { public const LOCALE = 'ar_LB'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArLyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArLyTest extends LocalizationTestCase { public const LOCALE = 'ar_LY'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArMaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArMaTest extends LocalizationTestCase { public const LOCALE = 'ar_MA'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدا على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت على الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد على الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم على الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم على الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدا على الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'في ثانية', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'في 3 سنوات', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'في أسبوع و 6 أيام', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'في ساعة', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArMrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArMrTest extends LocalizationTestCase { public const LOCALE = 'ar_MR'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArOmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArOmTest extends LocalizationTestCase { public const LOCALE = 'ar_OM'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArPsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArPsTest extends LocalizationTestCase { public const LOCALE = 'ar_PS'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArQaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArQaTest extends LocalizationTestCase { public const LOCALE = 'ar_QA'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArSaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArSaTest extends LocalizationTestCase { public const LOCALE = 'ar_SA'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدا على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت على الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد على الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم على الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم على الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدا على الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'في ثانية', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'في 3 سنوات', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'في أسبوع و 6 أيام', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'في ساعة', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArSdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArSdTest extends LocalizationTestCase { public const LOCALE = 'ar_SD'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArShaklTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArShaklTest extends LocalizationTestCase { public const LOCALE = 'ar_Shakl'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'مُنْذُ ثَانِيَة', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'مُنْذُ ثَانِيَة', // Carbon::now()->subSeconds(2)->diffForHumans() 'مُنْذُ ثَانِيَتَيْن', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'مُنْذُ ثَانِيَتَيْن', // Carbon::now()->subMinutes(1)->diffForHumans() 'مُنْذُ دَقِيقَة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'مُنْذُ دَقِيقَة', // Carbon::now()->subMinutes(2)->diffForHumans() 'مُنْذُ دَقِيقَتَيْن', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'مُنْذُ دَقِيقَتَيْن', // Carbon::now()->subHours(1)->diffForHumans() 'مُنْذُ سَاعَة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'مُنْذُ سَاعَة', // Carbon::now()->subHours(2)->diffForHumans() 'مُنْذُ سَاعَتَيْن', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'مُنْذُ سَاعَتَيْن', // Carbon::now()->subDays(1)->diffForHumans() 'مُنْذُ يَوْم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'مُنْذُ يَوْم', // Carbon::now()->subDays(2)->diffForHumans() 'مُنْذُ يَوْمَيْن', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'مُنْذُ يَوْمَيْن', // Carbon::now()->subWeeks(1)->diffForHumans() 'مُنْذُ أُسْبُوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'مُنْذُ أُسْبُوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'مُنْذُ أُسْبُوعَيْن', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'مُنْذُ أُسْبُوعَيْن', // Carbon::now()->subMonths(1)->diffForHumans() 'مُنْذُ شَهْرَ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'مُنْذُ شَهْرَ', // Carbon::now()->subMonths(2)->diffForHumans() 'مُنْذُ شَهْرَيْن', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'مُنْذُ شَهْرَيْن', // Carbon::now()->subYears(1)->diffForHumans() 'مُنْذُ سَنَة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'مُنْذُ سَنَة', // Carbon::now()->subYears(2)->diffForHumans() 'مُنْذُ سَنَتَيْن', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'مُنْذُ سَنَتَيْن', // Carbon::now()->addSecond()->diffForHumans() 'مِنَ الْآن ثَانِيَة', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'مِنَ الْآن ثَانِيَة', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بَعْدَ ثَانِيَة', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بَعْدَ ثَانِيَة', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قَبْلَ ثَانِيَة', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قَبْلَ ثَانِيَة', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثَانِيَة', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثَانِيَة', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثَانِيَتَيْن', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثَانِيَتَيْن', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'مِنَ الْآن ثَانِيَة', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دَقِيقَة ثَانِيَة', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سَنَتَيْن 3 أَشْهُر يَوْم ثَانِيَة', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'مِنَ الْآن 3 سَنَوَات', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'مُنْذُ 5 أَشْهُر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'مُنْذُ سَنَتَيْن 3 أَشْهُر يَوْم ثَانِيَة', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أُسْبُوع 10 سَاعَات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أُسْبُوع 6 أَيَّام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أُسْبُوع 6 أَيَّام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'مِنَ الْآن أُسْبُوع و 6 أَيَّام', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أُسْبُوعَيْن سَاعَة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'مِنَ الْآن سَاعَة', // CarbonInterval::days(2)->forHumans() 'يَوْمَيْن', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يَوْم 3 سَاعَات', ]; } ================================================ FILE: tests/Localization/ArSoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArSoTest extends LocalizationTestCase { public const LOCALE = 'ar_SO'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArSsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArSsTest extends LocalizationTestCase { public const LOCALE = 'ar_SS'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArSyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArSyTest extends LocalizationTestCase { public const LOCALE = 'ar_SY'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArTdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArTdTest extends LocalizationTestCase { public const LOCALE = 'ar_TD'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArTest extends LocalizationTestCase { public const LOCALE = 'ar'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArTnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArTnTest extends LocalizationTestCase { public const LOCALE = 'ar_TN'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدا على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت على الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد على الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم على الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم على الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدا على الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت على الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس على الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء على الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة على الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'في ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'في ثانية', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'في 3 سنوات', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'في أسبوع و 6 أيام', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'في ساعة', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/ArYeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ArYeTest extends LocalizationTestCase { public const LOCALE = 'ar_YE'; // Arabic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'غدًا عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::now()->subDays(2)->calendar() 'الأحد عند الساعة 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اليوم عند الساعة 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اليوم عند الساعة 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'غدًا عند الساعة 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'أمس عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الثلاثاء عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الاثنين عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الأحد عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'السبت عند الساعة 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'الخميس عند الساعة 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'الأربعاء عند الساعة 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'الجمعة عند الساعة 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 م, 12:00 م', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 م, 5:00 م', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 م, 9:30 م', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 م, 11:00 م', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'منذ ثانية', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'منذ ثانية', // Carbon::now()->subSeconds(2)->diffForHumans() 'منذ ثانيتين', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'منذ ثانيتين', // Carbon::now()->subMinutes(1)->diffForHumans() 'منذ دقيقة', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'منذ دقيقة', // Carbon::now()->subMinutes(2)->diffForHumans() 'منذ دقيقتين', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'منذ دقيقتين', // Carbon::now()->subHours(1)->diffForHumans() 'منذ ساعة', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'منذ ساعة', // Carbon::now()->subHours(2)->diffForHumans() 'منذ ساعتين', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'منذ ساعتين', // Carbon::now()->subDays(1)->diffForHumans() 'منذ يوم', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'منذ يوم', // Carbon::now()->subDays(2)->diffForHumans() 'منذ يومين', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'منذ يومين', // Carbon::now()->subWeeks(1)->diffForHumans() 'منذ أسبوع', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'منذ أسبوع', // Carbon::now()->subWeeks(2)->diffForHumans() 'منذ أسبوعين', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'منذ أسبوعين', // Carbon::now()->subMonths(1)->diffForHumans() 'منذ شهر', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'منذ شهر', // Carbon::now()->subMonths(2)->diffForHumans() 'منذ شهرين', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'منذ شهرين', // Carbon::now()->subYears(1)->diffForHumans() 'منذ سنة', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'منذ سنة', // Carbon::now()->subYears(2)->diffForHumans() 'منذ سنتين', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'منذ سنتين', // Carbon::now()->addSecond()->diffForHumans() 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ثانية من الآن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'بعد ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'بعد ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'قبل ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'قبل ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ثانية', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ثانية', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'ثانيتين', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'ثانيتين', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ثانية من الآن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'دقيقة ثانية', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'سنتين 3 أشهر يوم ثانية', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سنوات من الآن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'منذ 5 أشهر', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'منذ سنتين 3 أشهر يوم ثانية', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'أسبوع 10 ساعات', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'أسبوع 6 أيام', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'أسبوع و 6 أيام من الآن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'أسبوعين ساعة', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ساعة من الآن', // CarbonInterval::days(2)->forHumans() 'يومين', // CarbonInterval::create('P1DT3H')->forHumans(true) 'يوم 3 ساعات', ]; } ================================================ FILE: tests/Localization/AsInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AsInTest extends LocalizationTestCase { public const LOCALE = 'as_IN'; // Assamese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'শনিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'দেওবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'সোমবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'বুধবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'বৃহষ্পতিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'বুধবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'বৃহষ্পতিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'শনিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::now()->subDays(2)->calendar() 'Last দেওবাৰ at 8:49 অপৰাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 অপৰাহ্ন', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last সোমবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last দেওবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last শনিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last বৃহষ্পতিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last বুধবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 পূৰ্ব্বাহ্ন CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 পূৰ্ব্বাহ্ন, 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 পূৰ্ব্বাহ্ন, 1:30 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 পূৰ্ব্বাহ্ন, 2:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 পূৰ্ব্বাহ্ন, 6:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 পূৰ্ব্বাহ্ন, 10:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 অপৰাহ্ন, 12:00 অপৰাহ্ন', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 অপৰাহ্ন, 5:00 অপৰাহ্ন', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 অপৰাহ্ন, 9:30 অপৰাহ্ন', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 অপৰাহ্ন, 11:00 অপৰাহ্ন', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 দ্বিতীয় ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 দ্বিতীয় ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 দ্বিতীয় ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 দ্বিতীয় ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 মিনিট ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 মিনিট ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 মিনিট ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 মিনিট ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ঘণ্টা ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ঘণ্টা ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ঘণ্টা ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ঘণ্টা ago', // Carbon::now()->subDays(1)->diffForHumans() '1 বাৰ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 বাৰ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 বাৰ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 বাৰ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 সপ্তাহ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 সপ্তাহ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 সপ্তাহ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 সপ্তাহ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 মাহ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 মাহ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 মাহ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 মাহ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 বছৰ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 বছৰ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 বছৰ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 বছৰ ago', // Carbon::now()->addSecond()->diffForHumans() '1 দ্বিতীয় from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 দ্বিতীয় from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 দ্বিতীয় after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 দ্বিতীয় after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 দ্বিতীয় before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 দ্বিতীয় before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 দ্বিতীয়', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 দ্বিতীয়', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 দ্বিতীয়', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 দ্বিতীয়', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 দ্বিতীয় from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 মিনিট 1 দ্বিতীয়', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 বছৰ 3 মাহ 1 বাৰ 1 দ্বিতীয়', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 বছৰ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 মাহ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 বছৰ 3 মাহ 1 বাৰ 1 দ্বিতীয় ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 সপ্তাহ 10 ঘণ্টা', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 সপ্তাহ 6 বাৰ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 সপ্তাহ 6 বাৰ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 সপ্তাহ and 6 বাৰ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 সপ্তাহ 1 ঘণ্টা', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ঘণ্টা from now', // CarbonInterval::days(2)->forHumans() '2 বাৰ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 বাৰ 3 ঘণ্টা', ]; } ================================================ FILE: tests/Localization/AsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AsTest extends LocalizationTestCase { public const LOCALE = 'as'; // Assamese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'শনিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'দেওবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'সোমবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'বুধবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'বৃহষ্পতিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'বুধবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'বৃহষ্পতিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'শনিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::now()->subDays(2)->calendar() 'Last দেওবাৰ at 8:49 অপৰাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 অপৰাহ্ন', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last মঙ্গলবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last সোমবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last দেওবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last শনিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last বৃহষ্পতিবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last বুধবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last শুক্ৰবাৰ at 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 পূৰ্ব্বাহ্ন CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 পূৰ্ব্বাহ্ন, 12:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 পূৰ্ব্বাহ্ন, 1:30 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 পূৰ্ব্বাহ্ন, 2:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 পূৰ্ব্বাহ্ন, 6:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 পূৰ্ব্বাহ্ন, 10:00 পূৰ্ব্বাহ্ন', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 অপৰাহ্ন, 12:00 অপৰাহ্ন', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 অপৰাহ্ন, 5:00 অপৰাহ্ন', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 অপৰাহ্ন, 9:30 অপৰাহ্ন', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 অপৰাহ্ন, 11:00 অপৰাহ্ন', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 দ্বিতীয় ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 দ্বিতীয় ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 দ্বিতীয় ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 দ্বিতীয় ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 মিনিট ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 মিনিট ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 মিনিট ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 মিনিট ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ঘণ্টা ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ঘণ্টা ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ঘণ্টা ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ঘণ্টা ago', // Carbon::now()->subDays(1)->diffForHumans() '1 বাৰ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 বাৰ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 বাৰ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 বাৰ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 সপ্তাহ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 সপ্তাহ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 সপ্তাহ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 সপ্তাহ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 মাহ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 মাহ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 মাহ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 মাহ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 বছৰ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 বছৰ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 বছৰ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 বছৰ ago', // Carbon::now()->addSecond()->diffForHumans() '1 দ্বিতীয় from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 দ্বিতীয় from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 দ্বিতীয় after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 দ্বিতীয় after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 দ্বিতীয় before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 দ্বিতীয় before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 দ্বিতীয়', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 দ্বিতীয়', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 দ্বিতীয়', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 দ্বিতীয়', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 দ্বিতীয় from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 মিনিট 1 দ্বিতীয়', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 বছৰ 3 মাহ 1 বাৰ 1 দ্বিতীয়', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 বছৰ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 মাহ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 বছৰ 3 মাহ 1 বাৰ 1 দ্বিতীয় ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 সপ্তাহ 10 ঘণ্টা', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 সপ্তাহ 6 বাৰ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 সপ্তাহ 6 বাৰ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 সপ্তাহ and 6 বাৰ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 সপ্তাহ 1 ঘণ্টা', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ঘণ্টা from now', // CarbonInterval::days(2)->forHumans() '2 বাৰ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 বাৰ 3 ঘণ্টা', ]; } ================================================ FILE: tests/Localization/AsaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AsaTest extends LocalizationTestCase { public const LOCALE = 'asa'; // Asu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapili at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 icheheavo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 icheheavo, 12:00 icheheavo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 icheheavo, 1:30 icheheavo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 icheheavo, 2:00 icheheavo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 icheheavo, 6:00 icheheavo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 icheheavo, 10:00 icheheavo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ichamthi, 12:00 ichamthi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ichamthi, 5:00 ichamthi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ichamthi, 9:30 ichamthi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ichamthi, 11:00 ichamthi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AstEsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AstEsTest extends LocalizationTestCase { public const LOCALE = 'ast_ES'; // Asturian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'sábadu a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'domingu a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'llunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'xueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'vienres a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'xueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'vienres a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'sábadu a las 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'el domingu pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'el llunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'el domingu pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'el sábadu pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'el vienres pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'el xueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'el vienres pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0º', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'hai 1 segundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'hai 1 segundu', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'hai 2 segundu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'hai 2 segundu', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'hai 1 minutu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'hai 1 minutu', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'hai 2 minutu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'hai 2 minutu', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'hai 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'hai 1 hora', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'hai 2 hora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'hai 2 hora', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'hai 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'hai 1 día', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'hai 2 día', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'hai 2 día', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'hai 1 selmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'hai 1 selmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'hai 2 selmana', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'hai 2 selmana', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'hai 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'hai 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'hai 2 mes', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'hai 2 mes', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'hai 1 añu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'hai 1 añu', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'hai 2 añu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'hai 2 añu', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'en 1 segundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'en 1 segundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 segundu dempués', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 segundu dempués', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 segundu enantes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 segundu enantes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 segundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 segundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 segundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 segundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'en 1 segundu', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minutu 1 segundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 añu 3 mes 1 día 1 segundu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'en 3 añu', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'hai 5 mes', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'hai 2 añu 3 mes 1 día 1 segundu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 selmana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 selmana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 selmana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'en 1 selmana y 6 día', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 selmana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'en una hora', // CarbonInterval::days(2)->forHumans() // '2 days' '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 día 3 hora', ]; } ================================================ FILE: tests/Localization/AstTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AstTest extends LocalizationTestCase { public const LOCALE = 'ast'; // Asturian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'sábadu a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'domingu a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'llunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'xueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'vienres a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'xueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'vienres a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'sábadu a las 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'el domingu pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'el llunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'el domingu pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'el sábadu pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'el vienres pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'el xueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'el vienres pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0º', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'hai 1 segundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'hai 1 segundu', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'hai 2 segundu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'hai 2 segundu', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'hai 1 minutu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'hai 1 minutu', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'hai 2 minutu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'hai 2 minutu', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'hai 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'hai 1 hora', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'hai 2 hora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'hai 2 hora', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'hai 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'hai 1 día', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'hai 2 día', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'hai 2 día', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'hai 1 selmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'hai 1 selmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'hai 2 selmana', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'hai 2 selmana', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'hai 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'hai 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'hai 2 mes', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'hai 2 mes', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'hai 1 añu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'hai 1 añu', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'hai 2 añu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'hai 2 añu', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'en 1 segundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'en 1 segundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 segundu dempués', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 segundu dempués', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 segundu enantes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 segundu enantes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 segundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 segundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 segundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 segundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'en 1 segundu', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minutu 1 segundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 añu 3 mes 1 día 1 segundu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'en 3 añu', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'hai 5 mes', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'hai 2 añu 3 mes 1 día 1 segundu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 selmana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 selmana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 selmana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'en 1 selmana y 6 día', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 selmana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'en una hora', // CarbonInterval::days(2)->forHumans() // '2 days' '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 día 3 hora', ]; } ================================================ FILE: tests/Localization/AycPeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AycPeTest extends LocalizationTestCase { public const LOCALE = 'ayc_PE'; // Southern Aymara public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sawäru at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tuminku at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mirkulisa at 12:00 VM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'juywisa at 12:00 VM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wirnisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mirkulisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'juywisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wirnisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sawäru at 12:00 VM', // Carbon::now()->subDays(2)->calendar() 'Last tuminku at 8:49 NM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 NM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 VM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martisa at 12:00 VM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tuminku at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sawäru at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wirnisa at 12:00 VM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last juywisa at 12:00 VM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mirkulisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last wirnisa at 12:00 VM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AycTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AycTest extends LocalizationTestCase { public const LOCALE = 'ayc'; // Southern Aymara public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sawäru at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tuminku at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mirkulisa at 12:00 VM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'juywisa at 12:00 VM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wirnisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mirkulisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'juywisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wirnisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sawäru at 12:00 VM', // Carbon::now()->subDays(2)->calendar() 'Last tuminku at 8:49 NM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 NM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 VM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martisa at 12:00 VM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunisa at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tuminku at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sawäru at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wirnisa at 12:00 VM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last juywisa at 12:00 VM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mirkulisa at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last wirnisa at 12:00 VM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AzArabTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AzArabTest extends LocalizationTestCase { public const LOCALE = 'az_Arab'; // Azerbaijani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'یکشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'دوشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'چارشنبه at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'جۆمعه آخشامی at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جۆمعه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'چارشنبه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جۆمعه آخشامی at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جۆمعه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'شنبه at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last یکشنبه at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last دوشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last یکشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last جۆمعه at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last جۆمعه آخشامی at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last چارشنبه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last جۆمعه at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/AzAzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AzAzTest extends LocalizationTestCase { public const LOCALE = 'az_AZ'; // Azerbaijani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sabah saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'gələn həftə şənbə saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'gələn həftə bazar günü saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'gələn həftə bazar ertəsi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'gələn həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'gələn həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'gələn həftə cümə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'gələn həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'gələn həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'gələn həftə cümə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'gələn həftə şənbə saat 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'keçən həftə bazar günü saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'dünən 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'bugün saat 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'bugün saat 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sabah saat 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'keçən həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'keçən həftə bazar ertəsi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'keçən həftə bazar günü saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'keçən həftə şənbə saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'keçən həftə cümə saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'keçən həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'keçən həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'keçən həftə cümə saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1-inci 1-inci 1-inci 1-inci 1-inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2-nci 1-inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3-üncü 1-inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4-üncü 1-inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5-inci 1-inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6-ncı 1-inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7-nci 1-inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11-inci 2-nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 gecə CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 gecə, 12:00 gecə', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 gecə, 1:30 gecə', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 gecə, 2:00 gecə', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 səhər, 6:00 səhər', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 səhər, 10:00 səhər', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 gündüz, 12:00 gündüz', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 axşam, 5:00 axşam', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 axşam, 9:30 axşam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 axşam, 11:00 axşam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0-ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 saniyə əvvəl', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 san. əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 saniyə əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 san. əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 dəqiqə əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 d. əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 dəqiqə əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 d. əvvəl', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saat əvvəl', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 s. əvvəl', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saat əvvəl', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 s. əvvəl', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 gün əvvəl', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 g. əvvəl', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 gün əvvəl', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 g. əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 həftə əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 h. əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 həftə əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 h. əvvəl', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ay əvvəl', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ay əvvəl', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 il əvvəl', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 il əvvəl', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 san. sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 san. sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 saniyə əvvəl', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 san. əvvəl', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 saniyə', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 san.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 saniyə', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 san.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 san. sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 dəqiqə 1 saniyə', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 il 3 ay 1 g. 1 san.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 il sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ay əvvəl', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 il 3 ay 1 g. 1 san. əvvəl', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 həftə 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 həftə və 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 həftə 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'bir saat sonra', // CarbonInterval::days(2)->forHumans() // '2 days' '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 g. 3 s.', ]; } ================================================ FILE: tests/Localization/AzCyrlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AzCyrlTest extends LocalizationTestCase { public const LOCALE = 'az_Cyrl'; // Azerbaijani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sabah saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'gələn həftə шәнбә saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'gələn həftə базар saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'gələn həftə базар ертәси saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə чәршәнбә ахшамы saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'gələn həftə чәршәнбә saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'gələn həftə ҹүмә ахшамы saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'gələn həftə ҹүмә saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə чәршәнбә ахшамы saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'gələn həftə чәршәнбә saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'gələn həftə ҹүмә ахшамы saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'gələn həftə ҹүмә saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'gələn həftə шәнбә saat 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'keçən həftə базар saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'dünən 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'bugün saat 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'bugün saat 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sabah saat 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə чәршәнбә ахшамы saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'keçən həftə чәршәнбә ахшамы saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'keçən həftə базар ертәси saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'keçən həftə базар saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'keçən həftə шәнбә saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'keçən həftə ҹүмә saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'keçən həftə ҹүмә ахшамы saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'keçən həftə чәршәнбә saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'keçən həftə ҹүмә saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1-inci 1-inci 1-inci 1-inci 1-inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2-nci 1-inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3-üncü 1-inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4-üncü 1-inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5-inci 1-inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6-ncı 1-inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7-nci 1-inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11-inci 2-nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 а CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 а, 12:00 а', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 а, 1:30 а', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 а, 2:00 а', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 а, 6:00 а', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 а, 10:00 а', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 п, 12:00 п', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 п, 5:00 п', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 п, 9:30 п', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 п, 11:00 п', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0-ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 saniyə əvvəl', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 san. əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 saniyə əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 san. əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 dəqiqə əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 d. əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 dəqiqə əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 d. əvvəl', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saat əvvəl', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 s. əvvəl', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saat əvvəl', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 s. əvvəl', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 gün əvvəl', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 g. əvvəl', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 gün əvvəl', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 g. əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 həftə əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 h. əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 həftə əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 h. əvvəl', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ay əvvəl', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ay əvvəl', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 il əvvəl', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 il əvvəl', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 san. sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 san. sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 saniyə əvvəl', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 san. əvvəl', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 saniyə', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 san.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 saniyə', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 san.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 san. sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 dəqiqə 1 saniyə', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 il 3 ay 1 g. 1 san.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 il sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ay əvvəl', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 il 3 ay 1 g. 1 san. əvvəl', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 həftə 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 həftə və 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 həftə 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'bir saat sonra', // CarbonInterval::days(2)->forHumans() // '2 days' '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 g. 3 s.', ]; } ================================================ FILE: tests/Localization/AzIrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AzIrTest extends LocalizationTestCase { public const LOCALE = 'az_IR'; // Azerbaijani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'یکشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'دوشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'چارشنبه at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'جۆمعه آخشامی at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'جۆمعه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'چارشنبه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'جۆمعه آخشامی at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'جۆمعه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'شنبه at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last یکشنبه at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last سه‌شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last دوشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last یکشنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last شنبه at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last جۆمعه at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last جۆمعه آخشامی at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last چارشنبه at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last جۆمعه at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/AzLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AzLatnTest extends LocalizationTestCase { public const LOCALE = 'az_Latn'; // Azerbaijani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sabah saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'gələn həftə şənbə saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'gələn həftə bazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'gələn həftə bazar ertəsi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'gələn həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'gələn həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'gələn həftə cümə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'gələn həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'gələn həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'gələn həftə cümə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'gələn həftə şənbə saat 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'keçən həftə bazar saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'dünən 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'bugün saat 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'bugün saat 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sabah saat 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'keçən həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'keçən həftə bazar ertəsi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'keçən həftə bazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'keçən həftə şənbə saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'keçən həftə cümə saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'keçən həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'keçən həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'keçən həftə cümə saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1-inci 1-inci 1-inci 1-inci 1-inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2-nci 1-inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3-üncü 1-inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4-üncü 1-inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5-inci 1-inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6-ncı 1-inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7-nci 1-inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11-inci 2-nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 a CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 a, 1:30 a', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 a, 2:00 a', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 a, 6:00 a', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 a, 10:00 a', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 p, 12:00 p', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 p, 5:00 p', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 p, 9:30 p', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 p, 11:00 p', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0-ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 saniyə əvvəl', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 san. əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 saniyə əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 san. əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 dəqiqə əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 d. əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 dəqiqə əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 d. əvvəl', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saat əvvəl', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 s. əvvəl', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saat əvvəl', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 s. əvvəl', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 gün əvvəl', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 g. əvvəl', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 gün əvvəl', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 g. əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 həftə əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 h. əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 həftə əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 h. əvvəl', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ay əvvəl', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ay əvvəl', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 il əvvəl', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 il əvvəl', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 san. sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 san. sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 saniyə əvvəl', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 san. əvvəl', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 saniyə', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 san.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 saniyə', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 san.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 san. sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 dəqiqə 1 saniyə', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 il 3 ay 1 g. 1 san.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 il sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ay əvvəl', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 il 3 ay 1 g. 1 san. əvvəl', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 həftə 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 həftə və 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 həftə 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'bir saat sonra', // CarbonInterval::days(2)->forHumans() // '2 days' '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 g. 3 s.', ]; } ================================================ FILE: tests/Localization/AzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class AzTest extends LocalizationTestCase { public const LOCALE = 'az'; // Azerbaijani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabah saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gələn həftə şənbə saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gələn həftə bazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gələn həftə bazar ertəsi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gələn həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'gələn həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'gələn həftə cümə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gələn həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gələn həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gələn həftə cümə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gələn həftə şənbə saat 00:00', // Carbon::now()->subDays(2)->calendar() 'keçən həftə bazar saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dünən 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'bugün saat 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'bugün saat 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'sabah saat 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gələn həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dünən 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keçən həftə çərşənbə axşamı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keçən həftə bazar ertəsi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keçən həftə bazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keçən həftə şənbə saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keçən həftə cümə saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'keçən həftə cümə axşamı saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'keçən həftə çərşənbə saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'keçən həftə cümə saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-inci 1-inci 1-inci 1-inci 1-inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-nci 1-inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-üncü 1-inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-üncü 1-inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-inci 1-inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ncı 1-inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-nci 1-inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-inci 2-nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 gecə CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 gecə, 12:00 gecə', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 gecə, 1:30 gecə', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 gecə, 2:00 gecə', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 səhər, 6:00 səhər', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 səhər, 10:00 səhər', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 gündüz, 12:00 gündüz', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 axşam, 5:00 axşam', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 axşam, 9:30 axşam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 axşam, 11:00 axşam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() '1 saniyə əvvəl', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 san. əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans() '2 saniyə əvvəl', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 san. əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans() '1 dəqiqə əvvəl', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 d. əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans() '2 dəqiqə əvvəl', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 d. əvvəl', // Carbon::now()->subHours(1)->diffForHumans() '1 saat əvvəl', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 s. əvvəl', // Carbon::now()->subHours(2)->diffForHumans() '2 saat əvvəl', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 s. əvvəl', // Carbon::now()->subDays(1)->diffForHumans() '1 gün əvvəl', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 g. əvvəl', // Carbon::now()->subDays(2)->diffForHumans() '2 gün əvvəl', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 g. əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans() '1 həftə əvvəl', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 h. əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans() '2 həftə əvvəl', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 h. əvvəl', // Carbon::now()->subMonths(1)->diffForHumans() '1 ay əvvəl', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans() '2 ay əvvəl', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ay əvvəl', // Carbon::now()->subYears(1)->diffForHumans() '1 il əvvəl', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans() '2 il əvvəl', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 il əvvəl', // Carbon::now()->addSecond()->diffForHumans() '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 san. sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 saniyə sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 san. sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 saniyə əvvəl', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 san. əvvəl', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saniyə', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 san.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saniyə', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 san.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 san. sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 dəqiqə 1 saniyə', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 il 3 ay 1 g. 1 san.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 il sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ay əvvəl', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 il 3 ay 1 g. 1 san. əvvəl', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 həftə 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 həftə 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 həftə və 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 həftə 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'bir saat sonra', // CarbonInterval::days(2)->forHumans() '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 g. 3 s.', ]; } ================================================ FILE: tests/Localization/BasTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BasTest extends LocalizationTestCase { public const LOCALE = 'bas'; // Basaa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ŋgwà jôn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ŋgwà nɔ̂y at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ŋgwà njaŋgumba at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ŋgwà ûm at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ŋgwà ŋgê at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ŋgwà mbɔk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ŋgwà kɔɔ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgwà ûm at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgwà ŋgê at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgwà mbɔk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgwà kɔɔ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgwà jôn at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last ŋgwà nɔ̂y at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgwà ûm at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ŋgwà ûm at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ŋgwà njaŋgumba at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ŋgwà nɔ̂y at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ŋgwà jôn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ŋgwà kɔɔ at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ŋgwà mbɔk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ŋgwà ŋgê at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ŋgwà kɔɔ at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 i bikɛ̂glà CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 I bikɛ̂glà, 12:00 i bikɛ̂glà', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 I bikɛ̂glà, 1:30 i bikɛ̂glà', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 I bikɛ̂glà, 2:00 i bikɛ̂glà', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 I bikɛ̂glà, 6:00 i bikɛ̂glà', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 I bikɛ̂glà, 10:00 i bikɛ̂glà', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 I ɓugajɔp, 12:00 i ɓugajɔp', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 I ɓugajɔp, 5:00 i ɓugajɔp', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 I ɓugajɔp, 9:30 i ɓugajɔp', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 I ɓugajɔp, 11:00 i ɓugajɔp', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 móndî ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 móndî ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 móndî ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 móndî ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 móndî from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 móndî from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 móndî after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 móndî after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 móndî before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 móndî before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 móndî', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 móndî', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 móndî', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 móndî', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 móndî from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 móndî', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1 móndî', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1 móndî ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/BeByLatinTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BeByLatinTest extends LocalizationTestCase { public const LOCALE = 'be_BY@latin'; // Belarusian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Subota at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Niadziela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Paniadziełak at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Aŭtorak at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Sierada at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Čaćvier at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Piatnica at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Aŭtorak at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Sierada at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Čaćvier at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Piatnica at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Subota at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Niadziela at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Aŭtorak at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Aŭtorak at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Paniadziełak at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Niadziela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Subota at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Piatnica at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Čaćvier at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Sierada at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Piatnica at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/BeByTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BeByTest extends LocalizationTestCase { public const LOCALE = 'be_BY'; // Belarusian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Заўтра ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'У субота ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'У нядзеля ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'У панядзелак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'У аўторак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'У серада ў 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'У чацвер ў 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'У пятніца ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'У аўторак ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'У серада ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'У чацвер ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'У пятніца ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'У субота ў 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'У мінулую нядзеля ў 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Учора ў 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Сёння ў 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Сёння ў 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Заўтра ў 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'У аўторак ў 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Учора ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Учора ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'У мінулы аўторак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'У мінулы панядзелак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'У мінулую нядзеля ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'У мінулую субота ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'У мінулую пятніца ў 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'У мінулы чацвер ў 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'У мінулую серада ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'У мінулую пятніца ў 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1-ы 1-ы 1-га 1-ы 1-ы', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2-га 1-ы', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3-га 1-ы', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4-га 1-ы', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5-га 1-ы', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6-га 1-ы', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7-га 1-ы', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11-га 2-і', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40-ы', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-ы', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-ы', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ночы CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 ночы, 12:00 ночы', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 ночы, 1:30 ночы', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 ночы, 2:00 ночы', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 раніцы, 6:00 раніцы', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 раніцы, 10:00 раніцы', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 вечара, 5:00 вечара', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 вечара, 9:30 вечара', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 вечара, 11:00 вечара', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 секунду таму', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 секунду таму', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 секунды таму', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 секунды таму', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 хвіліну таму', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 хвіліну таму', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 хвіліны таму', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 хвіліны таму', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 гадзіну таму', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 гадзіну таму', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 гадзіны таму', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 гадзіны таму', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 дзень таму', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 дн таму', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 дні таму', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 дн таму', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 тыдзень таму', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 тыдзень таму', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 тыдні таму', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 тыдні таму', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 месяц таму', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 месяц таму', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 месяцы таму', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 месяцы таму', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 год таму', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 год таму', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 гады таму', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 гады таму', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'праз 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'праз 1 секунду', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 секунду пасля', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 секунду пасля', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 секунду да', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 секунду да', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 сек', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 сек', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'праз 1 секунду', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 хвіліна 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 гады 3 месяцы 1 дн 1 сек', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'праз 3 гады', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 месяцаў таму', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 гады 3 месяцы 1 дн 1 секунду таму', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 тыдзень 10 гадзін', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 тыдзень 6 дзён', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 тыдзень 6 дзён', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'праз 1 тыдзень і 6 дзён', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 тыдні 1 гадзіну', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'праз гадзіну', // CarbonInterval::days(2)->forHumans() // '2 days' '2 дні', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 дн 3 гадзіны', ]; } ================================================ FILE: tests/Localization/BeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BeTest extends LocalizationTestCase { public const LOCALE = 'be'; // Belarusian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Заўтра ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У субота ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У нядзеля ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У панядзелак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У аўторак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У серада ў 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'У чацвер ў 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'У пятніца ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У аўторак ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У серада ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У чацвер ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У пятніца ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У субота ў 00:00', // Carbon::now()->subDays(2)->calendar() 'У мінулую нядзеля ў 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Учора ў 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сёння ў 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сёння ў 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Заўтра ў 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У аўторак ў 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Учора ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Учора ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У мінулы аўторак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У мінулы панядзелак ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У мінулую нядзеля ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У мінулую субота ў 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У мінулую пятніца ў 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'У мінулы чацвер ў 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'У мінулую серада ў 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У мінулую пятніца ў 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ы 1-ы 1-га 1-ы 1-ы', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-га 1-ы', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-га 1-ы', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-га 1-ы', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-га 1-ы', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-га 1-ы', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-га 1-ы', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-га 2-і', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ы', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ы', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ы', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночы CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночы, 12:00 ночы', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночы, 1:30 ночы', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночы, 2:00 ночы', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 раніцы, 6:00 раніцы', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 раніцы, 10:00 раніцы', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечара, 5:00 вечара', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечара, 9:30 вечара', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечара, 11:00 вечара', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду таму', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 секунду таму', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды таму', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 секунды таму', // Carbon::now()->subMinutes(1)->diffForHumans() '1 хвіліну таму', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 хвіліну таму', // Carbon::now()->subMinutes(2)->diffForHumans() '2 хвіліны таму', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 хвіліны таму', // Carbon::now()->subHours(1)->diffForHumans() '1 гадзіну таму', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 гадзіну таму', // Carbon::now()->subHours(2)->diffForHumans() '2 гадзіны таму', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 гадзіны таму', // Carbon::now()->subDays(1)->diffForHumans() '1 дзень таму', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 дн таму', // Carbon::now()->subDays(2)->diffForHumans() '2 дні таму', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 дн таму', // Carbon::now()->subWeeks(1)->diffForHumans() '1 тыдзень таму', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 тыдзень таму', // Carbon::now()->subWeeks(2)->diffForHumans() '2 тыдні таму', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 тыдні таму', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц таму', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 месяц таму', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяцы таму', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 месяцы таму', // Carbon::now()->subYears(1)->diffForHumans() '1 год таму', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 год таму', // Carbon::now()->subYears(2)->diffForHumans() '2 гады таму', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 гады таму', // Carbon::now()->addSecond()->diffForHumans() 'праз 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'праз 1 секунду', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду пасля', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 секунду пасля', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду да', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 секунду да', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'праз 1 секунду', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 хвіліна 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 гады 3 месяцы 1 дн 1 сек', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'праз 3 гады', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 месяцаў таму', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 гады 3 месяцы 1 дн 1 секунду таму', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 тыдзень 10 гадзін', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 тыдзень 6 дзён', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 тыдзень 6 дзён', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'праз 1 тыдзень і 6 дзён', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 тыдні 1 гадзіну', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'праз гадзіну', // CarbonInterval::days(2)->forHumans() '2 дні', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 дн 3 гадзіны', ]; } ================================================ FILE: tests/Localization/BemTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BemTest extends LocalizationTestCase { public const LOCALE = 'bem'; // Bemba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Pachibelushi at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Pa Mulungu at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Palichimo at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Palichitatu at 12:00 uluchelo', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Palichine at 12:00 uluchelo', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Palichitatu at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Palichine at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Pachibelushi at 12:00 uluchelo', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Pa Mulungu at 8:49 akasuba', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 akasuba', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 uluchelo', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Palichimo at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Pa Mulungu at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Pachibelushi at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Palichine at 12:00 uluchelo', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Palichitatu at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 uluchelo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 uluchelo, 12:00 uluchelo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 uluchelo, 1:30 uluchelo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 uluchelo, 2:00 uluchelo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 uluchelo, 6:00 uluchelo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 uluchelo, 10:00 uluchelo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 akasuba, 12:00 akasuba', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 akasuba, 5:00 akasuba', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 akasuba, 9:30 akasuba', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 akasuba, 11:00 akasuba', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'sekondi 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'sekondi 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'sekondi 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'sekondi 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'awala 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'awala 1 ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'awala 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'awala 2 ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'inshiku 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'inshiku 1 ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'inshiku 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'inshiku 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'umulungu 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'umulungu 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'umulungu 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'umulungu 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'myeshi 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'myeshi 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'myeshi 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'myeshi 2 ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'myaka 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'myaka 1 ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'myaka 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'myaka 2 ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'sekondi 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'sekondi 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'sekondi 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'sekondi 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'sekondi 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'sekondi 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' 'sekondi 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' 'sekondi 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' 'sekondi 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' 'sekondi 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'sekondi 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' 'miniti 1 sekondi 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' 'myaka 2 myeshi 3 inshiku 1 sekondi 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'myaka 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'myeshi 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'myaka 2 myeshi 3 inshiku 1 sekondi 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' 'umulungu 1 awala 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'umulungu 1 inshiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'umulungu 1 inshiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'umulungu 1 and inshiku 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' 'umulungu 2 awala 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'awala 1 from now', // CarbonInterval::days(2)->forHumans() // '2 days' 'inshiku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' 'inshiku 1 awala 3', ]; } ================================================ FILE: tests/Localization/BemZmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BemZmTest extends LocalizationTestCase { public const LOCALE = 'bem_ZM'; // Bemba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Pachibelushi at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Pa Mulungu at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Palichimo at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Palichitatu at 12:00 uluchelo', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Palichine at 12:00 uluchelo', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Palichitatu at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Palichine at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Pachibelushi at 12:00 uluchelo', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Pa Mulungu at 8:49 akasuba', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 akasuba', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 uluchelo', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Palichibuli at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Palichimo at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Pa Mulungu at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Pachibelushi at 12:00 uluchelo', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Palichine at 12:00 uluchelo', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Palichitatu at 12:00 uluchelo', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Palichisano at 12:00 uluchelo', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 uluchelo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 uluchelo, 12:00 uluchelo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 uluchelo, 1:30 uluchelo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 uluchelo, 2:00 uluchelo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 uluchelo, 6:00 uluchelo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 uluchelo, 10:00 uluchelo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 akasuba, 12:00 akasuba', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 akasuba, 5:00 akasuba', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 akasuba, 9:30 akasuba', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 akasuba, 11:00 akasuba', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'sekondi 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'sekondi 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'sekondi 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'sekondi 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'awala 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'awala 1 ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'awala 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'awala 2 ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'inshiku 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'inshiku 1 ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'inshiku 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'inshiku 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'umulungu 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'umulungu 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'umulungu 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'umulungu 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'myeshi 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'myeshi 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'myeshi 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'myeshi 2 ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'myaka 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'myaka 1 ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'myaka 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'myaka 2 ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'sekondi 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'sekondi 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'sekondi 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'sekondi 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'sekondi 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'sekondi 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' 'sekondi 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' 'sekondi 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' 'sekondi 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' 'sekondi 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'sekondi 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' 'miniti 1 sekondi 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' 'myaka 2 myeshi 3 inshiku 1 sekondi 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'myaka 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'myeshi 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'myaka 2 myeshi 3 inshiku 1 sekondi 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' 'umulungu 1 awala 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'umulungu 1 inshiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'umulungu 1 inshiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'umulungu 1 and inshiku 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' 'umulungu 2 awala 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'awala 1 from now', // CarbonInterval::days(2)->forHumans() // '2 days' 'inshiku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' 'inshiku 1 awala 3', ]; } ================================================ FILE: tests/Localization/BerDzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BerDzTest extends LocalizationTestCase { public const LOCALE = 'ber_DZ'; // ber public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'altıncı gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'bazar günü at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'birinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'beşinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'beşinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'altıncı gün at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last bazar günü at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last ikinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last birinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last bazar günü at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last altıncı gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last beşinci gün at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last beşinci gün at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/BerMaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BerMaTest extends LocalizationTestCase { public const LOCALE = 'ber_MA'; // ber public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'altıncı gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'bazar günü at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'birinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'beşinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'beşinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'altıncı gün at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last bazar günü at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last ikinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last birinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last bazar günü at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last altıncı gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last beşinci gün at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last beşinci gün at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/BerTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BerTest extends LocalizationTestCase { public const LOCALE = 'ber'; // ber public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'altıncı gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'bazar günü at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'birinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'beşinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'beşinci gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'altıncı gün at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last bazar günü at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ikinci gün at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last ikinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last birinci gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last bazar günü at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last altıncı gün at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last beşinci gün at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last dördüncü gün at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last üçüncü gün at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last beşinci gün at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/BezTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BezTest extends LocalizationTestCase { public const LOCALE = 'bez'; // Bena public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'pa shahulembela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'pa mulungu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'pa shahuviluha at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'pa hivili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'pa hidatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'pa hitayi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'pa hihanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'pa hivili at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'pa hidatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'pa hitayi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'pa hihanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'pa shahulembela at 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last pa mulungu at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'pa hivili at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last pa hivili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last pa shahuviluha at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last pa mulungu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last pa shahulembela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last pa hihanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last pa hitayi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last pa hidatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last pa hihanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 pamilau CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 pamilau, 12:00 pamilau', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 pamilau, 1:30 pamilau', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 pamilau, 2:00 pamilau', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 pamilau, 6:00 pamilau', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 pamilau, 10:00 pamilau', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 pamunyi, 12:00 pamunyi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 pamunyi, 5:00 pamunyi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 pamunyi, 9:30 pamunyi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 pamunyi, 11:00 pamunyi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/BgBgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BgBgTest extends LocalizationTestCase { public const LOCALE = 'bg_BG'; // Bulgarian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Утре в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'събота в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'неделя в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'понеделник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'вторник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сряда в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'четвъртък в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'петък в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'вторник в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сряда в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'четвъртък в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'петък в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'събота в 0:00', // Carbon::now()->subDays(2)->calendar() 'В изминалата неделя в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Днес в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Днес в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Утре в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'вторник в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалия вторник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалия понеделник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалата неделя в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалата събота в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалия петък в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В изминалия четвъртък в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В изминалата сряда в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В изминалия петък в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ви 1-ви 1-ви 1-ви 1-ви', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-ри 1-ви', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-ти 1-ви', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ти 1-ви', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ти 1-ви', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ти 1-ви', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ми 1-ви', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ти 2-ри', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ти', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ви', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ен', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 преди обяд CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 преди обяд, 12:00 преди обяд', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 преди обяд, 1:30 преди обяд', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 преди обяд, 2:00 преди обяд', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 преди обяд, 6:00 преди обяд', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 преди обяд, 10:00 преди обяд', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 следобед, 12:00 следобед', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 следобед, 5:00 следобед', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 следобед, 9:30 следобед', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 следобед, 11:00 следобед', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ев', // Carbon::now()->subSeconds(1)->diffForHumans() 'преди 1 секунда', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'преди 1 секунда', // Carbon::now()->subSeconds(2)->diffForHumans() 'преди 2 секунди', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'преди 2 секунди', // Carbon::now()->subMinutes(1)->diffForHumans() 'преди 1 минута', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'преди 1 минута', // Carbon::now()->subMinutes(2)->diffForHumans() 'преди 2 минути', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'преди 2 минути', // Carbon::now()->subHours(1)->diffForHumans() 'преди 1 час', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'преди 1 час', // Carbon::now()->subHours(2)->diffForHumans() 'преди 2 часа', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'преди 2 часа', // Carbon::now()->subDays(1)->diffForHumans() 'преди 1 ден', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'преди 1 ден', // Carbon::now()->subDays(2)->diffForHumans() 'преди 2 дни', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'преди 2 дни', // Carbon::now()->subWeeks(1)->diffForHumans() 'преди 1 седмица', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'преди 1 седмица', // Carbon::now()->subWeeks(2)->diffForHumans() 'преди 2 седмици', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'преди 2 седмици', // Carbon::now()->subMonths(1)->diffForHumans() 'преди 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'преди 1 месец', // Carbon::now()->subMonths(2)->diffForHumans() 'преди 2 месеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'преди 2 месеца', // Carbon::now()->subYears(1)->diffForHumans() 'преди 1 година', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'преди 1 година', // Carbon::now()->subYears(2)->diffForHumans() 'преди 2 години', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'преди 2 години', // Carbon::now()->addSecond()->diffForHumans() 'след 1 секунда', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'след 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'след 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'след 1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'преди 1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'преди 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунди', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 секунди', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'след 1 секунда', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 години 3 месеца 1 ден 1 секунда', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'след 3 години', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'преди 5 месеца', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'преди 2 години 3 месеца 1 ден 1 секунда', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 седмица 10 часа', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дни', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дни', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'след 1 седмица и 6 дни', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 седмици 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'след час', // CarbonInterval::days(2)->forHumans() '2 дни', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ден 3 часа', ]; } ================================================ FILE: tests/Localization/BgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BgTest extends LocalizationTestCase { public const LOCALE = 'bg'; // Bulgarian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Утре в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'събота в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'неделя в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'понеделник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'вторник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сряда в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'четвъртък в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'петък в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'вторник в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сряда в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'четвъртък в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'петък в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'събота в 0:00', // Carbon::now()->subDays(2)->calendar() 'В изминалата неделя в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Днес в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Днес в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Утре в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'вторник в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалия вторник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалия понеделник в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалата неделя в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалата събота в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В изминалия петък в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В изминалия четвъртък в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В изминалата сряда в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В изминалия петък в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ви 1-ви 1-ви 1-ви 1-ви', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-ри 1-ви', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-ти 1-ви', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ти 1-ви', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ти 1-ви', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ти 1-ви', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ми 1-ви', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ти 2-ри', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ти', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ви', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ен', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 преди обяд CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 преди обяд, 12:00 преди обяд', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 преди обяд, 1:30 преди обяд', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 преди обяд, 2:00 преди обяд', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 преди обяд, 6:00 преди обяд', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 преди обяд, 10:00 преди обяд', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 следобед, 12:00 следобед', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 следобед, 5:00 следобед', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 следобед, 9:30 следобед', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 следобед, 11:00 следобед', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ев', // Carbon::now()->subSeconds(1)->diffForHumans() 'преди 1 секунда', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'преди 1 секунда', // Carbon::now()->subSeconds(2)->diffForHumans() 'преди 2 секунди', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'преди 2 секунди', // Carbon::now()->subMinutes(1)->diffForHumans() 'преди 1 минута', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'преди 1 минута', // Carbon::now()->subMinutes(2)->diffForHumans() 'преди 2 минути', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'преди 2 минути', // Carbon::now()->subHours(1)->diffForHumans() 'преди 1 час', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'преди 1 час', // Carbon::now()->subHours(2)->diffForHumans() 'преди 2 часа', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'преди 2 часа', // Carbon::now()->subDays(1)->diffForHumans() 'преди 1 ден', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'преди 1 ден', // Carbon::now()->subDays(2)->diffForHumans() 'преди 2 дни', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'преди 2 дни', // Carbon::now()->subWeeks(1)->diffForHumans() 'преди 1 седмица', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'преди 1 седмица', // Carbon::now()->subWeeks(2)->diffForHumans() 'преди 2 седмици', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'преди 2 седмици', // Carbon::now()->subMonths(1)->diffForHumans() 'преди 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'преди 1 месец', // Carbon::now()->subMonths(2)->diffForHumans() 'преди 2 месеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'преди 2 месеца', // Carbon::now()->subYears(1)->diffForHumans() 'преди 1 година', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'преди 1 година', // Carbon::now()->subYears(2)->diffForHumans() 'преди 2 години', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'преди 2 години', // Carbon::now()->addSecond()->diffForHumans() 'след 1 секунда', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'след 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'след 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'след 1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'преди 1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'преди 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунди', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 секунди', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'след 1 секунда', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 години 3 месеца 1 ден 1 секунда', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'след 3 години', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'преди 5 месеца', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'преди 2 години 3 месеца 1 ден 1 секунда', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 седмица 10 часа', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дни', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дни', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'след 1 седмица и 6 дни', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 седмици 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'след час', // CarbonInterval::days(2)->forHumans() '2 дни', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ден 3 часа', ]; } ================================================ FILE: tests/Localization/BhbInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BhbInTest extends LocalizationTestCase { public const LOCALE = 'bhb_IN'; // Bhili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/BhbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BhbTest extends LocalizationTestCase { public const LOCALE = 'bhb'; // Bhili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/BhoInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BhoInTest extends LocalizationTestCase { public const LOCALE = 'bho_IN'; // Bhojpuri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'गुरुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गुरुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last गुरुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 सोमार ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सोमार ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सोमार ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सोमार ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 कला ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 कला ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 कला ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 कला ago', // Carbon::now()->subHours(1)->diffForHumans() '1 मौसम ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 मौसम ago', // Carbon::now()->subHours(2)->diffForHumans() '2 मौसम ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 मौसम ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिन ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 सप्ताह ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 सप्ताह ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 सप्ताह ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 सप्ताह ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 महिना ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना ago', // Carbon::now()->subYears(1)->diffForHumans() '1 साल ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 साल ago', // Carbon::now()->subYears(2)->diffForHumans() '2 साल ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 साल ago', // Carbon::now()->addSecond()->diffForHumans() '1 सोमार from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सोमार from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 सोमार after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सोमार after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 सोमार before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सोमार before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 सोमार', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सोमार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सोमार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सोमार', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सोमार from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 कला 1 सोमार', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 साल 3 महिना 1 दिन 1 सोमार', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 साल from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 साल 3 महिना 1 दिन 1 सोमार ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 सप्ताह 10 मौसम', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 सप्ताह and 6 दिन from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 सप्ताह 1 मौसम', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 मौसम from now', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 मौसम', ]; } ================================================ FILE: tests/Localization/BhoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BhoTest extends LocalizationTestCase { public const LOCALE = 'bho'; // Bhojpuri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'गुरुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गुरुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last गुरुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 सोमार ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सोमार ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सोमार ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सोमार ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 कला ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 कला ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 कला ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 कला ago', // Carbon::now()->subHours(1)->diffForHumans() '1 मौसम ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 मौसम ago', // Carbon::now()->subHours(2)->diffForHumans() '2 मौसम ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 मौसम ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिन ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 सप्ताह ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 सप्ताह ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 सप्ताह ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 सप्ताह ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 महिना ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना ago', // Carbon::now()->subYears(1)->diffForHumans() '1 साल ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 साल ago', // Carbon::now()->subYears(2)->diffForHumans() '2 साल ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 साल ago', // Carbon::now()->addSecond()->diffForHumans() '1 सोमार from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सोमार from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 सोमार after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सोमार after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 सोमार before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सोमार before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 सोमार', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सोमार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सोमार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सोमार', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सोमार from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 कला 1 सोमार', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 साल 3 महिना 1 दिन 1 सोमार', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 साल from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 साल 3 महिना 1 दिन 1 सोमार ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 सप्ताह 10 मौसम', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 सप्ताह and 6 दिन from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 सप्ताह 1 मौसम', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 मौसम from now', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 मौसम', ]; } ================================================ FILE: tests/Localization/BiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BiTest extends LocalizationTestCase { public const LOCALE = 'bi'; // Bislama public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maj at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wota at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'fraede at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sarede at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maj at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wota at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fraede at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sarede at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last sande at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maj at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maj at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sarede at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last fraede at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last wota at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last sarede at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 smol ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 smol ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 smol ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 smol ago', // Carbon::now()->subHours(1)->diffForHumans() '1 klok ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 klok ago', // Carbon::now()->subHours(2)->diffForHumans() '2 klok ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 klok ago', // Carbon::now()->subDays(1)->diffForHumans() '1 betde ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 betde ago', // Carbon::now()->subDays(2)->diffForHumans() '2 betde ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 betde ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sarede ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sarede ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sarede ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sarede ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 seven ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 seven ago', // Carbon::now()->subYears(2)->diffForHumans() '2 seven ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 seven ago', // Carbon::now()->addSecond()->diffForHumans() '1 tu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 smol 1 tu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 seven 3 mi 1 betde 1 tu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 seven from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 seven 3 mi 1 betde 1 tu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sarede 10 klok', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sarede 6 betde', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sarede 6 betde', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sarede and 6 betde from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sarede 1 klok', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 klok from now', // CarbonInterval::days(2)->forHumans() '2 betde', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 betde 3 klok', ]; } ================================================ FILE: tests/Localization/BiVuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BiVuTest extends LocalizationTestCase { public const LOCALE = 'bi_VU'; // Bislama public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maj at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wota at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'fraede at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sarede at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maj at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wota at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fraede at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sarede at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last sande at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maj at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maj at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sande at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sarede at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last fraede at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last wota at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last sarede at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 smol ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 smol ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 smol ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 smol ago', // Carbon::now()->subHours(1)->diffForHumans() '1 klok ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 klok ago', // Carbon::now()->subHours(2)->diffForHumans() '2 klok ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 klok ago', // Carbon::now()->subDays(1)->diffForHumans() '1 betde ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 betde ago', // Carbon::now()->subDays(2)->diffForHumans() '2 betde ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 betde ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sarede ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sarede ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sarede ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sarede ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 seven ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 seven ago', // Carbon::now()->subYears(2)->diffForHumans() '2 seven ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 seven ago', // Carbon::now()->addSecond()->diffForHumans() '1 tu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 smol 1 tu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 seven 3 mi 1 betde 1 tu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 seven from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 seven 3 mi 1 betde 1 tu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sarede 10 klok', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sarede 6 betde', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sarede 6 betde', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sarede and 6 betde from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sarede 1 klok', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 klok from now', // CarbonInterval::days(2)->forHumans() '2 betde', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 betde 3 klok', ]; } ================================================ FILE: tests/Localization/BmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BmTest extends LocalizationTestCase { public const LOCALE = 'bm'; // Bambara public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sini lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sibiri don lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kari don lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ntɛnɛn don lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tarata don lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Araba don lɛrɛ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alamisa don lɛrɛ 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Juma don lɛrɛ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tarata don lɛrɛ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Araba don lɛrɛ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alamisa don lɛrɛ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Juma don lɛrɛ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sibiri don lɛrɛ 00:00', // Carbon::now()->subDays(2)->calendar() 'Kari tɛmɛnen lɛrɛ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kunu lɛrɛ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Bi lɛrɛ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bi lɛrɛ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Sini lɛrɛ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tarata don lɛrɛ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kunu lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kunu lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tarata tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ntɛnɛn tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kari tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sibiri tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Juma tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Alamisa tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Araba tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Juma tɛmɛnen lɛrɛ 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'a bɛ sekondi 1 bɔ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'a bɛ sek. 1 bɔ', // Carbon::now()->subSeconds(2)->diffForHumans() 'a bɛ sekondi 2 bɔ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'a bɛ sek. 2 bɔ', // Carbon::now()->subMinutes(1)->diffForHumans() 'a bɛ miniti 1 bɔ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'a bɛ m. 1 bɔ', // Carbon::now()->subMinutes(2)->diffForHumans() 'a bɛ miniti 2 bɔ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'a bɛ m. 2 bɔ', // Carbon::now()->subHours(1)->diffForHumans() 'a bɛ lɛrɛ 1 bɔ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'a bɛ l. 1 bɔ', // Carbon::now()->subHours(2)->diffForHumans() 'a bɛ lɛrɛ 2 bɔ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'a bɛ l. 2 bɔ', // Carbon::now()->subDays(1)->diffForHumans() 'a bɛ tile 1 bɔ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'a bɛ t. 1 bɔ', // Carbon::now()->subDays(2)->diffForHumans() 'a bɛ tile 2 bɔ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'a bɛ t. 2 bɔ', // Carbon::now()->subWeeks(1)->diffForHumans() 'a bɛ dɔgɔkun 1 bɔ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'a bɛ d. 1 bɔ', // Carbon::now()->subWeeks(2)->diffForHumans() 'a bɛ dɔgɔkun 2 bɔ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'a bɛ d. 2 bɔ', // Carbon::now()->subMonths(1)->diffForHumans() 'a bɛ kalo 1 bɔ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'a bɛ k. 1 bɔ', // Carbon::now()->subMonths(2)->diffForHumans() 'a bɛ kalo 2 bɔ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'a bɛ k. 2 bɔ', // Carbon::now()->subYears(1)->diffForHumans() 'a bɛ san 1 bɔ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'a bɛ san 1 bɔ', // Carbon::now()->subYears(2)->diffForHumans() 'a bɛ san 2 bɔ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'a bɛ san 2 bɔ', // Carbon::now()->addSecond()->diffForHumans() 'sekondi 1 kɔnɔ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sek. 1 kɔnɔ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekondi 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sek. 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekondi 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sek. 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sek. 1 kɔnɔ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 sekondi 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'san 2 k. 3 t. 1 sek. 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'san 3 kɔnɔ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'a bɛ k. 5 bɔ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'a bɛ san 2 k. 3 t. 1 sek. 1 bɔ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'dɔgɔkun 1 lɛrɛ 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'dɔgɔkun 1 tile 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'dɔgɔkun 1 tile 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dɔgɔkun 1 ni tile 6 kɔnɔ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'dɔgɔkun 2 lɛrɛ 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'lɛrɛ kelen kɔnɔ', // CarbonInterval::days(2)->forHumans() 'tile 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 't. 1 l. 3', ]; } ================================================ FILE: tests/Localization/BnBdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BnBdTest extends LocalizationTestCase { public const LOCALE = 'bn_BD'; // Bengali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'আগামীকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'শনিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'রবিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'সোমবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'শনিবার, রাত ১২:০ সময়', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'গত রবিবার, রাত ৮:৪৯ সময়', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'গতকাল রাত ১০:০ সময়', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'আজ দুপুর ১০:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'আজ রাত ২:০ সময়', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'আগামীকাল রাত ১:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'গতকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'গতকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'গত মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'গত সোমবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'গত রবিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'গত শনিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'গত শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'গত বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'গত বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'গত শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '১ম ১ম ১ম ১ম ১ম', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '২য় ১ম', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '৩য় ১ম', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '৪র্থ ১ম', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '৫ম ২য়', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '৬ষ্ঠ ২য়', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '৭ম ২য়', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '১১তম ২য়', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '৪০তম', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '৪১তম', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '১০০তম', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 রাত CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 রাত, 12:00 রাত', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 রাত, 1:30 রাত', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 রাত, 2:00 রাত', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 সকাল, 6:00 সকাল', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 দুপুর, 10:00 দুপুর', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 দুপুর, 12:00 দুপুর', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 বিকাল, 5:00 বিকাল', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 রাত, 9:30 রাত', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 রাত, 11:00 রাত', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '০তম', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 সেকেন্ড আগে', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '১ সেকেন্ড আগে', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 সেকেন্ড আগে', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 সেকেন্ড আগে', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 মিনিট আগে', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '১ মিনিট আগে', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 মিনিট আগে', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 মিনিট আগে', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ঘন্টা আগে', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '১ ঘন্টা আগে', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ঘন্টা আগে', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ঘন্টা আগে', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 দিন আগে', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '১ দিন আগে', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 দিন আগে', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 দিন আগে', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 সপ্তাহ আগে', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '১ সপ্তাহ আগে', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 সপ্তাহ আগে', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 সপ্তাহ আগে', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 মাস আগে', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '১ মাস আগে', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 মাস আগে', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 মাস আগে', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 বছর আগে', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '১ বছর আগে', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 বছর আগে', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 বছর আগে', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '১ সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '১ সেকেন্ড পরে', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 সেকেন্ড আগে', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '১ সেকেন্ড আগে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 সেকেন্ড', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '১ সেকেন্ড', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 সেকেন্ড', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 সেকেন্ড', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '১ সেকেন্ড পরে', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 মিনিট 1 সেকেন্ড', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 বছর 3 মাস ১ দিন ১ সেকেন্ড', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 বছর পরে', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 মাস আগে', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 বছর 3 মাস ১ দিন ১ সেকেন্ড আগে', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 সপ্তাহ 10 ঘন্টা', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 সপ্তাহ 6 দিন', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 সপ্তাহ 6 দিন', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 সপ্তাহ এবং 6 দিন পরে', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 সপ্তাহ 1 ঘন্টা', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'এক ঘন্টা পরে', // CarbonInterval::days(2)->forHumans() // '2 days', '2 দিন', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '১ দিন 3 ঘন্টা', ]; } ================================================ FILE: tests/Localization/BnInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BnInTest extends LocalizationTestCase { public const LOCALE = 'bn_IN'; // Bengali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'আগামীকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'শনিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'রবিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'সোমবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'শনিবার, রাত ১২:০ সময়', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'গত রবিবার, রাত ৮:৪৯ সময়', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'গতকাল রাত ১০:০ সময়', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'আজ দুপুর ১০:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'আজ রাত ২:০ সময়', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'আগামীকাল রাত ১:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'গতকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'গতকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'গত মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'গত সোমবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'গত রবিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'গত শনিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'গত শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'গত বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'গত বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'গত শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '১ম ১ম ১ম ১ম ১ম', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '২য় ১ম', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '৩য় ১ম', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '৪র্থ ১ম', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '৫ম ১ম', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '৬ষ্ঠ ১ম', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '৭ম ২য়', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '১১তম ২য়', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '৪০তম', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '৪১তম', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '১০০তম', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 রাত CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 রাত, 12:00 রাত', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 রাত, 1:30 রাত', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 রাত, 2:00 রাত', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 সকাল, 6:00 সকাল', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 দুপুর, 10:00 দুপুর', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 দুপুর, 12:00 দুপুর', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 বিকাল, 5:00 বিকাল', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 রাত, 9:30 রাত', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 রাত, 11:00 রাত', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '০তম', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 সেকেন্ড আগে', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '১ সেকেন্ড আগে', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 সেকেন্ড আগে', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 সেকেন্ড আগে', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 মিনিট আগে', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '১ মিনিট আগে', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 মিনিট আগে', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 মিনিট আগে', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ঘন্টা আগে', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '১ ঘন্টা আগে', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ঘন্টা আগে', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ঘন্টা আগে', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 দিন আগে', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '১ দিন আগে', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 দিন আগে', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 দিন আগে', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 সপ্তাহ আগে', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '১ সপ্তাহ আগে', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 সপ্তাহ আগে', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 সপ্তাহ আগে', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 মাস আগে', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '১ মাস আগে', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 মাস আগে', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 মাস আগে', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 বছর আগে', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '১ বছর আগে', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 বছর আগে', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 বছর আগে', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '১ সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '১ সেকেন্ড পরে', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 সেকেন্ড আগে', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '১ সেকেন্ড আগে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 সেকেন্ড', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '১ সেকেন্ড', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 সেকেন্ড', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 সেকেন্ড', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '১ সেকেন্ড পরে', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 মিনিট 1 সেকেন্ড', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 বছর 3 মাস ১ দিন ১ সেকেন্ড', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 বছর পরে', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 মাস আগে', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 বছর 3 মাস ১ দিন ১ সেকেন্ড আগে', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 সপ্তাহ 10 ঘন্টা', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 সপ্তাহ 6 দিন', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 সপ্তাহ 6 দিন', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 সপ্তাহ এবং 6 দিন পরে', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 সপ্তাহ 1 ঘন্টা', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'এক ঘন্টা পরে', // CarbonInterval::days(2)->forHumans() // '2 days', '2 দিন', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '১ দিন 3 ঘন্টা', ]; } ================================================ FILE: tests/Localization/BnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BnTest extends LocalizationTestCase { public const LOCALE = 'bn'; // Bengali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'আগামীকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'শনিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'রবিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'সোমবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'শনিবার, রাত ১২:০ সময়', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'গত রবিবার, রাত ৮:৪৯ সময়', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'গতকাল রাত ১০:০ সময়', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'আজ দুপুর ১০:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'আজ রাত ২:০ সময়', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'আগামীকাল রাত ১:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'গতকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'গতকাল রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'গত মঙ্গলবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'গত সোমবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'গত রবিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'গত শনিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'গত শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'গত বৃহস্পতিবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'গত বুধবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'গত শুক্রবার, রাত ১২:০ সময়', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '১ম ১ম ১ম ১ম ১ম', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '২য় ১ম', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '৩য় ১ম', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '৪র্থ ১ম', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '৫ম ১ম', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '৬ষ্ঠ ১ম', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '৭ম ২য়', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '১১তম ২য়', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '৪০তম', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '৪১তম', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '১০০তম', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 রাত CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 রাত, 12:00 রাত', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 রাত, 1:30 রাত', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 রাত, 2:00 রাত', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 সকাল, 6:00 সকাল', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 দুপুর, 10:00 দুপুর', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 দুপুর, 12:00 দুপুর', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 বিকাল, 5:00 বিকাল', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 রাত, 9:30 রাত', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 রাত, 11:00 রাত', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '০তম', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 সেকেন্ড আগে', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '১ সেকেন্ড আগে', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 সেকেন্ড আগে', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 সেকেন্ড আগে', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 মিনিট আগে', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '১ মিনিট আগে', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 মিনিট আগে', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 মিনিট আগে', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ঘন্টা আগে', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '১ ঘন্টা আগে', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ঘন্টা আগে', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ঘন্টা আগে', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 দিন আগে', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '১ দিন আগে', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 দিন আগে', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 দিন আগে', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 সপ্তাহ আগে', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '১ সপ্তাহ আগে', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 সপ্তাহ আগে', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 সপ্তাহ আগে', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 মাস আগে', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '১ মাস আগে', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 মাস আগে', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 মাস আগে', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 বছর আগে', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '১ বছর আগে', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 বছর আগে', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 বছর আগে', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '১ সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 সেকেন্ড পরে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '১ সেকেন্ড পরে', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 সেকেন্ড আগে', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '১ সেকেন্ড আগে', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 সেকেন্ড', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '১ সেকেন্ড', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 সেকেন্ড', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 সেকেন্ড', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '১ সেকেন্ড পরে', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 মিনিট 1 সেকেন্ড', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 বছর 3 মাস ১ দিন ১ সেকেন্ড', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 বছর পরে', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 মাস আগে', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 বছর 3 মাস ১ দিন ১ সেকেন্ড আগে', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 সপ্তাহ 10 ঘন্টা', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 সপ্তাহ 6 দিন', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 সপ্তাহ 6 দিন', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 সপ্তাহ এবং 6 দিন পরে', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 সপ্তাহ 1 ঘন্টা', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'এক ঘন্টা পরে', // CarbonInterval::days(2)->forHumans() // '2 days', '2 দিন', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '১ দিন 3 ঘন্টা', ]; } ================================================ FILE: tests/Localization/BoCnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BoCnTest extends LocalizationTestCase { public const LOCALE = 'bo_CN'; // Tibetan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'སང་ཉིན མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::now()->subDays(2)->calendar() 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཉི་མ་, མཚན་མོ 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ཁ་སང མཚན་མོ 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'དི་རིང ཉིན་གུང 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'དི་རིང མཚན་མོ 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'སང་ཉིན མཚན་མོ 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ཁ་སང མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ཁ་སང མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་མིག་དམར་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཟླ་བ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཉི་མ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་སྤེན་པ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་པ་སངས་, མཚན་མོ 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཕུར་བུ, མཚན་མོ 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ལྷག་པ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་པ་སངས་, མཚན་མོ 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 མཚན་མོ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 མཚན་མོ, 12:00 མཚན་མོ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 མཚན་མོ, 1:30 མཚན་མོ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 མཚན་མོ, 2:00 མཚན་མོ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ཞོགས་ཀས, 6:00 ཞོགས་ཀས', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ཉིན་གུང, 10:00 ཉིན་གུང', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ཉིན་གུང, 12:00 ཉིན་གུང', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 དགོང་དག, 5:00 དགོང་དག', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 མཚན་མོ, 9:30 མཚན་མོ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 མཚན་མོ, 11:00 མཚན་མོ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'སྐར་ཆ1 སྔན་ལ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'སྐར་ཆ1 སྔན་ལ', // Carbon::now()->subSeconds(2)->diffForHumans() 'སྐར་ཆ2 སྔན་ལ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'སྐར་ཆ2 སྔན་ལ', // Carbon::now()->subMinutes(1)->diffForHumans() 'སྐར་མ་1 སྔན་ལ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'སྐར་མ་1 སྔན་ལ', // Carbon::now()->subMinutes(2)->diffForHumans() 'སྐར་མ་2 སྔན་ལ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'སྐར་མ་2 སྔན་ལ', // Carbon::now()->subHours(1)->diffForHumans() 'ཆུ་ཚོད1 སྔན་ལ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ཆུ་ཚོད1 སྔན་ལ', // Carbon::now()->subHours(2)->diffForHumans() 'ཆུ་ཚོད2 སྔན་ལ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ཆུ་ཚོད2 སྔན་ལ', // Carbon::now()->subDays(1)->diffForHumans() 'ཉིན1་ སྔན་ལ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ཉིན1་ སྔན་ལ', // Carbon::now()->subDays(2)->diffForHumans() 'ཉིན2་ སྔན་ལ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ཉིན2་ སྔན་ལ', // Carbon::now()->subWeeks(1)->diffForHumans() 'གཟའ་འཁོར་1 སྔན་ལ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'གཟའ་འཁོར་1 སྔན་ལ', // Carbon::now()->subWeeks(2)->diffForHumans() 'གཟའ་འཁོར་2 སྔན་ལ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'གཟའ་འཁོར་2 སྔན་ལ', // Carbon::now()->subMonths(1)->diffForHumans() 'ཟླ་བ1 སྔན་ལ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ཟླ་བ1 སྔན་ལ', // Carbon::now()->subMonths(2)->diffForHumans() 'ཟླ་བ2 སྔན་ལ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ཟླ་བ2 སྔན་ལ', // Carbon::now()->subYears(1)->diffForHumans() 'ལོ1 སྔན་ལ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ལོ1 སྔན་ལ', // Carbon::now()->subYears(2)->diffForHumans() 'ལོ2 སྔན་ལ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ལོ2 སྔན་ལ', // Carbon::now()->addSecond()->diffForHumans() 'སྐར་ཆ1 ལ་', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'སྐར་ཆ1 ལ་', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'སྐར་ཆ1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'སྐར་ཆ1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'སྐར་ཆ2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'སྐར་ཆ2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'སྐར་ཆ1 ལ་', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'སྐར་མ་1 སྐར་ཆ1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ལོ2 ཟླ་བ3 ཉིན1་ སྐར་ཆ1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ལོ3 ལ་', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ཟླ་བ5 སྔན་ལ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ལོ2 ཟླ་བ3 ཉིན1་ སྐར་ཆ1 སྔན་ལ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཆུ་ཚོད10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཉིན6་', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཉིན6་', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'གཟའ་འཁོར་1 ཨནད་ ཉིན6་ ལ་', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་2 ཆུ་ཚོད1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ཆུ་ཚོད་གཅིག ལ་', // CarbonInterval::days(2)->forHumans() 'ཉིན2་', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ཉིན1་ ཆུ་ཚོད3', ]; } ================================================ FILE: tests/Localization/BoInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BoInTest extends LocalizationTestCase { public const LOCALE = 'bo_IN'; // Tibetan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'སང་ཉིན 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::now()->subDays(2)->calendar() 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཉི་མ་, 8:49 ཕྱི་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ཁ་སང 10:00 ཕྱི་དྲོ་', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'དི་རིང 10:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'དི་རིང 2:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'སང་ཉིན 1:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ཁ་སང 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ཁ་སང 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་མིག་དམར་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཟླ་བ་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཉི་མ་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་སྤེན་པ་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་པ་སངས་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཕུར་བུ་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ལྷག་པ་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་པ་སངས་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 སྔ་དྲོ་ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 སྔ་དྲོ་, 12:00 སྔ་དྲོ་', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 སྔ་དྲོ་, 1:30 སྔ་དྲོ་', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 སྔ་དྲོ་, 2:00 སྔ་དྲོ་', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 སྔ་དྲོ་, 6:00 སྔ་དྲོ་', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 སྔ་དྲོ་, 10:00 སྔ་དྲོ་', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ཕྱི་དྲོ་, 12:00 ཕྱི་དྲོ་', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ཕྱི་དྲོ་, 5:00 ཕྱི་དྲོ་', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ཕྱི་དྲོ་, 9:30 ཕྱི་དྲོ་', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ཕྱི་དྲོ་, 11:00 ཕྱི་དྲོ་', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'སྐར་ཆ1 སྔན་ལ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'སྐར་ཆ1 སྔན་ལ', // Carbon::now()->subSeconds(2)->diffForHumans() 'སྐར་ཆ2 སྔན་ལ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'སྐར་ཆ2 སྔན་ལ', // Carbon::now()->subMinutes(1)->diffForHumans() 'སྐར་མ་1 སྔན་ལ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'སྐར་མ་1 སྔན་ལ', // Carbon::now()->subMinutes(2)->diffForHumans() 'སྐར་མ་2 སྔན་ལ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'སྐར་མ་2 སྔན་ལ', // Carbon::now()->subHours(1)->diffForHumans() 'ཆུ་ཚོད1 སྔན་ལ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ཆུ་ཚོད1 སྔན་ལ', // Carbon::now()->subHours(2)->diffForHumans() 'ཆུ་ཚོད2 སྔན་ལ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ཆུ་ཚོད2 སྔན་ལ', // Carbon::now()->subDays(1)->diffForHumans() 'ཉིན1་ སྔན་ལ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ཉིན1་ སྔན་ལ', // Carbon::now()->subDays(2)->diffForHumans() 'ཉིན2་ སྔན་ལ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ཉིན2་ སྔན་ལ', // Carbon::now()->subWeeks(1)->diffForHumans() 'གཟའ་འཁོར་1 སྔན་ལ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'གཟའ་འཁོར་1 སྔན་ལ', // Carbon::now()->subWeeks(2)->diffForHumans() 'གཟའ་འཁོར་2 སྔན་ལ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'གཟའ་འཁོར་2 སྔན་ལ', // Carbon::now()->subMonths(1)->diffForHumans() 'ཟླ་བ1 སྔན་ལ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ཟླ་བ1 སྔན་ལ', // Carbon::now()->subMonths(2)->diffForHumans() 'ཟླ་བ2 སྔན་ལ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ཟླ་བ2 སྔན་ལ', // Carbon::now()->subYears(1)->diffForHumans() 'ལོ1 སྔན་ལ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ལོ1 སྔན་ལ', // Carbon::now()->subYears(2)->diffForHumans() 'ལོ2 སྔན་ལ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ལོ2 སྔན་ལ', // Carbon::now()->addSecond()->diffForHumans() 'སྐར་ཆ1 ལ་', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'སྐར་ཆ1 ལ་', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'སྐར་ཆ1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'སྐར་ཆ1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'སྐར་ཆ2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'སྐར་ཆ2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'སྐར་ཆ1 ལ་', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'སྐར་མ་1 སྐར་ཆ1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ལོ2 ཟླ་བ3 ཉིན1་ སྐར་ཆ1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ལོ3 ལ་', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ཟླ་བ5 སྔན་ལ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ལོ2 ཟླ་བ3 ཉིན1་ སྐར་ཆ1 སྔན་ལ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཆུ་ཚོད10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཉིན6་', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཉིན6་', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'གཟའ་འཁོར་1 ཨནད་ ཉིན6་ ལ་', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་2 ཆུ་ཚོད1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ཆུ་ཚོད་གཅིག ལ་', // CarbonInterval::days(2)->forHumans() 'ཉིན2་', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ཉིན1་ ཆུ་ཚོད3', ]; } ================================================ FILE: tests/Localization/BoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BoTest extends LocalizationTestCase { public const LOCALE = 'bo'; // Tibetan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'སང་ཉིན མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::now()->subDays(2)->calendar() 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཉི་མ་, མཚན་མོ 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ཁ་སང མཚན་མོ 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'དི་རིང ཉིན་གུང 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'དི་རིང མཚན་མོ 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'སང་ཉིན མཚན་མོ 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་རྗེས་མ, མཚན་མོ 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ཁ་སང མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ཁ་སང མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་མིག་དམར་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཟླ་བ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཉི་མ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་སྤེན་པ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་པ་སངས་, མཚན་མོ 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ཕུར་བུ, མཚན་མོ 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་ལྷག་པ་, མཚན་མོ 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'བདུན་ཕྲག་མཐའ་མ གཟའ་པ་སངས་, མཚན་མོ 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 མཚན་མོ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 མཚན་མོ, 12:00 མཚན་མོ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 མཚན་མོ, 1:30 མཚན་མོ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 མཚན་མོ, 2:00 མཚན་མོ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ཞོགས་ཀས, 6:00 ཞོགས་ཀས', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ཉིན་གུང, 10:00 ཉིན་གུང', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ཉིན་གུང, 12:00 ཉིན་གུང', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 དགོང་དག, 5:00 དགོང་དག', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 མཚན་མོ, 9:30 མཚན་མོ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 མཚན་མོ, 11:00 མཚན་མོ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'སྐར་ཆ1 སྔན་ལ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'སྐར་ཆ1 སྔན་ལ', // Carbon::now()->subSeconds(2)->diffForHumans() 'སྐར་ཆ2 སྔན་ལ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'སྐར་ཆ2 སྔན་ལ', // Carbon::now()->subMinutes(1)->diffForHumans() 'སྐར་མ་1 སྔན་ལ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'སྐར་མ་1 སྔན་ལ', // Carbon::now()->subMinutes(2)->diffForHumans() 'སྐར་མ་2 སྔན་ལ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'སྐར་མ་2 སྔན་ལ', // Carbon::now()->subHours(1)->diffForHumans() 'ཆུ་ཚོད1 སྔན་ལ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ཆུ་ཚོད1 སྔན་ལ', // Carbon::now()->subHours(2)->diffForHumans() 'ཆུ་ཚོད2 སྔན་ལ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ཆུ་ཚོད2 སྔན་ལ', // Carbon::now()->subDays(1)->diffForHumans() 'ཉིན1་ སྔན་ལ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ཉིན1་ སྔན་ལ', // Carbon::now()->subDays(2)->diffForHumans() 'ཉིན2་ སྔན་ལ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ཉིན2་ སྔན་ལ', // Carbon::now()->subWeeks(1)->diffForHumans() 'གཟའ་འཁོར་1 སྔན་ལ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'གཟའ་འཁོར་1 སྔན་ལ', // Carbon::now()->subWeeks(2)->diffForHumans() 'གཟའ་འཁོར་2 སྔན་ལ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'གཟའ་འཁོར་2 སྔན་ལ', // Carbon::now()->subMonths(1)->diffForHumans() 'ཟླ་བ1 སྔན་ལ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ཟླ་བ1 སྔན་ལ', // Carbon::now()->subMonths(2)->diffForHumans() 'ཟླ་བ2 སྔན་ལ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ཟླ་བ2 སྔན་ལ', // Carbon::now()->subYears(1)->diffForHumans() 'ལོ1 སྔན་ལ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ལོ1 སྔན་ལ', // Carbon::now()->subYears(2)->diffForHumans() 'ལོ2 སྔན་ལ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ལོ2 སྔན་ལ', // Carbon::now()->addSecond()->diffForHumans() 'སྐར་ཆ1 ལ་', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'སྐར་ཆ1 ལ་', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'སྐར་ཆ1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'སྐར་ཆ1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'སྐར་ཆ2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'སྐར་ཆ2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'སྐར་ཆ1 ལ་', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'སྐར་མ་1 སྐར་ཆ1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ལོ2 ཟླ་བ3 ཉིན1་ སྐར་ཆ1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ལོ3 ལ་', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ཟླ་བ5 སྔན་ལ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ལོ2 ཟླ་བ3 ཉིན1་ སྐར་ཆ1 སྔན་ལ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཆུ་ཚོད10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཉིན6་', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་1 ཉིན6་', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'གཟའ་འཁོར་1 ཨནད་ ཉིན6་ ལ་', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'གཟའ་འཁོར་2 ཆུ་ཚོད1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ཆུ་ཚོད་གཅིག ལ་', // CarbonInterval::days(2)->forHumans() 'ཉིན2་', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ཉིན1་ ཆུ་ཚོད3', ]; } ================================================ FILE: tests/Localization/BrFrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BrFrTest extends LocalizationTestCase { public const LOCALE = 'br_FR'; // Breton public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Warc\'hoazh da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sadorn da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sul da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lun da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Meurzh da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Merc\'her da 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Yaou da 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Gwener da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Meurzh da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Merc\'her da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Yaou da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gwener da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sadorn da 00:00', // Carbon::now()->subDays(2)->calendar() 'Sul paset da 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dec\'h da 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hiziv da 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hiziv da 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Warc\'hoazh da 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Meurzh da 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Dec\'h da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dec\'h da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Meurzh paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lun paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sul paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sadorn paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gwener paset da 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Yaou paset da 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Merc\'her paset da 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gwener paset da 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1añ 1añ 1añ 1añ 1añ', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2vet 1añ', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3vet 1añ', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4vet 1añ', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5vet 1añ', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6vet 1añ', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7vet 1añ', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11vet 2vet', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40vet', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41vet', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100vet', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 A.M., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 A.M., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 A.M., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 A.M., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 A.M., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 G.M., 12:00 g.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 G.M., 5:00 g.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 G.M., 9:30 g.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 G.M., 11:00 g.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0vet', // Carbon::now()->subSeconds(1)->diffForHumans() '1 eilenn \'zo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s \'zo', // Carbon::now()->subSeconds(2)->diffForHumans() '2 eilenn \'zo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s \'zo', // Carbon::now()->subMinutes(1)->diffForHumans() '1 vunutenn \'zo', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min \'zo', // Carbon::now()->subMinutes(2)->diffForHumans() '2 vunutenn \'zo', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min \'zo', // Carbon::now()->subHours(1)->diffForHumans() '1 eur \'zo', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 e \'zo', // Carbon::now()->subHours(2)->diffForHumans() '2 eur \'zo', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 e \'zo', // Carbon::now()->subDays(1)->diffForHumans() '1 devezh \'zo', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d \'zo', // Carbon::now()->subDays(2)->diffForHumans() '2 zevezh \'zo', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d \'zo', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sizhun \'zo', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sizhun \'zo', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sizhun \'zo', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sizhun \'zo', // Carbon::now()->subMonths(1)->diffForHumans() '1 miz \'zo', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 miz \'zo', // Carbon::now()->subMonths(2)->diffForHumans() '2 viz \'zo', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 viz \'zo', // Carbon::now()->subYears(1)->diffForHumans() '1 bloaz \'zo', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 bl. \'zo', // Carbon::now()->subYears(2)->diffForHumans() '2 vloaz \'zo', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 bl. \'zo', // Carbon::now()->addSecond()->diffForHumans() 'a-benn 1 eilenn', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'a-benn 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 eilenn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 eilenn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'a-benn 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 vunutenn 1 eilenn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 bl. 3 miz 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'a-benn 3 bloaz', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 miz \'zo', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 bl. 3 miz 1 d 1 s \'zo', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sizhun 10 eur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sizhun 6 devezh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sizhun 6 devezh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'a-benn 1 sizhun hag 6 devezh', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sizhun 1 eur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'a-benn un eur', // CarbonInterval::days(2)->forHumans() '2 zevezh', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d 3 e', ]; } ================================================ FILE: tests/Localization/BrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BrTest extends LocalizationTestCase { public const LOCALE = 'br'; // Breton public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Warc\'hoazh da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sadorn da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sul da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lun da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Meurzh da 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Merc\'her da 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Yaou da 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Gwener da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Meurzh da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Merc\'her da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Yaou da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gwener da 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sadorn da 00:00', // Carbon::now()->subDays(2)->calendar() 'Sul paset da 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dec\'h da 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hiziv da 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hiziv da 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Warc\'hoazh da 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Meurzh da 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Dec\'h da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dec\'h da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Meurzh paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lun paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sul paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sadorn paset da 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gwener paset da 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Yaou paset da 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Merc\'her paset da 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Gwener paset da 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1añ 1añ 1añ 1añ 1añ', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2vet 1añ', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3vet 1añ', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4vet 1añ', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5vet 1añ', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6vet 1añ', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7vet 1añ', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11vet 2vet', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40vet', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41vet', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100vet', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 A.M., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 A.M., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 A.M., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 A.M., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 A.M., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 G.M., 12:00 g.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 G.M., 5:00 g.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 G.M., 9:30 g.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 G.M., 11:00 g.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0vet', // Carbon::now()->subSeconds(1)->diffForHumans() '1 eilenn \'zo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s \'zo', // Carbon::now()->subSeconds(2)->diffForHumans() '2 eilenn \'zo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s \'zo', // Carbon::now()->subMinutes(1)->diffForHumans() '1 vunutenn \'zo', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min \'zo', // Carbon::now()->subMinutes(2)->diffForHumans() '2 vunutenn \'zo', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min \'zo', // Carbon::now()->subHours(1)->diffForHumans() '1 eur \'zo', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 e \'zo', // Carbon::now()->subHours(2)->diffForHumans() '2 eur \'zo', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 e \'zo', // Carbon::now()->subDays(1)->diffForHumans() '1 devezh \'zo', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d \'zo', // Carbon::now()->subDays(2)->diffForHumans() '2 zevezh \'zo', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d \'zo', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sizhun \'zo', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sizhun \'zo', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sizhun \'zo', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sizhun \'zo', // Carbon::now()->subMonths(1)->diffForHumans() '1 miz \'zo', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 miz \'zo', // Carbon::now()->subMonths(2)->diffForHumans() '2 viz \'zo', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 viz \'zo', // Carbon::now()->subYears(1)->diffForHumans() '1 bloaz \'zo', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 bl. \'zo', // Carbon::now()->subYears(2)->diffForHumans() '2 vloaz \'zo', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 bl. \'zo', // Carbon::now()->addSecond()->diffForHumans() 'a-benn 1 eilenn', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'a-benn 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 eilenn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 eilenn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'a-benn 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 vunutenn 1 eilenn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 bl. 3 miz 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'a-benn 3 bloaz', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 miz \'zo', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 bl. 3 miz 1 d 1 s \'zo', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sizhun 10 eur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sizhun 6 devezh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sizhun 6 devezh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'a-benn 1 sizhun hag 6 devezh', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sizhun 1 eur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'a-benn un eur', // CarbonInterval::days(2)->forHumans() '2 zevezh', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d 3 e', ]; } ================================================ FILE: tests/Localization/BrxInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BrxInTest extends LocalizationTestCase { public const LOCALE = 'brx_IN'; // Bodo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सुनिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रबिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुदबार at 12:00 फुं.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिसथिबार at 12:00 फुं.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुदबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिसथिबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सुनिबार at 12:00 फुं.', // Carbon::now()->subDays(2)->calendar() 'Last रबिबार at 8:49 बेलासे.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 बेलासे.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 फुं.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रबिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सुनिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिसथिबार at 12:00 फुं.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुदबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 फुं. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 फुं., 12:00 फुं.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 फुं., 1:30 फुं.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 फुं., 2:00 फुं.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 फुं., 6:00 फुं.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 फुं., 10:00 फुं.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 बेलासे., 12:00 बेलासे.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 बेलासे., 5:00 बेलासे.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 बेलासे., 9:30 बेलासे.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 बेलासे., 11:00 बेलासे.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/BrxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BrxTest extends LocalizationTestCase { public const LOCALE = 'brx'; // Bodo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सुनिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रबिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुदबार at 12:00 फुं.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिसथिबार at 12:00 फुं.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुदबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिसथिबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सुनिबार at 12:00 फुं.', // Carbon::now()->subDays(2)->calendar() 'Last रबिबार at 8:49 बेलासे.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 बेलासे.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 फुं.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रबिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सुनिबार at 12:00 फुं.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिसथिबार at 12:00 फुं.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुदबार at 12:00 फुं.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last सुखुरबार at 12:00 फुं.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 फुं. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 फुं., 12:00 फुं.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 फुं., 1:30 फुं.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 फुं., 2:00 फुं.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 फुं., 6:00 फुं.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 फुं., 10:00 फुं.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 बेलासे., 12:00 बेलासे.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 बेलासे., 5:00 बेलासे.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 बेलासे., 9:30 बेलासे.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 बेलासे., 11:00 बेलासे.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/BsBaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BsBaTest extends LocalizationTestCase { public const LOCALE = 'bs_BA'; // Bosnian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() 'prošlu nedjelja u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošlu nedjelja u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli petak u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'prošli četvrtak u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'prošlu srijeda u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'prošli petak u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 prijepodne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 prijepodne, 12:00 prijepodne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 prijepodne, 1:30 prijepodne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 prijepodne, 2:00 prijepodne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 prijepodne, 6:00 prijepodne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 prijepodne, 10:00 prijepodne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 popodne, 12:00 popodne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 popodne, 5:00 popodne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 popodne, 9:30 popodne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 popodne, 11:00 popodne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'prije 1 sekund', // Carbon::now()->subSeconds(2)->diffForHumans() 'prije 2 sekunda', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'prije 2 sekunda', // Carbon::now()->subMinutes(1)->diffForHumans() 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'prije 1 minut', // Carbon::now()->subMinutes(2)->diffForHumans() 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'prije 2 minuta', // Carbon::now()->subHours(1)->diffForHumans() 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'prije 1 dan', // Carbon::now()->subDays(2)->diffForHumans() 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'prije 2 dana', // Carbon::now()->subWeeks(1)->diffForHumans() 'prije 1 sedmicu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'prije 1 sedmica', // Carbon::now()->subWeeks(2)->diffForHumans() 'prije 2 sedmice', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'prije 2 sedmice', // Carbon::now()->subMonths(1)->diffForHumans() 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'prije 1 mjesec', // Carbon::now()->subMonths(2)->diffForHumans() 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'prije 2 mjeseca', // Carbon::now()->subYears(1)->diffForHumans() 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'prije 1 godina', // Carbon::now()->subYears(2)->diffForHumans() 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'prije 2 godine', // Carbon::now()->addSecond()->diffForHumans() 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'nakon 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'nakon 1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund ranije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund ranije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'za 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'prije 5 mjeseci', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'prije 2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sedmica 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'za 1 sedmicu i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sedmice 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'za 1 sat', // CarbonInterval::days(2)->forHumans() '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dan 3 sata', ]; } ================================================ FILE: tests/Localization/BsCyrlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BsCyrlTest extends LocalizationTestCase { public const LOCALE = 'bs_Cyrl'; // Bosnian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sutra u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u subotu u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u nedjelju u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u понедјељак u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u уторак u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u srijedu u 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'u четвртак u 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'u петак u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u уторак u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u srijedu u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u четвртак u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u петак u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u subotu u 00:00', // Carbon::now()->subDays(2)->calendar() 'prošlu недјеља u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'danas u 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'sutra u 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u уторак u 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jučer u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli уторак u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli понедјељак u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošlu недјеља u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošle subote u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli петак u 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'prošli четвртак u 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'prošlu сриједа u 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'prošli петак u 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 пре подне CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 пре подне, 12:00 пре подне', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 пре подне, 1:30 пре подне', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 пре подне, 2:00 пре подне', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 пре подне, 6:00 пре подне', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 пре подне, 10:00 пре подне', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 поподне, 12:00 поподне', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 поподне, 5:00 поподне', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 поподне, 9:30 поподне', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 поподне, 11:00 поподне', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'prije 1 sekund', // Carbon::now()->subSeconds(2)->diffForHumans() 'prije 2 sekunda', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'prije 2 sekunda', // Carbon::now()->subMinutes(1)->diffForHumans() 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'prije 1 minut', // Carbon::now()->subMinutes(2)->diffForHumans() 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'prije 2 minuta', // Carbon::now()->subHours(1)->diffForHumans() 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'prije 1 dan', // Carbon::now()->subDays(2)->diffForHumans() 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'prije 2 dana', // Carbon::now()->subWeeks(1)->diffForHumans() 'prije 1 sedmicu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'prije 1 sedmica', // Carbon::now()->subWeeks(2)->diffForHumans() 'prije 2 sedmice', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'prije 2 sedmice', // Carbon::now()->subMonths(1)->diffForHumans() 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'prije 1 mjesec', // Carbon::now()->subMonths(2)->diffForHumans() 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'prije 2 mjeseca', // Carbon::now()->subYears(1)->diffForHumans() 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'prije 1 godina', // Carbon::now()->subYears(2)->diffForHumans() 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'prije 2 godine', // Carbon::now()->addSecond()->diffForHumans() 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'nakon 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'nakon 1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund ranije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund ranije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'za 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'prije 5 mjeseci', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'prije 2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sedmica 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'za 1 sedmicu i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sedmice 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'za 1 sat', // CarbonInterval::days(2)->forHumans() '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dan 3 sata', ]; } ================================================ FILE: tests/Localization/BsLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BsLatnTest extends LocalizationTestCase { public const LOCALE = 'bs_Latn'; // Bosnian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() 'prošlu nedjelja u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošlu nedjelja u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli petak u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'prošli četvrtak u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'prošlu srijeda u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'prošli petak u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 prijepodne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 prijepodne, 12:00 prijepodne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 prijepodne, 1:30 prijepodne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 prijepodne, 2:00 prijepodne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 prijepodne, 6:00 prijepodne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 prijepodne, 10:00 prijepodne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 popodne, 12:00 popodne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 popodne, 5:00 popodne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 popodne, 9:30 popodne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 popodne, 11:00 popodne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'prije 1 sekund', // Carbon::now()->subSeconds(2)->diffForHumans() 'prije 2 sekunda', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'prije 2 sekunda', // Carbon::now()->subMinutes(1)->diffForHumans() 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'prije 1 minut', // Carbon::now()->subMinutes(2)->diffForHumans() 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'prije 2 minuta', // Carbon::now()->subHours(1)->diffForHumans() 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'prije 1 dan', // Carbon::now()->subDays(2)->diffForHumans() 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'prije 2 dana', // Carbon::now()->subWeeks(1)->diffForHumans() 'prije 1 sedmicu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'prije 1 sedmica', // Carbon::now()->subWeeks(2)->diffForHumans() 'prije 2 sedmice', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'prije 2 sedmice', // Carbon::now()->subMonths(1)->diffForHumans() 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'prije 1 mjesec', // Carbon::now()->subMonths(2)->diffForHumans() 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'prije 2 mjeseca', // Carbon::now()->subYears(1)->diffForHumans() 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'prije 1 godina', // Carbon::now()->subYears(2)->diffForHumans() 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'prije 2 godine', // Carbon::now()->addSecond()->diffForHumans() 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'nakon 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'nakon 1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund ranije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund ranije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'za 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'prije 5 mjeseci', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'prije 2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sedmica 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'za 1 sedmicu i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sedmice 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'za 1 sat', // CarbonInterval::days(2)->forHumans() '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dan 3 sata', ]; } ================================================ FILE: tests/Localization/BsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BsTest extends LocalizationTestCase { public const LOCALE = 'bs'; // Bosnian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() 'prošlu nedjelja u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošlu nedjelja u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'prošli petak u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'prošli četvrtak u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'prošlu srijeda u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'prošli petak u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 prijepodne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 prijepodne, 12:00 prijepodne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 prijepodne, 1:30 prijepodne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 prijepodne, 2:00 prijepodne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 prijepodne, 6:00 prijepodne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 prijepodne, 10:00 prijepodne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 popodne, 12:00 popodne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 popodne, 5:00 popodne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 popodne, 9:30 popodne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 popodne, 11:00 popodne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'prije 1 sekund', // Carbon::now()->subSeconds(2)->diffForHumans() 'prije 2 sekunda', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'prije 2 sekunda', // Carbon::now()->subMinutes(1)->diffForHumans() 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'prije 1 minut', // Carbon::now()->subMinutes(2)->diffForHumans() 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'prije 2 minuta', // Carbon::now()->subHours(1)->diffForHumans() 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'prije 1 dan', // Carbon::now()->subDays(2)->diffForHumans() 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'prije 2 dana', // Carbon::now()->subWeeks(1)->diffForHumans() 'prije 1 sedmicu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'prije 1 sedmica', // Carbon::now()->subWeeks(2)->diffForHumans() 'prije 2 sedmice', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'prije 2 sedmice', // Carbon::now()->subMonths(1)->diffForHumans() 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'prije 1 mjesec', // Carbon::now()->subMonths(2)->diffForHumans() 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'prije 2 mjeseca', // Carbon::now()->subYears(1)->diffForHumans() 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'prije 1 godina', // Carbon::now()->subYears(2)->diffForHumans() 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'prije 2 godine', // Carbon::now()->addSecond()->diffForHumans() 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'nakon 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'nakon 1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund ranije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund ranije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'za 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'prije 5 mjeseci', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'prije 2 godine 3 mjeseca 1 dan 1 sekund', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sedmica 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sedmica 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'za 1 sedmicu i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sedmice 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'za 1 sat', // CarbonInterval::days(2)->forHumans() '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dan 3 sata', ]; } ================================================ FILE: tests/Localization/BynErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BynErTest extends LocalizationTestCase { public const LOCALE = 'byn_ER'; // Bilin public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበር ሽጓዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበር ቅዳዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ለጓ ወሪ ለብዋ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ኣምድ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ለጓ ወሪ ለብዋ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ኣምድ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰንበር ሽጓዅ at 12:00 ፋዱስ ጃብ', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበር ቅዳዅ at 8:49 ፋዱስ ደምቢ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ፋዱስ ደምቢ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበር ቅዳዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበር ሽጓዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ኣምድ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ለጓ ወሪ ለብዋ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ፋዱስ ጃብ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ፋዱስ ጃብ, 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ፋዱስ ጃብ, 1:30 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ፋዱስ ጃብ, 2:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ፋዱስ ጃብ, 6:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ፋዱስ ጃብ, 10:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ፋዱስ ደምቢ, 12:00 ፋዱስ ደምቢ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ፋዱስ ደምቢ, 5:00 ፋዱስ ደምቢ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ፋዱስ ደምቢ, 9:30 ፋዱስ ደምቢ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ፋዱስ ደምቢ, 11:00 ፋዱስ ደምቢ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/BynTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class BynTest extends LocalizationTestCase { public const LOCALE = 'byn'; // Bilin public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበር ሽጓዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበር ቅዳዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ለጓ ወሪ ለብዋ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ኣምድ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ለጓ ወሪ ለብዋ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ኣምድ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰንበር ሽጓዅ at 12:00 ፋዱስ ጃብ', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበር ቅዳዅ at 8:49 ፋዱስ ደምቢ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ፋዱስ ደምቢ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰሊጝ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበር ቅዳዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበር ሽጓዅ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ኣምድ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ለጓ ወሪ ለብዋ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ኣርብ at 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ፋዱስ ጃብ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ፋዱስ ጃብ, 12:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ፋዱስ ጃብ, 1:30 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ፋዱስ ጃብ, 2:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ፋዱስ ጃብ, 6:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ፋዱስ ጃብ, 10:00 ፋዱስ ጃብ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ፋዱስ ደምቢ, 12:00 ፋዱስ ደምቢ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ፋዱስ ደምቢ, 5:00 ፋዱስ ደምቢ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ፋዱስ ደምቢ, 9:30 ፋዱስ ደምቢ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ፋዱስ ደምቢ, 11:00 ፋዱስ ደምቢ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/CaAdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CaAdTest extends LocalizationTestCase { public const LOCALE = 'ca_AD'; // Catalan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'demà a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'diumenge a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'dilluns a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'el diumenge passat a les 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'ahir a les 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'avui a les 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'avui a les 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'demà a les 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'el dimarts passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'el dilluns passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'el diumenge passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'el dissabte passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'el dijous passat a les 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'el dimecres passat a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1r 1r 1r 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2n 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3r 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4t 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5è 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6è 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7è 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11è 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40è', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41è', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100è', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0è', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'fa 1 segon', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'fa 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'fa 2 segons', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'fa 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'fa 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'fa 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'fa 2 minuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'fa 2 min', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'fa 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'fa 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'fa 2 hores', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'fa 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'fa 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'fa 1 d', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'fa 2 dies', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'fa 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'fa 2 setmanes', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'fa 2 setmanes', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'fa 2 mesos', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'fa 2 mesos', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'fa 1 any', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'fa 1 any', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'fa 2 anys', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'fa 2 anys', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'd\'aquí a 1 segon', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 segon després', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 s després', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 segon abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 s abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 segon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 segons', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minut 1 segon', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 anys 3 mesos 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'd\'aquí a 3 anys', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'fa 5 mesos', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'fa 2 anys 3 mesos 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 setmana 10 hores', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'd\'aquí a 1 setmana i 6 dies', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 setmanes 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'd\'aquí a una hora', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dies', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 h', ]; } ================================================ FILE: tests/Localization/CaEsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CaEsTest extends LocalizationTestCase { public const LOCALE = 'ca_ES'; // Catalan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'demà a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'diumenge a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'dilluns a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'el diumenge passat a les 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'ahir a les 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'avui a les 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'avui a les 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'demà a les 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'el dimarts passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'el dilluns passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'el diumenge passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'el dissabte passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'el dijous passat a les 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'el dimecres passat a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1r 1r 1r 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2n 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3r 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4t 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5è 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6è 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7è 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11è 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40è', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41è', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100è', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0è', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'fa 1 segon', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'fa 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'fa 2 segons', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'fa 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'fa 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'fa 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'fa 2 minuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'fa 2 min', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'fa 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'fa 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'fa 2 hores', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'fa 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'fa 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'fa 1 d', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'fa 2 dies', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'fa 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'fa 2 setmanes', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'fa 2 setmanes', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'fa 2 mesos', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'fa 2 mesos', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'fa 1 any', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'fa 1 any', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'fa 2 anys', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'fa 2 anys', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'd\'aquí a 1 segon', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 segon després', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 s després', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 segon abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 s abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 segon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 segons', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minut 1 segon', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 anys 3 mesos 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'd\'aquí a 3 anys', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'fa 5 mesos', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'fa 2 anys 3 mesos 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 setmana 10 hores', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'd\'aquí a 1 setmana i 6 dies', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 setmanes 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'd\'aquí a una hora', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dies', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 h', ]; } ================================================ FILE: tests/Localization/CaEsValenciaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CaEsValenciaTest extends LocalizationTestCase { public const LOCALE = 'ca_ES_Valencia'; // Catalan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'demà a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'diumenge a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'dilluns a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'el diumenge passat a les 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'ahir a les 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'avui a les 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'avui a les 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'demà a les 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'el dimarts passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'el dilluns passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'el diumenge passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'el dissabte passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'el dijous passat a les 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'el dimecres passat a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1r 1r 1r 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2n 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3r 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4t 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5è 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6è 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7è 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11è 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40è', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41è', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100è', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0è', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'fa 1 segon', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'fa 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'fa 2 segons', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'fa 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'fa 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'fa 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'fa 2 minuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'fa 2 min', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'fa 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'fa 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'fa 2 hores', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'fa 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'fa 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'fa 1 d', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'fa 2 dies', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'fa 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'fa 2 setmanes', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'fa 2 setmanes', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'fa 2 mesos', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'fa 2 mesos', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'fa 1 any', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'fa 1 any', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'fa 2 anys', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'fa 2 anys', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'd\'aquí a 1 segon', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 segon després', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 s després', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 segon abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 s abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 segon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 segons', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minut 1 segon', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 anys 3 mesos 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'd\'aquí a 3 anys', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'fa 5 mesos', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'fa 2 anys 3 mesos 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 setmana 10 hores', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'd\'aquí a 1 setmana i 6 dies', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 setmanes 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'd\'aquí a una hora', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dies', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 h', ]; } ================================================ FILE: tests/Localization/CaFrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CaFrTest extends LocalizationTestCase { public const LOCALE = 'ca_FR'; // Catalan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'demà a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'diumenge a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'dilluns a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'el diumenge passat a les 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'ahir a les 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'avui a les 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'avui a les 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'demà a les 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'el dimarts passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'el dilluns passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'el diumenge passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'el dissabte passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'el dijous passat a les 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'el dimecres passat a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1r 1r 1r 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2n 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3r 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4t 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5è 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6è 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7è 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11è 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40è', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41è', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100è', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0è', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'fa 1 segon', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'fa 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'fa 2 segons', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'fa 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'fa 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'fa 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'fa 2 minuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'fa 2 min', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'fa 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'fa 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'fa 2 hores', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'fa 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'fa 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'fa 1 d', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'fa 2 dies', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'fa 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'fa 2 setmanes', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'fa 2 setmanes', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'fa 2 mesos', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'fa 2 mesos', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'fa 1 any', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'fa 1 any', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'fa 2 anys', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'fa 2 anys', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'd\'aquí a 1 segon', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 segon després', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 s després', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 segon abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 s abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 segon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 segons', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minut 1 segon', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 anys 3 mesos 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'd\'aquí a 3 anys', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'fa 5 mesos', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'fa 2 anys 3 mesos 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 setmana 10 hores', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'd\'aquí a 1 setmana i 6 dies', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 setmanes 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'd\'aquí a una hora', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dies', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 h', ]; } ================================================ FILE: tests/Localization/CaItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CaItTest extends LocalizationTestCase { public const LOCALE = 'ca_IT'; // Catalan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'demà a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'diumenge a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'dilluns a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'el diumenge passat a les 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'ahir a les 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'avui a les 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'avui a les 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'demà a les 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'el dimarts passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'el dilluns passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'el diumenge passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'el dissabte passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'el dijous passat a les 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'el dimecres passat a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1r 1r 1r 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2n 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3r 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4t 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5è 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6è 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7è 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11è 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40è', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41è', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100è', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0è', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'fa 1 segon', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'fa 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'fa 2 segons', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'fa 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'fa 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'fa 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'fa 2 minuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'fa 2 min', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'fa 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'fa 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'fa 2 hores', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'fa 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'fa 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'fa 1 d', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'fa 2 dies', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'fa 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'fa 2 setmanes', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'fa 2 setmanes', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'fa 2 mesos', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'fa 2 mesos', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'fa 1 any', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'fa 1 any', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'fa 2 anys', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'fa 2 anys', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'd\'aquí a 1 segon', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 segon després', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 s després', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 segon abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 s abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 segon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 segons', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minut 1 segon', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 anys 3 mesos 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'd\'aquí a 3 anys', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'fa 5 mesos', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'fa 2 anys 3 mesos 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 setmana 10 hores', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'd\'aquí a 1 setmana i 6 dies', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 setmanes 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'd\'aquí a una hora', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dies', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 h', ]; } ================================================ FILE: tests/Localization/CaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CaTest extends LocalizationTestCase { public const LOCALE = 'ca'; // Catalan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'demà a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'diumenge a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'dilluns a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'dimecres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'dijous a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'divendres a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'dissabte a les 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'el diumenge passat a les 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'ahir a les 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'avui a les 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'avui a les 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'demà a les 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'dimarts a les 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'ahir a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'el dimarts passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'el dilluns passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'el diumenge passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'el dissabte passat a les 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'el dijous passat a les 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'el dimecres passat a les 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'el divendres passat a les 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1r 1r 1r 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2n 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3r 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4t 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5è 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6è 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7è 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11è 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40è', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41è', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100è', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0è', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'fa 1 segon', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'fa 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'fa 2 segons', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'fa 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'fa 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'fa 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'fa 2 minuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'fa 2 min', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'fa 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'fa 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'fa 2 hores', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'fa 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'fa 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'fa 1 d', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'fa 2 dies', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'fa 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'fa 2 setmanes', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'fa 2 setmanes', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'fa 2 mesos', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'fa 2 mesos', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'fa 1 any', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'fa 1 any', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'fa 2 anys', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'fa 2 anys', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'd\'aquí a 1 segon', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 segon després', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 s després', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 segon abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 s abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 segon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 segons', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'd\'aquí a 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minut 1 segon', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 anys 3 mesos 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'd\'aquí a 3 anys', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'fa 5 mesos', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'fa 2 anys 3 mesos 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 setmana 10 hores', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 setmana 6 dies', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'd\'aquí a 1 setmana i 6 dies', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 setmanes 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'd\'aquí a una hora', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dies', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 h', ]; } ================================================ FILE: tests/Localization/CcpInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CcpInTest extends LocalizationTestCase { public const LOCALE = 'ccp_IN'; // Chakma public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄥𑄧𑄚𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄢𑄧𑄝𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄥𑄧𑄟𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄝𑄪𑄖𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄝𑄪𑄖𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄥𑄧𑄚𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Last 𑄢𑄧𑄝𑄨𑄝𑄢𑄴 at 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄥𑄧𑄟𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄢𑄧𑄝𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄥𑄧𑄚𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 𑄝𑄪𑄖𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/CcpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CcpTest extends LocalizationTestCase { public const LOCALE = 'ccp'; // Chakma public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄥𑄧𑄚𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄢𑄧𑄝𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄥𑄧𑄟𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '𑄝𑄪𑄖𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄝𑄪𑄖𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄥𑄧𑄚𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Last 𑄢𑄧𑄝𑄨𑄝𑄢𑄴 at 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄥𑄧𑄟𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄢𑄧𑄝𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄥𑄧𑄚𑄨𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 𑄝𑄪𑄖𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴 at 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/CeRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CeRuTest extends LocalizationTestCase { public const LOCALE = 'ce_RU'; // Chechen public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шот де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'КӀиранан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Оршотан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шинарин де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кхаарин де at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Еарин де at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шинарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кхаарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Еарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шот де at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last КӀиранан де at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шинарин де at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шинарин де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Оршотан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last КӀиранан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шот де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Еарин де at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Кхаарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунд ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 секунд ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунд ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 секунд ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минот ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 минот ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минот ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 минот ago', // Carbon::now()->subHours(1)->diffForHumans() '1 сахьт ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 сахьт ago', // Carbon::now()->subHours(2)->diffForHumans() '2 сахьт ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 сахьт ago', // Carbon::now()->subDays(1)->diffForHumans() '1 де ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 де ago', // Carbon::now()->subDays(2)->diffForHumans() '2 де ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 де ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 кӏира ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 кӏира ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 кӏира ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 кӏира ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 бутт ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 бутт ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 бутт ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 бутт ago', // Carbon::now()->subYears(1)->diffForHumans() '1 шо ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 шо ago', // Carbon::now()->subYears(2)->diffForHumans() '2 шо ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 шо ago', // Carbon::now()->addSecond()->diffForHumans() '1 секунд from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 секунд from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунд after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 секунд after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунд before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 секунд before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 секунд from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минот 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 шо 3 бутт 1 де 1 секунд', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 шо from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 бутт ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 шо 3 бутт 1 де 1 секунд ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 кӏира 10 сахьт', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 кӏира 6 де', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 кӏира 6 де', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 кӏира and 6 де from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 кӏира 1 сахьт', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 сахьт from now', // CarbonInterval::days(2)->forHumans() '2 де', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 де 3 сахьт', ]; } ================================================ FILE: tests/Localization/CeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CeTest extends LocalizationTestCase { public const LOCALE = 'ce'; // Chechen public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шот де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'КӀиранан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Оршотан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шинарин де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кхаарин де at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Еарин де at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шинарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кхаарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Еарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шот де at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last КӀиранан де at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шинарин де at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шинарин де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Оршотан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last КӀиранан де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шот де at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Еарин де at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Кхаарин де at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ПӀераскан де at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунд ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 секунд ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунд ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 секунд ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минот ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 минот ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минот ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 минот ago', // Carbon::now()->subHours(1)->diffForHumans() '1 сахьт ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 сахьт ago', // Carbon::now()->subHours(2)->diffForHumans() '2 сахьт ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 сахьт ago', // Carbon::now()->subDays(1)->diffForHumans() '1 де ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 де ago', // Carbon::now()->subDays(2)->diffForHumans() '2 де ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 де ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 кӏира ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 кӏира ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 кӏира ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 кӏира ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 бутт ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 бутт ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 бутт ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 бутт ago', // Carbon::now()->subYears(1)->diffForHumans() '1 шо ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 шо ago', // Carbon::now()->subYears(2)->diffForHumans() '2 шо ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 шо ago', // Carbon::now()->addSecond()->diffForHumans() '1 секунд from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 секунд from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунд after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 секунд after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунд before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 секунд before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 секунд from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минот 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 шо 3 бутт 1 де 1 секунд', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 шо from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 бутт ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 шо 3 бутт 1 де 1 секунд ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 кӏира 10 сахьт', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 кӏира 6 де', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 кӏира 6 де', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 кӏира and 6 де from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 кӏира 1 сахьт', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 сахьт from now', // CarbonInterval::days(2)->forHumans() '2 де', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 де 3 сахьт', ]; } ================================================ FILE: tests/Localization/CggTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CggTest extends LocalizationTestCase { public const LOCALE = 'cgg'; // Chiga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwamukaaga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sande at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwokubanza at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwakabiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwakashatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Orwakana at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Orwakataano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakabiri at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakashatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakana at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakataano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwamukaaga at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sande at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakabiri at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwakabiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwokubanza at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sande at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwamukaaga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwakataano at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Orwakana at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Orwakashatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Orwakataano at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ruhanga ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ruhanga ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ruhanga ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ruhanga ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1 ruhanga 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1 ruhanga 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ruhanga', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ruhanga', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ruhanga from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ruhanga', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ruhanga 3h', ]; } ================================================ FILE: tests/Localization/ChrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ChrTest extends LocalizationTestCase { public const LOCALE = 'chr'; // Cherokee public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᎤᎾᏙᏓᏈᏕᎾ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᎤᎾᏙᏓᏆᏍᎬ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᎤᎾᏙᏓᏉᏅᎯ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᏦᎢᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ᏅᎩᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏦᎢᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏅᎩᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᎤᎾᏙᏓᏈᏕᎾ at 12:00 ᏌᎾᎴ', // Carbon::now()->subDays(2)->calendar() 'Last ᎤᎾᏙᏓᏆᏍᎬ at 8:49 ᏒᎯᏱᎢᏗᏢ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ᏒᎯᏱᎢᏗᏢ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᎤᎾᏙᏓᏉᏅᎯ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᎤᎾᏙᏓᏆᏍᎬ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᎤᎾᏙᏓᏈᏕᎾ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ᏅᎩᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ᏦᎢᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ꮜꮎꮄ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ᏌᎾᎴ, 12:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ᏌᎾᎴ, 1:30 ꮜꮎꮄ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ᏌᎾᎴ, 2:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ᏌᎾᎴ, 6:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ᏌᎾᎴ, 10:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ᏒᎯᏱᎢᏗᏢ, 12:00 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ᏒᎯᏱᎢᏗᏢ, 5:00 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ᏒᎯᏱᎢᏗᏢ, 9:30 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ᏒᎯᏱᎢᏗᏢ, 11:00 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subHours(1)->diffForHumans() '1 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subHours(2)->diffForHumans() '2 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subDays(1)->diffForHumans() '1 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subDays(2)->diffForHumans() '2 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subMonths(1)->diffForHumans() '1 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subYears(1)->diffForHumans() '1 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->subYears(2)->diffForHumans() '2 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->addSecond()->diffForHumans() 'ᎾᎿ 1 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ᎾᎿ 1 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ᏐᎢ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ᏐᎢ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ᏐᎢ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ᏐᎢ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ᏐᎢ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ᏐᎢ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ᎾᎿ 1 ᏐᎢ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ᎢᏯᏔᏬᏍᏔᏅ 1 ᏐᎢ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ᏑᏕᏘᏴᏓ 3 ᏏᏅᏙ 1 ᎢᎦ 1 ᏐᎢ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ᎾᎿ 3 ᏑᏕᏘᏴᏓ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ᏑᏕᏘᏴᏓ 3 ᏏᏅᏙ 1 ᎢᎦ 1 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ᏑᎾᏙᏓᏆᏍᏗ 10 ᏑᏟᎶᏛ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ᏑᎾᏙᏓᏆᏍᏗ 6 ᎢᎦ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ᏑᎾᏙᏓᏆᏍᏗ 6 ᎢᎦ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ᎾᎿ 1 ᏑᎾᏙᏓᏆᏍᏗ and 6 ᎢᎦ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ᏑᎾᏙᏓᏆᏍᏗ 1 ᏑᏟᎶᏛ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ᎾᎿ 1 ᏑᏟᎶᏛ', // CarbonInterval::days(2)->forHumans() '2 ᎢᎦ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ᎢᎦ 3 ᏑᏟᎶᏛ', ]; } ================================================ FILE: tests/Localization/ChrUsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ChrUsTest extends LocalizationTestCase { public const LOCALE = 'chr_US'; // Cherokee public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᎤᎾᏙᏓᏈᏕᎾ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᎤᎾᏙᏓᏆᏍᎬ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᎤᎾᏙᏓᏉᏅᎯ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᏦᎢᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ᏅᎩᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏦᎢᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏅᎩᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᎤᎾᏙᏓᏈᏕᎾ at 12:00 ᏌᎾᎴ', // Carbon::now()->subDays(2)->calendar() 'Last ᎤᎾᏙᏓᏆᏍᎬ at 8:49 ᏒᎯᏱᎢᏗᏢ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ᏒᎯᏱᎢᏗᏢ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᏔᎵᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᎤᎾᏙᏓᏉᏅᎯ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᎤᎾᏙᏓᏆᏍᎬ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᎤᎾᏙᏓᏈᏕᎾ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ᏅᎩᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ᏦᎢᏁᎢᎦ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ᏧᎾᎩᎶᏍᏗ at 12:00 ᏌᎾᎴ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ꮜꮎꮄ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ᏌᎾᎴ, 12:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ᏌᎾᎴ, 1:30 ꮜꮎꮄ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ᏌᎾᎴ, 2:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ᏌᎾᎴ, 6:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ᏌᎾᎴ, 10:00 ꮜꮎꮄ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ᏒᎯᏱᎢᏗᏢ, 12:00 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ᏒᎯᏱᎢᏗᏢ, 5:00 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ᏒᎯᏱᎢᏗᏢ, 9:30 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ᏒᎯᏱᎢᏗᏢ, 11:00 ꮢꭿᏹꭲꮧꮲ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ᎢᏯᏔᏬᏍᏔᏅ ᏥᎨᏒ', // Carbon::now()->subHours(1)->diffForHumans() '1 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subHours(2)->diffForHumans() '2 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ᏑᏟᎶᏛ ᏥᎨᏒ', // Carbon::now()->subDays(1)->diffForHumans() '1 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subDays(2)->diffForHumans() '2 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ᎢᎦ ᏥᎨᏒ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ᏑᎾᏙᏓᏆᏍᏗ ᏥᎨᏒ', // Carbon::now()->subMonths(1)->diffForHumans() '1 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subYears(1)->diffForHumans() '1 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->subYears(2)->diffForHumans() '2 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ᏑᏕᏘᏴᏓ ᏥᎨᏒ', // Carbon::now()->addSecond()->diffForHumans() 'ᎾᎿ 1 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ᎾᎿ 1 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ᏐᎢ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ᏐᎢ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ᏐᎢ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ᏐᎢ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ᏐᎢ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ᏐᎢ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ᏐᎢ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ᎾᎿ 1 ᏐᎢ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ᎢᏯᏔᏬᏍᏔᏅ 1 ᏐᎢ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ᏑᏕᏘᏴᏓ 3 ᏏᏅᏙ 1 ᎢᎦ 1 ᏐᎢ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ᎾᎿ 3 ᏑᏕᏘᏴᏓ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ᏏᏅᏙ ᏥᎨᏒ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ᏑᏕᏘᏴᏓ 3 ᏏᏅᏙ 1 ᎢᎦ 1 ᏐᎢ ᏥᎨᏒ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ᏑᎾᏙᏓᏆᏍᏗ 10 ᏑᏟᎶᏛ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ᏑᎾᏙᏓᏆᏍᏗ 6 ᎢᎦ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ᏑᎾᏙᏓᏆᏍᏗ 6 ᎢᎦ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ᎾᎿ 1 ᏑᎾᏙᏓᏆᏍᏗ and 6 ᎢᎦ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ᏑᎾᏙᏓᏆᏍᏗ 1 ᏑᏟᎶᏛ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ᎾᎿ 1 ᏑᏟᎶᏛ', // CarbonInterval::days(2)->forHumans() '2 ᎢᎦ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ᎢᎦ 3 ᏑᏟᎶᏛ', ]; } ================================================ FILE: tests/Localization/CkbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CkbTest extends LocalizationTestCase { public const LOCALE = 'ckb'; // ckb public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سبەینێ لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'شەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'یەکشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'دووشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سێشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'چوارشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'پێنجشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'هەینی لە کاتژمێر 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'سێشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'چوارشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'پێنجشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'هەینی لە کاتژمێر 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'شەممە لە کاتژمێر 00:00', // Carbon::now()->subDays(2)->calendar() 'یەکشەممە لە کاتژمێر 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'دوێنێ لە کاتژمێر 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ئەمڕۆ لە کاتژمێر 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئەمڕۆ لە کاتژمێر 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'سبەینێ لە کاتژمێر 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'سێشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'دوێنێ لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'دوێنێ لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سێشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'دووشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'یەکشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'شەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'هەینی لە کاتژمێر 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'پێنجشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'چوارشەممە لە کاتژمێر 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'هەینی لە کاتژمێر 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 پ.ن CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 پ.ن, 12:00 پ.ن', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 پ.ن, 1:30 پ.ن', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 پ.ن, 2:00 پ.ن', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 پ.ن, 6:00 پ.ن', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 پ.ن, 10:00 پ.ن', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 د.ن, 12:00 د.ن', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 د.ن, 5:00 د.ن', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 د.ن, 9:30 د.ن', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 د.ن, 11:00 د.ن', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'پێش چرکەیەک', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'پێش چرکەیەک', // Carbon::now()->subSeconds(2)->diffForHumans() 'پێش دوو چرکە', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'پێش دوو چرکە', // Carbon::now()->subMinutes(1)->diffForHumans() 'پێش خولەکێک', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'پێش خولەکێک', // Carbon::now()->subMinutes(2)->diffForHumans() 'پێش دوو خولەک', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'پێش دوو خولەک', // Carbon::now()->subHours(1)->diffForHumans() 'پێش کاتژمێرێک', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'پێش کاتژمێرێک', // Carbon::now()->subHours(2)->diffForHumans() 'پێش دوو کاتژمێر', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'پێش دوو کاتژمێر', // Carbon::now()->subDays(1)->diffForHumans() 'پێش ڕۆژێک', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'پێش ڕۆژێک', // Carbon::now()->subDays(2)->diffForHumans() 'پێش دوو ڕۆژ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'پێش دوو ڕۆژ', // Carbon::now()->subWeeks(1)->diffForHumans() 'پێش هەفتەیەک', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'پێش هەفتەیەک', // Carbon::now()->subWeeks(2)->diffForHumans() 'پێش دوو هەفتە', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'پێش دوو هەفتە', // Carbon::now()->subMonths(1)->diffForHumans() 'پێش مانگێک', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'پێش مانگێک', // Carbon::now()->subMonths(2)->diffForHumans() 'پێش دوو مانگ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'پێش دوو مانگ', // Carbon::now()->subYears(1)->diffForHumans() 'پێش ساڵێک', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'پێش ساڵێک', // Carbon::now()->subYears(2)->diffForHumans() 'پێش دوو ساڵ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'پێش دوو ساڵ', // Carbon::now()->addSecond()->diffForHumans() 'چرکەیەک لە ئێستاوە', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'چرکەیەک لە ئێستاوە', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'دوای چرکەیەک', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'دوای چرکەیەک', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'پێش چرکەیەک', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'پێش چرکەیەک', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'چرکەیەک', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'چرکەیەک', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'دوو چرکە', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'دوو چرکە', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'چرکەیەک لە ئێستاوە', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'خولەکێک چرکەیەک', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'دوو ساڵ 3 مانگ ڕۆژێک چرکەیەک', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ساڵ لە ئێستاوە', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'پێش 5 مانگ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'پێش دوو ساڵ 3 مانگ ڕۆژێک چرکەیەک', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'هەفتەیەک 10 کاتژمێر', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'هەفتەیەک 6 ڕۆژ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'هەفتەیەک 6 ڕۆژ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'هەفتەیەک و 6 ڕۆژ لە ئێستاوە', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'دوو هەفتە کاتژمێرێک', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'کاتژمێرێک لە ئێستاوە', // CarbonInterval::days(2)->forHumans() 'دوو ڕۆژ', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ڕۆژێک 3 کاتژمێر', ]; } ================================================ FILE: tests/Localization/CmnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CmnTest extends LocalizationTestCase { public const LOCALE = 'cmn'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期六 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期日 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期一 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期二 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期三 at 12:00 上午', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '星期四 at 12:00 上午', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '星期五 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期二 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期三 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期四 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期五 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期六 at 12:00 上午', // Carbon::now()->subDays(2)->calendar() 'Last 星期日 at 8:49 下午', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 下午', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 上午', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期二 at 12:00 上午', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期二 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期一 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期日 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期六 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期五 at 12:00 上午', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 星期四 at 12:00 上午', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 星期三 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 星期五 at 12:00 上午', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 上午 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 上午, 12:00 上午', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 上午, 1:30 上午', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 上午, 2:00 上午', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 上午, 6:00 上午', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 下午, 12:00 下午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 下午, 9:30 下午', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 下午, 11:00 下午', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 秒 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 秒 ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 秒 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 秒 ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 分钟 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 分钟 ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 分钟 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 分钟 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 小时 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 小时 ago', // Carbon::now()->subHours(2)->diffForHumans() '2 小时 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 小时 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 白天 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 白天 ago', // Carbon::now()->subDays(2)->diffForHumans() '2 白天 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 白天 ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 周 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 周 ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 周 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 周 ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 月 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 月 ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 月 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 月 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 年 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 年 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 年 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 年 ago', // Carbon::now()->addSecond()->diffForHumans() '1 秒 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 秒 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 秒 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 秒 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 秒 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 秒 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 秒 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 分钟 1 秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 年 3 月 1 白天 1 秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 年 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 月 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 年 3 月 1 白天 1 秒 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 周 10 小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 周 6 白天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 周 6 白天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 周 and 6 白天 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 周 1 小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 小时 from now', // CarbonInterval::days(2)->forHumans() '2 白天', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 白天 3 小时', ]; } ================================================ FILE: tests/Localization/CmnTwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CmnTwTest extends LocalizationTestCase { public const LOCALE = 'cmn_TW'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期六 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期日 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期一 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期二 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '星期三 at 12:00 上午', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '星期四 at 12:00 上午', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '星期五 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期二 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期三 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期四 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期五 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期六 at 12:00 上午', // Carbon::now()->subDays(2)->calendar() 'Last 星期日 at 8:49 下午', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 下午', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 上午', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 上午', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 上午', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '星期二 at 12:00 上午', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期二 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期一 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期日 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期六 at 12:00 上午', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 星期五 at 12:00 上午', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 星期四 at 12:00 上午', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 星期三 at 12:00 上午', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 星期五 at 12:00 上午', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 上午 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 上午, 12:00 上午', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 上午, 1:30 上午', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 上午, 2:00 上午', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 上午, 6:00 上午', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 下午, 12:00 下午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 下午, 9:30 下午', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 下午, 11:00 下午', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 秒 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 秒 ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 秒 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 秒 ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 分钟 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 分钟 ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 分钟 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 分钟 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 小时 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 小时 ago', // Carbon::now()->subHours(2)->diffForHumans() '2 小时 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 小时 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 白天 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 白天 ago', // Carbon::now()->subDays(2)->diffForHumans() '2 白天 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 白天 ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 周 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 周 ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 周 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 周 ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 月 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 月 ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 月 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 月 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 年 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 年 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 年 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 年 ago', // Carbon::now()->addSecond()->diffForHumans() '1 秒 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 秒 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 秒 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 秒 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 秒 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 秒 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 秒 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 分钟 1 秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 年 3 月 1 白天 1 秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 年 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 月 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 年 3 月 1 白天 1 秒 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 周 10 小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 周 6 白天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 周 6 白天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 周 and 6 白天 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 周 1 小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 小时 from now', // CarbonInterval::days(2)->forHumans() '2 白天', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 白天 3 小时', ]; } ================================================ FILE: tests/Localization/CrhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CrhTest extends LocalizationTestCase { public const LOCALE = 'crh'; // Crimean Turkish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Cumaertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bazar at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bazarertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Salı at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Çarşembe at 12:00 ÜE', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Cumaaqşamı at 12:00 ÜE', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Cuma at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Salı at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Çarşembe at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Cumaaqşamı at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Cuma at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Cumaertesi at 12:00 ÜE', // Carbon::now()->subDays(2)->calendar() 'Last Bazar at 8:49 ÜS', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ÜS', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ÜE', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Salı at 12:00 ÜE', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Salı at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bazarertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bazar at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Cumaertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Cuma at 12:00 ÜE', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Cumaaqşamı at 12:00 ÜE', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Çarşembe at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Cuma at 12:00 ÜE', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 üe CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ÜE, 12:00 üe', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ÜE, 1:30 üe', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ÜE, 2:00 üe', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ÜE, 6:00 üe', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ÜE, 10:00 üe', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ÜS, 12:00 üs', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ÜS, 5:00 üs', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ÜS, 9:30 üs', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ÜS, 11:00 üs', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ekinci ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ekinci ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ekinci ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ekinci ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 daqqa ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 daqqa ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 daqqa ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 daqqa ago', // Carbon::now()->subHours(1)->diffForHumans() '1 saat ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 saat ago', // Carbon::now()->subHours(2)->diffForHumans() '2 saat ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 saat ago', // Carbon::now()->subDays(1)->diffForHumans() '1 kün ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 kün ago', // Carbon::now()->subDays(2)->diffForHumans() '2 kün ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 kün ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 afta ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 afta ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 afta ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 afta ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ay ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ay ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ay ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ay ago', // Carbon::now()->subYears(1)->diffForHumans() '1 yıl ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 yıl ago', // Carbon::now()->subYears(2)->diffForHumans() '2 yıl ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 yıl ago', // Carbon::now()->addSecond()->diffForHumans() '1 ekinci from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ekinci from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ekinci after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ekinci after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ekinci before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ekinci before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ekinci', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ekinci', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ekinci', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ekinci', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ekinci from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 daqqa 1 ekinci', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 yıl 3 ay 1 kün 1 ekinci', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 yıl from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ay ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 yıl 3 ay 1 kün 1 ekinci ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 afta 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 afta 6 kün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 afta 6 kün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 afta and 6 kün from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 afta 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 saat from now', // CarbonInterval::days(2)->forHumans() '2 kün', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 kün 3 saat', ]; } ================================================ FILE: tests/Localization/CrhUaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CrhUaTest extends LocalizationTestCase { public const LOCALE = 'crh_UA'; // Crimean Turkish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Cumaertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bazar at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bazarertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Salı at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Çarşembe at 12:00 ÜE', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Cumaaqşamı at 12:00 ÜE', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Cuma at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Salı at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Çarşembe at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Cumaaqşamı at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Cuma at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Cumaertesi at 12:00 ÜE', // Carbon::now()->subDays(2)->calendar() 'Last Bazar at 8:49 ÜS', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ÜS', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ÜE', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Salı at 12:00 ÜE', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Salı at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bazarertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bazar at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Cumaertesi at 12:00 ÜE', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Cuma at 12:00 ÜE', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Cumaaqşamı at 12:00 ÜE', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Çarşembe at 12:00 ÜE', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Cuma at 12:00 ÜE', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 üe CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ÜE, 12:00 üe', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ÜE, 1:30 üe', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ÜE, 2:00 üe', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ÜE, 6:00 üe', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ÜE, 10:00 üe', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ÜS, 12:00 üs', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ÜS, 5:00 üs', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ÜS, 9:30 üs', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ÜS, 11:00 üs', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ekinci ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ekinci ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ekinci ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ekinci ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 daqqa ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 daqqa ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 daqqa ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 daqqa ago', // Carbon::now()->subHours(1)->diffForHumans() '1 saat ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 saat ago', // Carbon::now()->subHours(2)->diffForHumans() '2 saat ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 saat ago', // Carbon::now()->subDays(1)->diffForHumans() '1 kün ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 kün ago', // Carbon::now()->subDays(2)->diffForHumans() '2 kün ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 kün ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 afta ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 afta ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 afta ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 afta ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ay ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ay ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ay ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ay ago', // Carbon::now()->subYears(1)->diffForHumans() '1 yıl ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 yıl ago', // Carbon::now()->subYears(2)->diffForHumans() '2 yıl ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 yıl ago', // Carbon::now()->addSecond()->diffForHumans() '1 ekinci from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ekinci from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ekinci after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ekinci after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ekinci before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ekinci before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ekinci', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ekinci', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ekinci', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ekinci', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ekinci from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 daqqa 1 ekinci', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 yıl 3 ay 1 kün 1 ekinci', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 yıl from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ay ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 yıl 3 ay 1 kün 1 ekinci ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 afta 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 afta 6 kün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 afta 6 kün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 afta and 6 kün from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 afta 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 saat from now', // CarbonInterval::days(2)->forHumans() '2 kün', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 kün 3 saat', ]; } ================================================ FILE: tests/Localization/CsCzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CsCzTest extends LocalizationTestCase { public const LOCALE = 'cs_CZ'; // Czech public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'neděle at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pondělí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'úterý at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'středa at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'čtvrtek at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pátek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'úterý at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'středa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'čtvrtek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pátek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobota at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last neděle at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'úterý at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last úterý at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pondělí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last neděle at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pátek at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last čtvrtek at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last středa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pátek at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 dopoledne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 dopoledne, 12:00 dopoledne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 dopoledne, 1:30 dopoledne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 dopoledne, 2:00 dopoledne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 dopoledne, 6:00 dopoledne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 dopoledne, 10:00 dopoledne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 odpoledne, 12:00 odpoledne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 odpoledne, 5:00 odpoledne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 odpoledne, 9:30 odpoledne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 odpoledne, 11:00 odpoledne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'před 1 sekundou', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'před 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'před 2 sekundami', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'před 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'před 1 minutou', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'před 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'před 2 minutami', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'před 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'před 1 hodinou', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'před 1 hod.', // Carbon::now()->subHours(2)->diffForHumans() 'před 2 hodinami', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'před 2 hod.', // Carbon::now()->subDays(1)->diffForHumans() 'před 1 dnem', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'před 1 den', // Carbon::now()->subDays(2)->diffForHumans() 'před 2 dny', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'před 2 dny', // Carbon::now()->subWeeks(1)->diffForHumans() 'před 1 týdnem', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'před 1 týd.', // Carbon::now()->subWeeks(2)->diffForHumans() 'před 2 týdny', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'před 2 týd.', // Carbon::now()->subMonths(1)->diffForHumans() 'před 1 měsícem', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'před 1 měs.', // Carbon::now()->subMonths(2)->diffForHumans() 'před 2 měsíci', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'před 2 měs.', // Carbon::now()->subYears(1)->diffForHumans() 'před 1 rokem', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'před 1 rok.', // Carbon::now()->subYears(2)->diffForHumans() 'před 2 roky', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'před 2 rok.', // Carbon::now()->addSecond()->diffForHumans() 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'za 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'před 1 sekundou', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'před 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundy', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 roky 3 měs. 1 den 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'za 3 roky', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'před 5 měs.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'před 2 rok. 3 měs. 1 den 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 týden 10 hodin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týden 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týden 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'za 1 týden a 6 dní', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 týdny 1 hodina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'za hodinu', // CarbonInterval::days(2)->forHumans() '2 dny', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 den 3 hod.', ]; } ================================================ FILE: tests/Localization/CsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CsTest extends LocalizationTestCase { public const LOCALE = 'cs'; // Czech public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'neděle at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pondělí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'úterý at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'středa at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'čtvrtek at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pátek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'úterý at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'středa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'čtvrtek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pátek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobota at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last neděle at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'úterý at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last úterý at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pondělí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last neděle at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pátek at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last čtvrtek at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last středa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pátek at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 dopoledne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 dopoledne, 12:00 dopoledne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 dopoledne, 1:30 dopoledne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 dopoledne, 2:00 dopoledne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 dopoledne, 6:00 dopoledne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 dopoledne, 10:00 dopoledne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 odpoledne, 12:00 odpoledne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 odpoledne, 5:00 odpoledne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 odpoledne, 9:30 odpoledne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 odpoledne, 11:00 odpoledne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'před 1 sekundou', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'před 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'před 2 sekundami', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'před 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'před 1 minutou', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'před 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'před 2 minutami', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'před 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'před 1 hodinou', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'před 1 hod.', // Carbon::now()->subHours(2)->diffForHumans() 'před 2 hodinami', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'před 2 hod.', // Carbon::now()->subDays(1)->diffForHumans() 'před 1 dnem', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'před 1 den', // Carbon::now()->subDays(2)->diffForHumans() 'před 2 dny', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'před 2 dny', // Carbon::now()->subWeeks(1)->diffForHumans() 'před 1 týdnem', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'před 1 týd.', // Carbon::now()->subWeeks(2)->diffForHumans() 'před 2 týdny', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'před 2 týd.', // Carbon::now()->subMonths(1)->diffForHumans() 'před 1 měsícem', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'před 1 měs.', // Carbon::now()->subMonths(2)->diffForHumans() 'před 2 měsíci', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'před 2 měs.', // Carbon::now()->subYears(1)->diffForHumans() 'před 1 rokem', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'před 1 rok.', // Carbon::now()->subYears(2)->diffForHumans() 'před 2 roky', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'před 2 rok.', // Carbon::now()->addSecond()->diffForHumans() 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'za 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'před 1 sekundou', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'před 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundy', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 roky 3 měs. 1 den 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'za 3 roky', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'před 5 měs.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'před 2 rok. 3 měs. 1 den 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 týden 10 hodin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týden 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týden 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'za 1 týden a 6 dní', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 týdny 1 hodina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'za hodinu', // CarbonInterval::days(2)->forHumans() '2 dny', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 den 3 hod.', ]; } ================================================ FILE: tests/Localization/CsbPlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CsbPlTest extends LocalizationTestCase { public const LOCALE = 'csb_PL'; // Kashubian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobòta at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'niedzela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pòniedzôłk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wtórk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'strzoda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'czwiôrtk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'piątk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtórk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'strzoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'czwiôrtk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'piątk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobòta at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last niedzela at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtórk at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wtórk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pòniedzôłk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last niedzela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobòta at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last piątk at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last czwiôrtk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last strzoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last piątk at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 rok 3 miesiąc 1 dzéń 1 sekunda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tidzéń 10 gòdzëna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tidzéń 6 dzéń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tidzéń 6 dzéń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tidzéń 1 gòdzëna', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 dzéń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dzéń 3 gòdzëna', ]; } ================================================ FILE: tests/Localization/CsbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CsbTest extends LocalizationTestCase { public const LOCALE = 'csb'; // Kashubian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobòta at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'niedzela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pòniedzôłk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wtórk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'strzoda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'czwiôrtk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'piątk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtórk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'strzoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'czwiôrtk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'piątk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobòta at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last niedzela at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtórk at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wtórk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pòniedzôłk at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last niedzela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobòta at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last piątk at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last czwiôrtk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last strzoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last piątk at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 rok 3 miesiąc 1 dzéń 1 sekunda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tidzéń 10 gòdzëna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tidzéń 6 dzéń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tidzéń 6 dzéń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tidzéń 1 gòdzëna', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 dzéń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dzéń 3 gòdzëna', ]; } ================================================ FILE: tests/Localization/CuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CuTest extends LocalizationTestCase { public const LOCALE = 'cu'; // Church Slavic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 въторъ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 въторъ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 въторъ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 въторъ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 малъ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 малъ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 малъ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 малъ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 година ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 година ago', // Carbon::now()->subHours(2)->diffForHumans() '2 година ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 година ago', // Carbon::now()->subDays(1)->diffForHumans() '1 дьнь ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 дьнь ago', // Carbon::now()->subDays(2)->diffForHumans() '2 дьнь ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 дьнь ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 сєдмица ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 сєдмица ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 сєдмица ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 сєдмица ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 мѣсѧць ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мѣсѧць ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 мѣсѧць ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мѣсѧць ago', // Carbon::now()->subYears(1)->diffForHumans() '1 лѣто ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 лѣто ago', // Carbon::now()->subYears(2)->diffForHumans() '2 лѣто ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 лѣто ago', // Carbon::now()->addSecond()->diffForHumans() '1 въторъ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 въторъ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 въторъ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 въторъ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 въторъ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 въторъ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 въторъ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 въторъ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 въторъ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 въторъ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 въторъ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 малъ 1 въторъ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 лѣто 3 мѣсѧць 1 дьнь 1 въторъ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 лѣто from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мѣсѧць ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 лѣто 3 мѣсѧць 1 дьнь 1 въторъ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 сєдмица 10 година', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 сєдмица 6 дьнь', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 сєдмица 6 дьнь', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 сєдмица and 6 дьнь from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 сєдмица 1 година', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 година from now', // CarbonInterval::days(2)->forHumans() '2 дьнь', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 дьнь 3 година', ]; } ================================================ FILE: tests/Localization/CvRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CvRuTest extends LocalizationTestCase { public const LOCALE = 'cv_RU'; // Chuvash public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ыран 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес шӑматкун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес вырсарникун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес тунтикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес ытларикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес юнкун 00:00 сехетре', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ҫитес кӗҫнерникун 00:00 сехетре', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ҫитес эрнекун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес ытларикун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес юнкун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес кӗҫнерникун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес эрнекун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес шӑматкун 00:00 сехетре', // Carbon::now()->subDays(2)->calendar() 'Иртнӗ вырсарникун 20:49 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ӗнер 22:00 сехетре', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Паян 10:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Паян 02:00 сехетре', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ыран 01:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес ытларикун 00:00 сехетре', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ӗнер 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ӗнер 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ ытларикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ тунтикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ вырсарникун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ шӑматкун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ эрнекун 00:00 сехетре', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Иртнӗ кӗҫнерникун 00:00 сехетре', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Иртнӗ юнкун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Иртнӗ эрнекун 00:00 сехетре', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-мӗш 1-мӗш 1-мӗш 1-мӗш 1-мӗш', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-мӗш 1-мӗш', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-мӗш 1-мӗш', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-мӗш 1-мӗш', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-мӗш 1-мӗш', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-мӗш 1-мӗш', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-мӗш 1-мӗш', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-мӗш 2-мӗш', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-мӗш', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-мӗш', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-мӗш', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-мӗш', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ҫеккунт каялла', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ҫеккунт каялла', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ҫеккунт каялла', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ҫеккунт каялла', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минут каялла', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 минут каялла', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минут каялла', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 минут каялла', // Carbon::now()->subHours(1)->diffForHumans() '1 сехет каялла', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 сехет каялла', // Carbon::now()->subHours(2)->diffForHumans() '2 сехет каялла', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 сехет каялла', // Carbon::now()->subDays(1)->diffForHumans() '1 кун каялла', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 кун каялла', // Carbon::now()->subDays(2)->diffForHumans() '2 кун каялла', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 кун каялла', // Carbon::now()->subWeeks(1)->diffForHumans() '1 эрне каялла', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 эрне каялла', // Carbon::now()->subWeeks(2)->diffForHumans() '2 эрне каялла', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 эрне каялла', // Carbon::now()->subMonths(1)->diffForHumans() '1 уйӑх каялла', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 уйӑх каялла', // Carbon::now()->subMonths(2)->diffForHumans() '2 уйӑх каялла', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 уйӑх каялла', // Carbon::now()->subYears(1)->diffForHumans() '1 ҫул каялла', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ҫул каялла', // Carbon::now()->subYears(2)->diffForHumans() '2 ҫул каялла', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ҫул каялла', // Carbon::now()->addSecond()->diffForHumans() '1 ҫеккунтран', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ҫеккунтран', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ҫеккунт', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ҫеккунт', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ҫеккунт', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ҫеккунт', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ҫеккунтран', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 ҫеккунт', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ҫул 3 уйӑх 1 кун 1 ҫеккунт', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ҫултан', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 уйӑх каялла', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ҫул 3 уйӑх 1 кун 1 ҫеккунт каялла', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 эрне 10 сехет', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 эрне 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 эрне 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 эрне тата 6 кунран', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 эрне 1 сехет', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'пӗр сехетрен', // CarbonInterval::days(2)->forHumans() '2 кун', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 кун 3 сехет', ]; } ================================================ FILE: tests/Localization/CvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CvTest extends LocalizationTestCase { public const LOCALE = 'cv'; // Chuvash public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ыран 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес шӑматкун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес вырсарникун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес тунтикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес ытларикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ҫитес юнкун 00:00 сехетре', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ҫитес кӗҫнерникун 00:00 сехетре', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ҫитес эрнекун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес ытларикун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес юнкун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес кӗҫнерникун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес эрнекун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес шӑматкун 00:00 сехетре', // Carbon::now()->subDays(2)->calendar() 'Иртнӗ вырсарникун 20:49 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ӗнер 22:00 сехетре', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Паян 10:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Паян 02:00 сехетре', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ыран 01:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ҫитес ытларикун 00:00 сехетре', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ӗнер 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ӗнер 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ ытларикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ тунтикун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ вырсарникун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ шӑматкун 00:00 сехетре', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Иртнӗ эрнекун 00:00 сехетре', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Иртнӗ кӗҫнерникун 00:00 сехетре', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Иртнӗ юнкун 00:00 сехетре', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Иртнӗ эрнекун 00:00 сехетре', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-мӗш 1-мӗш 1-мӗш 1-мӗш 1-мӗш', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-мӗш 1-мӗш', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-мӗш 1-мӗш', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-мӗш 1-мӗш', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-мӗш 1-мӗш', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-мӗш 1-мӗш', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-мӗш 1-мӗш', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-мӗш 2-мӗш', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-мӗш', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-мӗш', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-мӗш', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-мӗш', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ҫеккунт каялла', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ҫеккунт каялла', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ҫеккунт каялла', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ҫеккунт каялла', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минут каялла', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 минут каялла', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минут каялла', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 минут каялла', // Carbon::now()->subHours(1)->diffForHumans() '1 сехет каялла', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 сехет каялла', // Carbon::now()->subHours(2)->diffForHumans() '2 сехет каялла', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 сехет каялла', // Carbon::now()->subDays(1)->diffForHumans() '1 кун каялла', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 кун каялла', // Carbon::now()->subDays(2)->diffForHumans() '2 кун каялла', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 кун каялла', // Carbon::now()->subWeeks(1)->diffForHumans() '1 эрне каялла', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 эрне каялла', // Carbon::now()->subWeeks(2)->diffForHumans() '2 эрне каялла', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 эрне каялла', // Carbon::now()->subMonths(1)->diffForHumans() '1 уйӑх каялла', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 уйӑх каялла', // Carbon::now()->subMonths(2)->diffForHumans() '2 уйӑх каялла', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 уйӑх каялла', // Carbon::now()->subYears(1)->diffForHumans() '1 ҫул каялла', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ҫул каялла', // Carbon::now()->subYears(2)->diffForHumans() '2 ҫул каялла', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ҫул каялла', // Carbon::now()->addSecond()->diffForHumans() '1 ҫеккунтран', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ҫеккунтран', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ҫеккунт', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ҫеккунт', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ҫеккунт', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ҫеккунт', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ҫеккунтран', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 ҫеккунт', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ҫул 3 уйӑх 1 кун 1 ҫеккунт', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ҫултан', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 уйӑх каялла', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ҫул 3 уйӑх 1 кун 1 ҫеккунт каялла', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 эрне 10 сехет', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 эрне 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 эрне 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 эрне тата 6 кунран', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 эрне 1 сехет', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'пӗр сехетрен', // CarbonInterval::days(2)->forHumans() '2 кун', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 кун 3 сехет', ]; } ================================================ FILE: tests/Localization/CyGbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CyGbTest extends LocalizationTestCase { public const LOCALE = 'cy_GB'; // Welsh public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yfory am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sadwrn am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sul am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Llun am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Mawrth am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Mercher am 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dydd Iau am 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dydd Gwener am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Mawrth am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Mercher am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Iau am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Gwener am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Sadwrn am 00:00', // Carbon::now()->subDays(2)->calendar() 'Dydd Sul diwethaf am 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ddoe am 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Heddiw am 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Heddiw am 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Yfory am 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Mawrth am 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ddoe am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ddoe am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Mawrth diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Llun diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sul diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sadwrn diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Gwener diwethaf am 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Dydd Iau diwethaf am 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Dydd Mercher diwethaf am 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Gwener diwethaf am 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1af 1af 1af 1af 1af', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2il 1af', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3ydd 1af', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4ydd 1af', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5ed 1af', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6ed 1af', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7ed 1af', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11eg 2il', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40fed', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ain', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100fed', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 yb CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 yb, 12:00 yb', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 yb, 1:30 yb', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 yb, 2:00 yb', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 yb, 6:00 yb', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 yb, 10:00 yb', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 yh, 12:00 yh', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 yh, 5:00 yh', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 yh, 9:30 yh', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 yh, 11:00 yh', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 eiliad yn ôl', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s yn ôl', // Carbon::now()->subSeconds(2)->diffForHumans() '2 eiliad yn ôl', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s yn ôl', // Carbon::now()->subMinutes(1)->diffForHumans() '1 munud yn ôl', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m yn ôl', // Carbon::now()->subMinutes(2)->diffForHumans() '2 munud yn ôl', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m yn ôl', // Carbon::now()->subHours(1)->diffForHumans() '1 awr yn ôl', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h yn ôl', // Carbon::now()->subHours(2)->diffForHumans() '2 awr yn ôl', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h yn ôl', // Carbon::now()->subDays(1)->diffForHumans() '1 diwrnod yn ôl', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d yn ôl', // Carbon::now()->subDays(2)->diffForHumans() '2 diwrnod yn ôl', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d yn ôl', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wythnos yn ôl', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w yn ôl', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wythnos yn ôl', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w yn ôl', // Carbon::now()->subMonths(1)->diffForHumans() '1 mis yn ôl', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mi yn ôl', // Carbon::now()->subMonths(2)->diffForHumans() '2 mis yn ôl', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mi yn ôl', // Carbon::now()->subYears(1)->diffForHumans() '1 flwyddyn yn ôl', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1bl yn ôl', // Carbon::now()->subYears(2)->diffForHumans() '2 flynedd yn ôl', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2bl yn ôl', // Carbon::now()->addSecond()->diffForHumans() 'mewn 1 eiliad', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'mewn 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 eiliad ar ôl', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s ar ôl', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 eiliad o\'r blaen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s o\'r blaen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 eiliad', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 eiliad', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'mewn 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 munud 1 eiliad', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2bl 3mi 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mewn 3 flynedd', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mi yn ôl', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2bl 3mi 1d 1s yn ôl', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wythnos 10 awr', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wythnos 6 diwrnod', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wythnos 6 diwrnod', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mewn 1 wythnos a 6 diwrnod', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wythnos 1 awr', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'mewn awr', // CarbonInterval::days(2)->forHumans() '2 diwrnod', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/CyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class CyTest extends LocalizationTestCase { public const LOCALE = 'cy'; // Welsh public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yfory am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sadwrn am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sul am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Llun am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Mawrth am 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Mercher am 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dydd Iau am 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dydd Gwener am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Mawrth am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Mercher am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Iau am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Gwener am 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Sadwrn am 00:00', // Carbon::now()->subDays(2)->calendar() 'Dydd Sul diwethaf am 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ddoe am 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Heddiw am 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Heddiw am 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Yfory am 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Mawrth am 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ddoe am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ddoe am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Mawrth diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Llun diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sul diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Sadwrn diwethaf am 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dydd Gwener diwethaf am 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Dydd Iau diwethaf am 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Dydd Mercher diwethaf am 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dydd Gwener diwethaf am 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1af 1af 1af 1af 1af', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2il 1af', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3ydd 1af', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4ydd 1af', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5ed 1af', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6ed 1af', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7ed 1af', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11eg 2il', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40fed', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ain', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100fed', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 yb CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 yb, 12:00 yb', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 yb, 1:30 yb', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 yb, 2:00 yb', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 yb, 6:00 yb', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 yb, 10:00 yb', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 yh, 12:00 yh', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 yh, 5:00 yh', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 yh, 9:30 yh', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 yh, 11:00 yh', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 eiliad yn ôl', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s yn ôl', // Carbon::now()->subSeconds(2)->diffForHumans() '2 eiliad yn ôl', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s yn ôl', // Carbon::now()->subMinutes(1)->diffForHumans() '1 munud yn ôl', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m yn ôl', // Carbon::now()->subMinutes(2)->diffForHumans() '2 munud yn ôl', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m yn ôl', // Carbon::now()->subHours(1)->diffForHumans() '1 awr yn ôl', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h yn ôl', // Carbon::now()->subHours(2)->diffForHumans() '2 awr yn ôl', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h yn ôl', // Carbon::now()->subDays(1)->diffForHumans() '1 diwrnod yn ôl', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d yn ôl', // Carbon::now()->subDays(2)->diffForHumans() '2 diwrnod yn ôl', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d yn ôl', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wythnos yn ôl', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w yn ôl', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wythnos yn ôl', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w yn ôl', // Carbon::now()->subMonths(1)->diffForHumans() '1 mis yn ôl', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mi yn ôl', // Carbon::now()->subMonths(2)->diffForHumans() '2 mis yn ôl', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mi yn ôl', // Carbon::now()->subYears(1)->diffForHumans() '1 flwyddyn yn ôl', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1bl yn ôl', // Carbon::now()->subYears(2)->diffForHumans() '2 flynedd yn ôl', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2bl yn ôl', // Carbon::now()->addSecond()->diffForHumans() 'mewn 1 eiliad', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'mewn 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 eiliad ar ôl', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s ar ôl', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 eiliad o\'r blaen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s o\'r blaen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 eiliad', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 eiliad', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'mewn 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 munud 1 eiliad', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2bl 3mi 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mewn 3 flynedd', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mi yn ôl', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2bl 3mi 1d 1s yn ôl', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wythnos 10 awr', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wythnos 6 diwrnod', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wythnos 6 diwrnod', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mewn 1 wythnos a 6 diwrnod', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wythnos 1 awr', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'mewn awr', // CarbonInterval::days(2)->forHumans() '2 diwrnod', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/DaDkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DaDkTest extends LocalizationTestCase { public const LOCALE = 'da_DK'; // Danish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'i søndags kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i tirsdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i mandags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i søndags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i lørdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'i torsdags kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'i onsdags kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'for 1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'for 1 s. siden', // Carbon::now()->subSeconds(2)->diffForHumans() 'for 2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'for 2 s. siden', // Carbon::now()->subMinutes(1)->diffForHumans() 'for 1 minut siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'for 1 min. siden', // Carbon::now()->subMinutes(2)->diffForHumans() 'for 2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'for 2 min. siden', // Carbon::now()->subHours(1)->diffForHumans() 'for 1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'for 1 t. siden', // Carbon::now()->subHours(2)->diffForHumans() 'for 2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'for 2 t. siden', // Carbon::now()->subDays(1)->diffForHumans() 'for 1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'for 1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() 'for 2 dage siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'for 2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() 'for 1 uge siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'for 1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() 'for 2 uger siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'for 2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() 'for 1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'for 1 mdr. siden', // Carbon::now()->subMonths(2)->diffForHumans() 'for 2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'for 2 mdr. siden', // Carbon::now()->subYears(1)->diffForHumans() 'for 1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'for 1 år siden', // Carbon::now()->subYears(2)->diffForHumans() 'for 2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'for 2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mdr. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'for 5 mdr. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'for 2 år 3 mdr. 1 d. 1 s. siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uge 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uge 6 dage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uge 6 dage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uge og 6 dage', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uger 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t.', ]; } ================================================ FILE: tests/Localization/DaGlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DaGlTest extends LocalizationTestCase { public const LOCALE = 'da_GL'; // Danish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'i søndags kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i tirsdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i mandags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i søndags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i lørdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'i torsdags kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'i onsdags kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'for 1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'for 1 s. siden', // Carbon::now()->subSeconds(2)->diffForHumans() 'for 2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'for 2 s. siden', // Carbon::now()->subMinutes(1)->diffForHumans() 'for 1 minut siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'for 1 min. siden', // Carbon::now()->subMinutes(2)->diffForHumans() 'for 2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'for 2 min. siden', // Carbon::now()->subHours(1)->diffForHumans() 'for 1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'for 1 t. siden', // Carbon::now()->subHours(2)->diffForHumans() 'for 2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'for 2 t. siden', // Carbon::now()->subDays(1)->diffForHumans() 'for 1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'for 1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() 'for 2 dage siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'for 2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() 'for 1 uge siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'for 1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() 'for 2 uger siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'for 2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() 'for 1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'for 1 mdr. siden', // Carbon::now()->subMonths(2)->diffForHumans() 'for 2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'for 2 mdr. siden', // Carbon::now()->subYears(1)->diffForHumans() 'for 1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'for 1 år siden', // Carbon::now()->subYears(2)->diffForHumans() 'for 2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'for 2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mdr. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'for 5 mdr. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'for 2 år 3 mdr. 1 d. 1 s. siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uge 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uge 6 dage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uge 6 dage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uge og 6 dage', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uger 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t.', ]; } ================================================ FILE: tests/Localization/DaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DaTest extends LocalizationTestCase { public const LOCALE = 'da'; // Danish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'i søndags kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i tirsdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i mandags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i søndags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i lørdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'i torsdags kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'i onsdags kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'for 1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'for 1 s. siden', // Carbon::now()->subSeconds(2)->diffForHumans() 'for 2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'for 2 s. siden', // Carbon::now()->subMinutes(1)->diffForHumans() 'for 1 minut siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'for 1 min. siden', // Carbon::now()->subMinutes(2)->diffForHumans() 'for 2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'for 2 min. siden', // Carbon::now()->subHours(1)->diffForHumans() 'for 1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'for 1 t. siden', // Carbon::now()->subHours(2)->diffForHumans() 'for 2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'for 2 t. siden', // Carbon::now()->subDays(1)->diffForHumans() 'for 1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'for 1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() 'for 2 dage siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'for 2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() 'for 1 uge siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'for 1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() 'for 2 uger siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'for 2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() 'for 1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'for 1 mdr. siden', // Carbon::now()->subMonths(2)->diffForHumans() 'for 2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'for 2 mdr. siden', // Carbon::now()->subYears(1)->diffForHumans() 'for 1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'for 1 år siden', // Carbon::now()->subYears(2)->diffForHumans() 'for 2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'for 2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mdr. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'for 5 mdr. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'for 2 år 3 mdr. 1 d. 1 s. siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uge 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uge 6 dage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uge 6 dage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uge og 6 dage', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uger 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t.', ]; } ================================================ FILE: tests/Localization/DavTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DavTest extends LocalizationTestCase { public const LOCALE = 'dav'; // Taita public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kifula nguwo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ituku ja jumwa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuramuka jimweri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuramuka kawi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuramuka kadadu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kuramuka kana at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Kuramuka kasanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuramuka kawi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuramuka kadadu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuramuka kana at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuramuka kasanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kifula nguwo at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Ituku ja jumwa at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuramuka kawi at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuramuka kawi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuramuka jimweri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ituku ja jumwa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kifula nguwo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuramuka kasanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kuramuka kana at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Kuramuka kadadu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Kuramuka kasanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 luma lwa k CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Luma lwa K, 12:00 luma lwa k', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Luma lwa K, 1:30 luma lwa k', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Luma lwa K, 2:00 luma lwa k', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Luma lwa K, 6:00 luma lwa k', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Luma lwa K, 10:00 luma lwa k', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 luma lwa p, 12:00 luma lwa p', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 luma lwa p, 5:00 luma lwa p', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 luma lwa p, 9:30 luma lwa p', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 luma lwa p, 11:00 luma lwa p', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/DeAtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeAtTest extends LocalizationTestCase { public const LOCALE = 'de_AT'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeBeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeBeTest extends LocalizationTestCase { public const LOCALE = 'de_BE'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeChTest extends LocalizationTestCase { public const LOCALE = 'de_CH'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeDeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeDeTest extends LocalizationTestCase { public const LOCALE = 'de_DE'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeItTest extends LocalizationTestCase { public const LOCALE = 'de_IT'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeLiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeLiTest extends LocalizationTestCase { public const LOCALE = 'de_LI'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeLuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeLuTest extends LocalizationTestCase { public const LOCALE = 'de_LU'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; } ================================================ FILE: tests/Localization/DeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use Carbon\CarbonPeriod; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DeTest extends LocalizationTestCase { public const LOCALE = 'de'; // German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freitag um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samstag um 00:00 Uhr', // Carbon::now()->subDays(2)->calendar() 'letzten Sonntag um 20:49 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 22:00 Uhr', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'heute um 10:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'heute um 02:00 Uhr', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen um 01:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gestern um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Dienstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Montag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Sonntag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Samstag um 00:00 Uhr', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'letzten Donnerstag um 00:00 Uhr', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'letzten Mittwoch um 00:00 Uhr', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'letzten Freitag um 00:00 Uhr', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'vor 1 Sekunde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vor 1 Sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'vor 2 Sekunden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vor 2 Sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'vor 1 Minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vor 1 Min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'vor 2 Minuten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vor 2 Min.', // Carbon::now()->subHours(1)->diffForHumans() 'vor 1 Stunde', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vor 1 Std.', // Carbon::now()->subHours(2)->diffForHumans() 'vor 2 Stunden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vor 2 Std.', // Carbon::now()->subDays(1)->diffForHumans() 'vor 1 Tag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vor 1 Tg.', // Carbon::now()->subDays(2)->diffForHumans() 'vor 2 Tagen', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vor 2 Tg.', // Carbon::now()->subWeeks(1)->diffForHumans() 'vor 1 Woche', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vor 1 Wo.', // Carbon::now()->subWeeks(2)->diffForHumans() 'vor 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vor 2 Wo.', // Carbon::now()->subMonths(1)->diffForHumans() 'vor 1 Monat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vor 1 Mon.', // Carbon::now()->subMonths(2)->diffForHumans() 'vor 2 Monaten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vor 2 Mon.', // Carbon::now()->subYears(1)->diffForHumans() 'vor 1 Jahr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vor 1 J.', // Carbon::now()->subYears(2)->diffForHumans() 'vor 2 Jahren', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vor 2 J.', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1 Sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunde später', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sek. später', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunde zuvor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sek. zuvor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1 Sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Jahren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vor 5 Mon.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vor 2 J. 3 Mon. 1 Tg. 1 Sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Stunden', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tage', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Woche und 6 Tagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stunde', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in eine Stunde', // CarbonInterval::days(2)->forHumans() '2 Tage', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tg. 3 Std.', ]; public function testPeriod() { $this->assertSame( '4 mal jede Woche von 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P7D')), ); $this->assertSame( '4 mal jede 2 Monate von 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P2M')), ); $this->assertSame( '4 mal jeden Monat von 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P1M')), ); $this->assertSame( '4 mal jede 2 Jahre von 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P2Y')), ); $this->assertSame( '4 mal jedes Jahr von 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P1Y')), ); } } ================================================ FILE: tests/Localization/DjeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DjeTest extends LocalizationTestCase { public const LOCALE = 'dje'; // Zarma public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asibti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atinni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Alzuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alzuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asibti at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Alhadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atalaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atinni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asibti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alzuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Alzuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subbaahi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Subbaahi, 12:00 subbaahi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Subbaahi, 1:30 subbaahi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Subbaahi, 2:00 subbaahi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Subbaahi, 6:00 subbaahi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Subbaahi, 10:00 subbaahi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Zaarikay b, 12:00 zaarikay b', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Zaarikay b, 5:00 zaarikay b', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Zaarikay b, 9:30 zaarikay b', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Zaarikay b, 11:00 zaarikay b', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 atinni ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 atinni ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 atinni ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 atinni ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 alzuma ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 alzuma ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 alzuma ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 alzuma ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 hari ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 hari ago', // Carbon::now()->subYears(2)->diffForHumans() '2 hari ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 hari ago', // Carbon::now()->addSecond()->diffForHumans() '1 atinni from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 atinni from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 atinni after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 atinni after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 atinni before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 atinni before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 atinni', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 atinni', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 atinni', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 atinni', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 atinni from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 atinni', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 hari 3mos 1d 1 atinni', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 hari from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 hari 3mos 1d 1 atinni ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 alzuma 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 alzuma 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 alzuma 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 alzuma and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 alzuma 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/DoiInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DoiInTest extends LocalizationTestCase { public const LOCALE = 'doi_IN'; // Dogri (macrolanguage) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'श्नीचरबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ऐतबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधबार at 12:00 सञं', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बीरबार at 12:00 सञं', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बीरबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'श्नीचरबार at 12:00 सञं', // Carbon::now()->subDays(2)->calendar() 'Last ऐतबार at 8:49 सबेर', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 सबेर', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 सञं', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ऐतबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last श्नीचरबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बीरबार at 12:00 सञं', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 सञं CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 सञं, 12:00 सञं', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 सञं, 1:30 सञं', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 सञं, 2:00 सञं', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 सञं, 6:00 सञं', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 सञं, 10:00 सञं', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 सबेर, 12:00 सबेर', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 सबेर, 5:00 सबेर', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 सबेर, 9:30 सबेर', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 सबेर, 11:00 सबेर', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 सङार ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सङार ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सङार ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सङार ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 सङार from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सङार from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 सङार after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सङार after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 सङार before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सङार before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 सङार', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सङार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सङार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सङार', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सङार from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 सङार', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1 सङार', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1 सङार ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/DoiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DoiTest extends LocalizationTestCase { public const LOCALE = 'doi'; // Dogri (macrolanguage) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'श्नीचरबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ऐतबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधबार at 12:00 सञं', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बीरबार at 12:00 सञं', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बीरबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'श्नीचरबार at 12:00 सञं', // Carbon::now()->subDays(2)->calendar() 'Last ऐतबार at 8:49 सबेर', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 सबेर', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 सञं', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलबर at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ऐतबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last श्नीचरबार at 12:00 सञं', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बीरबार at 12:00 सञं', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधबार at 12:00 सञं', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्करबार at 12:00 सञं', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 सञं CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 सञं, 12:00 सञं', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 सञं, 1:30 सञं', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 सञं, 2:00 सञं', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 सञं, 6:00 सञं', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 सञं, 10:00 सञं', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 सबेर, 12:00 सबेर', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 सबेर, 5:00 सबेर', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 सबेर, 9:30 सबेर', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 सबेर, 11:00 सबेर', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 सङार ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सङार ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सङार ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सङार ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 सङार from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सङार from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 सङार after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सङार after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 सङार before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सङार before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 सङार', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सङार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सङार', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सङार', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सङार from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 सङार', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1 सङार', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1 सङार ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/DsbDeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DsbDeTest extends LocalizationTestCase { public const LOCALE = 'dsb_DE'; // Lower Sorbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njeźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Pónjeźele at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wałtora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Srjoda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Stwórtk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Pětk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wałtora at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Srjoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Stwórtk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Pětk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sobota at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Njeźela at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wałtora at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wałtora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Pónjeźele at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njeźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Pětk at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Stwórtk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Srjoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Pětk at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 drugi ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 drugi ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 drugi ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 drugi ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuta ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuta ago', // Carbon::now()->subHours(1)->diffForHumans() '1 góźina ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 góźina ago', // Carbon::now()->subHours(2)->diffForHumans() '2 góźina ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 góźina ago', // Carbon::now()->subDays(1)->diffForHumans() '1 źeń ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 źeń ago', // Carbon::now()->subDays(2)->diffForHumans() '2 źeń ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 źeń ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tyźeń ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tyźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tyźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tyźeń ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mjasec ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mjasec ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mjasec ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mjasec ago', // Carbon::now()->subYears(1)->diffForHumans() '1 lěto ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 lěto ago', // Carbon::now()->subYears(2)->diffForHumans() '2 lěto ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 lěto ago', // Carbon::now()->addSecond()->diffForHumans() '1 drugi from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 drugi from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 drugi after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 drugi after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 drugi before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 drugi before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 drugi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 drugi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 drugi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 drugi', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 drugi from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 drugi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 lěto 3 mjasec 1 źeń 1 drugi', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 lěto from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mjasec ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 lěto 3 mjasec 1 źeń 1 drugi ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tyźeń 10 góźina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tyźeń 6 źeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tyźeń 6 źeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tyźeń and 6 źeń from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tyźeń 1 góźina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 góźina from now', // CarbonInterval::days(2)->forHumans() '2 źeń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 źeń 3 góźina', ]; } ================================================ FILE: tests/Localization/DsbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DsbTest extends LocalizationTestCase { public const LOCALE = 'dsb'; // Lower Sorbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njeźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Pónjeźele at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wałtora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Srjoda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Stwórtk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Pětk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wałtora at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Srjoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Stwórtk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Pětk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sobota at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Njeźela at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wałtora at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wałtora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Pónjeźele at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njeźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Pětk at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Stwórtk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Srjoda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Pětk at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 drugi ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 drugi ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 drugi ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 drugi ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuta ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuta ago', // Carbon::now()->subHours(1)->diffForHumans() '1 góźina ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 góźina ago', // Carbon::now()->subHours(2)->diffForHumans() '2 góźina ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 góźina ago', // Carbon::now()->subDays(1)->diffForHumans() '1 źeń ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 źeń ago', // Carbon::now()->subDays(2)->diffForHumans() '2 źeń ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 źeń ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tyźeń ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tyźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tyźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tyźeń ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mjasec ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mjasec ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mjasec ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mjasec ago', // Carbon::now()->subYears(1)->diffForHumans() '1 lěto ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 lěto ago', // Carbon::now()->subYears(2)->diffForHumans() '2 lěto ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 lěto ago', // Carbon::now()->addSecond()->diffForHumans() '1 drugi from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 drugi from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 drugi after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 drugi after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 drugi before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 drugi before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 drugi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 drugi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 drugi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 drugi', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 drugi from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 drugi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 lěto 3 mjasec 1 źeń 1 drugi', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 lěto from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mjasec ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 lěto 3 mjasec 1 źeń 1 drugi ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tyźeń 10 góźina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tyźeń 6 źeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tyźeń 6 źeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tyźeń and 6 źeń from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tyźeń 1 góźina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 góźina from now', // CarbonInterval::days(2)->forHumans() '2 źeń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 źeń 3 góźina', ]; } ================================================ FILE: tests/Localization/DuaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DuaTest extends LocalizationTestCase { public const LOCALE = 'dua'; // Duala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'esaɓasú at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'éti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mɔ́sú at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kwasú at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mukɔ́sú at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ŋgisú at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ɗónɛsú at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kwasú at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mukɔ́sú at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ŋgisú at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ɗónɛsú at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'esaɓasú at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last éti at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kwasú at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last kwasú at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mɔ́sú at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last éti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last esaɓasú at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ɗónɛsú at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ŋgisú at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mukɔ́sú at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ɗónɛsú at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 idiɓa CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 idiɓa, 12:00 idiɓa', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 idiɓa, 1:30 idiɓa', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 idiɓa, 2:00 idiɓa', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 idiɓa, 6:00 idiɓa', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 idiɓa, 10:00 idiɓa', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ebyámu, 12:00 ebyámu', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ebyámu, 5:00 ebyámu', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ebyámu, 9:30 ebyámu', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ebyámu, 11:00 ebyámu', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 maba ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 maba ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 maba ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 maba ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ma awa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ma awa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ma awa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ma awa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 buńa ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 buńa ago', // Carbon::now()->subDays(2)->diffForHumans() '2 buńa ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 buńa ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 woki ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 woki ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 woki ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 woki ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 myo̱di ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 myo̱di ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 myo̱di ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 myo̱di ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ma mbu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ma mbu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ma mbu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ma mbu ago', // Carbon::now()->addSecond()->diffForHumans() '1 maba from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 maba from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 maba after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 maba after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 maba before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 maba before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 maba', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 maba', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 maba', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 maba', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 maba from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuti 1 maba', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ma mbu 3 myo̱di 1 buńa 1 maba', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ma mbu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 myo̱di ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ma mbu 3 myo̱di 1 buńa 1 maba ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 woki 10 ma awa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 woki 6 buńa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 woki 6 buńa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 woki and 6 buńa from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 woki 1 ma awa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ma awa from now', // CarbonInterval::days(2)->forHumans() '2 buńa', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 buńa 3 ma awa', ]; } ================================================ FILE: tests/Localization/DvMvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DvMvTest extends LocalizationTestCase { public const LOCALE = 'dv_MV'; // Divehi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'މާދަމާ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ހޮނިހިރު 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އާދިއްތަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ހޯމަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އަންގާރަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ބުދަ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ބުރާސްފަތި 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ހުކުރު 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'އަންގާރަ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ބުދަ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ބުރާސްފަތި 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ހުކުރު 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ހޮނިހިރު 00:00', // Carbon::now()->subDays(2)->calendar() 'ފާއިތުވި އާދިއްތަ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އިއްޔެ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'މިއަދު 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'މިއަދު 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'މާދަމާ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'އަންގާރަ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'އިއްޔެ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އިއްޔެ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި އަންގާރަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި ހޯމަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި އާދިއްތަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި ހޮނިހިރު 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި ހުކުރު 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ފާއިތުވި ބުރާސްފަތި 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ފާއިތުވި ބުދަ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ފާއިތުވި ހުކުރު 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 މކ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 މކ, 12:00 މކ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 މކ, 1:30 މކ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 މކ, 2:00 މކ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 މކ, 6:00 މކ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 މކ, 10:00 މކ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 މފ, 12:00 މފ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 މފ, 5:00 މފ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 މފ, 9:30 މފ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 މފ, 11:00 މފ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ސިކުންތު ކުރިން', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ސިކުންތު ކުރިން', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ސިކުންތު ކުރިން', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ސިކުންތު ކުރިން', // Carbon::now()->subMinutes(1)->diffForHumans() '1 މިނެޓް ކުރިން', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 މިނެޓް ކުރިން', // Carbon::now()->subMinutes(2)->diffForHumans() '2 މިނެޓް ކުރިން', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 މިނެޓް ކުރިން', // Carbon::now()->subHours(1)->diffForHumans() '1 ގަޑި ކުރިން', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ގަޑި ކުރިން', // Carbon::now()->subHours(2)->diffForHumans() '2 ގަޑި ކުރިން', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ގަޑި ކުރިން', // Carbon::now()->subDays(1)->diffForHumans() '1 ދުވަސް ކުރިން', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ދުވަސް ކުރިން', // Carbon::now()->subDays(2)->diffForHumans() '2 ދުވަސް ކުރިން', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ދުވަސް ކުރިން', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ހަފްތާ ކުރިން', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ހަފްތާ ކުރިން', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ހަފްތާ ކުރިން', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ހަފްތާ ކުރިން', // Carbon::now()->subMonths(1)->diffForHumans() '1 މަސް ކުރިން', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 މަސް ކުރިން', // Carbon::now()->subMonths(2)->diffForHumans() '2 މަސް ކުރިން', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 މަސް ކުރިން', // Carbon::now()->subYears(1)->diffForHumans() '1 އަހަރު ކުރިން', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 އަހަރު ކުރިން', // Carbon::now()->subYears(2)->diffForHumans() '2 އަހަރު ކުރިން', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 އަހަރު ކުރިން', // Carbon::now()->addSecond()->diffForHumans() '1 ސިކުންތު ފަހުން', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ސިކުންތު ފަހުން', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ސިކުންތު ފަހުން', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ސިކުންތު ފަހުން', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ސިކުންތު ކުރި', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ސިކުންތު ކުރި', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ސިކުންތު', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ސިކުންތު', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ސިކުންތު', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ސިކުންތު', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ސިކުންތު ފަހުން', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 މިނެޓް 1 ސިކުންތު', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 އަހަރު 3 މަސް 1 ދުވަސް 1 ސިކުންތު', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 އަހަރު ފަހުން', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 މަސް ކުރިން', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 އަހަރު 3 މަސް 1 ދުވަސް 1 ސިކުންތު ކުރިން', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ހަފްތާ 10 ގަޑި', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ހަފްތާ 6 ދުވަސް', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ހަފްތާ 6 ދުވަސް', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ހަފްތާ އަދި 6 ދުވަސް ފަހުން', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ހަފްތާ 1 ގަޑި', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ގަޑި ފަހުން', // CarbonInterval::days(2)->forHumans() '2 ދުވަސް', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ދުވަސް 3 ގަޑި', ]; } ================================================ FILE: tests/Localization/DvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DvTest extends LocalizationTestCase { public const LOCALE = 'dv'; // Divehi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'މާދަމާ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ހޮނިހިރު 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އާދިއްތަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ހޯމަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އަންގާރަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ބުދަ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ބުރާސްފަތި 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ހުކުރު 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'އަންގާރަ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ބުދަ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ބުރާސްފަތި 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ހުކުރު 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ހޮނިހިރު 00:00', // Carbon::now()->subDays(2)->calendar() 'ފާއިތުވި އާދިއްތަ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އިއްޔެ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'މިއަދު 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'މިއަދު 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'މާދަމާ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'އަންގާރަ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'އިއްޔެ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'އިއްޔެ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި އަންގާރަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި ހޯމަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި އާދިއްތަ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި ހޮނިހިރު 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ފާއިތުވި ހުކުރު 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ފާއިތުވި ބުރާސްފަތި 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ފާއިތުވި ބުދަ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ފާއިތުވި ހުކުރު 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 މކ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 މކ, 12:00 މކ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 މކ, 1:30 މކ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 މކ, 2:00 މކ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 މކ, 6:00 މކ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 މކ, 10:00 މކ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 މފ, 12:00 މފ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 މފ, 5:00 މފ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 މފ, 9:30 މފ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 މފ, 11:00 މފ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ކުރިން 1 ސިކުންތު', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ކުރިން 1 ސިކުންތު', // Carbon::now()->subSeconds(2)->diffForHumans() 'ކުރިން 2 ސިކުންތު', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ކުރިން 2 ސިކުންތު', // Carbon::now()->subMinutes(1)->diffForHumans() 'ކުރިން 1 މިނިޓު', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ކުރިން 1 މިނިޓު', // Carbon::now()->subMinutes(2)->diffForHumans() 'ކުރިން 2 މިނިޓު', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ކުރިން 2 މިނިޓު', // Carbon::now()->subHours(1)->diffForHumans() 'ކުރިން 1 ގަޑިއިރު', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ކުރިން 1 ގަޑިއިރު', // Carbon::now()->subHours(2)->diffForHumans() 'ކުރިން 2 ގަޑިއިރު', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ކުރިން 2 ގަޑިއިރު', // Carbon::now()->subDays(1)->diffForHumans() 'ކުރިން 1 ދުވަސް', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ކުރިން 1 ދުވަސް', // Carbon::now()->subDays(2)->diffForHumans() 'ކުރިން 2 ދުވަސް', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ކުރިން 2 ދުވަސް', // Carbon::now()->subWeeks(1)->diffForHumans() 'ކުރިން 1 ހަފްތާ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ކުރިން 1 ހަފްތާ', // Carbon::now()->subWeeks(2)->diffForHumans() 'ކުރިން 2 ހަފްތާ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ކުރިން 2 ހަފްތާ', // Carbon::now()->subMonths(1)->diffForHumans() 'ކުރިން 1 މަސް', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ކުރިން 1 މަސް', // Carbon::now()->subMonths(2)->diffForHumans() 'ކުރިން 2 މަސް', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ކުރިން 2 މަސް', // Carbon::now()->subYears(1)->diffForHumans() 'ކުރިން 1 އަހަރު', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ކުރިން 1 އަހަރު', // Carbon::now()->subYears(2)->diffForHumans() 'ކުރިން 2 އަހަރު', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ކުރިން 2 އަހަރު', // Carbon::now()->addSecond()->diffForHumans() 'ތެރޭގައި 1 ސިކުންތު', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ތެރޭގައި 1 ސިކުންތު', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ސިކުންތު ފަހުން', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ސިކުންތު ފަހުން', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ސިކުންތު ކުރި', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ސިކުންތު ކުރި', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ސިކުންތު', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ސިކުންތު', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ސިކުންތު', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ސިކުންތު', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ތެރޭގައި 1 ސިކުންތު', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 މިނިޓު 1 ސިކުންތު', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 އަހަރު 3 މަސް 1 ދުވަސް 1 ސިކުންތު', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ތެރޭގައި 3 އަހަރު', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ކުރިން 5 މަސް', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ކުރިން 2 އަހަރު 3 މަސް 1 ދުވަސް 1 ސިކުންތު', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ހަފްތާ 10 ގަޑިއިރު', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ހަފްތާ 6 ދުވަސް', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ހަފްތާ 6 ދުވަސް', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ތެރޭގައި 1 ހަފްތާ އަދި 6 ދުވަސް', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ހަފްތާ 1 ގަޑިއިރު', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ތެރޭގައި ގަޑިއިރެއް', // CarbonInterval::days(2)->forHumans() '2 ދުވަސް', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ދުވަސް 3 ގަޑިއިރު', ]; } ================================================ FILE: tests/Localization/DyoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DyoTest extends LocalizationTestCase { public const LOCALE = 'dyo'; // Jola-Fonyi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sibiti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dimas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Teneŋ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alarbay at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aramisay at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Arjuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alarbay at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aramisay at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arjuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sibiti at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Dimas at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Teneŋ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dimas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sibiti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Arjuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aramisay at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Alarbay at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Arjuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/DzBtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DzBtTest extends LocalizationTestCase { public const LOCALE = 'dz_BT'; // Dzongkha public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་ཉི་མ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་ཟླ་བ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་མིག་དམར་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་པུར་བུ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'གཟའ་པ་སངས་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་པུར་བུ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་པ་སངས་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་ཉི་མ་ at 12:00 ངས་ཆ', // Carbon::now()->subDays(2)->calendar() 'Last གཟའ་ཟླ་བ་ at 8:49 ཕྱི་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ཕྱི་ཆ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ངས་ཆ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་མིག་དམར་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་ཟླ་བ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་ཉི་མ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last གཟའ་པ་སངས་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last གཟའ་པུར་བུ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ངས་ཆ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ངས་ཆ, 12:00 ངས་ཆ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ངས་ཆ, 1:30 ངས་ཆ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ངས་ཆ, 2:00 ངས་ཆ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ངས་ཆ, 6:00 ངས་ཆ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ངས་ཆ, 10:00 ངས་ཆ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ཕྱི་ཆ, 12:00 ཕྱི་ཆ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ཕྱི་ཆ, 5:00 ཕྱི་ཆ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ཕྱི་ཆ, 9:30 ཕྱི་ཆ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ཕྱི་ཆ, 11:00 ཕྱི་ཆ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ཆ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ཆ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ཆ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ཆ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ཉི ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ཉི ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ཉི ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ཉི ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ཟླ་བ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ཟླ་བ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ཟླ་བ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ཟླ་བ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ཆརཔ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ཆརཔ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ཆརཔ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ཆརཔ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ཆ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ཆ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ཆ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ཆ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ཆ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ཆ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ཆ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ཆ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ཆ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ཆ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ཆ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ཆ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ཆརཔ 3 ཟླ་བ 1 ཉི 1 ཆ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ཆརཔ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ཟླ་བ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ཆརཔ 3 ཟླ་བ 1 ཉི 1 ཆ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ཉི', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ཉི', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ཉི from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ཉི', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ཉི 3h', ]; } ================================================ FILE: tests/Localization/DzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class DzTest extends LocalizationTestCase { public const LOCALE = 'dz'; // Dzongkha public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་ཉི་མ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་ཟླ་བ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་མིག་དམར་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'གཟའ་པུར་བུ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'གཟའ་པ་སངས་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་པུར་བུ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་པ་སངས་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་ཉི་མ་ at 12:00 ངས་ཆ', // Carbon::now()->subDays(2)->calendar() 'Last གཟའ་ཟླ་བ་ at 8:49 ཕྱི་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ཕྱི་ཆ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ངས་ཆ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་ལྷག་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་མིག་དམར་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་ཟླ་བ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་ཉི་མ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last གཟའ་པ་སངས་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last གཟའ་པུར་བུ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last གཟའ་སྤེན་ཕ་ at 12:00 ངས་ཆ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ངས་ཆ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ངས་ཆ, 12:00 ངས་ཆ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ངས་ཆ, 1:30 ངས་ཆ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ངས་ཆ, 2:00 ངས་ཆ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ངས་ཆ, 6:00 ངས་ཆ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ངས་ཆ, 10:00 ངས་ཆ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ཕྱི་ཆ, 12:00 ཕྱི་ཆ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ཕྱི་ཆ, 5:00 ཕྱི་ཆ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ཕྱི་ཆ, 9:30 ཕྱི་ཆ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ཕྱི་ཆ, 11:00 ཕྱི་ཆ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ཆ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ཆ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ཆ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ཆ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ཉི ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ཉི ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ཉི ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ཉི ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ཟླ་བ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ཟླ་བ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ཟླ་བ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ཟླ་བ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ཆརཔ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ཆརཔ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ཆརཔ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ཆརཔ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ཆ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ཆ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ཆ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ཆ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ཆ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ཆ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ཆ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ཆ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ཆ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ཆ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ཆ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ཆ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ཆརཔ 3 ཟླ་བ 1 ཉི 1 ཆ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ཆརཔ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ཟླ་བ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ཆརཔ 3 ཟླ་བ 1 ཉི 1 ཆ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ཉི', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ཉི', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ཉི from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ཉི', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ཉི 3h', ]; } ================================================ FILE: tests/Localization/EbuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EbuTest extends LocalizationTestCase { public const LOCALE = 'ebu'; // Embu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'NJumamothii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kiumia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumaine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aramithi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Njumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumaine at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aramithi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'NJumamothii at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Kiumia at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumaine at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumaine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kiumia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last NJumamothii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aramithi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Njumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Njumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ki CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 KI, 12:00 ki', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 KI, 1:30 ki', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 KI, 2:00 ki', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 KI, 6:00 ki', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 KI, 10:00 ki', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 UT, 12:00 ut', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 UT, 5:00 ut', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 UT, 9:30 ut', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 UT, 11:00 ut', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EeTest extends LocalizationTestCase { public const LOCALE = 'ee'; // Ewe public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'memleɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kɔsiɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dzoɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'blaɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kuɖa at ŋ ga 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'yawoɖa at ŋ ga 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fiɖa at ŋ ga 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'blaɖa at ŋ ga 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kuɖa at ŋ ga 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'yawoɖa at ŋ ga 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fiɖa at ŋ ga 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'memleɖa at ŋ ga 12:00', // Carbon::now()->subDays(2)->calendar() 'Last kɔsiɖa at ɣ ga 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at ɣ ga 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at ŋ ga 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at ŋ ga 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at ŋ ga 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'blaɖa at ŋ ga 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last blaɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dzoɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last kɔsiɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last memleɖa at ŋ ga 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last fiɖa at ŋ ga 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last yawoɖa at ŋ ga 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last kuɖa at ŋ ga 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last fiɖa at ŋ ga 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ŋ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ŋ, 12:00 ŋ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ŋ, 1:30 ŋ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ŋ, 2:00 ŋ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ŋ, 6:00 ŋ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ŋ, 10:00 ŋ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ɣ, 12:00 ɣ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ɣ, 5:00 ɣ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ɣ, 9:30 ɣ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ɣ, 11:00 ɣ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sɛkɛnd 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sɛkɛnd 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sɛkɛnd 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sɛkɛnd 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'gaƒoƒo 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'gaƒoƒo 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'gaƒoƒo 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'gaƒoƒo 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ŋkeke 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ŋkeke 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ŋkeke 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ŋkeke 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'kwasiɖa 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'kwasiɖa 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'kwasiɖa 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'kwasiɖa 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ɣleti 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ɣleti 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ɣleti 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ɣleti 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'ƒe 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ƒe 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'ƒe 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ƒe 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sɛkɛnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sɛkɛnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sɛkɛnd 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sɛkɛnd 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sɛkɛnd 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sɛkɛnd 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sɛkɛnd 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sɛkɛnd 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sɛkɛnd 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sɛkɛnd 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sɛkɛnd 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 sɛkɛnd 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ƒe 2 ɣleti 3 ŋkeke 1 sɛkɛnd 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ƒe 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ɣleti 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ƒe 2 ɣleti 3 ŋkeke 1 sɛkɛnd 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'kwasiɖa 1 gaƒoƒo 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'kwasiɖa 1 ŋkeke 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'kwasiɖa 1 ŋkeke 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'kwasiɖa 1 and ŋkeke 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'kwasiɖa 2 gaƒoƒo 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'gaƒoƒo 1 from now', // CarbonInterval::days(2)->forHumans() 'ŋkeke 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ŋkeke 1 gaƒoƒo 3', ]; } ================================================ FILE: tests/Localization/EeTgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EeTgTest extends LocalizationTestCase { public const LOCALE = 'ee_TG'; // Ewe public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'memleɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kɔsiɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dzoɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'blaɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kuɖa at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'yawoɖa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fiɖa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'blaɖa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kuɖa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'yawoɖa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fiɖa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'memleɖa at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last kɔsiɖa at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'blaɖa at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last blaɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dzoɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last kɔsiɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last memleɖa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last fiɖa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last yawoɖa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last kuɖa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last fiɖa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ŋ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ŋ, 12:00 ŋ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ŋ, 1:30 ŋ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ŋ, 2:00 ŋ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ŋ, 6:00 ŋ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ŋ, 10:00 ŋ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ɣ, 12:00 ɣ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ɣ, 5:00 ɣ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ɣ, 9:30 ɣ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ɣ, 11:00 ɣ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sɛkɛnd 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sɛkɛnd 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sɛkɛnd 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sɛkɛnd 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'gaƒoƒo 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'gaƒoƒo 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'gaƒoƒo 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'gaƒoƒo 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ŋkeke 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ŋkeke 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ŋkeke 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ŋkeke 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'kwasiɖa 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'kwasiɖa 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'kwasiɖa 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'kwasiɖa 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ɣleti 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ɣleti 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ɣleti 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ɣleti 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'ƒe 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ƒe 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'ƒe 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ƒe 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sɛkɛnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sɛkɛnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sɛkɛnd 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sɛkɛnd 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sɛkɛnd 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sɛkɛnd 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sɛkɛnd 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sɛkɛnd 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sɛkɛnd 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sɛkɛnd 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sɛkɛnd 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 sɛkɛnd 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ƒe 2 ɣleti 3 ŋkeke 1 sɛkɛnd 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ƒe 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ɣleti 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ƒe 2 ɣleti 3 ŋkeke 1 sɛkɛnd 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'kwasiɖa 1 gaƒoƒo 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'kwasiɖa 1 ŋkeke 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'kwasiɖa 1 ŋkeke 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'kwasiɖa 1 and ŋkeke 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'kwasiɖa 2 gaƒoƒo 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'gaƒoƒo 1 from now', // CarbonInterval::days(2)->forHumans() 'ŋkeke 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ŋkeke 1 gaƒoƒo 3', ]; } ================================================ FILE: tests/Localization/ElCyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ElCyTest extends LocalizationTestCase { public const LOCALE = 'el_CY'; // Greek (modern) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Αύριο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Σάββατο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Κυριακή {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Δευτέρα {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Σάββατο {} 12:00 ΠΜ', // Carbon::now()->subDays(2)->calendar() 'την προηγούμενη Κυριακή {} 8:49 ΜΜ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Χθες {} 10:00 ΜΜ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Σήμερα {} 10:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Σήμερα {} 2:00 ΠΜ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Αύριο {} 1:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Χθες {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Χθες {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Δευτέρα {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Κυριακή {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'το προηγούμενο Σάββατο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'την προηγούμενη Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'την προηγούμενη Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'την προηγούμενη Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1η 1η 1η 1η 1η', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2η 1η', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3η 1η', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4η 1η', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5η 1η', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6η 1η', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7η 1η', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11η 2η', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40η', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41η', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100η', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 πμ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ΠΜ, 12:00 πμ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ΠΜ, 1:30 πμ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ΠΜ, 2:00 πμ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ΠΜ, 6:00 πμ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ΠΜ, 10:00 πμ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ΜΜ, 12:00 μμ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ΜΜ, 5:00 μμ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ΜΜ, 9:30 μμ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ΜΜ, 11:00 μμ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0η', // Carbon::now()->subSeconds(1)->diffForHumans() 'πριν 1 δευτερόλεπτο', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'πριν 1 δευ.', // Carbon::now()->subSeconds(2)->diffForHumans() 'πριν 2 δευτερόλεπτα', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'πριν 2 δευ.', // Carbon::now()->subMinutes(1)->diffForHumans() 'πριν 1 λεπτό', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'πριν 1 λεπ.', // Carbon::now()->subMinutes(2)->diffForHumans() 'πριν 2 λεπτά', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'πριν 2 λεπ.', // Carbon::now()->subHours(1)->diffForHumans() 'πριν 1 ώρα', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'πριν 1 ώρα', // Carbon::now()->subHours(2)->diffForHumans() 'πριν 2 ώρες', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'πριν 2 ώρες', // Carbon::now()->subDays(1)->diffForHumans() 'πριν 1 μέρα', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'πριν 1 μέρ.', // Carbon::now()->subDays(2)->diffForHumans() 'πριν 2 μέρες', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'πριν 2 μέρ.', // Carbon::now()->subWeeks(1)->diffForHumans() 'πριν 1 εβδομάδα', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'πριν 1 εβδ.', // Carbon::now()->subWeeks(2)->diffForHumans() 'πριν 2 εβδομάδες', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'πριν 2 εβδ.', // Carbon::now()->subMonths(1)->diffForHumans() 'πριν 1 μήνα', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'πριν 1 μήν.', // Carbon::now()->subMonths(2)->diffForHumans() 'πριν 2 μήνες', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'πριν 2 μήν.', // Carbon::now()->subYears(1)->diffForHumans() 'πριν 1 χρόνο', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'πριν 1 χρ.', // Carbon::now()->subYears(2)->diffForHumans() 'πριν 2 χρόνια', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'πριν 2 χρ.', // Carbon::now()->addSecond()->diffForHumans() 'σε 1 δευτερόλεπτο', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'σε 1 δευ.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 δευτερόλεπτο μετά', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 δευ. μετά', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 δευτερόλεπτο πριν', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 δευ. πριν', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 δευτερόλεπτο', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 δευ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 δευτερόλεπτα', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 δευ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'σε 1 δευ.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 λεπτό 1 δευτερόλεπτο', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 χρ. 3 μήν. 1 μέρ. 1 δευ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'σε 3 χρόνια', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'πριν 5 μήν.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'πριν 2 χρ. 3 μήν. 1 μέρ. 1 δευ.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 εβδομάδα 10 ώρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 εβδομάδα 6 μέρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 εβδομάδα 6 μέρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'σε 1 εβδομάδα και 6 μέρες', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 εβδομάδες 1 ώρα', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'σε μία ώρα', // CarbonInterval::days(2)->forHumans() '2 μέρες', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 μέρ. 3 ώρες', ]; } ================================================ FILE: tests/Localization/ElGrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ElGrTest extends LocalizationTestCase { public const LOCALE = 'el_GR'; // Greek (modern) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Αύριο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Σάββατο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Κυριακή {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Δευτέρα {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Σάββατο {} 12:00 ΠΜ', // Carbon::now()->subDays(2)->calendar() 'την προηγούμενη Κυριακή {} 8:49 ΜΜ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Χθες {} 10:00 ΜΜ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Σήμερα {} 10:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Σήμερα {} 2:00 ΠΜ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Αύριο {} 1:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Χθες {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Χθες {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Δευτέρα {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Κυριακή {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'το προηγούμενο Σάββατο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'την προηγούμενη Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'την προηγούμενη Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'την προηγούμενη Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1η 1η 1η 1η 1η', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2η 1η', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3η 1η', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4η 1η', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5η 1η', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6η 1η', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7η 1η', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11η 2η', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40η', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41η', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100η', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 πμ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ΠΜ, 12:00 πμ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ΠΜ, 1:30 πμ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ΠΜ, 2:00 πμ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ΠΜ, 6:00 πμ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ΠΜ, 10:00 πμ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ΜΜ, 12:00 μμ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ΜΜ, 5:00 μμ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ΜΜ, 9:30 μμ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ΜΜ, 11:00 μμ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0η', // Carbon::now()->subSeconds(1)->diffForHumans() 'πριν 1 δευτερόλεπτο', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'πριν 1 δευ.', // Carbon::now()->subSeconds(2)->diffForHumans() 'πριν 2 δευτερόλεπτα', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'πριν 2 δευ.', // Carbon::now()->subMinutes(1)->diffForHumans() 'πριν 1 λεπτό', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'πριν 1 λεπ.', // Carbon::now()->subMinutes(2)->diffForHumans() 'πριν 2 λεπτά', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'πριν 2 λεπ.', // Carbon::now()->subHours(1)->diffForHumans() 'πριν 1 ώρα', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'πριν 1 ώρα', // Carbon::now()->subHours(2)->diffForHumans() 'πριν 2 ώρες', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'πριν 2 ώρες', // Carbon::now()->subDays(1)->diffForHumans() 'πριν 1 μέρα', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'πριν 1 μέρ.', // Carbon::now()->subDays(2)->diffForHumans() 'πριν 2 μέρες', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'πριν 2 μέρ.', // Carbon::now()->subWeeks(1)->diffForHumans() 'πριν 1 εβδομάδα', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'πριν 1 εβδ.', // Carbon::now()->subWeeks(2)->diffForHumans() 'πριν 2 εβδομάδες', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'πριν 2 εβδ.', // Carbon::now()->subMonths(1)->diffForHumans() 'πριν 1 μήνα', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'πριν 1 μήν.', // Carbon::now()->subMonths(2)->diffForHumans() 'πριν 2 μήνες', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'πριν 2 μήν.', // Carbon::now()->subYears(1)->diffForHumans() 'πριν 1 χρόνο', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'πριν 1 χρ.', // Carbon::now()->subYears(2)->diffForHumans() 'πριν 2 χρόνια', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'πριν 2 χρ.', // Carbon::now()->addSecond()->diffForHumans() 'σε 1 δευτερόλεπτο', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'σε 1 δευ.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 δευτερόλεπτο μετά', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 δευ. μετά', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 δευτερόλεπτο πριν', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 δευ. πριν', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 δευτερόλεπτο', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 δευ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 δευτερόλεπτα', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 δευ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'σε 1 δευ.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 λεπτό 1 δευτερόλεπτο', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 χρ. 3 μήν. 1 μέρ. 1 δευ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'σε 3 χρόνια', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'πριν 5 μήν.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'πριν 2 χρ. 3 μήν. 1 μέρ. 1 δευ.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 εβδομάδα 10 ώρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 εβδομάδα 6 μέρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 εβδομάδα 6 μέρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'σε 1 εβδομάδα και 6 μέρες', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 εβδομάδες 1 ώρα', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'σε μία ώρα', // CarbonInterval::days(2)->forHumans() '2 μέρες', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 μέρ. 3 ώρες', ]; } ================================================ FILE: tests/Localization/ElTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ElTest extends LocalizationTestCase { public const LOCALE = 'el'; // Greek (modern) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Αύριο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Σάββατο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Κυριακή {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Δευτέρα {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Σάββατο {} 12:00 ΠΜ', // Carbon::now()->subDays(2)->calendar() 'την προηγούμενη Κυριακή {} 8:49 ΜΜ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Χθες {} 10:00 ΜΜ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Σήμερα {} 10:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Σήμερα {} 2:00 ΠΜ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Αύριο {} 1:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Χθες {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Χθες {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Τρίτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Δευτέρα {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Κυριακή {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'το προηγούμενο Σάββατο {} 12:00 ΠΜ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'την προηγούμενη Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'την προηγούμενη Πέμπτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'την προηγούμενη Τετάρτη {} 12:00 ΠΜ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'την προηγούμενη Παρασκευή {} 12:00 ΠΜ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1η 1η 1η 1η 1η', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2η 1η', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3η 1η', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4η 1η', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5η 1η', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6η 1η', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7η 1η', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11η 2η', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40η', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41η', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100η', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 πμ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ΠΜ, 12:00 πμ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ΠΜ, 1:30 πμ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ΠΜ, 2:00 πμ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ΠΜ, 6:00 πμ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ΠΜ, 10:00 πμ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ΜΜ, 12:00 μμ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ΜΜ, 5:00 μμ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ΜΜ, 9:30 μμ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ΜΜ, 11:00 μμ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0η', // Carbon::now()->subSeconds(1)->diffForHumans() 'πριν 1 δευτερόλεπτο', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'πριν 1 δευ.', // Carbon::now()->subSeconds(2)->diffForHumans() 'πριν 2 δευτερόλεπτα', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'πριν 2 δευ.', // Carbon::now()->subMinutes(1)->diffForHumans() 'πριν 1 λεπτό', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'πριν 1 λεπ.', // Carbon::now()->subMinutes(2)->diffForHumans() 'πριν 2 λεπτά', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'πριν 2 λεπ.', // Carbon::now()->subHours(1)->diffForHumans() 'πριν 1 ώρα', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'πριν 1 ώρα', // Carbon::now()->subHours(2)->diffForHumans() 'πριν 2 ώρες', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'πριν 2 ώρες', // Carbon::now()->subDays(1)->diffForHumans() 'πριν 1 μέρα', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'πριν 1 μέρ.', // Carbon::now()->subDays(2)->diffForHumans() 'πριν 2 μέρες', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'πριν 2 μέρ.', // Carbon::now()->subWeeks(1)->diffForHumans() 'πριν 1 εβδομάδα', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'πριν 1 εβδ.', // Carbon::now()->subWeeks(2)->diffForHumans() 'πριν 2 εβδομάδες', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'πριν 2 εβδ.', // Carbon::now()->subMonths(1)->diffForHumans() 'πριν 1 μήνα', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'πριν 1 μήν.', // Carbon::now()->subMonths(2)->diffForHumans() 'πριν 2 μήνες', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'πριν 2 μήν.', // Carbon::now()->subYears(1)->diffForHumans() 'πριν 1 χρόνο', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'πριν 1 χρ.', // Carbon::now()->subYears(2)->diffForHumans() 'πριν 2 χρόνια', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'πριν 2 χρ.', // Carbon::now()->addSecond()->diffForHumans() 'σε 1 δευτερόλεπτο', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'σε 1 δευ.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 δευτερόλεπτο μετά', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 δευ. μετά', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 δευτερόλεπτο πριν', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 δευ. πριν', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 δευτερόλεπτο', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 δευ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 δευτερόλεπτα', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 δευ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'σε 1 δευ.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 λεπτό 1 δευτερόλεπτο', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 χρ. 3 μήν. 1 μέρ. 1 δευ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'σε 3 χρόνια', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'πριν 5 μήν.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'πριν 2 χρ. 3 μήν. 1 μέρ. 1 δευ.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 εβδομάδα 10 ώρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 εβδομάδα 6 μέρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 εβδομάδα 6 μέρες', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'σε 1 εβδομάδα και 6 μέρες', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 εβδομάδες 1 ώρα', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'σε μία ώρα', // CarbonInterval::days(2)->forHumans() '2 μέρες', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 μέρ. 3 ώρες', ]; } ================================================ FILE: tests/Localization/En001Test.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class En001Test extends LocalizationTestCase { public const LOCALE = 'en_001'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/En150Test.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class En150Test extends LocalizationTestCase { public const LOCALE = 'en_150'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnAgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnAgTest extends LocalizationTestCase { public const LOCALE = 'en_AG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnAiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnAiTest extends LocalizationTestCase { public const LOCALE = 'en_AI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnAsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnAsTest extends LocalizationTestCase { public const LOCALE = 'en_AS'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnAtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnAtTest extends LocalizationTestCase { public const LOCALE = 'en_AT'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnAuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnAuTest extends LocalizationTestCase { public const LOCALE = 'en_AU'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBbTest extends LocalizationTestCase { public const LOCALE = 'en_BB'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBeTest extends LocalizationTestCase { public const LOCALE = 'en_BE'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBiTest extends LocalizationTestCase { public const LOCALE = 'en_BI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBmTest extends LocalizationTestCase { public const LOCALE = 'en_BM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBsTest extends LocalizationTestCase { public const LOCALE = 'en_BS'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBwTest extends LocalizationTestCase { public const LOCALE = 'en_BW'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnBzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnBzTest extends LocalizationTestCase { public const LOCALE = 'en_BZ'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnCaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnCaTest extends LocalizationTestCase { public const LOCALE = 'en_CA'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnCcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnCcTest extends LocalizationTestCase { public const LOCALE = 'en_CC'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnChTest extends LocalizationTestCase { public const LOCALE = 'en_CH'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnCkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnCkTest extends LocalizationTestCase { public const LOCALE = 'en_CK'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnCmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnCmTest extends LocalizationTestCase { public const LOCALE = 'en_CM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnCxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnCxTest extends LocalizationTestCase { public const LOCALE = 'en_CX'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnCyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnCyTest extends LocalizationTestCase { public const LOCALE = 'en_CY'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnDeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnDeTest extends LocalizationTestCase { public const LOCALE = 'en_DE'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnDgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnDgTest extends LocalizationTestCase { public const LOCALE = 'en_DG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnDkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnDkTest extends LocalizationTestCase { public const LOCALE = 'en_DK'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnDmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnDmTest extends LocalizationTestCase { public const LOCALE = 'en_DM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnErTest extends LocalizationTestCase { public const LOCALE = 'en_ER'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnFiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnFiTest extends LocalizationTestCase { public const LOCALE = 'en_FI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnFjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnFjTest extends LocalizationTestCase { public const LOCALE = 'en_FJ'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnFkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnFkTest extends LocalizationTestCase { public const LOCALE = 'en_FK'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnFmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnFmTest extends LocalizationTestCase { public const LOCALE = 'en_FM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGbTest extends LocalizationTestCase { public const LOCALE = 'en_GB'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGdTest extends LocalizationTestCase { public const LOCALE = 'en_GD'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGgTest extends LocalizationTestCase { public const LOCALE = 'en_GG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGhTest extends LocalizationTestCase { public const LOCALE = 'en_GH'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGiTest extends LocalizationTestCase { public const LOCALE = 'en_GI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGmTest extends LocalizationTestCase { public const LOCALE = 'en_GM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGuTest extends LocalizationTestCase { public const LOCALE = 'en_GU'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnGyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnGyTest extends LocalizationTestCase { public const LOCALE = 'en_GY'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnHkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnHkTest extends LocalizationTestCase { public const LOCALE = 'en_HK'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnIeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnIeTest extends LocalizationTestCase { public const LOCALE = 'en_IE'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnIlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnIlTest extends LocalizationTestCase { public const LOCALE = 'en_IL'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnImTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnImTest extends LocalizationTestCase { public const LOCALE = 'en_IM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnInTest extends LocalizationTestCase { public const LOCALE = 'en_IN'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnIoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnIoTest extends LocalizationTestCase { public const LOCALE = 'en_IO'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnIsoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnIsoTest extends LocalizationTestCase { public const LOCALE = 'en_ISO'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnJeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnJeTest extends LocalizationTestCase { public const LOCALE = 'en_JE'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnJmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnJmTest extends LocalizationTestCase { public const LOCALE = 'en_JM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnKeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnKeTest extends LocalizationTestCase { public const LOCALE = 'en_KE'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnKiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnKiTest extends LocalizationTestCase { public const LOCALE = 'en_KI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnKnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnKnTest extends LocalizationTestCase { public const LOCALE = 'en_KN'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnKyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnKyTest extends LocalizationTestCase { public const LOCALE = 'en_KY'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnLcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnLcTest extends LocalizationTestCase { public const LOCALE = 'en_LC'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnLrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnLrTest extends LocalizationTestCase { public const LOCALE = 'en_LR'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnLsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnLsTest extends LocalizationTestCase { public const LOCALE = 'en_LS'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMgTest extends LocalizationTestCase { public const LOCALE = 'en_MG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMhTest extends LocalizationTestCase { public const LOCALE = 'en_MH'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMoTest extends LocalizationTestCase { public const LOCALE = 'en_MO'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMpTest extends LocalizationTestCase { public const LOCALE = 'en_MP'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMsTest extends LocalizationTestCase { public const LOCALE = 'en_MS'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMtTest extends LocalizationTestCase { public const LOCALE = 'en_MT'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMuTest extends LocalizationTestCase { public const LOCALE = 'en_MU'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMwTest extends LocalizationTestCase { public const LOCALE = 'en_MW'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnMyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnMyTest extends LocalizationTestCase { public const LOCALE = 'en_MY'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNaTest extends LocalizationTestCase { public const LOCALE = 'en_NA'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNfTest extends LocalizationTestCase { public const LOCALE = 'en_NF'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNgTest extends LocalizationTestCase { public const LOCALE = 'en_NG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNlTest extends LocalizationTestCase { public const LOCALE = 'en_NL'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNrTest extends LocalizationTestCase { public const LOCALE = 'en_NR'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNuTest extends LocalizationTestCase { public const LOCALE = 'en_NU'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnNzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnNzTest extends LocalizationTestCase { public const LOCALE = 'en_NZ'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnPgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnPgTest extends LocalizationTestCase { public const LOCALE = 'en_PG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnPhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnPhTest extends LocalizationTestCase { public const LOCALE = 'en_PH'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnPkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnPkTest extends LocalizationTestCase { public const LOCALE = 'en_PK'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnPnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnPnTest extends LocalizationTestCase { public const LOCALE = 'en_PN'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnPrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnPrTest extends LocalizationTestCase { public const LOCALE = 'en_PR'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnPwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnPwTest extends LocalizationTestCase { public const LOCALE = 'en_PW'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnRwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnRwTest extends LocalizationTestCase { public const LOCALE = 'en_RW'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSbTest extends LocalizationTestCase { public const LOCALE = 'en_SB'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnScTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnScTest extends LocalizationTestCase { public const LOCALE = 'en_SC'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSdTest extends LocalizationTestCase { public const LOCALE = 'en_SD'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSeTest extends LocalizationTestCase { public const LOCALE = 'en_SE'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSgTest extends LocalizationTestCase { public const LOCALE = 'en_SG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() 'in 1 second', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 years', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 week and 6 days', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in an hour', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnShTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnShTest extends LocalizationTestCase { public const LOCALE = 'en_SH'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSiTest extends LocalizationTestCase { public const LOCALE = 'en_SI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSlTest extends LocalizationTestCase { public const LOCALE = 'en_SL'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSsTest extends LocalizationTestCase { public const LOCALE = 'en_SS'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSxTest extends LocalizationTestCase { public const LOCALE = 'en_SX'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnSzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnSzTest extends LocalizationTestCase { public const LOCALE = 'en_SZ'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnTcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnTcTest extends LocalizationTestCase { public const LOCALE = 'en_TC'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnTest extends LocalizationTestCase { public const LOCALE = 'en'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnTkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnTkTest extends LocalizationTestCase { public const LOCALE = 'en_TK'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnToTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnToTest extends LocalizationTestCase { public const LOCALE = 'en_TO'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnTtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnTtTest extends LocalizationTestCase { public const LOCALE = 'en_TT'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnTvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnTvTest extends LocalizationTestCase { public const LOCALE = 'en_TV'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnTzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnTzTest extends LocalizationTestCase { public const LOCALE = 'en_TZ'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnUgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnUgTest extends LocalizationTestCase { public const LOCALE = 'en_UG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnUmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnUmTest extends LocalizationTestCase { public const LOCALE = 'en_UM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnUsPosixTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnUsPosixTest extends LocalizationTestCase { public const LOCALE = 'en_US_Posix'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnUsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnUsTest extends LocalizationTestCase { public const LOCALE = 'en_US'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnVcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnVcTest extends LocalizationTestCase { public const LOCALE = 'en_VC'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnVgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnVgTest extends LocalizationTestCase { public const LOCALE = 'en_VG'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnViTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnViTest extends LocalizationTestCase { public const LOCALE = 'en_VI'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnVuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnVuTest extends LocalizationTestCase { public const LOCALE = 'en_VU'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnWsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnWsTest extends LocalizationTestCase { public const LOCALE = 'en_WS'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnZaTest extends LocalizationTestCase { public const LOCALE = 'en_ZA'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnZmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnZmTest extends LocalizationTestCase { public const LOCALE = 'en_ZM'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EnZwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EnZwTest extends LocalizationTestCase { public const LOCALE = 'en_ZW'; // English public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EoTest extends LocalizationTestCase { public const LOCALE = 'eo'; // Esperanto public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Morgaŭ je 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabato je 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanĉo je 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundo je 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardo je 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'merkredo je 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ĵaŭdo je 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredo je 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardo je 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'merkredo je 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ĵaŭdo je 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredo je 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabato je 00:00', // Carbon::now()->subDays(2)->calendar() 'pasinta dimanĉo je 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hieraŭ je 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hodiaŭ je 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hodiaŭ je 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Morgaŭ je 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardo je 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hieraŭ je 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hieraŭ je 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pasinta mardo je 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pasinta lundo je 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pasinta dimanĉo je 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pasinta sabato je 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pasinta vendredo je 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'pasinta ĵaŭdo je 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'pasinta merkredo je 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pasinta vendredo je 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3a 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4a 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5a 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6a 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7a 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11a 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40a', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100a', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.t.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.t.m., 12:00 a.t.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.t.m., 1:30 a.t.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.t.m., 2:00 a.t.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.t.m., 6:00 a.t.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.t.m., 10:00 a.t.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.t.m., 12:00 p.t.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.t.m., 5:00 p.t.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.t.m., 9:30 p.t.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.t.m., 11:00 p.t.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0a', // Carbon::now()->subSeconds(1)->diffForHumans() 'antaŭ 1 sekundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'antaŭ 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() 'antaŭ 2 sekundoj', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'antaŭ 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() 'antaŭ 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'antaŭ 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'antaŭ 2 minutoj', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'antaŭ 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'antaŭ 1 horo', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'antaŭ 1 h.', // Carbon::now()->subHours(2)->diffForHumans() 'antaŭ 2 horoj', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'antaŭ 2 h.', // Carbon::now()->subDays(1)->diffForHumans() 'antaŭ 1 tago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'antaŭ 1 t.', // Carbon::now()->subDays(2)->diffForHumans() 'antaŭ 2 tagoj', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'antaŭ 2 t.', // Carbon::now()->subWeeks(1)->diffForHumans() 'antaŭ 1 semajno', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'antaŭ 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'antaŭ 2 semajnoj', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'antaŭ 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'antaŭ 1 monato', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'antaŭ 1 mo.', // Carbon::now()->subMonths(2)->diffForHumans() 'antaŭ 2 monatoj', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'antaŭ 2 mo.', // Carbon::now()->subYears(1)->diffForHumans() 'antaŭ 1 jaro', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'antaŭ 1 j.', // Carbon::now()->subYears(2)->diffForHumans() 'antaŭ 2 jaroj', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'antaŭ 2 j.', // Carbon::now()->addSecond()->diffForHumans() 'post 1 sekundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'post 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekundo poste', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sek. poste', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekundo antaŭe', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sek. antaŭe', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundoj', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'post 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 sekundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 mo. 1 t. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'post 3 jaroj', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'antaŭ 5 mo.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'antaŭ 2 j. 3 mo. 1 t. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semajno 10 horoj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semajno 6 tagoj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semajno 6 tagoj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'post 1 semajno kaj 6 tagoj', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semajnoj 1 horo', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'post horo', // CarbonInterval::days(2)->forHumans() '2 tagoj', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 t. 3 h.', ]; } ================================================ FILE: tests/Localization/Es419Test.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class Es419Test extends LocalizationTestCase { public const LOCALE = 'es_419'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsArTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsArTest extends LocalizationTestCase { public const LOCALE = 'es_AR'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsBoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsBoTest extends LocalizationTestCase { public const LOCALE = 'es_BO'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsBrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsBrTest extends LocalizationTestCase { public const LOCALE = 'es_BR'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsBzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsBzTest extends LocalizationTestCase { public const LOCALE = 'es_BZ'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsClTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsClTest extends LocalizationTestCase { public const LOCALE = 'es_CL'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsCoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsCoTest extends LocalizationTestCase { public const LOCALE = 'es_CO'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsCrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsCrTest extends LocalizationTestCase { public const LOCALE = 'es_CR'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsCuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsCuTest extends LocalizationTestCase { public const LOCALE = 'es_CU'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsDoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsDoTest extends LocalizationTestCase { public const LOCALE = 'es_DO'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 12:00 a. m.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 12:00 a. m.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 12:00 a. m.', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 8:49 p. m.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 10:00 p. m.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00 a. m.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 12:00 a. m.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsEaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsEaTest extends LocalizationTestCase { public const LOCALE = 'es_EA'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsEcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsEcTest extends LocalizationTestCase { public const LOCALE = 'es_EC'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsEsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsEsTest extends LocalizationTestCase { public const LOCALE = 'es_ES'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsGqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsGqTest extends LocalizationTestCase { public const LOCALE = 'es_GQ'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsGtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsGtTest extends LocalizationTestCase { public const LOCALE = 'es_GT'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsHnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsHnTest extends LocalizationTestCase { public const LOCALE = 'es_HN'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsIcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsIcTest extends LocalizationTestCase { public const LOCALE = 'es_IC'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsMxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsMxTest extends LocalizationTestCase { public const LOCALE = 'es_MX'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsNiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsNiTest extends LocalizationTestCase { public const LOCALE = 'es_NI'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsPaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsPaTest extends LocalizationTestCase { public const LOCALE = 'es_PA'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsPeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsPeTest extends LocalizationTestCase { public const LOCALE = 'es_PE'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsPhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsPhTest extends LocalizationTestCase { public const LOCALE = 'es_PH'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 12:00 a. m.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 12:00 a. m.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 12:00 a. m.', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 8:49 p. m.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 10:00 p. m.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00 a. m.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 12:00 a. m.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsPrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsPrTest extends LocalizationTestCase { public const LOCALE = 'es_PR'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsPyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsPyTest extends LocalizationTestCase { public const LOCALE = 'es_PY'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsSvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsSvTest extends LocalizationTestCase { public const LOCALE = 'es_SV'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsTest extends LocalizationTestCase { public const LOCALE = 'es'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsUsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsUsTest extends LocalizationTestCase { public const LOCALE = 'es_US'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 12:00 a. m.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 12:00 a. m.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 12:00 a. m.', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 8:49 p. m.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 10:00 p. m.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00 a. m.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 12:00 a. m.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 12:00 a. m.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 12:00 a. m.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 12:00 a. m.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 12:00 a. m.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsUyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsUyTest extends LocalizationTestCase { public const LOCALE = 'es_UY'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EsVeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EsVeTest extends LocalizationTestCase { public const LOCALE = 'es_VE'; // Spanish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 0:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 años', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 años', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 años 3 meses 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 años', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 años 3 meses 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/EtEeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EtEeTest extends LocalizationTestCase { public const LOCALE = 'et_EE'; // Estonian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'homme 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'laupäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pühapäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'esmaspäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'teisipäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kolmapäev 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'neljapäev 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'reede 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'teisipäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kolmapäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'neljapäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'reede 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'laupäev 00:00', // Carbon::now()->subDays(2)->calendar() 'eelmine pühapäev 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eile 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'täna 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'täna 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'homme 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'teisipäev 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'eile 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eile 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine teisipäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine esmaspäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine pühapäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine laupäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine reede 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'eelmine neljapäev 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'eelmine kolmapäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'eelmine reede 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 enne lõunat CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 enne lõunat, 12:00 enne lõunat', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 enne lõunat, 1:30 enne lõunat', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 enne lõunat, 2:00 enne lõunat', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 enne lõunat, 6:00 enne lõunat', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 enne lõunat, 10:00 enne lõunat', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 pärast lõunat, 12:00 pärast lõunat', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 pärast lõunat, 5:00 pärast lõunat', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 pärast lõunat, 9:30 pärast lõunat', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 pärast lõunat, 11:00 pärast lõunat', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekund tagasi', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s tagasi', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekundit tagasi', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s tagasi', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut tagasi', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min tagasi', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutit tagasi', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min tagasi', // Carbon::now()->subHours(1)->diffForHumans() '1 tund tagasi', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t tagasi', // Carbon::now()->subHours(2)->diffForHumans() '2 tundi tagasi', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t tagasi', // Carbon::now()->subDays(1)->diffForHumans() '1 päev tagasi', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 p tagasi', // Carbon::now()->subDays(2)->diffForHumans() '2 päeva tagasi', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 p tagasi', // Carbon::now()->subWeeks(1)->diffForHumans() '1 nädal tagasi', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 näd tagasi', // Carbon::now()->subWeeks(2)->diffForHumans() '2 nädalat tagasi', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 näd tagasi', // Carbon::now()->subMonths(1)->diffForHumans() '1 kuu tagasi', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 k tagasi', // Carbon::now()->subMonths(2)->diffForHumans() '2 kuud tagasi', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 k tagasi', // Carbon::now()->subYears(1)->diffForHumans() '1 aasta tagasi', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 a tagasi', // Carbon::now()->subYears(2)->diffForHumans() '2 aastat tagasi', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 a tagasi', // Carbon::now()->addSecond()->diffForHumans() '1 sekundi pärast', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s pärast', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund pärast', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s pärast', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund enne', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s enne', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundit', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s pärast', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a 3 k 1 p 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 aasta pärast', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 k tagasi', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 a 3 k 1 p 1 s tagasi', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 nädal 10 tundi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nädal 6 päeva', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nädal 6 päeva', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 nädala ja 6 päeva pärast', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 nädalat 1 tund', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 tunni pärast', // CarbonInterval::days(2)->forHumans() '2 päeva', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 p 3 t', ]; } ================================================ FILE: tests/Localization/EtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EtTest extends LocalizationTestCase { public const LOCALE = 'et'; // Estonian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'homme 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'laupäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pühapäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'esmaspäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'teisipäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kolmapäev 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'neljapäev 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'reede 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'teisipäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kolmapäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'neljapäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'reede 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'laupäev 00:00', // Carbon::now()->subDays(2)->calendar() 'eelmine pühapäev 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eile 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'täna 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'täna 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'homme 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'teisipäev 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'eile 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eile 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine teisipäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine esmaspäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine pühapäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine laupäev 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eelmine reede 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'eelmine neljapäev 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'eelmine kolmapäev 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'eelmine reede 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 enne lõunat CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 enne lõunat, 12:00 enne lõunat', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 enne lõunat, 1:30 enne lõunat', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 enne lõunat, 2:00 enne lõunat', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 enne lõunat, 6:00 enne lõunat', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 enne lõunat, 10:00 enne lõunat', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 pärast lõunat, 12:00 pärast lõunat', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 pärast lõunat, 5:00 pärast lõunat', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 pärast lõunat, 9:30 pärast lõunat', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 pärast lõunat, 11:00 pärast lõunat', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekund tagasi', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s tagasi', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekundit tagasi', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s tagasi', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut tagasi', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min tagasi', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutit tagasi', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min tagasi', // Carbon::now()->subHours(1)->diffForHumans() '1 tund tagasi', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t tagasi', // Carbon::now()->subHours(2)->diffForHumans() '2 tundi tagasi', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t tagasi', // Carbon::now()->subDays(1)->diffForHumans() '1 päev tagasi', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 p tagasi', // Carbon::now()->subDays(2)->diffForHumans() '2 päeva tagasi', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 p tagasi', // Carbon::now()->subWeeks(1)->diffForHumans() '1 nädal tagasi', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 näd tagasi', // Carbon::now()->subWeeks(2)->diffForHumans() '2 nädalat tagasi', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 näd tagasi', // Carbon::now()->subMonths(1)->diffForHumans() '1 kuu tagasi', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 k tagasi', // Carbon::now()->subMonths(2)->diffForHumans() '2 kuud tagasi', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 k tagasi', // Carbon::now()->subYears(1)->diffForHumans() '1 aasta tagasi', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 a tagasi', // Carbon::now()->subYears(2)->diffForHumans() '2 aastat tagasi', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 a tagasi', // Carbon::now()->addSecond()->diffForHumans() '1 sekundi pärast', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s pärast', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund pärast', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s pärast', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund enne', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s enne', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundit', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s pärast', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a 3 k 1 p 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 aasta pärast', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 k tagasi', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 a 3 k 1 p 1 s tagasi', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 nädal 10 tundi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nädal 6 päeva', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nädal 6 päeva', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 nädala ja 6 päeva pärast', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 nädalat 1 tund', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 tunni pärast', // CarbonInterval::days(2)->forHumans() '2 päeva', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 p 3 t', ]; } ================================================ FILE: tests/Localization/EuEsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EuEsTest extends LocalizationTestCase { public const LOCALE = 'eu_ES'; // Basque public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'bihar 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'larunbata 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'igandea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'astelehena 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asteartea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asteazkena 00:00etan', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'osteguna 00:00etan', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ostirala 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asteartea 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asteazkena 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'osteguna 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ostirala 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'larunbata 00:00etan', // Carbon::now()->subDays(2)->calendar() 'aurreko igandea 20:49etan', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'atzo 22:00etan', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'gaur 10:00etan', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaur 02:00etan', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'bihar 01:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asteartea 00:00etan', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'atzo 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'atzo 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko asteartea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko astelehena 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko igandea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko larunbata 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko ostirala 00:00etan', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'aurreko osteguna 00:00etan', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'aurreko asteazkena 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'aurreko ostirala 00:00etan', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 g CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 g, 12:00 g', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 g, 1:30 g', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 g, 2:00 g', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 g, 6:00 g', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 g, 10:00 g', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 a, 5:00 a', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 a, 9:30 a', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 a, 11:00 a', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'duela segundo batzuk', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'duela Segundu 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'duela 2 segundo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'duela 2 segundu', // Carbon::now()->subMinutes(1)->diffForHumans() 'duela minutu bat', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'duela Minutu 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'duela 2 minutu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'duela 2 minutu', // Carbon::now()->subHours(1)->diffForHumans() 'duela ordu bat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'duela Ordu 1', // Carbon::now()->subHours(2)->diffForHumans() 'duela 2 ordu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'duela 2 ordu', // Carbon::now()->subDays(1)->diffForHumans() 'duela egun bat', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'duela Egun 1', // Carbon::now()->subDays(2)->diffForHumans() 'duela 2 egun', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'duela 2 egun', // Carbon::now()->subWeeks(1)->diffForHumans() 'duela Aste 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'duela Aste 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'duela 2 aste', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'duela 2 aste', // Carbon::now()->subMonths(1)->diffForHumans() 'duela hilabete bat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'duela Hile 1', // Carbon::now()->subMonths(2)->diffForHumans() 'duela 2 hilabete', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'duela 2 hile', // Carbon::now()->subYears(1)->diffForHumans() 'duela urte bat', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'duela Urte 1', // Carbon::now()->subYears(2)->diffForHumans() 'duela 2 urte', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'duela 2 urte', // Carbon::now()->addSecond()->diffForHumans() 'segundo batzuk barru', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'Segundu 1 barru', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segundo batzuk geroago', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'Segundu 1 geroago', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segundo batzuk lehenago', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'Segundu 1 lehenago', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segundo batzuk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'Segundu 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'Segundu 1 barru', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minutu bat segundo batzuk', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 urte 3 hile Egun 1 Segundu 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 urte barru', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'duela 5 hile', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'duela 2 urte 3 hile Egun 1 Segundu 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'Aste 1 10 ordu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'Aste 1 6 egun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'Aste 1 6 egun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'Aste 1 eta 6 egun barru', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 aste ordu bat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ordu bat barru', // CarbonInterval::days(2)->forHumans() '2 egun', // CarbonInterval::create('P1DT3H')->forHumans(true) 'Egun 1 3 ordu', ]; } ================================================ FILE: tests/Localization/EuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EuTest extends LocalizationTestCase { public const LOCALE = 'eu'; // Basque public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'bihar 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'larunbata 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'igandea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'astelehena 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asteartea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asteazkena 00:00etan', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'osteguna 00:00etan', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ostirala 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asteartea 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asteazkena 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'osteguna 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ostirala 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'larunbata 00:00etan', // Carbon::now()->subDays(2)->calendar() 'aurreko igandea 20:49etan', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'atzo 22:00etan', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'gaur 10:00etan', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaur 02:00etan', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'bihar 01:00etan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asteartea 00:00etan', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'atzo 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'atzo 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko asteartea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko astelehena 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko igandea 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko larunbata 00:00etan', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aurreko ostirala 00:00etan', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'aurreko osteguna 00:00etan', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'aurreko asteazkena 00:00etan', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'aurreko ostirala 00:00etan', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 g CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 g, 12:00 g', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 g, 1:30 g', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 g, 2:00 g', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 g, 6:00 g', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 g, 10:00 g', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 a, 5:00 a', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 a, 9:30 a', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 a, 11:00 a', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'duela segundo batzuk', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'duela Segundu 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'duela 2 segundo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'duela 2 segundu', // Carbon::now()->subMinutes(1)->diffForHumans() 'duela minutu bat', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'duela Minutu 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'duela 2 minutu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'duela 2 minutu', // Carbon::now()->subHours(1)->diffForHumans() 'duela ordu bat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'duela Ordu 1', // Carbon::now()->subHours(2)->diffForHumans() 'duela 2 ordu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'duela 2 ordu', // Carbon::now()->subDays(1)->diffForHumans() 'duela egun bat', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'duela Egun 1', // Carbon::now()->subDays(2)->diffForHumans() 'duela 2 egun', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'duela 2 egun', // Carbon::now()->subWeeks(1)->diffForHumans() 'duela Aste 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'duela Aste 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'duela 2 aste', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'duela 2 aste', // Carbon::now()->subMonths(1)->diffForHumans() 'duela hilabete bat', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'duela Hile 1', // Carbon::now()->subMonths(2)->diffForHumans() 'duela 2 hilabete', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'duela 2 hile', // Carbon::now()->subYears(1)->diffForHumans() 'duela urte bat', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'duela Urte 1', // Carbon::now()->subYears(2)->diffForHumans() 'duela 2 urte', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'duela 2 urte', // Carbon::now()->addSecond()->diffForHumans() 'segundo batzuk barru', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'Segundu 1 barru', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segundo batzuk geroago', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'Segundu 1 geroago', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segundo batzuk lehenago', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'Segundu 1 lehenago', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segundo batzuk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'Segundu 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'Segundu 1 barru', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minutu bat segundo batzuk', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 urte 3 hile Egun 1 Segundu 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 urte barru', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'duela 5 hile', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'duela 2 urte 3 hile Egun 1 Segundu 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'Aste 1 10 ordu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'Aste 1 6 egun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'Aste 1 6 egun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'Aste 1 eta 6 egun barru', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 aste ordu bat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ordu bat barru', // CarbonInterval::days(2)->forHumans() '2 egun', // CarbonInterval::create('P1DT3H')->forHumans(true) 'Egun 1 3 ordu', ]; } ================================================ FILE: tests/Localization/EwoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class EwoTest extends LocalizationTestCase { public const LOCALE = 'ewo'; // Ewondo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'séradé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mɔ́ndi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndɔ məlú mə́bɛ̌ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndɔ məlú mə́lɛ́ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sɔ́ndɔ məlú mə́nyi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fúladé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ məlú mə́bɛ̌ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ məlú mə́lɛ́ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ məlú mə́nyi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fúladé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'séradé at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sɔ́ndɔ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ məlú mə́bɛ̌ at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sɔ́ndɔ məlú mə́bɛ̌ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mɔ́ndi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sɔ́ndɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last séradé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last fúladé at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sɔ́ndɔ məlú mə́nyi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last sɔ́ndɔ məlú mə́lɛ́ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last fúladé at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 kíkíríg CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kíkíríg, 12:00 kíkíríg', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 kíkíríg, 1:30 kíkíríg', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 kíkíríg, 2:00 kíkíríg', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 kíkíríg, 6:00 kíkíríg', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 kíkíríg, 10:00 kíkíríg', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ngəgógəle, 12:00 ngəgógəle', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ngəgógəle, 5:00 ngəgógəle', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ngəgógəle, 9:30 ngəgógəle', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ngəgógəle, 11:00 ngəgógəle', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/FaAfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FaAfTest extends LocalizationTestCase { public const LOCALE = 'fa_AF'; // Persian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'فردا ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'یکشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'دوشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت ۰۰:۰۰', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'یکشنبه پیش ساعت ۲۰:۴۹', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'دیروز ساعت ۲۲:۰۰', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'امروز ساعت ۱۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'امروز ساعت ۰۲:۰۰', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'فردا ساعت ۰۱:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'سه‌شنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'دوشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'یکشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'شنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'پنجشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'چهارشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', ':timeم :timeم :timeم :timeم :timeم', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', ':timeم :timeم', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', ':timeم :timeم', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', ':timeم :timeم', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', ':timeم :timeم', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', ':timeم :timeم', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', ':timeم :timeم', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', ':timeم :timeم', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', ':timeم', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', ':timeم', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', ':timeم', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 ق CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ق, 12:00 ق', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ق, 1:30 ق', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ق, 2:00 ق', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 ق, 6:00 ق', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 ق, 10:00 ق', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 ب, 12:00 ب', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 ب, 5:00 ب', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 ب, 9:30 ب', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ب, 11:00 ب', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', ':timeم', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 ثانیه پیش', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 دقیقه پیش', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ساعت پیش', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ساعت پیش', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 روز پیش', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 روز پیش', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 روز پیش', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 روز پیش', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 هفته پیش', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 هفته پیش', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ماه پیش', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 ماه پیش', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 سال پیش', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 سال پیش', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 سال پیش', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 سال پیش', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 ثانیه پس از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 ثانیه پس از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 ثانیه پیش از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 ثانیه پیش از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 ثانیه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 ثانیه', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 دقیقه 1 ثانیه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 سال 3 ماه 1 روز 1 ثانیه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 سال دیگر', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 ماه پیش', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 سال 3 ماه 1 روز 1 ثانیه پیش', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 هفته 10 ساعت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 هفته و 6 روز دیگر', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 هفته 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'یک ساعت دیگر', // CarbonInterval::days(2)->forHumans() // '2 days', '2 روز', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 روز 3 ساعت', ]; } ================================================ FILE: tests/Localization/FaIrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FaIrTest extends LocalizationTestCase { public const LOCALE = 'fa_IR'; // Persian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'فردا ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'یکشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'دوشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت ۰۰:۰۰', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'یکشنبه پیش ساعت ۲۰:۴۹', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'دیروز ساعت ۲۲:۰۰', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'امروز ساعت ۱۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'امروز ساعت ۰۲:۰۰', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'فردا ساعت ۰۱:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'سه‌شنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'دوشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'یکشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'شنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'پنجشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'چهارشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', ':timeم :timeم :timeم :timeم :timeم', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', ':timeم :timeم', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', ':timeم :timeم', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', ':timeم :timeم', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', ':timeم :timeم', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', ':timeم :timeم', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', ':timeم :timeم', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', ':timeم :timeم', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', ':timeم', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', ':timeم', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', ':timeم', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 قبل از ظهر CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 قبل از ظهر, 12:00 قبل از ظهر', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 قبل از ظهر, 1:30 قبل از ظهر', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 قبل از ظهر, 2:00 قبل از ظهر', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 قبل از ظهر, 6:00 قبل از ظهر', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 قبل از ظهر, 10:00 قبل از ظهر', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 بعد از ظهر, 12:00 بعد از ظهر', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 بعد از ظهر, 5:00 بعد از ظهر', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 بعد از ظهر, 9:30 بعد از ظهر', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 بعد از ظهر, 11:00 بعد از ظهر', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', ':timeم', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 ثانیه پیش', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 دقیقه پیش', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ساعت پیش', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ساعت پیش', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 روز پیش', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 روز پیش', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 روز پیش', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 روز پیش', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 هفته پیش', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 هفته پیش', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ماه پیش', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 ماه پیش', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 سال پیش', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 سال پیش', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 سال پیش', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 سال پیش', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 ثانیه پس از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 ثانیه پس از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 ثانیه پیش از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 ثانیه پیش از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 ثانیه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 ثانیه', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 دقیقه 1 ثانیه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 سال 3 ماه 1 روز 1 ثانیه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 سال دیگر', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 ماه پیش', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 سال 3 ماه 1 روز 1 ثانیه پیش', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 هفته 10 ساعت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 هفته و 6 روز دیگر', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 هفته 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'یک ساعت دیگر', // CarbonInterval::days(2)->forHumans() // '2 days', '2 روز', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 روز 3 ساعت', ]; } ================================================ FILE: tests/Localization/FaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FaTest extends LocalizationTestCase { public const LOCALE = 'fa'; // Persian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'فردا ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'یکشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'دوشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت ۰۰:۰۰', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'یکشنبه پیش ساعت ۲۰:۴۹', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'دیروز ساعت ۲۲:۰۰', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'امروز ساعت ۱۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'امروز ساعت ۰۲:۰۰', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'فردا ساعت ۰۱:۰۰', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت ۰۰:۰۰', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'سه‌شنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'دوشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'یکشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'شنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'پنجشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'چهارشنبه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت ۰۰:۰۰', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', ':timeم :timeم :timeم :timeم :timeم', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', ':timeم :timeم', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', ':timeم :timeم', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', ':timeم :timeم', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', ':timeم :timeم', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', ':timeم :timeم', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', ':timeم :timeم', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', ':timeم :timeم', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', ':timeم', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', ':timeم', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', ':timeم', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 قبل از ظهر CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 قبل از ظهر, 12:00 قبل از ظهر', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 قبل از ظهر, 1:30 قبل از ظهر', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 قبل از ظهر, 2:00 قبل از ظهر', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 قبل از ظهر, 6:00 قبل از ظهر', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 قبل از ظهر, 10:00 قبل از ظهر', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 بعد از ظهر, 12:00 بعد از ظهر', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 بعد از ظهر, 5:00 بعد از ظهر', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 بعد از ظهر, 9:30 بعد از ظهر', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 بعد از ظهر, 11:00 بعد از ظهر', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', ':timeم', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 ثانیه پیش', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 دقیقه پیش', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ساعت پیش', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ساعت پیش', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 روز پیش', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 روز پیش', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 روز پیش', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 روز پیش', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 هفته پیش', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 هفته پیش', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ماه پیش', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 ماه پیش', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 سال پیش', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 سال پیش', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 سال پیش', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 سال پیش', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 ثانیه پس از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 ثانیه پس از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 ثانیه پیش از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 ثانیه پیش از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 ثانیه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 ثانیه', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 دقیقه 1 ثانیه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 سال 3 ماه 1 روز 1 ثانیه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 سال دیگر', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 ماه پیش', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 سال 3 ماه 1 روز 1 ثانیه پیش', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 هفته 10 ساعت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 هفته و 6 روز دیگر', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 هفته 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'یک ساعت دیگر', // CarbonInterval::days(2)->forHumans() // '2 days', '2 روز', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 روز 3 ساعت', ]; } ================================================ FILE: tests/Localization/FfCmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FfCmTest extends LocalizationTestCase { public const LOCALE = 'ff_CM'; // Fulah public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hoore-biir at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dewo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last naasaande at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subaka CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 subaka, 12:00 subaka', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 subaka, 1:30 subaka', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 subaka, 2:00 subaka', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 subaka, 6:00 subaka', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 subaka, 10:00 subaka', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kikiiɗe, 12:00 kikiiɗe', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kikiiɗe, 5:00 kikiiɗe', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kikiiɗe, 9:30 kikiiɗe', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kikiiɗe, 11:00 kikiiɗe', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tenen ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tenen ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 tokossuoum ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 tokossuoum ago', // Carbon::now()->subHours(1)->diffForHumans() '1 montor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 montor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 montor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 montor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dian ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dian ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dian ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dian ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 naange ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 naange ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 lewru ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 lewru ago', // Carbon::now()->subYears(1)->diffForHumans() '1 baret ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 baret ago', // Carbon::now()->subYears(2)->diffForHumans() '2 baret ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 baret ago', // Carbon::now()->addSecond()->diffForHumans() '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tenen after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tenen after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tenen before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tenen before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tenen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tenen', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tenen from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 tokossuoum 1 tenen', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 baret 3 lewru 1 dian 1 tenen', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 baret from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 lewru ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 baret 3 lewru 1 dian 1 tenen ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 naange 10 montor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 naange and 6 dian from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 naange 1 montor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 montor from now', // CarbonInterval::days(2)->forHumans() '2 dian', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dian 3 montor', ]; } ================================================ FILE: tests/Localization/FfGnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FfGnTest extends LocalizationTestCase { public const LOCALE = 'ff_GN'; // Fulah public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hoore-biir at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dewo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last naasaande at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subaka CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 subaka, 12:00 subaka', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 subaka, 1:30 subaka', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 subaka, 2:00 subaka', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 subaka, 6:00 subaka', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 subaka, 10:00 subaka', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kikiiɗe, 12:00 kikiiɗe', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kikiiɗe, 5:00 kikiiɗe', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kikiiɗe, 9:30 kikiiɗe', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kikiiɗe, 11:00 kikiiɗe', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tenen ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tenen ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 tokossuoum ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 tokossuoum ago', // Carbon::now()->subHours(1)->diffForHumans() '1 montor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 montor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 montor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 montor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dian ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dian ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dian ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dian ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 naange ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 naange ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 lewru ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 lewru ago', // Carbon::now()->subYears(1)->diffForHumans() '1 baret ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 baret ago', // Carbon::now()->subYears(2)->diffForHumans() '2 baret ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 baret ago', // Carbon::now()->addSecond()->diffForHumans() '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tenen after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tenen after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tenen before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tenen before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tenen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tenen', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tenen from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 tokossuoum 1 tenen', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 baret 3 lewru 1 dian 1 tenen', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 baret from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 lewru ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 baret 3 lewru 1 dian 1 tenen ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 naange 10 montor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 naange and 6 dian from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 naange 1 montor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 montor from now', // CarbonInterval::days(2)->forHumans() '2 dian', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dian 3 montor', ]; } ================================================ FILE: tests/Localization/FfMrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FfMrTest extends LocalizationTestCase { public const LOCALE = 'ff_MR'; // Fulah public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoore-biir at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dewo at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aaɓnde at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mawbaare at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'njeslaare at 12:00 subaka', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'naasaande at 12:00 subaka', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mawnde at 12:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 12:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'njeslaare at 12:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'naasaande at 12:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawnde at 12:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hoore-biir at 12:00 subaka', // Carbon::now()->subDays(2)->calendar() 'Last dewo at 8:49 kikiiɗe', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 kikiiɗe', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 subaka', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 12:00 subaka', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawbaare at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aaɓnde at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dewo at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last hoore-biir at 12:00 subaka', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawnde at 12:00 subaka', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last naasaande at 12:00 subaka', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last njeslaare at 12:00 subaka', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mawnde at 12:00 subaka', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subaka CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 subaka, 12:00 subaka', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 subaka, 1:30 subaka', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 subaka, 2:00 subaka', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 subaka, 6:00 subaka', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 subaka, 10:00 subaka', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kikiiɗe, 12:00 kikiiɗe', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kikiiɗe, 5:00 kikiiɗe', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kikiiɗe, 9:30 kikiiɗe', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kikiiɗe, 11:00 kikiiɗe', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tenen ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tenen ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 tokossuoum ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 tokossuoum ago', // Carbon::now()->subHours(1)->diffForHumans() '1 montor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 montor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 montor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 montor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dian ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dian ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dian ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dian ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 naange ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 naange ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 lewru ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 lewru ago', // Carbon::now()->subYears(1)->diffForHumans() '1 baret ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 baret ago', // Carbon::now()->subYears(2)->diffForHumans() '2 baret ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 baret ago', // Carbon::now()->addSecond()->diffForHumans() '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tenen after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tenen after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tenen before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tenen before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tenen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tenen', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tenen from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 tokossuoum 1 tenen', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 baret 3 lewru 1 dian 1 tenen', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 baret from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 lewru ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 baret 3 lewru 1 dian 1 tenen ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 naange 10 montor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 naange and 6 dian from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 naange 1 montor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 montor from now', // CarbonInterval::days(2)->forHumans() '2 dian', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dian 3 montor', ]; } ================================================ FILE: tests/Localization/FfSnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FfSnTest extends LocalizationTestCase { public const LOCALE = 'ff_SN'; // Fulah public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hoore-biir at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dewo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last naasaande at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subaka CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 subaka, 12:00 subaka', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 subaka, 1:30 subaka', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 subaka, 2:00 subaka', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 subaka, 6:00 subaka', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 subaka, 10:00 subaka', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kikiiɗe, 12:00 kikiiɗe', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kikiiɗe, 5:00 kikiiɗe', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kikiiɗe, 9:30 kikiiɗe', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kikiiɗe, 11:00 kikiiɗe', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tenen ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tenen ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 tokossuoum ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 tokossuoum ago', // Carbon::now()->subHours(1)->diffForHumans() '1 montor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 montor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 montor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 montor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dian ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dian ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dian ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dian ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 naange ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 naange ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 lewru ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 lewru ago', // Carbon::now()->subYears(1)->diffForHumans() '1 baret ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 baret ago', // Carbon::now()->subYears(2)->diffForHumans() '2 baret ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 baret ago', // Carbon::now()->addSecond()->diffForHumans() '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tenen after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tenen after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tenen before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tenen before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tenen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tenen', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tenen from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 tokossuoum 1 tenen', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 baret 3 lewru 1 dian 1 tenen', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 baret from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 lewru ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 baret 3 lewru 1 dian 1 tenen ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 naange 10 montor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 naange and 6 dian from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 naange 1 montor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 montor from now', // CarbonInterval::days(2)->forHumans() '2 dian', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dian 3 montor', ]; } ================================================ FILE: tests/Localization/FfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FfTest extends LocalizationTestCase { public const LOCALE = 'ff'; // Fulah public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'naasaande at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawnde at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hoore-biir at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dewo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mawbaare at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawbaare at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aaɓnde at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dewo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last hoore-biir at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last naasaande at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last njeslaare at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mawnde at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subaka CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 subaka, 12:00 subaka', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 subaka, 1:30 subaka', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 subaka, 2:00 subaka', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 subaka, 6:00 subaka', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 subaka, 10:00 subaka', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kikiiɗe, 12:00 kikiiɗe', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kikiiɗe, 5:00 kikiiɗe', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kikiiɗe, 9:30 kikiiɗe', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kikiiɗe, 11:00 kikiiɗe', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tenen ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tenen ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tenen ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 tokossuoum ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 tokossuoum ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 tokossuoum ago', // Carbon::now()->subHours(1)->diffForHumans() '1 montor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 montor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 montor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 montor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dian ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dian ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dian ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dian ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 naange ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 naange ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 naange ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 lewru ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 lewru ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 lewru ago', // Carbon::now()->subYears(1)->diffForHumans() '1 baret ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 baret ago', // Carbon::now()->subYears(2)->diffForHumans() '2 baret ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 baret ago', // Carbon::now()->addSecond()->diffForHumans() '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tenen from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tenen after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tenen after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tenen before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tenen before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tenen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tenen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tenen', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tenen from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 tokossuoum 1 tenen', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 baret 3 lewru 1 dian 1 tenen', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 baret from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 lewru ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 baret 3 lewru 1 dian 1 tenen ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 naange 10 montor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 naange 6 dian', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 naange and 6 dian from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 naange 1 montor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 montor from now', // CarbonInterval::days(2)->forHumans() '2 dian', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dian 3 montor', ]; } ================================================ FILE: tests/Localization/FiFiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FiFiTest extends LocalizationTestCase { public const LOCALE = 'fi_FI'; // Finnish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lauantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnuntai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maanantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tiistai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keskiviikko at 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'torstai at 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'perjantai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiistai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'keskiviikko at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'torstai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'perjantai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lauantai at 00.00', // Carbon::now()->subDays(2)->calendar() 'Last sunnuntai at 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiistai at 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tiistai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maanantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sunnuntai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lauantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last perjantai at 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last torstai at 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last keskiviikko at 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last perjantai at 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 aamupäivä CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 aamupäivä, 12:00 aamupäivä', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 aamupäivä, 1:30 aamupäivä', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 aamupäivä, 2:00 aamupäivä', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 aamupäivä, 6:00 aamupäivä', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 aamupäivä, 10:00 aamupäivä', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 iltapäivä, 12:00 iltapäivä', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 iltapäivä, 5:00 iltapäivä', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 iltapäivä, 9:30 iltapäivä', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 iltapäivä, 11:00 iltapäivä', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekunti sitten', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s sitten', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekuntia sitten', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s sitten', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuutti sitten', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min sitten', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuuttia sitten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min sitten', // Carbon::now()->subHours(1)->diffForHumans() '1 tunti sitten', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t sitten', // Carbon::now()->subHours(2)->diffForHumans() '2 tuntia sitten', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t sitten', // Carbon::now()->subDays(1)->diffForHumans() '1 päivä sitten', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 pv sitten', // Carbon::now()->subDays(2)->diffForHumans() '2 päivää sitten', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 pv sitten', // Carbon::now()->subWeeks(1)->diffForHumans() '1 viikko sitten', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vk sitten', // Carbon::now()->subWeeks(2)->diffForHumans() '2 viikkoa sitten', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vk sitten', // Carbon::now()->subMonths(1)->diffForHumans() '1 kuukausi sitten', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 kk sitten', // Carbon::now()->subMonths(2)->diffForHumans() '2 kuukautta sitten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 kk sitten', // Carbon::now()->subYears(1)->diffForHumans() '1 vuosi sitten', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 v sitten', // Carbon::now()->subYears(2)->diffForHumans() '2 vuotta sitten', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 v sitten', // Carbon::now()->addSecond()->diffForHumans() '1 sekunnin päästä', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s päästä', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekunti sen jälkeen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s sen jälkeen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekunti ennen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s ennen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunti', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekuntia', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s päästä', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuutti 1 sekunti', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 v 3 kk 1 pv 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 vuoden päästä', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 kk sitten', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 v 3 kk 1 pv 1 s sitten', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 viikko 10 tuntia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 viikko 6 päivää', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 viikko 6 päivää', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 viikon ja 6 päivän päästä', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 viikkoa 1 tunti', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 tunnin päästä', // CarbonInterval::days(2)->forHumans() '2 päivää', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 pv 3 t', ]; } ================================================ FILE: tests/Localization/FiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FiTest extends LocalizationTestCase { public const LOCALE = 'fi'; // Finnish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lauantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnuntai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maanantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tiistai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'keskiviikko at 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'torstai at 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'perjantai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiistai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'keskiviikko at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'torstai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'perjantai at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lauantai at 00.00', // Carbon::now()->subDays(2)->calendar() 'Last sunnuntai at 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiistai at 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tiistai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maanantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sunnuntai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lauantai at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last perjantai at 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last torstai at 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last keskiviikko at 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last perjantai at 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 aamupäivä CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 aamupäivä, 12:00 aamupäivä', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 aamupäivä, 1:30 aamupäivä', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 aamupäivä, 2:00 aamupäivä', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 aamupäivä, 6:00 aamupäivä', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 aamupäivä, 10:00 aamupäivä', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 iltapäivä, 12:00 iltapäivä', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 iltapäivä, 5:00 iltapäivä', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 iltapäivä, 9:30 iltapäivä', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 iltapäivä, 11:00 iltapäivä', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekunti sitten', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s sitten', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekuntia sitten', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s sitten', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuutti sitten', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min sitten', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuuttia sitten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min sitten', // Carbon::now()->subHours(1)->diffForHumans() '1 tunti sitten', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t sitten', // Carbon::now()->subHours(2)->diffForHumans() '2 tuntia sitten', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t sitten', // Carbon::now()->subDays(1)->diffForHumans() '1 päivä sitten', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 pv sitten', // Carbon::now()->subDays(2)->diffForHumans() '2 päivää sitten', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 pv sitten', // Carbon::now()->subWeeks(1)->diffForHumans() '1 viikko sitten', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vk sitten', // Carbon::now()->subWeeks(2)->diffForHumans() '2 viikkoa sitten', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vk sitten', // Carbon::now()->subMonths(1)->diffForHumans() '1 kuukausi sitten', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 kk sitten', // Carbon::now()->subMonths(2)->diffForHumans() '2 kuukautta sitten', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 kk sitten', // Carbon::now()->subYears(1)->diffForHumans() '1 vuosi sitten', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 v sitten', // Carbon::now()->subYears(2)->diffForHumans() '2 vuotta sitten', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 v sitten', // Carbon::now()->addSecond()->diffForHumans() '1 sekunnin päästä', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s päästä', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekunti sen jälkeen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s sen jälkeen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekunti ennen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s ennen', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunti', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekuntia', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s päästä', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuutti 1 sekunti', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 v 3 kk 1 pv 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 vuoden päästä', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 kk sitten', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 v 3 kk 1 pv 1 s sitten', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 viikko 10 tuntia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 viikko 6 päivää', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 viikko 6 päivää', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 viikon ja 6 päivän päästä', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 viikkoa 1 tunti', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 tunnin päästä', // CarbonInterval::days(2)->forHumans() '2 päivää', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 pv 3 t', ]; } ================================================ FILE: tests/Localization/FilPhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FilPhTest extends LocalizationTestCase { public const LOCALE = 'fil_PH'; // Filipino public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabado at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Linggo at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lunes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Martes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Miyerkoles at 12:00 N.U.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Huwebes at 12:00 N.U.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Miyerkoles at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Huwebes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabado at 12:00 N.U.', // Carbon::now()->subDays(2)->calendar() 'Last Linggo at 8:49 N.H.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 N.H.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 N.U.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martes at 12:00 N.U.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Martes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lunes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Linggo at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabado at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Huwebes at 12:00 N.U.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Miyerkoles at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 n.u. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 N.U., 12:00 n.u.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 N.U., 1:30 n.u.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 N.U., 2:00 n.u.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 N.U., 6:00 n.u.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 N.U., 10:00 n.u.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 N.H., 12:00 n.h.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 N.H., 5:00 n.h.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 N.H., 9:30 n.h.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 N.H., 11:00 n.h.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segundo ang nakalipas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segundo ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segundo ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segundo ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuto ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuto ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuto ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans() '1 oras ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans() '2 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oras ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans() '1 araw ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans() '2 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 araw ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 linggo ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 linggo ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans() '1 buwan ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans() '2 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 buwan ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans() '1 taon ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans() '2 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taon ang nakalipas', // Carbon::now()->addSecond()->diffForHumans() 'sa 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sa 1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo pagkatapos', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segundo pagkatapos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo bago', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segundo bago', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sa 1 segundo', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taon 3 buwan 1 araw 1 segundo', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'sa 3 taon', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 buwan ang nakalipas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taon 3 buwan 1 araw 1 segundo ang nakalipas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 linggo 10 oras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'sa 1 linggo and 6 araw', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 linggo 1 oras', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sa 1 oras', // CarbonInterval::days(2)->forHumans() '2 araw', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 araw 3 oras', ]; } ================================================ FILE: tests/Localization/FilTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FilTest extends LocalizationTestCase { public const LOCALE = 'fil'; // Filipino public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabado at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Linggo at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lunes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Martes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Miyerkoles at 12:00 N.U.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Huwebes at 12:00 N.U.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Miyerkoles at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Huwebes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabado at 12:00 N.U.', // Carbon::now()->subDays(2)->calendar() 'Last Linggo at 8:49 N.H.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 N.H.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 N.U.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martes at 12:00 N.U.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Martes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lunes at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Linggo at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabado at 12:00 N.U.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Huwebes at 12:00 N.U.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Miyerkoles at 12:00 N.U.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Biyernes at 12:00 N.U.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 n.u. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 N.U., 12:00 n.u.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 N.U., 1:30 n.u.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 N.U., 2:00 n.u.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 N.U., 6:00 n.u.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 N.U., 10:00 n.u.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 N.H., 12:00 n.h.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 N.H., 5:00 n.h.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 N.H., 9:30 n.h.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 N.H., 11:00 n.h.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segundo ang nakalipas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segundo ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segundo ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segundo ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuto ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuto ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuto ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans() '1 oras ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans() '2 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oras ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans() '1 araw ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans() '2 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 araw ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 linggo ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 linggo ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans() '1 buwan ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans() '2 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 buwan ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans() '1 taon ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans() '2 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taon ang nakalipas', // Carbon::now()->addSecond()->diffForHumans() 'sa 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sa 1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo pagkatapos', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segundo pagkatapos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo bago', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segundo bago', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sa 1 segundo', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taon 3 buwan 1 araw 1 segundo', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'sa 3 taon', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 buwan ang nakalipas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taon 3 buwan 1 araw 1 segundo ang nakalipas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 linggo 10 oras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'sa 1 linggo and 6 araw', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 linggo 1 oras', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sa 1 oras', // CarbonInterval::days(2)->forHumans() '2 araw', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 araw 3 oras', ]; } ================================================ FILE: tests/Localization/FoDkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FoDkTest extends LocalizationTestCase { public const LOCALE = 'fo_DK'; // Faroese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í morgin kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leygardagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnudagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mánadagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mikudagur kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'hósdagur kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fríggjadagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mikudagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hósdagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fríggjadagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'leygardagur kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'síðstu sunnudagur kl 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í gjár kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Í dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Í morgin kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Í gjár kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í gjár kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu týsdagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu mánadagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu sunnudagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu leygardagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu fríggjadagur kl 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'síðstu hósdagur kl 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'síðstu mikudagur kl 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'síðstu fríggjadagur kl 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'fá sekund síðani', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekund síðani', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekundir síðani', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekundir síðani', // Carbon::now()->subMinutes(1)->diffForHumans() 'ein minutt síðani', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minutt síðani', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuttir síðani', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuttir síðani', // Carbon::now()->subHours(1)->diffForHumans() 'ein tími síðani', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 tími síðani', // Carbon::now()->subHours(2)->diffForHumans() '2 tímar síðani', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 tímar síðani', // Carbon::now()->subDays(1)->diffForHumans() 'ein dagur síðani', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dag síðani', // Carbon::now()->subDays(2)->diffForHumans() '2 dagar síðani', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dagar síðani', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vika síðani', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vika síðani', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vikur síðani', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vikur síðani', // Carbon::now()->subMonths(1)->diffForHumans() 'ein mánaði síðani', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mánaður síðani', // Carbon::now()->subMonths(2)->diffForHumans() '2 mánaðir síðani', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mánaðir síðani', // Carbon::now()->subYears(1)->diffForHumans() 'eitt ár síðani', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ár síðani', // Carbon::now()->subYears(2)->diffForHumans() '2 ár síðani', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ár síðani', // Carbon::now()->addSecond()->diffForHumans() 'um fá sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'um 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'fá sekund aftaná', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekund aftaná', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'fá sekund áðrenn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund áðrenn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'fá sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekundir', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'um 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ein minutt fá sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ár 3 mánaðir 1 dag 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'um 3 ár', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mánaðir síðani', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ár 3 mánaðir 1 dag 1 sekund síðani', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vika 10 tímar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'um 1 vika og 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vikur ein tími', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'um ein tími', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dag 3 tímar', ]; } ================================================ FILE: tests/Localization/FoFoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FoFoTest extends LocalizationTestCase { public const LOCALE = 'fo_FO'; // Faroese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í morgin kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leygardagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnudagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mánadagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mikudagur kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'hósdagur kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fríggjadagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mikudagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hósdagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fríggjadagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'leygardagur kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'síðstu sunnudagur kl 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í gjár kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Í dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Í morgin kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Í gjár kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í gjár kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu týsdagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu mánadagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu sunnudagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu leygardagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu fríggjadagur kl 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'síðstu hósdagur kl 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'síðstu mikudagur kl 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'síðstu fríggjadagur kl 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'fá sekund síðani', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekund síðani', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekundir síðani', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekundir síðani', // Carbon::now()->subMinutes(1)->diffForHumans() 'ein minutt síðani', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minutt síðani', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuttir síðani', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuttir síðani', // Carbon::now()->subHours(1)->diffForHumans() 'ein tími síðani', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 tími síðani', // Carbon::now()->subHours(2)->diffForHumans() '2 tímar síðani', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 tímar síðani', // Carbon::now()->subDays(1)->diffForHumans() 'ein dagur síðani', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dag síðani', // Carbon::now()->subDays(2)->diffForHumans() '2 dagar síðani', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dagar síðani', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vika síðani', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vika síðani', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vikur síðani', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vikur síðani', // Carbon::now()->subMonths(1)->diffForHumans() 'ein mánaði síðani', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mánaður síðani', // Carbon::now()->subMonths(2)->diffForHumans() '2 mánaðir síðani', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mánaðir síðani', // Carbon::now()->subYears(1)->diffForHumans() 'eitt ár síðani', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ár síðani', // Carbon::now()->subYears(2)->diffForHumans() '2 ár síðani', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ár síðani', // Carbon::now()->addSecond()->diffForHumans() 'um fá sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'um 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'fá sekund aftaná', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekund aftaná', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'fá sekund áðrenn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund áðrenn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'fá sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekundir', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'um 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ein minutt fá sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ár 3 mánaðir 1 dag 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'um 3 ár', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mánaðir síðani', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ár 3 mánaðir 1 dag 1 sekund síðani', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vika 10 tímar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'um 1 vika og 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vikur ein tími', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'um ein tími', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dag 3 tímar', ]; } ================================================ FILE: tests/Localization/FoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FoTest extends LocalizationTestCase { public const LOCALE = 'fo'; // Faroese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í morgin kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leygardagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnudagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mánadagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mikudagur kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'hósdagur kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fríggjadagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mikudagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'hósdagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fríggjadagur kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'leygardagur kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'síðstu sunnudagur kl 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í gjár kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Í dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Í morgin kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'týsdagur kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Í gjár kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Í gjár kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu týsdagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu mánadagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu sunnudagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu leygardagur kl 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'síðstu fríggjadagur kl 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'síðstu hósdagur kl 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'síðstu mikudagur kl 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'síðstu fríggjadagur kl 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'fá sekund síðani', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekund síðani', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekundir síðani', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekundir síðani', // Carbon::now()->subMinutes(1)->diffForHumans() 'ein minutt síðani', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minutt síðani', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuttir síðani', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuttir síðani', // Carbon::now()->subHours(1)->diffForHumans() 'ein tími síðani', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 tími síðani', // Carbon::now()->subHours(2)->diffForHumans() '2 tímar síðani', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 tímar síðani', // Carbon::now()->subDays(1)->diffForHumans() 'ein dagur síðani', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dag síðani', // Carbon::now()->subDays(2)->diffForHumans() '2 dagar síðani', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dagar síðani', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vika síðani', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vika síðani', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vikur síðani', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vikur síðani', // Carbon::now()->subMonths(1)->diffForHumans() 'ein mánaði síðani', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mánaður síðani', // Carbon::now()->subMonths(2)->diffForHumans() '2 mánaðir síðani', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mánaðir síðani', // Carbon::now()->subYears(1)->diffForHumans() 'eitt ár síðani', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ár síðani', // Carbon::now()->subYears(2)->diffForHumans() '2 ár síðani', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ár síðani', // Carbon::now()->addSecond()->diffForHumans() 'um fá sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'um 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'fá sekund aftaná', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekund aftaná', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'fá sekund áðrenn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekund áðrenn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'fá sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekundir', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'um 1 sekund', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ein minutt fá sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ár 3 mánaðir 1 dag 1 sekund', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'um 3 ár', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mánaðir síðani', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ár 3 mánaðir 1 dag 1 sekund síðani', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vika 10 tímar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'um 1 vika og 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vikur ein tími', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'um ein tími', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dag 3 tímar', ]; } ================================================ FILE: tests/Localization/FrBeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrBeTest extends LocalizationTestCase { public const LOCALE = 'fr_BE'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrBfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrBfTest extends LocalizationTestCase { public const LOCALE = 'fr_BF'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrBiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrBiTest extends LocalizationTestCase { public const LOCALE = 'fr_BI'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrBjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrBjTest extends LocalizationTestCase { public const LOCALE = 'fr_BJ'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrBlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrBlTest extends LocalizationTestCase { public const LOCALE = 'fr_BL'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrCaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrCaTest extends LocalizationTestCase { public const LOCALE = 'fr_CA'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2e', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrCdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrCdTest extends LocalizationTestCase { public const LOCALE = 'fr_CD'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrCfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrCfTest extends LocalizationTestCase { public const LOCALE = 'fr_CF'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrCgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrCgTest extends LocalizationTestCase { public const LOCALE = 'fr_CG'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrChTest extends LocalizationTestCase { public const LOCALE = 'fr_CH'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrCiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrCiTest extends LocalizationTestCase { public const LOCALE = 'fr_CI'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrCmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrCmTest extends LocalizationTestCase { public const LOCALE = 'fr_CM'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 mat. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mat., 12:00 mat.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 mat., 1:30 mat.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 mat., 2:00 mat.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 mat., 6:00 mat.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 mat., 10:00 mat.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 soir, 12:00 soir', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 soir, 5:00 soir', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 soir, 9:30 soir', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 soir, 11:00 soir', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrDjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrDjTest extends LocalizationTestCase { public const LOCALE = 'fr_DJ'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2e', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2e', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrDzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrDzTest extends LocalizationTestCase { public const LOCALE = 'fr_DZ'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2e', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2e', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrFrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrFrTest extends LocalizationTestCase { public const LOCALE = 'fr_FR'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrGaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrGaTest extends LocalizationTestCase { public const LOCALE = 'fr_GA'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrGfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrGfTest extends LocalizationTestCase { public const LOCALE = 'fr_GF'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrGnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrGnTest extends LocalizationTestCase { public const LOCALE = 'fr_GN'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrGpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrGpTest extends LocalizationTestCase { public const LOCALE = 'fr_GP'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrGqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrGqTest extends LocalizationTestCase { public const LOCALE = 'fr_GQ'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrHtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrHtTest extends LocalizationTestCase { public const LOCALE = 'fr_HT'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrKmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrKmTest extends LocalizationTestCase { public const LOCALE = 'fr_KM'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrLuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrLuTest extends LocalizationTestCase { public const LOCALE = 'fr_LU'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMaTest extends LocalizationTestCase { public const LOCALE = 'fr_MA'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2e', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2e', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMcTest extends LocalizationTestCase { public const LOCALE = 'fr_MC'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMfTest extends LocalizationTestCase { public const LOCALE = 'fr_MF'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMgTest extends LocalizationTestCase { public const LOCALE = 'fr_MG'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMlTest extends LocalizationTestCase { public const LOCALE = 'fr_ML'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMqTest extends LocalizationTestCase { public const LOCALE = 'fr_MQ'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMrTest extends LocalizationTestCase { public const LOCALE = 'fr_MR'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrMuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrMuTest extends LocalizationTestCase { public const LOCALE = 'fr_MU'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrNcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrNcTest extends LocalizationTestCase { public const LOCALE = 'fr_NC'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrNeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrNeTest extends LocalizationTestCase { public const LOCALE = 'fr_NE'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrPfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrPfTest extends LocalizationTestCase { public const LOCALE = 'fr_PF'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrPmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrPmTest extends LocalizationTestCase { public const LOCALE = 'fr_PM'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrReTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrReTest extends LocalizationTestCase { public const LOCALE = 'fr_RE'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrRwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrRwTest extends LocalizationTestCase { public const LOCALE = 'fr_RW'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrScTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrScTest extends LocalizationTestCase { public const LOCALE = 'fr_SC'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrSnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrSnTest extends LocalizationTestCase { public const LOCALE = 'fr_SN'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrSyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrSyTest extends LocalizationTestCase { public const LOCALE = 'fr_SY'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2e', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2e', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrTdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrTdTest extends LocalizationTestCase { public const LOCALE = 'fr_TD'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrTest extends LocalizationTestCase { public const LOCALE = 'fr'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrTgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrTgTest extends LocalizationTestCase { public const LOCALE = 'fr_TG'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrTnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrTnTest extends LocalizationTestCase { public const LOCALE = 'fr_TN'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrVuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrVuTest extends LocalizationTestCase { public const LOCALE = 'fr_VU'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 12:00 am', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrWfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrWfTest extends LocalizationTestCase { public const LOCALE = 'fr_WF'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FrYtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FrYtTest extends LocalizationTestCase { public const LOCALE = 'fr_YT'; // French public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Demain à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jeudi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi à 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samedi à 00:00', // Carbon::now()->subDays(2)->calendar() 'dimanche dernier à 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aujourd’hui à 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aujourd’hui à 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Demain à 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi à 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lundi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanche dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samedi dernier à 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'jeudi dernier à 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'mercredi dernier à 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vendredi dernier à 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1er 1er 1er 1re 1re', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1re', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1re', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1re', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1re', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1re', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1re', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2e', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41e', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'il y a 1 seconde', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'il y a 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'il y a 2 secondes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'il y a 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'il y a 1 minute', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'il y a 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'il y a 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'il y a 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'il y a 1 heure', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'il y a 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'il y a 2 heures', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'il y a 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'il y a 1 jour', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'il y a 1 j', // Carbon::now()->subDays(2)->diffForHumans() 'il y a 2 jours', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'il y a 2 j', // Carbon::now()->subWeeks(1)->diffForHumans() 'il y a 1 semaine', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'il y a 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'il y a 2 semaines', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'il y a 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'il y a 1 mois', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'il y a 1 mois', // Carbon::now()->subMonths(2)->diffForHumans() 'il y a 2 mois', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'il y a 2 mois', // Carbon::now()->subYears(1)->diffForHumans() 'il y a 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'il y a 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'il y a 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'il y a 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'dans 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dans 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde après', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s après', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde avant', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s avant', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dans 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 mois 1 j 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dans 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'il y a 5 mois', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'il y a 2 ans 3 mois 1 j 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semaine 10 heures', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semaine 6 jours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dans 1 semaine et 6 jours', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semaines 1 heure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dans une heure', // CarbonInterval::days(2)->forHumans() '2 jours', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 j 3 h', ]; } ================================================ FILE: tests/Localization/FurItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FurItTest extends LocalizationTestCase { public const LOCALE = 'fur_IT'; // Friulian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabide at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunis at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martars at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miercus at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'joibe at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vinars at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martars at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miercus at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'joibe at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vinars at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabide at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last domenie at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martars at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martars at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunis at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last domenie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabide at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vinars at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last joibe at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last miercus at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vinars at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secont', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secont', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secont', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secont', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minût 1 secont', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 an 3 mês 1 zornade 1 secont', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 setemane 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setemane 6 zornade', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setemane 6 zornade', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 setemane 1 ore', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 zornade', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 zornade 3 ore', ]; } ================================================ FILE: tests/Localization/FurTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FurTest extends LocalizationTestCase { public const LOCALE = 'fur'; // Friulian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabide at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunis at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martars at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miercus at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'joibe at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vinars at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martars at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miercus at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'joibe at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vinars at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabide at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last domenie at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martars at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martars at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunis at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last domenie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabide at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vinars at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last joibe at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last miercus at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vinars at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secont', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secont', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secont', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secont', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minût 1 secont', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 an 3 mês 1 zornade 1 secont', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 setemane 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setemane 6 zornade', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setemane 6 zornade', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 setemane 1 ore', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 zornade', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 zornade 3 ore', ]; } ================================================ FILE: tests/Localization/FyDeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FyDeTest extends LocalizationTestCase { public const LOCALE = 'fy_DE'; // Western Frisian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'moarn om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sinnowend om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Sinndag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Mondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Dingsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Meddwäakj om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Donnadag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Friedag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Dingsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Meddwäakj om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Donnadag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Friedag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sinnowend om 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'ôfrûne Sinndag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juster om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'hjoed om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'hjoed om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'moarn om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Dingsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juster om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juster om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'ôfrûne Dingsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'ôfrûne Mondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'ôfrûne Sinndag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'ôfrûne Sinnowend om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'ôfrûne Friedag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'ôfrûne Donnadag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'ôfrûne Meddwäakj om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'ôfrûne Friedag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0de', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 sekonde lyn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 s. lyn', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 sekonden lyn', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 s. lyn', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minút lyn', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 min. lyn', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minuten lyn', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 min. lyn', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 oere lyn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 o. lyn', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 oeren lyn', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 o. lyn', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 dei lyn', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 d. lyn', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 dagen lyn', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 d. lyn', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 wike lyn', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 wike lyn', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 wiken lyn', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 wiken lyn', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 moanne lyn', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 moa. lyn', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 moannen lyn', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 moa. lyn', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 jier lyn', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 j lyn', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 jierren lyn', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 j lyn', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'oer 1 sekonde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'oer 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekonde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekonden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'oer 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minút 1 sekonde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 j 3 moa. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'oer 3 jierren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 moa. lyn', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 j 3 moa. 1 d. 1 s. lyn', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 wike 10 oeren', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 wike 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 wike 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'oer 1 wike en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 wiken 1 oere', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'oer ien oere', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/FyNlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FyNlTest extends LocalizationTestCase { public const LOCALE = 'fy_NL'; // Western Frisian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'moarn om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sneon om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Snein om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Moandei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Tiisdei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Woansdei om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Tongersdei om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Freed om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Tiisdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Woansdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Tongersdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Freed om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sneon om 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'ôfrûne Snein om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juster om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'hjoed om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'hjoed om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'moarn om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Tiisdei om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juster om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juster om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'ôfrûne Tiisdei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'ôfrûne Moandei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'ôfrûne Snein om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'ôfrûne Sneon om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'ôfrûne Freed om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'ôfrûne Tongersdei om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'ôfrûne Woansdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'ôfrûne Freed om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0de', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 sekonde lyn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 s. lyn', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 sekonden lyn', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 s. lyn', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minút lyn', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 min. lyn', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minuten lyn', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 min. lyn', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 oere lyn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 o. lyn', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 oeren lyn', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 o. lyn', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 dei lyn', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 d. lyn', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 dagen lyn', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 d. lyn', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 wike lyn', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 wike lyn', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 wiken lyn', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 wiken lyn', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 moanne lyn', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 moa. lyn', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 moannen lyn', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 moa. lyn', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 jier lyn', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 j lyn', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 jierren lyn', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 j lyn', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'oer 1 sekonde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'oer 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekonde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekonden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'oer 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minút 1 sekonde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 j 3 moa. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'oer 3 jierren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 moa. lyn', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 j 3 moa. 1 d. 1 s. lyn', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 wike 10 oeren', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 wike 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 wike 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'oer 1 wike en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 wiken 1 oere', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'oer ien oere', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/FyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class FyTest extends LocalizationTestCase { public const LOCALE = 'fy'; // Western Frisian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'moarn om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sneon om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'snein om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'moandei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tiisdei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woansdei om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tongersdei om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'freed om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiisdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woansdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tongersdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'freed om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sneon om 00:00', // Carbon::now()->subDays(2)->calendar() 'ôfrûne snein om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'juster om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hjoed om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hjoed om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'moarn om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiisdei om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'juster om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'juster om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ôfrûne tiisdei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ôfrûne moandei om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ôfrûne snein om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ôfrûne sneon om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ôfrûne freed om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ôfrûne tongersdei om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ôfrûne woansdei om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ôfrûne freed om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekonde lyn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. lyn', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekonden lyn', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. lyn', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minút lyn', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. lyn', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten lyn', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. lyn', // Carbon::now()->subHours(1)->diffForHumans() '1 oere lyn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. lyn', // Carbon::now()->subHours(2)->diffForHumans() '2 oeren lyn', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. lyn', // Carbon::now()->subDays(1)->diffForHumans() '1 dei lyn', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. lyn', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen lyn', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. lyn', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wike lyn', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 wike lyn', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wiken lyn', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 wiken lyn', // Carbon::now()->subMonths(1)->diffForHumans() '1 moanne lyn', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 moa. lyn', // Carbon::now()->subMonths(2)->diffForHumans() '2 moannen lyn', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 moa. lyn', // Carbon::now()->subYears(1)->diffForHumans() '1 jier lyn', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 j lyn', // Carbon::now()->subYears(2)->diffForHumans() '2 jierren lyn', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 j lyn', // Carbon::now()->addSecond()->diffForHumans() 'oer 1 sekonde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'oer 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekonde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekonden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'oer 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minút 1 sekonde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j 3 moa. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'oer 3 jierren', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 moa. lyn', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 j 3 moa. 1 d. 1 s. lyn', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wike 10 oeren', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wike 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wike 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'oer 1 wike en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wiken 1 oere', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'oer ien oere', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/GaIeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GaIeTest extends LocalizationTestCase { public const LOCALE = 'ga_IE'; // Irish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amárach ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Satharn ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Domhnaigh ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Luain ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Máirt ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Céadaoin ag 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Déardaoin ag 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dé hAoine ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Máirt ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Céadaoin ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Déardaoin ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé hAoine ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Satharn ag 00:00', // Carbon::now()->subDays(2)->calendar() 'Dé Domhnaigh seo caite ag 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Inné aig 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Inniu ag 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Inniu ag 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amárach ag 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Máirt ag 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Inné aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Inné aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Máirt seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Luain seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Domhnaigh seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Satharn seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé hAoine seo caite ag 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Déardaoin seo caite ag 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Dé Céadaoin seo caite ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé hAoine seo caite ag 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1d 1d 1d 1d 1d', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2na 1d', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3mh 1d', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4mh 1d', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5mh 1d', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6mh 1d', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7mh 1d', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11mh 2na', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40mh', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41mh', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100mh', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 r.n. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 r.n., 12:00 r.n.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 r.n., 1:30 r.n.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 r.n., 2:00 r.n.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 r.n., 6:00 r.n.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 r.n., 10:00 r.n.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 i.n., 12:00 i.n.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 i.n., 5:00 i.n.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 i.n., 9:30 i.n.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 i.n., 11:00 i.n.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0mh', // Carbon::now()->subSeconds(1)->diffForHumans() '1 soicind ó shin', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1so ó shin', // Carbon::now()->subSeconds(2)->diffForHumans() '2 soicind ó shin', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2so ó shin', // Carbon::now()->subMinutes(1)->diffForHumans() '1 nóiméad ó shin', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1n ó shin', // Carbon::now()->subMinutes(2)->diffForHumans() '2 nóiméad ó shin', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2n ó shin', // Carbon::now()->subHours(1)->diffForHumans() '1 uair an chloig ó shin', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u ó shin', // Carbon::now()->subHours(2)->diffForHumans() '2 uair an chloig ó shin', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u ó shin', // Carbon::now()->subDays(1)->diffForHumans() '1 lá ó shin', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1l ó shin', // Carbon::now()->subDays(2)->diffForHumans() '2 lá ó shin', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2l ó shin', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sheachtain ó shin', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1sh ó shin', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sheachtain ó shin', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2sh ó shin', // Carbon::now()->subMonths(1)->diffForHumans() '1 mí ó shin', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1m ó shin', // Carbon::now()->subMonths(2)->diffForHumans() '2 mí ó shin', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2m ó shin', // Carbon::now()->subYears(1)->diffForHumans() '1 bliain ó shin', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1b ó shin', // Carbon::now()->subYears(2)->diffForHumans() '2 bliain ó shin', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2b ó shin', // Carbon::now()->addSecond()->diffForHumans() 'i 1 soicind', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'i 1so', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 soicind tar éis', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1so tar éis', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 soicind roimh', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1so roimh', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 soicind', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1so', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 soicind', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2so', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'i 1so', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 nóiméad 1 soicind', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2b 3m 1l 1so', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'i 3 bliain', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5m ó shin', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2b 3m 1l 1so ó shin', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sheachtain 10 uair an chloig', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sheachtain 6 lá', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sheachtain 6 lá', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'i 1 sheachtain agus 6 lá', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sheachtain 1 uair an chloig', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'i uair an chloig', // CarbonInterval::days(2)->forHumans() '2 lá', // CarbonInterval::create('P1DT3H')->forHumans(true) '1l 3u', ]; } ================================================ FILE: tests/Localization/GaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GaTest extends LocalizationTestCase { public const LOCALE = 'ga'; // Irish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amárach ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Satharn ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Domhnaigh ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Luain ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Máirt ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Céadaoin ag 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Déardaoin ag 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dé hAoine ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Máirt ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Céadaoin ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Déardaoin ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé hAoine ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Satharn ag 00:00', // Carbon::now()->subDays(2)->calendar() 'Dé Domhnaigh seo caite ag 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Inné aig 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Inniu ag 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Inniu ag 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amárach ag 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé Máirt ag 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Inné aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Inné aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Máirt seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Luain seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Domhnaigh seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé Satharn seo caite ag 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dé hAoine seo caite ag 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Déardaoin seo caite ag 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Dé Céadaoin seo caite ag 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dé hAoine seo caite ag 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1d 1d 1d 1d 1d', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2na 1d', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3mh 1d', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4mh 1d', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5mh 1d', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6mh 1d', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7mh 1d', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11mh 2na', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40mh', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41mh', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100mh', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 r.n. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 r.n., 12:00 r.n.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 r.n., 1:30 r.n.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 r.n., 2:00 r.n.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 r.n., 6:00 r.n.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 r.n., 10:00 r.n.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 i.n., 12:00 i.n.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 i.n., 5:00 i.n.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 i.n., 9:30 i.n.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 i.n., 11:00 i.n.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0mh', // Carbon::now()->subSeconds(1)->diffForHumans() '1 soicind ó shin', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1so ó shin', // Carbon::now()->subSeconds(2)->diffForHumans() '2 soicind ó shin', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2so ó shin', // Carbon::now()->subMinutes(1)->diffForHumans() '1 nóiméad ó shin', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1n ó shin', // Carbon::now()->subMinutes(2)->diffForHumans() '2 nóiméad ó shin', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2n ó shin', // Carbon::now()->subHours(1)->diffForHumans() '1 uair an chloig ó shin', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u ó shin', // Carbon::now()->subHours(2)->diffForHumans() '2 uair an chloig ó shin', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u ó shin', // Carbon::now()->subDays(1)->diffForHumans() '1 lá ó shin', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1l ó shin', // Carbon::now()->subDays(2)->diffForHumans() '2 lá ó shin', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2l ó shin', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sheachtain ó shin', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1sh ó shin', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sheachtain ó shin', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2sh ó shin', // Carbon::now()->subMonths(1)->diffForHumans() '1 mí ó shin', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1m ó shin', // Carbon::now()->subMonths(2)->diffForHumans() '2 mí ó shin', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2m ó shin', // Carbon::now()->subYears(1)->diffForHumans() '1 bliain ó shin', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1b ó shin', // Carbon::now()->subYears(2)->diffForHumans() '2 bliain ó shin', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2b ó shin', // Carbon::now()->addSecond()->diffForHumans() 'i 1 soicind', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'i 1so', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 soicind tar éis', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1so tar éis', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 soicind roimh', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1so roimh', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 soicind', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1so', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 soicind', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2so', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'i 1so', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 nóiméad 1 soicind', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2b 3m 1l 1so', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'i 3 bliain', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5m ó shin', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2b 3m 1l 1so ó shin', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sheachtain 10 uair an chloig', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sheachtain 6 lá', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sheachtain 6 lá', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'i 1 sheachtain agus 6 lá', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sheachtain 1 uair an chloig', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'i uair an chloig', // CarbonInterval::days(2)->forHumans() '2 lá', // CarbonInterval::create('P1DT3H')->forHumans(true) '1l 3u', ]; } ================================================ FILE: tests/Localization/GdGbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GdGbTest extends LocalizationTestCase { public const LOCALE = 'gd_GB'; // ScottishGaelic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'A-màireach aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Disathairne aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Didòmhnaich aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diluain aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dimàirt aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diciadain aig 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Diardaoin aig 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dihaoine aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dimàirt aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Diciadain aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Diardaoin aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dihaoine aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Disathairne aig 00:00', // Carbon::now()->subDays(2)->calendar() 'Didòmhnaich seo chaidh aig 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'An-dè aig 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'An-diugh aig 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'An-diugh aig 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'A-màireach aig 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dimàirt aig 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'An-dè aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'An-dè aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dimàirt seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diluain seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Didòmhnaich seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Disathairne seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dihaoine seo chaidh aig 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Diardaoin seo chaidh aig 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Diciadain seo chaidh aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dihaoine seo chaidh aig 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1d 1d 1d 1d 1d', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2na 1d', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3mh 1d', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4mh 1d', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5mh 1d', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6mh 1d', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7mh 1d', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11mh 2na', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40mh', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41mh', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100mh', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 m CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 m, 12:00 m', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 m, 1:30 m', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 m, 2:00 m', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 m, 6:00 m', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 m, 10:00 m', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 f, 12:00 f', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 f, 5:00 f', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 f, 9:30 f', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 f, 11:00 f', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0mh', // Carbon::now()->subSeconds(1)->diffForHumans() 'bho chionn 1 diogan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'bho chionn 1 d.', // Carbon::now()->subSeconds(2)->diffForHumans() 'bho chionn 2 diogan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'bho chionn 2 d.', // Carbon::now()->subMinutes(1)->diffForHumans() 'bho chionn 1 mionaidean', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'bho chionn 1 md.', // Carbon::now()->subMinutes(2)->diffForHumans() 'bho chionn 2 mionaidean', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'bho chionn 2 md.', // Carbon::now()->subHours(1)->diffForHumans() 'bho chionn 1 uairean', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'bho chionn 1 u.', // Carbon::now()->subHours(2)->diffForHumans() 'bho chionn 2 uairean', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'bho chionn 2 u.', // Carbon::now()->subDays(1)->diffForHumans() 'bho chionn 1 latha', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'bho chionn 1 l.', // Carbon::now()->subDays(2)->diffForHumans() 'bho chionn 2 latha', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'bho chionn 2 l.', // Carbon::now()->subWeeks(1)->diffForHumans() 'bho chionn 1 seachdainean', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'bho chionn 1 s.', // Carbon::now()->subWeeks(2)->diffForHumans() 'bho chionn 2 seachdainean', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'bho chionn 2 s.', // Carbon::now()->subMonths(1)->diffForHumans() 'bho chionn 1 mìosan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'bho chionn 1 ms.', // Carbon::now()->subMonths(2)->diffForHumans() 'bho chionn 2 mìosan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'bho chionn 2 ms.', // Carbon::now()->subYears(1)->diffForHumans() 'bho chionn 1 bliadhna', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'bho chionn 1 b.', // Carbon::now()->subYears(2)->diffForHumans() 'bho chionn 2 bliadhna', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'bho chionn 2 b.', // Carbon::now()->addSecond()->diffForHumans() 'ann an 1 diogan', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ann an 1 d.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 diogan', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 d.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 diogan', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 d.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ann an 1 d.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mionaidean 1 diogan', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 b. 3 ms. 1 l. 1 d.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ann an 3 bliadhna', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'bho chionn 5 ms.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'bho chionn 2 b. 3 ms. 1 l. 1 d.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 seachdainean 10 uairean', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seachdainean 6 latha', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seachdainean 6 latha', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ann an 1 seachdainean agus 6 latha', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 seachdainean 1 uairean', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ann an uair', // CarbonInterval::days(2)->forHumans() '2 latha', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 l. 3 u.', ]; } ================================================ FILE: tests/Localization/GdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GdTest extends LocalizationTestCase { public const LOCALE = 'gd'; // ScottishGaelic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'A-màireach aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Disathairne aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Didòmhnaich aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diluain aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dimàirt aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diciadain aig 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Diardaoin aig 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dihaoine aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dimàirt aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Diciadain aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Diardaoin aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dihaoine aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Disathairne aig 00:00', // Carbon::now()->subDays(2)->calendar() 'Didòmhnaich seo chaidh aig 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'An-dè aig 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'An-diugh aig 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'An-diugh aig 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'A-màireach aig 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dimàirt aig 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'An-dè aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'An-dè aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dimàirt seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diluain seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Didòmhnaich seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Disathairne seo chaidh aig 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dihaoine seo chaidh aig 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Diardaoin seo chaidh aig 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Diciadain seo chaidh aig 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dihaoine seo chaidh aig 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1d 1d 1d 1d 1d', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2na 1d', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3mh 1d', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4mh 1d', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5mh 1d', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6mh 1d', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7mh 1d', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11mh 2na', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40mh', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41mh', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100mh', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 m CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 m, 12:00 m', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 m, 1:30 m', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 m, 2:00 m', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 m, 6:00 m', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 m, 10:00 m', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 f, 12:00 f', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 f, 5:00 f', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 f, 9:30 f', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 f, 11:00 f', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0mh', // Carbon::now()->subSeconds(1)->diffForHumans() 'bho chionn 1 diogan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'bho chionn 1 d.', // Carbon::now()->subSeconds(2)->diffForHumans() 'bho chionn 2 diogan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'bho chionn 2 d.', // Carbon::now()->subMinutes(1)->diffForHumans() 'bho chionn 1 mionaidean', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'bho chionn 1 md.', // Carbon::now()->subMinutes(2)->diffForHumans() 'bho chionn 2 mionaidean', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'bho chionn 2 md.', // Carbon::now()->subHours(1)->diffForHumans() 'bho chionn 1 uairean', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'bho chionn 1 u.', // Carbon::now()->subHours(2)->diffForHumans() 'bho chionn 2 uairean', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'bho chionn 2 u.', // Carbon::now()->subDays(1)->diffForHumans() 'bho chionn 1 latha', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'bho chionn 1 l.', // Carbon::now()->subDays(2)->diffForHumans() 'bho chionn 2 latha', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'bho chionn 2 l.', // Carbon::now()->subWeeks(1)->diffForHumans() 'bho chionn 1 seachdainean', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'bho chionn 1 s.', // Carbon::now()->subWeeks(2)->diffForHumans() 'bho chionn 2 seachdainean', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'bho chionn 2 s.', // Carbon::now()->subMonths(1)->diffForHumans() 'bho chionn 1 mìosan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'bho chionn 1 ms.', // Carbon::now()->subMonths(2)->diffForHumans() 'bho chionn 2 mìosan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'bho chionn 2 ms.', // Carbon::now()->subYears(1)->diffForHumans() 'bho chionn 1 bliadhna', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'bho chionn 1 b.', // Carbon::now()->subYears(2)->diffForHumans() 'bho chionn 2 bliadhna', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'bho chionn 2 b.', // Carbon::now()->addSecond()->diffForHumans() 'ann an 1 diogan', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ann an 1 d.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 diogan', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 d.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 diogan', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 d.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ann an 1 d.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mionaidean 1 diogan', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 b. 3 ms. 1 l. 1 d.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ann an 3 bliadhna', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'bho chionn 5 ms.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'bho chionn 2 b. 3 ms. 1 l. 1 d.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 seachdainean 10 uairean', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seachdainean 6 latha', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seachdainean 6 latha', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ann an 1 seachdainean agus 6 latha', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 seachdainean 1 uairean', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ann an uair', // CarbonInterval::days(2)->forHumans() '2 latha', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 l. 3 u.', ]; } ================================================ FILE: tests/Localization/GezErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GezErTest extends LocalizationTestCase { public const LOCALE = 'gez_ER'; // Geez public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቀዳሚት at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'እኁድ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑይ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቀዳሚት at 12:00 ጽባሕ', // Carbon::now()->subDays(2)->calendar() 'Last እኁድ at 8:49 ምሴት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ምሴት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ጽባሕ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑይ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last እኁድ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቀዳሚት at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ጽባሕ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ጽባሕ, 12:00 ጽባሕ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ጽባሕ, 1:30 ጽባሕ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ጽባሕ, 2:00 ጽባሕ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ጽባሕ, 6:00 ጽባሕ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ጽባሕ, 10:00 ጽባሕ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ምሴት, 12:00 ምሴት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ምሴት, 5:00 ምሴት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ምሴት, 9:30 ምሴት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ምሴት, 11:00 ምሴት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ካልእ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ካልእ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ካልእ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ካልእ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ንኡስ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ንኡስ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ንኡስ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ንኡስ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 አንትሙ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 አንትሙ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 አንትሙ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 አንትሙ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ዕለት ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ዕለት ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ዕለት ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ዕለት ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ሰብዑ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ሰብዑ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ሰብዑ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ሰብዑ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ወርሕ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ወርሕ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ወርሕ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ወርሕ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ዓመት ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ዓመት ago', // Carbon::now()->addSecond()->diffForHumans() '1 ካልእ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ካልእ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ካልእ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ካልእ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ካልእ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ካልእ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ካልእ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ካልእ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ካልእ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ካልእ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ካልእ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ንኡስ 1 ካልእ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ዓመት 3 ወርሕ 1 ዕለት 1 ካልእ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ዓመት from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ወርሕ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ዓመት 3 ወርሕ 1 ዕለት 1 ካልእ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሰብዑ 10 አንትሙ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰብዑ 6 ዕለት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰብዑ 6 ዕለት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ሰብዑ and 6 ዕለት from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሰብዑ 1 አንትሙ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 አንትሙ from now', // CarbonInterval::days(2)->forHumans() '2 ዕለት', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ዕለት 3 አንትሙ', ]; } ================================================ FILE: tests/Localization/GezEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GezEtTest extends LocalizationTestCase { public const LOCALE = 'gez_ET'; // Geez public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቀዳሚት at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'እኁድ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑይ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቀዳሚት at 12:00 ጽባሕ', // Carbon::now()->subDays(2)->calendar() 'Last እኁድ at 8:49 ምሴት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ምሴት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ጽባሕ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑይ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last እኁድ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቀዳሚት at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ጽባሕ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ጽባሕ, 12:00 ጽባሕ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ጽባሕ, 1:30 ጽባሕ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ጽባሕ, 2:00 ጽባሕ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ጽባሕ, 6:00 ጽባሕ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ጽባሕ, 10:00 ጽባሕ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ምሴት, 12:00 ምሴት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ምሴት, 5:00 ምሴት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ምሴት, 9:30 ምሴት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ምሴት, 11:00 ምሴት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/GezTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GezTest extends LocalizationTestCase { public const LOCALE = 'gez'; // Geez public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቀዳሚት at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'እኁድ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑይ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቀዳሚት at 12:00 ጽባሕ', // Carbon::now()->subDays(2)->calendar() 'Last እኁድ at 8:49 ምሴት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ምሴት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ጽባሕ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሠሉስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑይ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last እኁድ at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቀዳሚት at 12:00 ጽባሕ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሐሙስ at 12:00 ጽባሕ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ራብዕ at 12:00 ጽባሕ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርበ at 12:00 ጽባሕ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ጽባሕ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ጽባሕ, 12:00 ጽባሕ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ጽባሕ, 1:30 ጽባሕ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ጽባሕ, 2:00 ጽባሕ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ጽባሕ, 6:00 ጽባሕ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ጽባሕ, 10:00 ጽባሕ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ምሴት, 12:00 ምሴት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ምሴት, 5:00 ምሴት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ምሴት, 9:30 ምሴት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ምሴት, 11:00 ምሴት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ካልእ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ካልእ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ካልእ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ካልእ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ንኡስ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ንኡስ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ንኡስ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ንኡስ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 አንትሙ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 አንትሙ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 አንትሙ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 አንትሙ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ዕለት ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ዕለት ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ዕለት ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ዕለት ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ሰብዑ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ሰብዑ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ሰብዑ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ሰብዑ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ወርሕ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ወርሕ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ወርሕ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ወርሕ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ዓመት ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ዓመት ago', // Carbon::now()->addSecond()->diffForHumans() '1 ካልእ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ካልእ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ካልእ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ካልእ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ካልእ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ካልእ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ካልእ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ካልእ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ካልእ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ካልእ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ካልእ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ንኡስ 1 ካልእ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ዓመት 3 ወርሕ 1 ዕለት 1 ካልእ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ዓመት from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ወርሕ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ዓመት 3 ወርሕ 1 ዕለት 1 ካልእ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሰብዑ 10 አንትሙ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰብዑ 6 ዕለት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰብዑ 6 ዕለት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ሰብዑ and 6 ዕለት from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሰብዑ 1 አንትሙ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 አንትሙ from now', // CarbonInterval::days(2)->forHumans() '2 ዕለት', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ዕለት 3 አንትሙ', ]; } ================================================ FILE: tests/Localization/GlEsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GlEsTest extends LocalizationTestCase { public const LOCALE = 'gl_ES'; // Galician public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañá ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luns ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mércores ás 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'xoves ás 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venres ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mércores ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'xoves ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venres ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado ás 0:00', // Carbon::now()->subDays(2)->calendar() 'o domingo pasado ás 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onte á 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoxe ás 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoxe ás 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañá ás 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes ás 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'onte á 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onte á 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o martes pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o luns pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o domingo pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o sábado pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o venres pasado ás 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'o xoves pasado ás 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'o mércores pasado ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'o venres pasado ás 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hai 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hai 1 seg.', // Carbon::now()->subSeconds(2)->diffForHumans() 'hai 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hai 2 seg.', // Carbon::now()->subMinutes(1)->diffForHumans() 'hai 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hai 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'hai 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hai 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'hai 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hai 1 h.', // Carbon::now()->subHours(2)->diffForHumans() 'hai 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hai 2 h.', // Carbon::now()->subDays(1)->diffForHumans() 'hai 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hai 1 d.', // Carbon::now()->subDays(2)->diffForHumans() 'hai 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hai 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() 'hai 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hai 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'hai 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hai 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'hai 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hai 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() 'hai 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hai 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() 'hai 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hai 1 a.', // Carbon::now()->subYears(2)->diffForHumans() 'hai 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hai 2 a.', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1 seg.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo despois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 seg. despois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 seg. antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 seg.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 seg.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1 seg.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a. 3 mes. 1 d. 1 seg.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hai 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hai 2 a. 3 mes. 1 d. 1 seg.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana e 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'nunha hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 h.', ]; } ================================================ FILE: tests/Localization/GlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GlTest extends LocalizationTestCase { public const LOCALE = 'gl'; // Galician public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañá ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luns ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mércores ás 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'xoves ás 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venres ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mércores ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'xoves ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venres ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado ás 0:00', // Carbon::now()->subDays(2)->calendar() 'o domingo pasado ás 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onte á 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoxe ás 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoxe ás 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañá ás 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes ás 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'onte á 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onte á 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o martes pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o luns pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o domingo pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o sábado pasado ás 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'o venres pasado ás 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'o xoves pasado ás 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'o mércores pasado ás 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'o venres pasado ás 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hai 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hai 1 seg.', // Carbon::now()->subSeconds(2)->diffForHumans() 'hai 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hai 2 seg.', // Carbon::now()->subMinutes(1)->diffForHumans() 'hai 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hai 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'hai 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hai 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'hai 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hai 1 h.', // Carbon::now()->subHours(2)->diffForHumans() 'hai 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hai 2 h.', // Carbon::now()->subDays(1)->diffForHumans() 'hai 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hai 1 d.', // Carbon::now()->subDays(2)->diffForHumans() 'hai 2 días', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hai 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() 'hai 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hai 1 sem.', // Carbon::now()->subWeeks(2)->diffForHumans() 'hai 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hai 2 sem.', // Carbon::now()->subMonths(1)->diffForHumans() 'hai 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hai 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() 'hai 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hai 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() 'hai 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hai 1 a.', // Carbon::now()->subYears(2)->diffForHumans() 'hai 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hai 2 a.', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1 seg.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo despois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 seg. despois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 seg. antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 seg.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 seg.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1 seg.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a. 3 mes. 1 d. 1 seg.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hai 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hai 2 a. 3 mes. 1 d. 1 seg.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 días', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana e 6 días', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'nunha hora', // CarbonInterval::days(2)->forHumans() '2 días', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 h.', ]; } ================================================ FILE: tests/Localization/GomLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GomLatnTest extends LocalizationTestCase { public const LOCALE = 'gom_Latn'; // Konkani Latin script public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Faleam rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Son\'var, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Aitar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Somar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Budvar, rati 12:00 vazta', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ieta to Brestar, rati 12:00 vazta', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ieta to Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Budvar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Brestar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Son\'var, rati 12:00 vazta', // Carbon::now()->subDays(2)->calendar() 'Fatlo Aitar, rati 8:49 vazta', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kal rati 10:00 vazta', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aiz sokalli 10:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aiz rati 2:00 vazta', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Faleam rati 1:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kal rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kal rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Somar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Aitar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Son\'var, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Fatlo Brestar, rati 12:00 vazta', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Fatlo Budvar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fatlo Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1er 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2er 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3er 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4er 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5er 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6er 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7er 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11er 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 rati CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 rati, 12:00 rati', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 rati, 1:30 rati', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 rati, 2:00 rati', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 sokalli, 6:00 sokalli', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 sokalli, 10:00 sokalli', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 donparam, 12:00 donparam', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 sanje, 5:00 sanje', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 rati, 9:30 rati', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 rati, 11:00 rati', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 second', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2v 3mh 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 satolleacho 10 hor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 satolleacho 6 dis', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 satolleacho 6 dis', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 satolleacho 1 hor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 dis', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/GomTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GomTest extends LocalizationTestCase { public const LOCALE = 'gom'; // Konkani Latin script public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Faleam rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Son\'var, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Aitar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Somar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieta to Budvar, rati 12:00 vazta', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ieta to Brestar, rati 12:00 vazta', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ieta to Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Budvar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Brestar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Son\'var, rati 12:00 vazta', // Carbon::now()->subDays(2)->calendar() 'Fatlo Aitar, rati 8:49 vazta', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kal rati 10:00 vazta', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Aiz sokalli 10:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aiz rati 2:00 vazta', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Faleam rati 1:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ieta to Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kal rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kal rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Mongllar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Somar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Aitar, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Son\'var, rati 12:00 vazta', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Fatlo Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Fatlo Brestar, rati 12:00 vazta', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Fatlo Budvar, rati 12:00 vazta', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fatlo Sukrar, rati 12:00 vazta', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1er 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2er 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3er 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4er 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5er 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6er 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7er 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11er 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 rati CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 rati, 12:00 rati', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 rati, 1:30 rati', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 rati, 2:00 rati', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 sokalli, 6:00 sokalli', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 sokalli, 10:00 sokalli', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 donparam, 12:00 donparam', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 sanje, 5:00 sanje', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 rati, 9:30 rati', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 rati, 11:00 rati', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 second', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2v 3mh 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 satolleacho 10 hor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 satolleacho 6 dis', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 satolleacho 6 dis', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 satolleacho 1 hor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 dis', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/GswChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GswChTest extends LocalizationTestCase { public const LOCALE = 'gsw_CH'; // Swiss German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschtig at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunntig at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunschtig at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 2.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am vormittag CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 am Vormittag, 12:00 am vormittag', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 am Vormittag, 1:30 am vormittag', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 am Vormittag, 2:00 am vormittag', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 am Vormittag, 6:00 am vormittag', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 am Vormittag, 10:00 am vormittag', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 am Namittag, 12:00 am namittag', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 am Namittag, 5:00 am namittag', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 am Namittag, 9:30 am namittag', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 am Namittag, 11:00 am namittag', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 Johr 3 Monet 1 Tag 1 Sekunde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Schtund', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Woche 1 Schtund', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 Tag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tag 3 Schtund', ]; } ================================================ FILE: tests/Localization/GswFrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GswFrTest extends LocalizationTestCase { public const LOCALE = 'gsw_FR'; // Swiss German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschtig at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunntig at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunschtig at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vorm. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 vorm., 12:00 vorm.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 vorm., 1:30 vorm.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 vorm., 2:00 vorm.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 vorm., 6:00 vorm.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 vorm., 10:00 vorm.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 nam., 12:00 nam.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 nam., 5:00 nam.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 nam., 9:30 nam.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 nam., 11:00 nam.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 Johr 3 Monet 1 Tag 1 Sekunde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Schtund', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Woche 1 Schtund', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 Tag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tag 3 Schtund', ]; } ================================================ FILE: tests/Localization/GswLiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GswLiTest extends LocalizationTestCase { public const LOCALE = 'gsw_LI'; // Swiss German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschtig at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunntig at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunschtig at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vorm. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 vorm., 12:00 vorm.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 vorm., 1:30 vorm.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 vorm., 2:00 vorm.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 vorm., 6:00 vorm.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 vorm., 10:00 vorm.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 nam., 12:00 nam.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 nam., 5:00 nam.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 nam., 9:30 nam.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 nam., 11:00 nam.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 Johr 3 Monet 1 Tag 1 Sekunde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Schtund', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Woche 1 Schtund', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 Tag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tag 3 Schtund', ]; } ================================================ FILE: tests/Localization/GswTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GswTest extends LocalizationTestCase { public const LOCALE = 'gsw'; // Swiss German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunschtig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friitig at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschtig at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunntig at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ziischtig at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ziischtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mäntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunntig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samschtig at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunschtig at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mittwuch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friitig at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 2.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am vormittag CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 am Vormittag, 12:00 am vormittag', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 am Vormittag, 1:30 am vormittag', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 am Vormittag, 2:00 am vormittag', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 am Vormittag, 6:00 am vormittag', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 am Vormittag, 10:00 am vormittag', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 am Namittag, 12:00 am namittag', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 am Namittag, 5:00 am namittag', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 am Namittag, 9:30 am namittag', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 am Namittag, 11:00 am namittag', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekunde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minute 1 Sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 Johr 3 Monet 1 Tag 1 Sekunde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woche 10 Schtund', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woche 6 Tag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Woche 1 Schtund', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 Tag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Tag 3 Schtund', ]; } ================================================ FILE: tests/Localization/GuInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GuInTest extends LocalizationTestCase { public const LOCALE = 'gu_IN'; // Gujarati public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'કાલે રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'શનિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'રવિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'સોમવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'બુધ્વાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ગુરુવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'બુધ્વાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ગુરુવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'શનિવાર, રાત 12:00 વાગ્યે', // Carbon::now()->subDays(2)->calendar() 'પાછલા રવિવાર, રાત 8:49 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ગઇકાલે રાત 10:00 વાગ્યે', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'આજ બપોર 10:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'આજ રાત 2:00 વાગ્યે', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'કાલે રાત 1:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ગઇકાલે રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ગઇકાલે રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા સોમવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા રવિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા શનિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'પાછલા ગુરુવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'પાછલા બુધ્વાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'પાછલા શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 રાત CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 રાત, 12:00 રાત', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 રાત, 1:30 રાત', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 રાત, 2:00 રાત', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 સવાર, 6:00 સવાર', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 બપોર, 10:00 બપોર', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 બપોર, 12:00 બપોર', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 સાંજ, 5:00 સાંજ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 રાત, 9:30 રાત', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 રાત, 11:00 રાત', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'અમુક પળો પેહલા', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1સે. પેહલા', // Carbon::now()->subSeconds(2)->diffForHumans() '2 સેકંડ પેહલા', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2સે. પેહલા', // Carbon::now()->subMinutes(1)->diffForHumans() 'એક મિનિટ પેહલા', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1મિ. પેહલા', // Carbon::now()->subMinutes(2)->diffForHumans() '2 મિનિટ પેહલા', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2મિ. પેહલા', // Carbon::now()->subHours(1)->diffForHumans() 'એક કલાક પેહલા', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1ક. પેહલા', // Carbon::now()->subHours(2)->diffForHumans() '2 કલાક પેહલા', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2ક. પેહલા', // Carbon::now()->subDays(1)->diffForHumans() 'એક દિવસ પેહલા', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1દિ. પેહલા', // Carbon::now()->subDays(2)->diffForHumans() '2 દિવસ પેહલા', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2દિ. પેહલા', // Carbon::now()->subWeeks(1)->diffForHumans() '1 અઠવાડિયું પેહલા', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1અઠ. પેહલા', // Carbon::now()->subWeeks(2)->diffForHumans() '2 અઠવાડિયા પેહલા', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2અઠ. પેહલા', // Carbon::now()->subMonths(1)->diffForHumans() 'એક મહિનો પેહલા', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1મહિનો પેહલા', // Carbon::now()->subMonths(2)->diffForHumans() '2 મહિના પેહલા', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2મહિના પેહલા', // Carbon::now()->subYears(1)->diffForHumans() 'એક વર્ષ પેહલા', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1વર્ષ પેહલા', // Carbon::now()->subYears(2)->diffForHumans() '2 વર્ષ પેહલા', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2વર્ષો પેહલા', // Carbon::now()->addSecond()->diffForHumans() 'અમુક પળો મા', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1સે. મા', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'અમુક પળો પછી', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1સે. પછી', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'અમુક પળો પહેલા', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1સે. પહેલા', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'અમુક પળો', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1સે.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 સેકંડ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2સે.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1સે. મા', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'એક મિનિટ અમુક પળો', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2વર્ષો 3મહિના 1દિ. 1સે.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 વર્ષ મા', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5મહિના પેહલા', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2વર્ષો 3મહિના 1દિ. 1સે. પેહલા', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 અઠવાડિયું 10 કલાક', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 અઠવાડિયું 6 દિવસ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 અઠવાડિયું 6 દિવસ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 અઠવાડિયું અને 6 દિવસ મા', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 અઠવાડિયા એક કલાક', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'એક કલાક મા', // CarbonInterval::days(2)->forHumans() '2 દિવસ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1દિ. 3ક.', ]; } ================================================ FILE: tests/Localization/GuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GuTest extends LocalizationTestCase { public const LOCALE = 'gu'; // Gujarati public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'કાલે રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'શનિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'રવિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'સોમવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'બુધ્વાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ગુરુવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'બુધ્વાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ગુરુવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'શનિવાર, રાત 12:00 વાગ્યે', // Carbon::now()->subDays(2)->calendar() 'પાછલા રવિવાર, રાત 8:49 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ગઇકાલે રાત 10:00 વાગ્યે', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'આજ બપોર 10:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'આજ રાત 2:00 વાગ્યે', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'કાલે રાત 1:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ગઇકાલે રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ગઇકાલે રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા મંગળવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા સોમવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા રવિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા શનિવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'પાછલા શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'પાછલા ગુરુવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'પાછલા બુધ્વાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'પાછલા શુક્રવાર, રાત 12:00 વાગ્યે', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 રાત CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 રાત, 12:00 રાત', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 રાત, 1:30 રાત', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 રાત, 2:00 રાત', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 સવાર, 6:00 સવાર', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 બપોર, 10:00 બપોર', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 બપોર, 12:00 બપોર', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 સાંજ, 5:00 સાંજ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 રાત, 9:30 રાત', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 રાત, 11:00 રાત', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'અમુક પળો પેહલા', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1સે. પેહલા', // Carbon::now()->subSeconds(2)->diffForHumans() '2 સેકંડ પેહલા', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2સે. પેહલા', // Carbon::now()->subMinutes(1)->diffForHumans() 'એક મિનિટ પેહલા', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1મિ. પેહલા', // Carbon::now()->subMinutes(2)->diffForHumans() '2 મિનિટ પેહલા', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2મિ. પેહલા', // Carbon::now()->subHours(1)->diffForHumans() 'એક કલાક પેહલા', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1ક. પેહલા', // Carbon::now()->subHours(2)->diffForHumans() '2 કલાક પેહલા', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2ક. પેહલા', // Carbon::now()->subDays(1)->diffForHumans() 'એક દિવસ પેહલા', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1દિ. પેહલા', // Carbon::now()->subDays(2)->diffForHumans() '2 દિવસ પેહલા', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2દિ. પેહલા', // Carbon::now()->subWeeks(1)->diffForHumans() '1 અઠવાડિયું પેહલા', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1અઠ. પેહલા', // Carbon::now()->subWeeks(2)->diffForHumans() '2 અઠવાડિયા પેહલા', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2અઠ. પેહલા', // Carbon::now()->subMonths(1)->diffForHumans() 'એક મહિનો પેહલા', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1મહિનો પેહલા', // Carbon::now()->subMonths(2)->diffForHumans() '2 મહિના પેહલા', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2મહિના પેહલા', // Carbon::now()->subYears(1)->diffForHumans() 'એક વર્ષ પેહલા', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1વર્ષ પેહલા', // Carbon::now()->subYears(2)->diffForHumans() '2 વર્ષ પેહલા', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2વર્ષો પેહલા', // Carbon::now()->addSecond()->diffForHumans() 'અમુક પળો મા', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1સે. મા', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'અમુક પળો પછી', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1સે. પછી', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'અમુક પળો પહેલા', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1સે. પહેલા', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'અમુક પળો', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1સે.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 સેકંડ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2સે.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1સે. મા', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'એક મિનિટ અમુક પળો', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2વર્ષો 3મહિના 1દિ. 1સે.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 વર્ષ મા', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5મહિના પેહલા', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2વર્ષો 3મહિના 1દિ. 1સે. પેહલા', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 અઠવાડિયું 10 કલાક', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 અઠવાડિયું 6 દિવસ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 અઠવાડિયું 6 દિવસ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 અઠવાડિયું અને 6 દિવસ મા', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 અઠવાડિયા એક કલાક', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'એક કલાક મા', // CarbonInterval::days(2)->forHumans() '2 દિવસ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1દિ. 3ક.', ]; } ================================================ FILE: tests/Localization/GuzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GuzTest extends LocalizationTestCase { public const LOCALE = 'guz'; // Gusii public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Esabato at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chumapiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chumatato at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chumaine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aramisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ichuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chumaine at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aramisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ichuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Esabato at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Chumapiri at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chumaine at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chumaine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chumatato at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chumapiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Esabato at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ichuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aramisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Chumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ichuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ma CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ma, 12:00 ma', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Ma, 1:30 ma', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Ma, 2:00 ma', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Ma, 6:00 ma', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Ma, 10:00 ma', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Mo, 12:00 mo', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Mo, 5:00 mo', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Mo, 9:30 mo', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Mo, 11:00 mo', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ibere ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ibere ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ibere ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ibere ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 rituko ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 rituko ago', // Carbon::now()->subDays(2)->diffForHumans() '2 rituko ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 rituko ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 isano naibere ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 isano naibere ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 isano naibere ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 isano naibere ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 omotunyi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 omotunyi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 omotunyi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 omotunyi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 omwaka ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 omwaka ago', // Carbon::now()->subYears(2)->diffForHumans() '2 omwaka ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 omwaka ago', // Carbon::now()->addSecond()->diffForHumans() '1 ibere from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ibere from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ibere after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ibere after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ibere before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ibere before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ibere', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ibere', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ibere', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ibere', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ibere from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ibere', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 omwaka 3 omotunyi 1 rituko 1 ibere', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 omwaka from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 omotunyi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 omwaka 3 omotunyi 1 rituko 1 ibere ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 isano naibere 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 isano naibere 6 rituko', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 isano naibere 6 rituko', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 isano naibere and 6 rituko from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 isano naibere 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 rituko', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 rituko 3h', ]; } ================================================ FILE: tests/Localization/GvGbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GvGbTest extends LocalizationTestCase { public const LOCALE = 'gv_GB'; // Manx public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jesarn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jedoonee at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jelhein at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jemayrt at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jercean at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Jerdein at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jeheiney at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jemayrt at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jercean at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jerdein at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jeheiney at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jesarn at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Jedoonee at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jemayrt at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jemayrt at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jelhein at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jedoonee at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jesarn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jeheiney at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Jerdein at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jercean at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jeheiney at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 derrey ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 derrey ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 derrey ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 derrey ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 feer veg ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 feer veg ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 feer veg ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 feer veg ago', // Carbon::now()->subHours(1)->diffForHumans() '1 oor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 oor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 laa ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 laa ago', // Carbon::now()->subDays(2)->diffForHumans() '2 laa ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 laa ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 shiaghtin ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 shiaghtin ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 shiaghtin ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 shiaghtin ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mee ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mee ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mee ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mee ago', // Carbon::now()->subYears(1)->diffForHumans() '1 blein ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 blein ago', // Carbon::now()->subYears(2)->diffForHumans() '2 blein ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 blein ago', // Carbon::now()->addSecond()->diffForHumans() '1 derrey from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 derrey from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 derrey after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 derrey after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 derrey before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 derrey before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 derrey', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 derrey', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 derrey', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 derrey', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 derrey from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 feer veg 1 derrey', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 blein 3 mee 1 laa 1 derrey', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 blein from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mee ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 blein 3 mee 1 laa 1 derrey ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 shiaghtin 10 oor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 shiaghtin 6 laa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 shiaghtin 6 laa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 shiaghtin and 6 laa from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 shiaghtin 1 oor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 oor from now', // CarbonInterval::days(2)->forHumans() '2 laa', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 laa 3 oor', ]; } ================================================ FILE: tests/Localization/GvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class GvTest extends LocalizationTestCase { public const LOCALE = 'gv'; // Manx public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jesarn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jedoonee at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jelhein at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jemayrt at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jercean at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Jerdein at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jeheiney at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jemayrt at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jercean at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jerdein at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jeheiney at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jesarn at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Jedoonee at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jemayrt at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jemayrt at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jelhein at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jedoonee at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jesarn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jeheiney at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Jerdein at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jercean at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jeheiney at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 derrey ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 derrey ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 derrey ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 derrey ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 feer veg ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 feer veg ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 feer veg ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 feer veg ago', // Carbon::now()->subHours(1)->diffForHumans() '1 oor ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oor ago', // Carbon::now()->subHours(2)->diffForHumans() '2 oor ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oor ago', // Carbon::now()->subDays(1)->diffForHumans() '1 laa ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 laa ago', // Carbon::now()->subDays(2)->diffForHumans() '2 laa ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 laa ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 shiaghtin ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 shiaghtin ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 shiaghtin ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 shiaghtin ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mee ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mee ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mee ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mee ago', // Carbon::now()->subYears(1)->diffForHumans() '1 blein ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 blein ago', // Carbon::now()->subYears(2)->diffForHumans() '2 blein ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 blein ago', // Carbon::now()->addSecond()->diffForHumans() '1 derrey from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 derrey from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 derrey after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 derrey after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 derrey before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 derrey before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 derrey', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 derrey', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 derrey', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 derrey', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 derrey from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 feer veg 1 derrey', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 blein 3 mee 1 laa 1 derrey', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 blein from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mee ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 blein 3 mee 1 laa 1 derrey ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 shiaghtin 10 oor', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 shiaghtin 6 laa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 shiaghtin 6 laa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 shiaghtin and 6 laa from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 shiaghtin 1 oor', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 oor from now', // CarbonInterval::days(2)->forHumans() '2 laa', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 laa 3 oor', ]; } ================================================ FILE: tests/Localization/HaGhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HaGhTest extends LocalizationTestCase { public const LOCALE = 'ha_GH'; // Hausa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asabar at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lahadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamis at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ná bíyú ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ná bíyú ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 áwàa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 áwàa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 rana ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 rana ago', // Carbon::now()->subDays(2)->diffForHumans() '2 rana ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 rana ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 mako ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 mako ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 wátàa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 wátàa ago', // Carbon::now()->subYears(1)->diffForHumans() 'shekara 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'shekara 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'shekara 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'shekara 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ná bíyú after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ná bíyú after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ná bíyú before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ná bíyú before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ná bíyú from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minti 1 1 ná bíyú', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'shekara 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 wátàa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 mako 10 áwàa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 mako and 6 rana from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 mako 1 áwàa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 áwàa from now', // CarbonInterval::days(2)->forHumans() '2 rana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 rana 3 áwàa', ]; } ================================================ FILE: tests/Localization/HaNeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HaNeTest extends LocalizationTestCase { public const LOCALE = 'ha_NE'; // Hausa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asabar at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lahadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamis at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ná bíyú ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ná bíyú ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 áwàa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 áwàa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 rana ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 rana ago', // Carbon::now()->subDays(2)->diffForHumans() '2 rana ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 rana ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 mako ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 mako ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 wátàa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 wátàa ago', // Carbon::now()->subYears(1)->diffForHumans() 'shekara 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'shekara 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'shekara 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'shekara 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ná bíyú after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ná bíyú after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ná bíyú before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ná bíyú before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ná bíyú from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minti 1 1 ná bíyú', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'shekara 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 wátàa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 mako 10 áwàa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 mako and 6 rana from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 mako 1 áwàa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 áwàa from now', // CarbonInterval::days(2)->forHumans() '2 rana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 rana 3 áwàa', ]; } ================================================ FILE: tests/Localization/HaNgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HaNgTest extends LocalizationTestCase { public const LOCALE = 'ha_NG'; // Hausa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asabar at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lahadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamis at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ná bíyú ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ná bíyú ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 áwàa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 áwàa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 rana ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 rana ago', // Carbon::now()->subDays(2)->diffForHumans() '2 rana ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 rana ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 mako ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 mako ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 wátàa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 wátàa ago', // Carbon::now()->subYears(1)->diffForHumans() 'shekara 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'shekara 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'shekara 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'shekara 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ná bíyú after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ná bíyú after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ná bíyú before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ná bíyú before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ná bíyú from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minti 1 1 ná bíyú', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'shekara 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 wátàa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 mako 10 áwàa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 mako and 6 rana from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 mako 1 áwàa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 áwàa from now', // CarbonInterval::days(2)->forHumans() '2 rana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 rana 3 áwàa', ]; } ================================================ FILE: tests/Localization/HaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HaTest extends LocalizationTestCase { public const LOCALE = 'ha'; // Hausa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamis at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaʼa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asabar at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lahadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Talata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Talata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Litini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lahadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asabar at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamis at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laraba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumaʼa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ná bíyú ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ná bíyú ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ná bíyú ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 áwàa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 áwàa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 áwàa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 rana ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 rana ago', // Carbon::now()->subDays(2)->diffForHumans() '2 rana ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 rana ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 mako ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 mako ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 mako ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 wátàa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 wátàa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 wátàa ago', // Carbon::now()->subYears(1)->diffForHumans() 'shekara 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'shekara 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'shekara 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'shekara 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ná bíyú from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ná bíyú after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ná bíyú after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ná bíyú before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ná bíyú before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ná bíyú', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ná bíyú', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ná bíyú from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minti 1 1 ná bíyú', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'shekara 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 wátàa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'shekara 2 3 wátàa 1 rana 1 ná bíyú ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 mako 10 áwàa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mako 6 rana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 mako and 6 rana from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 mako 1 áwàa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 áwàa from now', // CarbonInterval::days(2)->forHumans() '2 rana', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 rana 3 áwàa', ]; } ================================================ FILE: tests/Localization/HakTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HakTest extends LocalizationTestCase { public const LOCALE = 'hak'; // Hakka Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜六 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜日 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜一 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜三 at 12:00 上晝', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '禮拜四 at 12:00 上晝', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜三 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜四 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜六 at 12:00 上晝', // Carbon::now()->subDays(2)->calendar() 'Last 禮拜日 at 8:49 下晝', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 下晝', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 上晝', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜一 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜日 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜六 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 禮拜四 at 12:00 上晝', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 禮拜三 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 上晝 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 上晝, 12:00 上晝', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 上晝, 1:30 上晝', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 上晝, 2:00 上晝', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 上晝, 6:00 上晝', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 上晝, 10:00 上晝', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 下晝, 12:00 下晝', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 下晝, 5:00 下晝', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 下晝, 9:30 下晝', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 下晝, 11:00 下晝', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 miéu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 miéu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 miéu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 miéu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 fûn ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 fûn ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 fûn ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 fûn ago', // Carbon::now()->subHours(1)->diffForHumans() '1 sṳ̀ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 sṳ̀ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 sṳ̀ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sṳ̀ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ngit ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ngit ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ngit ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ngit ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 lî-pai ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 lî-pai ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 lî-pai ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 lî-pai ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ngie̍t ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ngie̍t ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ngie̍t ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ngie̍t ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ngien11 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ngien11 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ngien11 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ngien11 ago', // Carbon::now()->addSecond()->diffForHumans() '1 miéu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 miéu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 miéu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 miéu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 miéu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 miéu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 miéu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 miéu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 miéu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 miéu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 miéu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 fûn 1 miéu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ngien11 3 ngie̍t 1 ngit 1 miéu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ngien11 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ngie̍t ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ngien11 3 ngie̍t 1 ngit 1 miéu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 lî-pai 10 sṳ̀', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lî-pai 6 ngit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lî-pai 6 ngit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 lî-pai and 6 ngit from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 lî-pai 1 sṳ̀', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 sṳ̀ from now', // CarbonInterval::days(2)->forHumans() '2 ngit', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ngit 3 sṳ̀', ]; } ================================================ FILE: tests/Localization/HakTwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HakTwTest extends LocalizationTestCase { public const LOCALE = 'hak_TW'; // Hakka Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜六 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜日 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜一 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜三 at 12:00 上晝', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '禮拜四 at 12:00 上晝', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜三 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜四 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜六 at 12:00 上晝', // Carbon::now()->subDays(2)->calendar() 'Last 禮拜日 at 8:49 下晝', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 下晝', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 上晝', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜二 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜一 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜日 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜六 at 12:00 上晝', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 禮拜四 at 12:00 上晝', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 禮拜三 at 12:00 上晝', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 禮拜五 at 12:00 上晝', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 上晝 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 上晝, 12:00 上晝', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 上晝, 1:30 上晝', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 上晝, 2:00 上晝', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 上晝, 6:00 上晝', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 上晝, 10:00 上晝', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 下晝, 12:00 下晝', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 下晝, 5:00 下晝', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 下晝, 9:30 下晝', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 下晝, 11:00 下晝', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 miéu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 miéu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 miéu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 miéu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 fûn ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 fûn ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 fûn ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 fûn ago', // Carbon::now()->subHours(1)->diffForHumans() '1 sṳ̀ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 sṳ̀ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 sṳ̀ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sṳ̀ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ngit ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ngit ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ngit ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ngit ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 lî-pai ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 lî-pai ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 lî-pai ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 lî-pai ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ngie̍t ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ngie̍t ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ngie̍t ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ngie̍t ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ngien11 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ngien11 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ngien11 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ngien11 ago', // Carbon::now()->addSecond()->diffForHumans() '1 miéu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 miéu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 miéu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 miéu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 miéu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 miéu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 miéu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 miéu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 miéu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 miéu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 miéu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 fûn 1 miéu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ngien11 3 ngie̍t 1 ngit 1 miéu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ngien11 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ngie̍t ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ngien11 3 ngie̍t 1 ngit 1 miéu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 lî-pai 10 sṳ̀', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lî-pai 6 ngit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lî-pai 6 ngit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 lî-pai and 6 ngit from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 lî-pai 1 sṳ̀', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 sṳ̀ from now', // CarbonInterval::days(2)->forHumans() '2 ngit', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ngit 3 sṳ̀', ]; } ================================================ FILE: tests/Localization/HawTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HawTest extends LocalizationTestCase { public const LOCALE = 'haw'; // Hawaiian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Poʻaono at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lāpule at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Poʻakahi at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Poʻalua at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Poʻakolu at 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Poʻahā at 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Poʻalima at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Poʻalua at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Poʻakolu at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Poʻahā at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Poʻalima at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Poʻaono at 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Last Lāpule at 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Poʻalua at 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Poʻalua at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Poʻakahi at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lāpule at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Poʻaono at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Poʻalima at 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Poʻahā at 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Poʻakolu at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Poʻalima at 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 lua ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 lua ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 lua ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 lua ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuke ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuke ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuke ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuke ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hola ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 hola ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hola ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 hola ago', // Carbon::now()->subDays(1)->diffForHumans() '1 lā ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 lā ago', // Carbon::now()->subDays(2)->diffForHumans() '2 lā ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 lā ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 pule ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 pule ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 pule ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 pule ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 makahiki ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 makahiki ago', // Carbon::now()->subYears(2)->diffForHumans() '2 makahiki ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 makahiki ago', // Carbon::now()->addSecond()->diffForHumans() '1 lua from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 lua from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 lua after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 lua after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 lua before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 lua before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 lua', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 lua', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 lua', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 lua', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 lua from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuke 1 lua', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 makahiki 3 mahina 1 lā 1 lua', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 makahiki from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 makahiki 3 mahina 1 lā 1 lua ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 pule 10 hola', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 pule 6 lā', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 pule 6 lā', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 pule and 6 lā from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 pule 1 hola', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 hola from now', // CarbonInterval::days(2)->forHumans() '2 lā', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 lā 3 hola', ]; } ================================================ FILE: tests/Localization/HeIlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HeIlTest extends LocalizationTestCase { public const LOCALE = 'he_IL'; // Hebrew public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'מחר ב־00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'שבת בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'ראשון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'שני בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'שלישי בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'רביעי בשעה 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'חמישי בשעה 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'שישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'שלישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'רביעי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'חמישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'שישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'שבת בשעה 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'ביום ראשון האחרון בשעה 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'אתמול ב־22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'היום ב־10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'היום ב־02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'מחר ב־01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'שלישי בשעה 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'אתמול ב־00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'אתמול ב־00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'ביום שלישי האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'ביום שני האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'ביום ראשון האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'ביום שבת האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'ביום שישי האחרון בשעה 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'ביום חמישי האחרון בשעה 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'ביום רביעי האחרון בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'ביום שישי האחרון בשעה 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 לפנות בוקר CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 לפנות בוקר, 12:00 לפנות בוקר', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 לפנות בוקר, 1:30 לפנות בוקר', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 לפנות בוקר, 2:00 לפנות בוקר', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 בבוקר, 6:00 בבוקר', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 לפני הצהריים, 10:00 לפנה"צ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 אחרי הצהריים, 12:00 אחה"צ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 אחרי הצהריים, 5:00 אחה"צ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 בערב, 9:30 בערב', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 בערב, 11:00 בערב', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'לפני שנייה', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'לפני שניה', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'לפני 2 שניות', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'לפני 2 שנ׳', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'לפני דקה', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'לפני דקה', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'לפני שתי דקות', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'לפני 2 דק׳', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'לפני שעה', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'לפני שעה', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'לפני שעתיים', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'לפני 2 שע׳', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'לפני יום', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'לפני יום', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'לפני יומיים', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'לפני 2 ימ׳', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'לפני שבוע', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'לפני שבוע', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'לפני שבועיים', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'לפני 2 שב׳', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'לפני חודש', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'לפני חודש', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'לפני חודשיים', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'לפני 2 חו׳', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'לפני שנה', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'לפני שנה', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'לפני שנתיים', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'לפני 2 שנ׳', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'בעוד שנייה מעכשיו', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'בעוד שניה מעכשיו', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'אחרי שנייה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'אחרי שניה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'לפני שנייה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'לפני שניה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' 'שנייה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' 'שניה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 שניות', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 שנ׳', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'בעוד שניה מעכשיו', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' 'דקה שנייה', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 שנ׳ 3 חו׳ יום שניה', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'בעוד 3 שנים מעכשיו', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'לפני 5 חו׳', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'לפני 2 שנ׳ 3 חו׳ יום שניה', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' 'שבוע 10 שעות', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'שבוע 6 ימים', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'שבוע 6 ימים', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'בעוד שבוע ו -6 ימים מעכשיו', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' 'שבועיים שעה', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'בעוד שעה מעכשיו', // CarbonInterval::days(2)->forHumans() // '2 days' 'יומיים', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' 'יום 3 שע׳', ]; } ================================================ FILE: tests/Localization/HeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HeTest extends LocalizationTestCase { public const LOCALE = 'he'; // Hebrew public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'מחר ב־00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'שבת בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'ראשון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'שני בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'שלישי בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'רביעי בשעה 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'חמישי בשעה 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'שישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'שלישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'רביעי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'חמישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'שישי בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'שבת בשעה 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'ביום ראשון האחרון בשעה 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'אתמול ב־22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'היום ב־10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'היום ב־02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'מחר ב־01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'שלישי בשעה 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'אתמול ב־00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'אתמול ב־00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'ביום שלישי האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'ביום שני האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'ביום ראשון האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'ביום שבת האחרון בשעה 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'ביום שישי האחרון בשעה 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'ביום חמישי האחרון בשעה 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'ביום רביעי האחרון בשעה 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'ביום שישי האחרון בשעה 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 לפנות בוקר CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 לפנות בוקר, 12:00 לפנות בוקר', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 לפנות בוקר, 1:30 לפנות בוקר', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 לפנות בוקר, 2:00 לפנות בוקר', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 בבוקר, 6:00 בבוקר', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 לפני הצהריים, 10:00 לפנה"צ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 אחרי הצהריים, 12:00 אחה"צ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 אחרי הצהריים, 5:00 אחה"צ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 בערב, 9:30 בערב', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 בערב, 11:00 בערב', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'לפני שנייה', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'לפני שניה', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'לפני 2 שניות', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'לפני 2 שנ׳', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'לפני דקה', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'לפני דקה', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'לפני שתי דקות', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'לפני 2 דק׳', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'לפני שעה', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'לפני שעה', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'לפני שעתיים', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'לפני 2 שע׳', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'לפני יום', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'לפני יום', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'לפני יומיים', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'לפני 2 ימ׳', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'לפני שבוע', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'לפני שבוע', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'לפני שבועיים', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'לפני 2 שב׳', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'לפני חודש', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'לפני חודש', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'לפני חודשיים', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'לפני 2 חו׳', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'לפני שנה', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'לפני שנה', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'לפני שנתיים', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'לפני 2 שנ׳', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'בעוד שנייה מעכשיו', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'בעוד שניה מעכשיו', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'אחרי שנייה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'אחרי שניה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'לפני שנייה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'לפני שניה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' 'שנייה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' 'שניה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 שניות', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 שנ׳', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'בעוד שניה מעכשיו', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' 'דקה שנייה', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 שנ׳ 3 חו׳ יום שניה', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'בעוד 3 שנים מעכשיו', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'לפני 5 חו׳', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'לפני 2 שנ׳ 3 חו׳ יום שניה', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' 'שבוע 10 שעות', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'שבוע 6 ימים', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'שבוע 6 ימים', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'בעוד שבוע ו -6 ימים מעכשיו', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' 'שבועיים שעה', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'בעוד שעה מעכשיו', // CarbonInterval::days(2)->forHumans() // '2 days' 'יומיים', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' 'יום 3 שע׳', ]; } ================================================ FILE: tests/Localization/HiInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HiInTest extends LocalizationTestCase { public const LOCALE = 'hi_IN'; // Hindi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'कल रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार, रात 12:00 बजे', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'गुरूवार, रात 12:00 बजे', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गुरूवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार, रात 12:00 बजे', // Carbon::now()->subDays(2)->calendar() 'पिछले रविवार, रात 8:49 बजे', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'कल रात 10:00 बजे', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज दोपहर 10:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज रात 2:00 बजे', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'कल रात 1:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'कल रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'कल रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले सोमवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले रविवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले शनिवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'पिछले गुरूवार, रात 12:00 बजे', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'पिछले बुधवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'पिछले शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 रात CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 रात, 12:00 रात', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 रात, 1:30 रात', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 रात, 2:00 रात', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 सुबह, 6:00 सुबह', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 दोपहर, 10:00 दोपहर', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 दोपहर, 12:00 दोपहर', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 शाम, 5:00 शाम', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 रात, 9:30 रात', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 रात, 11:00 रात', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'कुछ ही क्षण पहले', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकंड पहले', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकंड पहले', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकंड पहले', // Carbon::now()->subMinutes(1)->diffForHumans() 'एक मिनट पहले', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनट पहले', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनट पहले', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनटों पहले', // Carbon::now()->subHours(1)->diffForHumans() 'एक घंटा पहले', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घंटा पहले', // Carbon::now()->subHours(2)->diffForHumans() '2 घंटे पहले', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घंटे पहले', // Carbon::now()->subDays(1)->diffForHumans() 'एक दिन पहले', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन पहले', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन पहले', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिनों पहले', // Carbon::now()->subWeeks(1)->diffForHumans() '1 सप्ताह पहले', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 सप्ताह पहले', // Carbon::now()->subWeeks(2)->diffForHumans() '2 सप्ताह पहले', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 सप्ताह पहले', // Carbon::now()->subMonths(1)->diffForHumans() 'एक महीने पहले', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 माह पहले', // Carbon::now()->subMonths(2)->diffForHumans() '2 महीने पहले', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महीने पहले', // Carbon::now()->subYears(1)->diffForHumans() 'एक वर्ष पहले', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष पहले', // Carbon::now()->subYears(2)->diffForHumans() '2 वर्ष पहले', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्षों पहले', // Carbon::now()->addSecond()->diffForHumans() 'कुछ ही क्षण में', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकंड में', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'कुछ ही क्षण के बाद', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकंड के बाद', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'कुछ ही क्षण के पहले', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकंड के पहले', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'कुछ ही क्षण', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकंड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकंड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकंड', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकंड में', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'एक मिनट कुछ ही क्षण', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्षों 3 महीने 1 दिन 1 सेकंड', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वर्ष में', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महीने पहले', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्षों 3 महीने 1 दिन 1 सेकंड पहले', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 सप्ताह 10 घंटे', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 सप्ताह और 6 दिन में', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 सप्ताह एक घंटा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'एक घंटा में', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घंटे', ]; } ================================================ FILE: tests/Localization/HiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HiTest extends LocalizationTestCase { public const LOCALE = 'hi'; // Hindi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'कल रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार, रात 12:00 बजे', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'गुरूवार, रात 12:00 बजे', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गुरूवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार, रात 12:00 बजे', // Carbon::now()->subDays(2)->calendar() 'पिछले रविवार, रात 8:49 बजे', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'कल रात 10:00 बजे', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज दोपहर 10:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज रात 2:00 बजे', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'कल रात 1:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'कल रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'कल रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले मंगलवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले सोमवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले रविवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले शनिवार, रात 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'पिछले शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'पिछले गुरूवार, रात 12:00 बजे', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'पिछले बुधवार, रात 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'पिछले शुक्रवार, रात 12:00 बजे', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 रात CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 रात, 12:00 रात', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 रात, 1:30 रात', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 रात, 2:00 रात', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 सुबह, 6:00 सुबह', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 दोपहर, 10:00 दोपहर', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 दोपहर, 12:00 दोपहर', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 शाम, 5:00 शाम', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 रात, 9:30 रात', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 रात, 11:00 रात', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'कुछ ही क्षण पहले', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकंड पहले', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकंड पहले', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकंड पहले', // Carbon::now()->subMinutes(1)->diffForHumans() 'एक मिनट पहले', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनट पहले', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनट पहले', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनटों पहले', // Carbon::now()->subHours(1)->diffForHumans() 'एक घंटा पहले', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घंटा पहले', // Carbon::now()->subHours(2)->diffForHumans() '2 घंटे पहले', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घंटे पहले', // Carbon::now()->subDays(1)->diffForHumans() 'एक दिन पहले', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन पहले', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन पहले', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिनों पहले', // Carbon::now()->subWeeks(1)->diffForHumans() '1 सप्ताह पहले', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 सप्ताह पहले', // Carbon::now()->subWeeks(2)->diffForHumans() '2 सप्ताह पहले', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 सप्ताह पहले', // Carbon::now()->subMonths(1)->diffForHumans() 'एक महीने पहले', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 माह पहले', // Carbon::now()->subMonths(2)->diffForHumans() '2 महीने पहले', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महीने पहले', // Carbon::now()->subYears(1)->diffForHumans() 'एक वर्ष पहले', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष पहले', // Carbon::now()->subYears(2)->diffForHumans() '2 वर्ष पहले', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्षों पहले', // Carbon::now()->addSecond()->diffForHumans() 'कुछ ही क्षण में', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकंड में', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'कुछ ही क्षण के बाद', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकंड के बाद', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'कुछ ही क्षण के पहले', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकंड के पहले', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'कुछ ही क्षण', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकंड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकंड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकंड', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकंड में', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'एक मिनट कुछ ही क्षण', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्षों 3 महीने 1 दिन 1 सेकंड', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वर्ष में', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महीने पहले', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्षों 3 महीने 1 दिन 1 सेकंड पहले', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 सप्ताह 10 घंटे', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताह 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 सप्ताह और 6 दिन में', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 सप्ताह एक घंटा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'एक घंटा में', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घंटे', ]; } ================================================ FILE: tests/Localization/HifFjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HifFjTest extends LocalizationTestCase { public const LOCALE = 'hif_FJ'; // Fiji Hindi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Shanivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ravivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Somvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Budhvar at 12:00 Purvahan', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Guruvar at 12:00 Purvahan', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Budhvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Guruvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Shanivar at 12:00 Purvahan', // Carbon::now()->subDays(2)->calendar() 'Last Ravivar at 8:49 Aparaahna', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 Aparaahna', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 Purvahan', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Somvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ravivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Shanivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Guruvar at 12:00 Purvahan', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Budhvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 purvahan CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Purvahan, 12:00 purvahan', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Purvahan, 1:30 purvahan', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Purvahan, 2:00 purvahan', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Purvahan, 6:00 purvahan', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Purvahan, 10:00 purvahan', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Aparaahna, 12:00 aparaahna', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Aparaahna, 5:00 aparaahna', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Aparaahna, 9:30 aparaahna', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Aparaahna, 11:00 aparaahna', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Second ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Second ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Second ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Minit ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Minit ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Minit ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Minit ago', // Carbon::now()->subHours(1)->diffForHumans() '1 minit ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 minit ago', // Carbon::now()->subHours(2)->diffForHumans() '2 minit ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 minit ago', // Carbon::now()->subDays(1)->diffForHumans() '1 Din ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 Din ago', // Carbon::now()->subDays(2)->diffForHumans() '2 Din ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 Din ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Hafta ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Hafta ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Hafta ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Hafta ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 saal ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 saal ago', // Carbon::now()->subYears(2)->diffForHumans() '2 saal ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 saal ago', // Carbon::now()->addSecond()->diffForHumans() '1 Second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Second from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Second after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Second before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Second', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Second', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Second', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Second from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minit 1 Second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 saal 3 Mahina 1 Din 1 Second', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 saal from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 saal 3 Mahina 1 Din 1 Second ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Hafta 10 minit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Hafta 6 Din', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Hafta 6 Din', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Hafta and 6 Din from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Hafta 1 minit', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 minit from now', // CarbonInterval::days(2)->forHumans() '2 Din', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Din 3 minit', ]; } ================================================ FILE: tests/Localization/HifTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HifTest extends LocalizationTestCase { public const LOCALE = 'hif'; // Fiji Hindi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Shanivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ravivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Somvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Budhvar at 12:00 Purvahan', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Guruvar at 12:00 Purvahan', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Budhvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Guruvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Shanivar at 12:00 Purvahan', // Carbon::now()->subDays(2)->calendar() 'Last Ravivar at 8:49 Aparaahna', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 Aparaahna', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 Purvahan', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mangalvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Somvar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ravivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Shanivar at 12:00 Purvahan', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Guruvar at 12:00 Purvahan', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Budhvar at 12:00 Purvahan', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Shukravar at 12:00 Purvahan', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 purvahan CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Purvahan, 12:00 purvahan', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Purvahan, 1:30 purvahan', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Purvahan, 2:00 purvahan', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Purvahan, 6:00 purvahan', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Purvahan, 10:00 purvahan', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Aparaahna, 12:00 aparaahna', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Aparaahna, 5:00 aparaahna', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Aparaahna, 9:30 aparaahna', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Aparaahna, 11:00 aparaahna', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Second ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Second ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Second ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Minit ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Minit ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Minit ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Minit ago', // Carbon::now()->subHours(1)->diffForHumans() '1 minit ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 minit ago', // Carbon::now()->subHours(2)->diffForHumans() '2 minit ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 minit ago', // Carbon::now()->subDays(1)->diffForHumans() '1 Din ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 Din ago', // Carbon::now()->subDays(2)->diffForHumans() '2 Din ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 Din ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Hafta ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Hafta ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Hafta ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Hafta ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 saal ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 saal ago', // Carbon::now()->subYears(2)->diffForHumans() '2 saal ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 saal ago', // Carbon::now()->addSecond()->diffForHumans() '1 Second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Second from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Second after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Second before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Second', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Second', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Second', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Second from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minit 1 Second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 saal 3 Mahina 1 Din 1 Second', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 saal from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 saal 3 Mahina 1 Din 1 Second ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Hafta 10 minit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Hafta 6 Din', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Hafta 6 Din', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Hafta and 6 Din from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Hafta 1 minit', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 minit from now', // CarbonInterval::days(2)->forHumans() '2 Din', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Din 3 minit', ]; } ================================================ FILE: tests/Localization/HneInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HneInTest extends LocalizationTestCase { public const LOCALE = 'hne_IN'; // Chhattisgarhi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सनिवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'इतवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिरसपत at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिरसपत at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सनिवार at 12:00 बिहिनियाँ', // Carbon::now()->subDays(2)->calendar() 'Last इतवार at 8:49 मंझनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 मंझनियाँ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 बिहिनियाँ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last इतवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सनिवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिरसपत at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 बिहिनियाँ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 बिहिनियाँ, 12:00 बिहिनियाँ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 बिहिनियाँ, 1:30 बिहिनियाँ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 बिहिनियाँ, 2:00 बिहिनियाँ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 बिहिनियाँ, 6:00 बिहिनियाँ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 बिहिनियाँ, 10:00 बिहिनियाँ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 मंझनियाँ, 12:00 मंझनियाँ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 मंझनियाँ, 5:00 मंझनियाँ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 मंझनियाँ, 9:30 मंझनियाँ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 मंझनियाँ, 11:00 मंझनियाँ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/HneTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HneTest extends LocalizationTestCase { public const LOCALE = 'hne'; // Chhattisgarhi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सनिवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'इतवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिरसपत at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिरसपत at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सनिवार at 12:00 बिहिनियाँ', // Carbon::now()->subDays(2)->calendar() 'Last इतवार at 8:49 मंझनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 मंझनियाँ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 बिहिनियाँ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last इतवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सनिवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिरसपत at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last सुकरवार at 12:00 बिहिनियाँ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 बिहिनियाँ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 बिहिनियाँ, 12:00 बिहिनियाँ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 बिहिनियाँ, 1:30 बिहिनियाँ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 बिहिनियाँ, 2:00 बिहिनियाँ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 बिहिनियाँ, 6:00 बिहिनियाँ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 बिहिनियाँ, 10:00 बिहिनियाँ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 मंझनियाँ, 12:00 मंझनियाँ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 मंझनियाँ, 5:00 मंझनियाँ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 मंझनियाँ, 9:30 मंझनियाँ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 मंझनियाँ, 11:00 मंझनियाँ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/HrBaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HrBaTest extends LocalizationTestCase { public const LOCALE = 'hr_BA'; // Croatian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'sutra u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'u subotu u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'u nedjelju u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'u ponedjeljak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'u srijedu u 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'u četvrtak u 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'u petak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'u srijedu u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'u četvrtak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'u petak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'u subotu u 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'prošlu nedjelja u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'danas u 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'sutra u 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'jučer u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'jučer u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'prošli utorak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'prošli ponedjeljak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'prošlu nedjelja u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'prošle subote u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'prošli petak u 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'prošli četvrtak u 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'prošlu srijeda u 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'prošli petak u 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'prije 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'prije 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'prije 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'prije 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'prije 1 minutu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'prije 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'prije 2 minute', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'prije 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'prije 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'prije 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'prije 1 tjedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'prije 1 tj.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'prije 2 tjedna', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'prije 2 tj.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'prije 1 mj.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'prije 2 mj.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'prije 1 god.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'prije 2 god.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekundu poslije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. poslije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekundu prije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. prije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minutu 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 god. 3 mj. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'prije 5 mj.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'prije 2 god. 3 mj. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 tjedan 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tjedan 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tjedan 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'za 1 tjedan i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 tjedna 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d. 3 sata', ]; } ================================================ FILE: tests/Localization/HrHrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HrHrTest extends LocalizationTestCase { public const LOCALE = 'hr_HR'; // Croatian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'prošlu nedjelju u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'prošli utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'prošli ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'prošlu nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'prošli petak u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'prošli četvrtak u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'prošlu srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'prošli petak u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'prije 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'prije 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'prije 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'prije 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'prije 1 minutu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'prije 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'prije 2 minute', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'prije 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'prije 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'prije 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'prije 1 tjedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'prije 1 tj.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'prije 2 tjedna', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'prije 2 tj.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'prije 1 mj.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'prije 2 mj.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'prije 1 god.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'prije 2 god.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekundu poslije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. poslije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekundu prije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. prije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minutu 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 god. 3 mj. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'prije 5 mj.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'prije 2 god. 3 mj. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 tjedan 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tjedan 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tjedan 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'za 1 tjedan i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 tjedna 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d. 3 sata', ]; } ================================================ FILE: tests/Localization/HrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HrTest extends LocalizationTestCase { public const LOCALE = 'hr'; // Croatian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'prošlu nedjelju u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'jučer u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'jučer u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'prošli utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'prošli ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'prošlu nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'prošli petak u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'prošli četvrtak u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'prošlu srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'prošli petak u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'prije 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'prije 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'prije 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'prije 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'prije 1 minutu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'prije 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'prije 2 minute', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'prije 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'prije 1 sat', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'prije 2 sata', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'prije 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'prije 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'prije 1 tjedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'prije 1 tj.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'prije 2 tjedna', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'prije 2 tj.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'prije 1 mj.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'prije 2 mj.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'prije 1 god.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'prije 2 god.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekundu poslije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. poslije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekundu prije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. prije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minutu 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 god. 3 mj. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'prije 5 mj.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'prije 2 god. 3 mj. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 tjedan 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tjedan 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tjedan 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'za 1 tjedan i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 tjedna 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d. 3 sata', ]; } ================================================ FILE: tests/Localization/HsbDeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HsbDeTest extends LocalizationTestCase { public const LOCALE = 'hsb_DE'; // Upper Sorbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njedźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Póndźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wutora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Srjeda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Štvórtk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Pjatk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wutora at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Srjeda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Štvórtk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Pjatk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sobota at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Njedźela at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wutora at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wutora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Póndźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njedźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Pjatk at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Štvórtk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Srjeda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Pjatk at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 druhi ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 druhi ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 druhi ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 druhi ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 chwila ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 chwila ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 chwila ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 chwila ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hodźina ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 hodźina ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hodźina ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 hodźina ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dźeń ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dźeń ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dźeń ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dźeń ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tydźeń ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tydźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tydźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tydźeń ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 měsac ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 měsac ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 měsac ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 měsac ago', // Carbon::now()->subYears(1)->diffForHumans() '1 lěto ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 lěto ago', // Carbon::now()->subYears(2)->diffForHumans() '2 lěto ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 lěto ago', // Carbon::now()->addSecond()->diffForHumans() '1 druhi from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 druhi from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 druhi after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 druhi after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 druhi before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 druhi before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 druhi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 druhi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 druhi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 druhi', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 druhi from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 chwila 1 druhi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 lěto 3 měsac 1 dźeń 1 druhi', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 lěto from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 měsac ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 lěto 3 měsac 1 dźeń 1 druhi ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tydźeń 10 hodźina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźeń 6 dźeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźeń 6 dźeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tydźeń and 6 dźeń from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tydźeń 1 hodźina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 hodźina from now', // CarbonInterval::days(2)->forHumans() '2 dźeń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dźeń 3 hodźina', ]; } ================================================ FILE: tests/Localization/HsbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HsbTest extends LocalizationTestCase { public const LOCALE = 'hsb'; // Upper Sorbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njedźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Póndźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wutora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Srjeda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Štvórtk at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Pjatk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wutora at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Srjeda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Štvórtk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Pjatk at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sobota at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Njedźela at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wutora at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wutora at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Póndźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njedźela at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sobota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Pjatk at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Štvórtk at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Srjeda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Pjatk at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 druhi ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 druhi ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 druhi ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 druhi ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 chwila ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 chwila ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 chwila ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 chwila ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hodźina ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 hodźina ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hodźina ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 hodźina ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dźeń ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dźeń ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dźeń ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dźeń ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tydźeń ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tydźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tydźeń ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tydźeń ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 měsac ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 měsac ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 měsac ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 měsac ago', // Carbon::now()->subYears(1)->diffForHumans() '1 lěto ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 lěto ago', // Carbon::now()->subYears(2)->diffForHumans() '2 lěto ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 lěto ago', // Carbon::now()->addSecond()->diffForHumans() '1 druhi from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 druhi from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 druhi after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 druhi after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 druhi before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 druhi before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 druhi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 druhi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 druhi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 druhi', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 druhi from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 chwila 1 druhi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 lěto 3 měsac 1 dźeń 1 druhi', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 lěto from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 měsac ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 lěto 3 měsac 1 dźeń 1 druhi ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tydźeń 10 hodźina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźeń 6 dźeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźeń 6 dźeń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tydźeń and 6 dźeń from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tydźeń 1 hodźina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 hodźina from now', // CarbonInterval::days(2)->forHumans() '2 dźeń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dźeń 3 hodźina', ]; } ================================================ FILE: tests/Localization/HtHtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HtHtTest extends LocalizationTestCase { public const LOCALE = 'ht_HT'; // Haitian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanch at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lendi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'madi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mèkredi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jedi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'madi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mèkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samdi at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dimanch at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'madi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last madi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lendi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dimanch at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last jedi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mèkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segonn ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segonn ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segonn ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segonn ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit ago', // Carbon::now()->subHours(1)->diffForHumans() '1 lè ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 lè ago', // Carbon::now()->subHours(2)->diffForHumans() '2 lè ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 lè ago', // Carbon::now()->subDays(1)->diffForHumans() '1 jou ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 jou ago', // Carbon::now()->subDays(2)->diffForHumans() '2 jou ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 jou ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'semèn 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'semèn 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'semèn 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'semèn 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'mwa 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'mwa 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'mwa 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'mwa 2 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 lane ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 lane ago', // Carbon::now()->subYears(2)->diffForHumans() '2 lane ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 lane ago', // Carbon::now()->addSecond()->diffForHumans() '1 segonn from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segonn from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segonn after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segonn after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segonn before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segonn before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segonn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segonn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segonn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segonn', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segonn from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 segonn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 lane mwa 3 1 jou 1 segonn', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 lane from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'mwa 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 lane mwa 3 1 jou 1 segonn ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'semèn 1 10 lè', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'semèn 1 6 jou', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'semèn 1 6 jou', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'semèn 1 and 6 jou from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'semèn 2 1 lè', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 lè from now', // CarbonInterval::days(2)->forHumans() '2 jou', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 jou 3 lè', ]; } ================================================ FILE: tests/Localization/HtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HtTest extends LocalizationTestCase { public const LOCALE = 'ht'; // Haitian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimanch at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lendi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'madi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mèkredi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jedi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'madi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mèkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samdi at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dimanch at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'madi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last madi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lendi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dimanch at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last jedi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mèkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segonn ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segonn ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segonn ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segonn ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit ago', // Carbon::now()->subHours(1)->diffForHumans() '1 lè ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 lè ago', // Carbon::now()->subHours(2)->diffForHumans() '2 lè ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 lè ago', // Carbon::now()->subDays(1)->diffForHumans() '1 jou ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 jou ago', // Carbon::now()->subDays(2)->diffForHumans() '2 jou ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 jou ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'semèn 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'semèn 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'semèn 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'semèn 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'mwa 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'mwa 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'mwa 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'mwa 2 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 lane ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 lane ago', // Carbon::now()->subYears(2)->diffForHumans() '2 lane ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 lane ago', // Carbon::now()->addSecond()->diffForHumans() '1 segonn from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segonn from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segonn after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segonn after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segonn before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segonn before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segonn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segonn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segonn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segonn', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segonn from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 segonn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 lane mwa 3 1 jou 1 segonn', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 lane from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'mwa 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 lane mwa 3 1 jou 1 segonn ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'semèn 1 10 lè', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'semèn 1 6 jou', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'semèn 1 6 jou', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'semèn 1 and 6 jou from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'semèn 2 1 lè', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 lè from now', // CarbonInterval::days(2)->forHumans() '2 jou', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 jou 3 lè', ]; } ================================================ FILE: tests/Localization/HuHuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HuHuTest extends LocalizationTestCase { public const LOCALE = 'hu_HU'; // Hungarian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'holnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'szombaton 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vasárnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hétfőn 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kedden 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'szerdán 0:00-kor', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'csütörtökön 0:00-kor', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pénteken 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kedden 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'szerdán 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'csütörtökön 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pénteken 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'szombaton 0:00-kor', // Carbon::now()->subDays(2)->calendar() 'múlt vasárnap 20:49-kor', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tegnap 22:00-kor', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ma 10:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ma 2:00-kor', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'holnap 1:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kedden 0:00-kor', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'tegnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tegnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt kedden 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt hétfőn 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt vasárnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt szombaton 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt pénteken 0:00-kor', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'múlt csütörtökön 0:00-kor', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'múlt szerdán 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'múlt pénteken 0:00-kor', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 de CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 DE, 12:00 de', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 DE, 1:30 de', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 DE, 2:00 de', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 DE, 6:00 de', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 DE, 10:00 de', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 DU, 12:00 du', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 DU, 5:00 du', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 DU, 9:30 du', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 DU, 11:00 du', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 másodperce', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 másodperce', // Carbon::now()->subSeconds(2)->diffForHumans() '2 másodperce', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 másodperce', // Carbon::now()->subMinutes(1)->diffForHumans() '1 perce', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 perce', // Carbon::now()->subMinutes(2)->diffForHumans() '2 perce', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 perce', // Carbon::now()->subHours(1)->diffForHumans() '1 órája', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 órája', // Carbon::now()->subHours(2)->diffForHumans() '2 órája', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 órája', // Carbon::now()->subDays(1)->diffForHumans() '1 napja', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 napja', // Carbon::now()->subDays(2)->diffForHumans() '2 napja', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 napja', // Carbon::now()->subWeeks(1)->diffForHumans() '1 hete', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 hete', // Carbon::now()->subWeeks(2)->diffForHumans() '2 hete', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 hete', // Carbon::now()->subMonths(1)->diffForHumans() '1 hónapja', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 hónapja', // Carbon::now()->subMonths(2)->diffForHumans() '2 hónapja', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 hónapja', // Carbon::now()->subYears(1)->diffForHumans() '1 éve', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 éve', // Carbon::now()->subYears(2)->diffForHumans() '2 éve', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 éve', // Carbon::now()->addSecond()->diffForHumans() '1 másodperc múlva', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 másodperc múlva', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 másodperccel később', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 másodperccel később', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 másodperccel korábban', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 másodperccel korábban', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 másodperc', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 másodperc', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 másodperc', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 másodperc', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 másodperc múlva', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 perc 1 másodperc', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 év 3 hónap 1 nap 1 másodperc', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 év múlva', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 hónapja', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 éve 3 hónapja 1 napja 1 másodperce', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 hét 10 óra', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hét 6 nap', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hét 6 nap', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 hét és 6 nap múlva', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 hét 1 óra', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 óra múlva', // CarbonInterval::days(2)->forHumans() '2 nap', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 nap 3 óra', ]; } ================================================ FILE: tests/Localization/HuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HuTest extends LocalizationTestCase { public const LOCALE = 'hu'; // Hungarian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'holnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'szombaton 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vasárnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hétfőn 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kedden 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'szerdán 0:00-kor', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'csütörtökön 0:00-kor', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pénteken 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kedden 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'szerdán 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'csütörtökön 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pénteken 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'szombaton 0:00-kor', // Carbon::now()->subDays(2)->calendar() 'múlt vasárnap 20:49-kor', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tegnap 22:00-kor', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ma 10:00-kor', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ma 2:00-kor', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'holnap 1:00-kor', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kedden 0:00-kor', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'tegnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tegnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt kedden 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt hétfőn 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt vasárnap 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt szombaton 0:00-kor', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'múlt pénteken 0:00-kor', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'múlt csütörtökön 0:00-kor', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'múlt szerdán 0:00-kor', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'múlt pénteken 0:00-kor', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 de CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 DE, 12:00 de', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 DE, 1:30 de', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 DE, 2:00 de', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 DE, 6:00 de', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 DE, 10:00 de', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 DU, 12:00 du', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 DU, 5:00 du', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 DU, 9:30 du', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 DU, 11:00 du', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 másodperce', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 másodperce', // Carbon::now()->subSeconds(2)->diffForHumans() '2 másodperce', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 másodperce', // Carbon::now()->subMinutes(1)->diffForHumans() '1 perce', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 perce', // Carbon::now()->subMinutes(2)->diffForHumans() '2 perce', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 perce', // Carbon::now()->subHours(1)->diffForHumans() '1 órája', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 órája', // Carbon::now()->subHours(2)->diffForHumans() '2 órája', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 órája', // Carbon::now()->subDays(1)->diffForHumans() '1 napja', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 napja', // Carbon::now()->subDays(2)->diffForHumans() '2 napja', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 napja', // Carbon::now()->subWeeks(1)->diffForHumans() '1 hete', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 hete', // Carbon::now()->subWeeks(2)->diffForHumans() '2 hete', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 hete', // Carbon::now()->subMonths(1)->diffForHumans() '1 hónapja', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 hónapja', // Carbon::now()->subMonths(2)->diffForHumans() '2 hónapja', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 hónapja', // Carbon::now()->subYears(1)->diffForHumans() '1 éve', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 éve', // Carbon::now()->subYears(2)->diffForHumans() '2 éve', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 éve', // Carbon::now()->addSecond()->diffForHumans() '1 másodperc múlva', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 másodperc múlva', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 másodperccel később', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 másodperccel később', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 másodperccel korábban', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 másodperccel korábban', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 másodperc', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 másodperc', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 másodperc', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 másodperc', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 másodperc múlva', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 perc 1 másodperc', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 év 3 hónap 1 nap 1 másodperc', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 év múlva', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 hónapja', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 éve 3 hónapja 1 napja 1 másodperce', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 hét 10 óra', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hét 6 nap', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hét 6 nap', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 hét és 6 nap múlva', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 hét 1 óra', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 óra múlva', // CarbonInterval::days(2)->forHumans() '2 nap', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 nap 3 óra', ]; } ================================================ FILE: tests/Localization/HyAmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HyAmTest extends LocalizationTestCase { public const LOCALE = 'hy_AM'; // Armenian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'վաղը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'շաբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'կիրակի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'երկուշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'չորեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'հինգշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'չորեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'հինգշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'շաբաթ օրը ժամը 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'անցած կիրակի օրը ժամը 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'երեկ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'այսօր 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'այսօր 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'վաղը 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'երեկ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'երեկ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'անցած երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'անցած երկուշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'անցած կիրակի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'անցած շաբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'անցած ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'անցած հինգշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'անցած չորեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'անցած ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1-ին 1-ին', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1-ին', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1-ին', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1-ին', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1-ին', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1-ին', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1-ին', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2-րդ', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40-րդ', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-րդ', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-րդ', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 գիշերվա CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 գիշերվա, 12:00 գիշերվա', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 գիշերվա, 1:30 գիշերվա', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 գիշերվա, 2:00 գիշերվա', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 առավոտվա, 6:00 առավոտվա', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 առավոտվա, 10:00 առավոտվա', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ցերեկվա, 12:00 ցերեկվա', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 երեկոյան, 5:00 երեկոյան', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 երեկոյան, 9:30 երեկոյան', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 երեկոյան, 11:00 երեկոյան', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 վայրկյան առաջ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1վրկ առաջ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 վայրկյան առաջ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2վրկ առաջ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 րոպե առաջ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1ր առաջ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 րոպե առաջ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2ր առաջ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 ժամ առաջ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1ժ առաջ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 ժամ առաջ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2ժ առաջ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 օր առաջ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1օր առաջ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 օր առաջ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2օր առաջ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 շաբաթ առաջ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1շ առաջ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 շաբաթ առաջ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2շ առաջ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ամիս առաջ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1ամ առաջ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ամիս առաջ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2ամ առաջ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 տարի առաջ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1տ առաջ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 տարի առաջ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2տ առաջ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 վայրկյան հետո', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1վրկ հետո', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 վայրկյան հետո', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1վրկ հետո', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 վայրկյան առաջ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1վրկ առաջ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 վայրկյան', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1վրկ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 վայրկյան', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2վրկ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1վրկ հետո', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 րոպե 1 վայրկյան', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2տ 3ամ 1օր 1վրկ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 տարի հետո', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5ամ առաջ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2տ 3ամ 1օր 1վրկ առաջ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 շաբաթ 10 ժամ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 շաբաթ 6 օր', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 շաբաթ 6 օր', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 շաբաթ եւ 6 օր հետո', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 շաբաթ 1 ժամ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'ժամ հետո', // CarbonInterval::days(2)->forHumans() // '2 days' '2 օր', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1օր 3ժ', ]; } ================================================ FILE: tests/Localization/HyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class HyTest extends LocalizationTestCase { public const LOCALE = 'hy'; // Armenian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'վաղը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'շաբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'կիրակի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'երկուշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'չորեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'հինգշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'չորեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'հինգշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'շաբաթ օրը ժամը 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'անցած կիրակի օրը ժամը 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'երեկ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'այսօր 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'այսօր 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'վաղը 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'երեկ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'երեկ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'անցած երեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'անցած երկուշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'անցած կիրակի օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'անցած շաբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'անցած ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'անցած հինգշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'անցած չորեքշաբթի օրը ժամը 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'անցած ուրբաթ օրը ժամը 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1-ին 1-ին', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1-ին', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1-ին', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1-ին', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1-ին', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1-ին', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1-ին', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2-րդ', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40-րդ', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-րդ', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-րդ', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 գիշերվա CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 գիշերվա, 12:00 գիշերվա', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 գիշերվա, 1:30 գիշերվա', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 գիշերվա, 2:00 գիշերվա', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 առավոտվա, 6:00 առավոտվա', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 առավոտվա, 10:00 առավոտվա', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ցերեկվա, 12:00 ցերեկվա', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 երեկոյան, 5:00 երեկոյան', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 երեկոյան, 9:30 երեկոյան', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 երեկոյան, 11:00 երեկոյան', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 վայրկյան առաջ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1վրկ առաջ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 վայրկյան առաջ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2վրկ առաջ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 րոպե առաջ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1ր առաջ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 րոպե առաջ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2ր առաջ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 ժամ առաջ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1ժ առաջ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 ժամ առաջ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2ժ առաջ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 օր առաջ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1օր առաջ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 օր առաջ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2օր առաջ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 շաբաթ առաջ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1շ առաջ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 շաբաթ առաջ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2շ առաջ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ամիս առաջ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1ամ առաջ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ամիս առաջ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2ամ առաջ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 տարի առաջ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1տ առաջ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 տարի առաջ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2տ առաջ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 վայրկյանից', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1վրկից', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 վայրկյան հետո', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1վրկ հետո', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 վայրկյան առաջ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1վրկ առաջ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 վայրկյան', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1վրկ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 վայրկյան', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2վրկ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1վրկից', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 րոպե 1 վայրկյան', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2տ 3ամ 1օր 1վրկ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 տարիից', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5ամ առաջ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2տ 3ամ 1օր 1վրկ առաջ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 շաբաթ 10 ժամ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 շաբաթ 6 օր', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 շաբաթ 6 օր', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 շաբաթ եւ 6 օրից', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 շաբաթ 1 ժամ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'ժամից', // CarbonInterval::days(2)->forHumans() // '2 days' '2 օր', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1օր 3ժ', ]; } ================================================ FILE: tests/Localization/I18nTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class I18nTest extends LocalizationTestCase { public const LOCALE = 'i18n'; // i18n public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '7 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '1 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '2 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '3 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '4 at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '5 at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '6 at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '3 at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '4 at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '5 at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '6 at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '7 at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last 1 at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '3 at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 3 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 2 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 1 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 7 at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 6 at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 5 at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 4 at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 6 at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/IaFrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IaFrTest extends LocalizationTestCase { public const LOCALE = 'ia_FR'; // Interlingua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabbato at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dominica at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercuridi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jovedi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercuridi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jovedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabbato at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dominica at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dominica at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabbato at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last venerdi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last jovedi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mercuridi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last venerdi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secunda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 secunda ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secunda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 secunda ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuscule ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuscule ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuscule ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuscule ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hora ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 hora ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hora ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 hora ago', // Carbon::now()->subDays(1)->diffForHumans() '1 die ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 die ago', // Carbon::now()->subDays(2)->diffForHumans() '2 die ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 die ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 septimana ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 septimana ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 septimana ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 septimana ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mense ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mense ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mense ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mense ago', // Carbon::now()->subYears(1)->diffForHumans() 'anno 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'anno 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'anno 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'anno 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 secunda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 secunda from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secunda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 secunda after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secunda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 secunda before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 secunda from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuscule 1 secunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'anno 2 3 mense 1 die 1 secunda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'anno 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mense ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'anno 2 3 mense 1 die 1 secunda ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 septimana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 septimana 6 die', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 septimana 6 die', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 septimana and 6 die from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 septimana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 hora from now', // CarbonInterval::days(2)->forHumans() '2 die', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 die 3 hora', ]; } ================================================ FILE: tests/Localization/IaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IaTest extends LocalizationTestCase { public const LOCALE = 'ia'; // Interlingua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabbato at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dominica at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercuridi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jovedi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercuridi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jovedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabbato at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dominica at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dominica at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabbato at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last venerdi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last jovedi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mercuridi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last venerdi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secunda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 secunda ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secunda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 secunda ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuscule ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuscule ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuscule ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuscule ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hora ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 hora ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hora ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 hora ago', // Carbon::now()->subDays(1)->diffForHumans() '1 die ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 die ago', // Carbon::now()->subDays(2)->diffForHumans() '2 die ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 die ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 septimana ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 septimana ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 septimana ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 septimana ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mense ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mense ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mense ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mense ago', // Carbon::now()->subYears(1)->diffForHumans() 'anno 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'anno 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'anno 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'anno 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 secunda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 secunda from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secunda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 secunda after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secunda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 secunda before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secunda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 secunda from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuscule 1 secunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'anno 2 3 mense 1 die 1 secunda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'anno 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mense ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'anno 2 3 mense 1 die 1 secunda ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 septimana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 septimana 6 die', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 septimana 6 die', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 septimana and 6 die from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 septimana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 hora from now', // CarbonInterval::days(2)->forHumans() '2 die', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 die 3 hora', ]; } ================================================ FILE: tests/Localization/IdIdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IdIdTest extends LocalizationTestCase { public const LOCALE = 'id_ID'; // Indonesian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Besok pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamis pukul 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamis pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 00.00', // Carbon::now()->subDays(2)->calendar() 'Minggu lalu pukul 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kemarin pukul 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Besok pukul 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kemarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kemarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senin lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumat lalu pukul 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Kamis lalu pukul 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lalu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumat lalu pukul 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pagi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 pagi, 12:00 pagi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 pagi, 1:30 pagi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 pagi, 2:00 pagi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 pagi, 6:00 pagi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 pagi, 10:00 pagi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 siang, 12:00 siang', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 sore, 5:00 sore', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 malam, 9:30 malam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 malam, 11:00 malam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 detik yang lalu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1dt yang lalu', // Carbon::now()->subSeconds(2)->diffForHumans() '2 detik yang lalu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2dt yang lalu', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menit yang lalu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1mnt yang lalu', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menit yang lalu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2mnt yang lalu', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lalu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1j yang lalu', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lalu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2j yang lalu', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lalu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1hr yang lalu', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lalu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2hr yang lalu', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lalu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1mgg yang lalu', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lalu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2mgg yang lalu', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lalu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1bln yang lalu', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lalu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2bln yang lalu', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lalu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1thn yang lalu', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lalu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2thn yang lalu', // Carbon::now()->addSecond()->diffForHumans() '1 detik dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1dt dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 detik setelahnya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1dt setelahnya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 detik sebelumnya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1dt sebelumnya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 detik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1dt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 detik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2dt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1dt dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menit 1 detik', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2thn 3bln 1hr 1dt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5bln yang lalu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2thn 3bln 1hr 1dt yang lalu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1hr 3j', ]; } ================================================ FILE: tests/Localization/IdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IdTest extends LocalizationTestCase { public const LOCALE = 'id'; // Indonesian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Besok pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamis pukul 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamis pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 00.00', // Carbon::now()->subDays(2)->calendar() 'Minggu lalu pukul 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kemarin pukul 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Besok pukul 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kemarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kemarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senin lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumat lalu pukul 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Kamis lalu pukul 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lalu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumat lalu pukul 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pagi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 pagi, 12:00 pagi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 pagi, 1:30 pagi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 pagi, 2:00 pagi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 pagi, 6:00 pagi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 pagi, 10:00 pagi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 siang, 12:00 siang', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 sore, 5:00 sore', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 malam, 9:30 malam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 malam, 11:00 malam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 detik yang lalu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1dt yang lalu', // Carbon::now()->subSeconds(2)->diffForHumans() '2 detik yang lalu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2dt yang lalu', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menit yang lalu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1mnt yang lalu', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menit yang lalu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2mnt yang lalu', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lalu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1j yang lalu', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lalu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2j yang lalu', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lalu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1hr yang lalu', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lalu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2hr yang lalu', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lalu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1mgg yang lalu', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lalu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2mgg yang lalu', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lalu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1bln yang lalu', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lalu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2bln yang lalu', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lalu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1thn yang lalu', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lalu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2thn yang lalu', // Carbon::now()->addSecond()->diffForHumans() '1 detik dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1dt dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 detik setelahnya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1dt setelahnya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 detik sebelumnya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1dt sebelumnya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 detik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1dt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 detik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2dt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1dt dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menit 1 detik', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2thn 3bln 1hr 1dt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5bln yang lalu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2thn 3bln 1hr 1dt yang lalu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1hr 3j', ]; } ================================================ FILE: tests/Localization/IgNgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IgNgTest extends LocalizationTestCase { public const LOCALE = 'ig_NG'; // Igbo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'satọde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tuzde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wenzde at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tọsde at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fraịde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tuzde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wenzde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tọsde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fraịde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'satọde at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last sọnde at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tuzde at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tuzde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last satọde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last fraịde at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tọsde at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last wenzde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last fraịde at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sekọnd 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sekọnd 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sekọnd 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sekọnd 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minit 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minit 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minit 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minit 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'awa 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'awa 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'awa 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'awa 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ụbọchị 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ụbọchị 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ụbọchị 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ụbọchị 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'izu 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'izu 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'izu 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'izu 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'önwa 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'önwa 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'önwa 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'önwa 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'afo 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'afo 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'afo 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'afo 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sekọnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sekọnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekọnd 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sekọnd 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekọnd 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sekọnd 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekọnd 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sekọnd 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekọnd 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sekọnd 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sekọnd 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minit 1 sekọnd 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'afo 2 önwa 3 ụbọchị 1 sekọnd 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'afo 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'önwa 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'afo 2 önwa 3 ụbọchị 1 sekọnd 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'izu 1 awa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'izu 1 ụbọchị 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'izu 1 ụbọchị 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'izu 1 and ụbọchị 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'izu 2 awa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'awa 1 from now', // CarbonInterval::days(2)->forHumans() 'ụbọchị 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ụbọchị 1 awa 3', ]; } ================================================ FILE: tests/Localization/IgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IgTest extends LocalizationTestCase { public const LOCALE = 'ig'; // Igbo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'satọde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tuzde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wenzde at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tọsde at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fraịde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tuzde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wenzde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tọsde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fraịde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'satọde at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last sọnde at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tuzde at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tuzde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sọnde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last satọde at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last fraịde at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tọsde at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last wenzde at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last fraịde at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sekọnd 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sekọnd 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sekọnd 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sekọnd 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minit 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minit 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minit 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minit 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'awa 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'awa 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'awa 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'awa 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ụbọchị 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ụbọchị 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ụbọchị 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ụbọchị 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'izu 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'izu 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'izu 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'izu 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'önwa 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'önwa 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'önwa 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'önwa 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'afo 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'afo 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'afo 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'afo 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sekọnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sekọnd 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekọnd 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sekọnd 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekọnd 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sekọnd 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekọnd 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sekọnd 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekọnd 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sekọnd 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sekọnd 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minit 1 sekọnd 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'afo 2 önwa 3 ụbọchị 1 sekọnd 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'afo 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'önwa 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'afo 2 önwa 3 ụbọchị 1 sekọnd 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'izu 1 awa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'izu 1 ụbọchị 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'izu 1 ụbọchị 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'izu 1 and ụbọchị 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'izu 2 awa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'awa 1 from now', // CarbonInterval::days(2)->forHumans() 'ụbọchị 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ụbọchị 1 awa 3', ]; } ================================================ FILE: tests/Localization/IiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IiTest extends LocalizationTestCase { public const LOCALE = 'ii'; // SichuanYi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꆏꊂꃘ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꑭꆏꑍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꆏꊂꋍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꆏꊂꑍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꆏꊂꌕ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ꆏꊂꇖ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ꆏꊂꉬ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꆏꊂꑍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꆏꊂꌕ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꆏꊂꇖ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꆏꊂꉬ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꆏꊂꃘ at 12:00 ꎸꄑ', // Carbon::now()->subDays(2)->calendar() 'Last ꑭꆏꑍ at 8:49 ꁯꋒ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ꁯꋒ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ꎸꄑ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꆏꊂꑍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꆏꊂꑍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꆏꊂꋍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꑭꆏꑍ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꆏꊂꃘ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꆏꊂꉬ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ꆏꊂꇖ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ꆏꊂꌕ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ꆏꊂꉬ at 12:00 ꎸꄑ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ꎸꄑ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ꎸꄑ, 12:00 ꎸꄑ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ꎸꄑ, 1:30 ꎸꄑ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ꎸꄑ, 2:00 ꎸꄑ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ꎸꄑ, 6:00 ꎸꄑ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ꎸꄑ, 10:00 ꎸꄑ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ꁯꋒ, 12:00 ꁯꋒ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ꁯꋒ, 5:00 ꁯꋒ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ꁯꋒ, 9:30 ꁯꋒ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ꁯꋒ, 11:00 ꁯꋒ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ꇅ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ꇅ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ꇅ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ꇅ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ꀄꊭ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ꀄꊭ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ꀄꊭ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ꀄꊭ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ꄮꈉ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ꄮꈉ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ꄮꈉ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ꄮꈉ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ꏜ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ꏜ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ꏜ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ꏜ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ꏃ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ꏃ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ꏃ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ꏃ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ꆪ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ꆪ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ꆪ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ꆪ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ꒉ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ꒉ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ꒉ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ꒉ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ꇅ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ꇅ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ꇅ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ꇅ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ꇅ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ꇅ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ꇅ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ꇅ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ꇅ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ꇅ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ꇅ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ꀄꊭ 1 ꇅ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ꒉ 3 ꆪ 1 ꏜ 1 ꇅ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ꒉ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ꆪ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ꒉ 3 ꆪ 1 ꏜ 1 ꇅ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ꏃ 10 ꄮꈉ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ꏃ 6 ꏜ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ꏃ 6 ꏜ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ꏃ and 6 ꏜ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ꏃ 1 ꄮꈉ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ꄮꈉ from now', // CarbonInterval::days(2)->forHumans() '2 ꏜ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ꏜ 3 ꄮꈉ', ]; } ================================================ FILE: tests/Localization/IkCaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IkCaTest extends LocalizationTestCase { public const LOCALE = 'ik_CA'; // Inupiaq public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maqinġuoiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minġuiqsioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Savałłiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qitchiioiq at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Sisamiioiq at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qitchiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sisamiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maqinġuoiq at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Minġuiqsioiq at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Savałłiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Minġuiqsioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Maqinġuoiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Sisamiioiq at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Qitchiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 iġñiq ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 iġñiq ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 iġñiq ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 iġñiq ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 Siḷa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 Siḷa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 Siḷa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 Siḷa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 siqiñiq ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 siqiñiq ago', // Carbon::now()->subDays(2)->diffForHumans() '2 siqiñiq ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 siqiñiq ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tatqiat ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tatqiat ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tatqiat ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tatqiat ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Tatqiat ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Tatqiat ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Tatqiat ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Tatqiat ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ukiuq ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ukiuq ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ukiuq ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ukiuq ago', // Carbon::now()->addSecond()->diffForHumans() '1 iġñiq from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 iġñiq from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 iġñiq after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 iġñiq after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 iġñiq before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 iġñiq before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 iġñiq', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 iġñiq', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 iġñiq', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 iġñiq', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 iġñiq from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 iġñiq', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ukiuq 3 Tatqiat 1 siqiñiq 1 iġñiq', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ukiuq from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Tatqiat ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ukiuq 3 Tatqiat 1 siqiñiq 1 iġñiq ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tatqiat 10 Siḷa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tatqiat 6 siqiñiq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tatqiat 6 siqiñiq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tatqiat and 6 siqiñiq from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tatqiat 1 Siḷa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 Siḷa from now', // CarbonInterval::days(2)->forHumans() '2 siqiñiq', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 siqiñiq 3 Siḷa', ]; } ================================================ FILE: tests/Localization/IkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IkTest extends LocalizationTestCase { public const LOCALE = 'ik'; // Inupiaq public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maqinġuoiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minġuiqsioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Savałłiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qitchiioiq at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Sisamiioiq at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qitchiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sisamiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maqinġuoiq at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Minġuiqsioiq at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ilaqtchiioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Savałłiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Minġuiqsioiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Maqinġuoiq at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Sisamiioiq at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Qitchiioiq at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Tallimmiioiq at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 iġñiq ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 iġñiq ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 iġñiq ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 iġñiq ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 Siḷa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 Siḷa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 Siḷa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 Siḷa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 siqiñiq ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 siqiñiq ago', // Carbon::now()->subDays(2)->diffForHumans() '2 siqiñiq ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 siqiñiq ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tatqiat ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tatqiat ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tatqiat ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tatqiat ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Tatqiat ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Tatqiat ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Tatqiat ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Tatqiat ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ukiuq ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ukiuq ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ukiuq ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ukiuq ago', // Carbon::now()->addSecond()->diffForHumans() '1 iġñiq from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 iġñiq from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 iġñiq after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 iġñiq after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 iġñiq before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 iġñiq before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 iġñiq', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 iġñiq', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 iġñiq', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 iġñiq', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 iġñiq from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 iġñiq', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ukiuq 3 Tatqiat 1 siqiñiq 1 iġñiq', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ukiuq from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Tatqiat ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ukiuq 3 Tatqiat 1 siqiñiq 1 iġñiq ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tatqiat 10 Siḷa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tatqiat 6 siqiñiq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tatqiat 6 siqiñiq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tatqiat and 6 siqiñiq from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tatqiat 1 Siḷa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 Siḷa from now', // CarbonInterval::days(2)->forHumans() '2 siqiñiq', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 siqiñiq 3 Siḷa', ]; } ================================================ FILE: tests/Localization/InTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class InTest extends LocalizationTestCase { public const LOCALE = 'in'; // in public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Besok pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamis pukul 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamis pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 00.00', // Carbon::now()->subDays(2)->calendar() 'Minggu lalu pukul 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kemarin pukul 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Besok pukul 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kemarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kemarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senin lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lalu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumat lalu pukul 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Kamis lalu pukul 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lalu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumat lalu pukul 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pagi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 pagi, 12:00 pagi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 pagi, 1:30 pagi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 pagi, 2:00 pagi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 pagi, 6:00 pagi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 pagi, 10:00 pagi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 siang, 12:00 siang', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 sore, 5:00 sore', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 malam, 9:30 malam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 malam, 11:00 malam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 detik yang lalu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1dt yang lalu', // Carbon::now()->subSeconds(2)->diffForHumans() '2 detik yang lalu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2dt yang lalu', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menit yang lalu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1mnt yang lalu', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menit yang lalu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2mnt yang lalu', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lalu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1j yang lalu', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lalu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2j yang lalu', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lalu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1hr yang lalu', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lalu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2hr yang lalu', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lalu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1mgg yang lalu', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lalu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2mgg yang lalu', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lalu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1bln yang lalu', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lalu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2bln yang lalu', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lalu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1thn yang lalu', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lalu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2thn yang lalu', // Carbon::now()->addSecond()->diffForHumans() '1 detik dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1dt dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 detik setelahnya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1dt setelahnya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 detik sebelumnya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1dt sebelumnya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 detik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1dt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 detik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2dt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1dt dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menit 1 detik', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2thn 3bln 1hr 1dt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5bln yang lalu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2thn 3bln 1hr 1dt yang lalu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1hr 3j', ]; } ================================================ FILE: tests/Localization/IsIsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IsIsTest extends LocalizationTestCase { public const LOCALE = 'is_IS'; // Icelandic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'laugardaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mánudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'þriðjudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miðvikudaginn at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'fimmtudaginn at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'föstudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'þriðjudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miðvikudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fimmtudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'föstudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'laugardaginn at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sunnudaginn at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'þriðjudaginn at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last þriðjudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mánudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sunnudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last laugardaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last föstudaginn at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last fimmtudaginn at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last miðvikudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last föstudaginn at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 fh CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 fh, 12:00 fh', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 fh, 1:30 fh', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 fh, 2:00 fh', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 fh, 6:00 fh', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 fh, 10:00 fh', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 eh, 12:00 eh', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 eh, 5:00 eh', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 eh, 9:30 eh', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 eh, 11:00 eh', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekúnda síðan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekúnda síðan', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekúndur síðan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekúndur síðan', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mínúta síðan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mínúta síðan', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mínútur síðan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mínútur síðan', // Carbon::now()->subHours(1)->diffForHumans() '1 klukkutími síðan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 klukkutími síðan', // Carbon::now()->subHours(2)->diffForHumans() '2 klukkutímar síðan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 klukkutímar síðan', // Carbon::now()->subDays(1)->diffForHumans() '1 dagur síðan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dagur síðan', // Carbon::now()->subDays(2)->diffForHumans() '2 dagar síðan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dagar síðan', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vika síðan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vika síðan', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vikur síðan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vikur síðan', // Carbon::now()->subMonths(1)->diffForHumans() '1 mánuður síðan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mánuður síðan', // Carbon::now()->subMonths(2)->diffForHumans() '2 mánuðir síðan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mánuðir síðan', // Carbon::now()->subYears(1)->diffForHumans() '1 ár síðan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ár síðan', // Carbon::now()->subYears(2)->diffForHumans() '2 ár síðan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ár síðan', // Carbon::now()->addSecond()->diffForHumans() '1 sekúnda síðan', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekúnda síðan', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekúnda eftir', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekúnda eftir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekúnda fyrir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekúnda fyrir', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekúnda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekúnda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekúndur', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekúndur', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekúnda síðan', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mínúta 1 sekúnda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ár 3 mánuðir 1 dagur 1 sekúnda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ár síðan', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mánuðir síðan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ár 3 mánuðir 1 dagur 1 sekúnda síðan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vika 10 klukkutímar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vika og 6 dagar síðan', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vikur 1 klukkutími', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 klukkutími síðan', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dagur 3 klukkutímar', ]; } ================================================ FILE: tests/Localization/IsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IsTest extends LocalizationTestCase { public const LOCALE = 'is'; // Icelandic public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'laugardaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sunnudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mánudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'þriðjudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miðvikudaginn at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'fimmtudaginn at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'föstudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'þriðjudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miðvikudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fimmtudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'föstudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'laugardaginn at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sunnudaginn at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'þriðjudaginn at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last þriðjudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mánudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sunnudaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last laugardaginn at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last föstudaginn at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last fimmtudaginn at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last miðvikudaginn at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last föstudaginn at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 fh CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 fh, 12:00 fh', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 fh, 1:30 fh', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 fh, 2:00 fh', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 fh, 6:00 fh', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 fh, 10:00 fh', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 eh, 12:00 eh', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 eh, 5:00 eh', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 eh, 9:30 eh', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 eh, 11:00 eh', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekúnda síðan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekúnda síðan', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekúndur síðan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekúndur síðan', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mínúta síðan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mínúta síðan', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mínútur síðan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mínútur síðan', // Carbon::now()->subHours(1)->diffForHumans() '1 klukkutími síðan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 klukkutími síðan', // Carbon::now()->subHours(2)->diffForHumans() '2 klukkutímar síðan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 klukkutímar síðan', // Carbon::now()->subDays(1)->diffForHumans() '1 dagur síðan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dagur síðan', // Carbon::now()->subDays(2)->diffForHumans() '2 dagar síðan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dagar síðan', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vika síðan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vika síðan', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vikur síðan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vikur síðan', // Carbon::now()->subMonths(1)->diffForHumans() '1 mánuður síðan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mánuður síðan', // Carbon::now()->subMonths(2)->diffForHumans() '2 mánuðir síðan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mánuðir síðan', // Carbon::now()->subYears(1)->diffForHumans() '1 ár síðan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ár síðan', // Carbon::now()->subYears(2)->diffForHumans() '2 ár síðan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ár síðan', // Carbon::now()->addSecond()->diffForHumans() '1 sekúnda síðan', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekúnda síðan', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekúnda eftir', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekúnda eftir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekúnda fyrir', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekúnda fyrir', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekúnda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekúnda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekúndur', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekúndur', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekúnda síðan', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mínúta 1 sekúnda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ár 3 mánuðir 1 dagur 1 sekúnda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ár síðan', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mánuðir síðan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ár 3 mánuðir 1 dagur 1 sekúnda síðan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vika 10 klukkutímar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vika 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vika og 6 dagar síðan', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vikur 1 klukkutími', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 klukkutími síðan', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dagur 3 klukkutímar', ]; } ================================================ FILE: tests/Localization/ItChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ItChTest extends LocalizationTestCase { public const LOCALE = 'it_CH'; // Italian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domani alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabato alle 00:00', // Carbon::now()->subDays(2)->calendar() 'la scorsa domenica alle 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Oggi alle 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Oggi alle 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Domani alle 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'la scorsa domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'lo scorso giovedì alle 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'lo scorso mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secondo fa', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. fa', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secondi fa', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. fa', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto fa', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. fa', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti fa', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. fa', // Carbon::now()->subHours(1)->diffForHumans() '1 ora fa', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 h fa', // Carbon::now()->subHours(2)->diffForHumans() '2 ore fa', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 h fa', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno fa', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 g fa', // Carbon::now()->subDays(2)->diffForHumans() '2 giorni fa', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gg fa', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settimana fa', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 set. fa', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settimane fa', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 set. fa', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese fa', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese fa', // Carbon::now()->subMonths(2)->diffForHumans() '2 mesi fa', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mesi fa', // Carbon::now()->subYears(1)->diffForHumans() '1 anno fa', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anno fa', // Carbon::now()->subYears(2)->diffForHumans() '2 anni fa', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anni fa', // Carbon::now()->addSecond()->diffForHumans() 'tra 1 secondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tra 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secondo dopo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sec. dopo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secondo prima', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sec. prima', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tra 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 secondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anni 3 mesi 1 g 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'tra 3 anni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mesi fa', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anni 3 mesi 1 g 1 sec. fa', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settimana 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'tra 1 settimana e 6 giorni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settimane 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in un\'ora', // CarbonInterval::days(2)->forHumans() '2 giorni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 g 3 h', ]; } ================================================ FILE: tests/Localization/ItItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ItItTest extends LocalizationTestCase { public const LOCALE = 'it_IT'; // Italian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domani alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabato alle 00:00', // Carbon::now()->subDays(2)->calendar() 'la scorsa domenica alle 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Oggi alle 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Oggi alle 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Domani alle 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'la scorsa domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'lo scorso giovedì alle 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'lo scorso mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secondo fa', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. fa', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secondi fa', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. fa', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto fa', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. fa', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti fa', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. fa', // Carbon::now()->subHours(1)->diffForHumans() '1 ora fa', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 h fa', // Carbon::now()->subHours(2)->diffForHumans() '2 ore fa', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 h fa', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno fa', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 g fa', // Carbon::now()->subDays(2)->diffForHumans() '2 giorni fa', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gg fa', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settimana fa', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 set. fa', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settimane fa', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 set. fa', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese fa', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese fa', // Carbon::now()->subMonths(2)->diffForHumans() '2 mesi fa', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mesi fa', // Carbon::now()->subYears(1)->diffForHumans() '1 anno fa', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anno fa', // Carbon::now()->subYears(2)->diffForHumans() '2 anni fa', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anni fa', // Carbon::now()->addSecond()->diffForHumans() 'tra 1 secondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tra 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secondo dopo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sec. dopo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secondo prima', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sec. prima', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tra 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 secondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anni 3 mesi 1 g 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'tra 3 anni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mesi fa', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anni 3 mesi 1 g 1 sec. fa', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settimana 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'tra 1 settimana e 6 giorni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settimane 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in un\'ora', // CarbonInterval::days(2)->forHumans() '2 giorni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 g 3 h', ]; } ================================================ FILE: tests/Localization/ItSmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ItSmTest extends LocalizationTestCase { public const LOCALE = 'it_SM'; // Italian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domani alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabato alle 00:00', // Carbon::now()->subDays(2)->calendar() 'la scorsa domenica alle 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Oggi alle 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Oggi alle 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Domani alle 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'la scorsa domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'lo scorso giovedì alle 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'lo scorso mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secondo fa', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. fa', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secondi fa', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. fa', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto fa', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. fa', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti fa', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. fa', // Carbon::now()->subHours(1)->diffForHumans() '1 ora fa', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 h fa', // Carbon::now()->subHours(2)->diffForHumans() '2 ore fa', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 h fa', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno fa', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 g fa', // Carbon::now()->subDays(2)->diffForHumans() '2 giorni fa', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gg fa', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settimana fa', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 set. fa', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settimane fa', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 set. fa', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese fa', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese fa', // Carbon::now()->subMonths(2)->diffForHumans() '2 mesi fa', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mesi fa', // Carbon::now()->subYears(1)->diffForHumans() '1 anno fa', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anno fa', // Carbon::now()->subYears(2)->diffForHumans() '2 anni fa', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anni fa', // Carbon::now()->addSecond()->diffForHumans() 'tra 1 secondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tra 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secondo dopo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sec. dopo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secondo prima', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sec. prima', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tra 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 secondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anni 3 mesi 1 g 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'tra 3 anni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mesi fa', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anni 3 mesi 1 g 1 sec. fa', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settimana 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'tra 1 settimana e 6 giorni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settimane 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in un\'ora', // CarbonInterval::days(2)->forHumans() '2 giorni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 g 3 h', ]; } ================================================ FILE: tests/Localization/ItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ItTest extends LocalizationTestCase { public const LOCALE = 'it'; // Italian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domani alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabato alle 00:00', // Carbon::now()->subDays(2)->calendar() 'la scorsa domenica alle 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Oggi alle 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Oggi alle 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Domani alle 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'la scorsa domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'lo scorso giovedì alle 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'lo scorso mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secondo fa', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. fa', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secondi fa', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. fa', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto fa', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. fa', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti fa', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. fa', // Carbon::now()->subHours(1)->diffForHumans() '1 ora fa', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 h fa', // Carbon::now()->subHours(2)->diffForHumans() '2 ore fa', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 h fa', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno fa', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 g fa', // Carbon::now()->subDays(2)->diffForHumans() '2 giorni fa', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gg fa', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settimana fa', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 set. fa', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settimane fa', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 set. fa', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese fa', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese fa', // Carbon::now()->subMonths(2)->diffForHumans() '2 mesi fa', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mesi fa', // Carbon::now()->subYears(1)->diffForHumans() '1 anno fa', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anno fa', // Carbon::now()->subYears(2)->diffForHumans() '2 anni fa', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anni fa', // Carbon::now()->addSecond()->diffForHumans() 'tra 1 secondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tra 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secondo dopo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sec. dopo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secondo prima', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sec. prima', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tra 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 secondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anni 3 mesi 1 g 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'tra 3 anni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mesi fa', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anni 3 mesi 1 g 1 sec. fa', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settimana 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'tra 1 settimana e 6 giorni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settimane 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in un\'ora', // CarbonInterval::days(2)->forHumans() '2 giorni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 g 3 h', ]; } ================================================ FILE: tests/Localization/ItVaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ItVaTest extends LocalizationTestCase { public const LOCALE = 'it_VA'; // Italian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domani alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'giovedì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venerdì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabato alle 00:00', // Carbon::now()->subDays(2)->calendar() 'la scorsa domenica alle 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Oggi alle 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Oggi alle 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Domani alle 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì alle 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ieri alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso martedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso lunedì alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'la scorsa domenica alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso sabato alle 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'lo scorso giovedì alle 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'lo scorso mercoledì alle 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lo scorso venerdì alle 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secondo fa', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. fa', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secondi fa', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. fa', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto fa', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. fa', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti fa', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. fa', // Carbon::now()->subHours(1)->diffForHumans() '1 ora fa', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 h fa', // Carbon::now()->subHours(2)->diffForHumans() '2 ore fa', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 h fa', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno fa', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 g fa', // Carbon::now()->subDays(2)->diffForHumans() '2 giorni fa', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gg fa', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settimana fa', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 set. fa', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settimane fa', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 set. fa', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese fa', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese fa', // Carbon::now()->subMonths(2)->diffForHumans() '2 mesi fa', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mesi fa', // Carbon::now()->subYears(1)->diffForHumans() '1 anno fa', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anno fa', // Carbon::now()->subYears(2)->diffForHumans() '2 anni fa', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anni fa', // Carbon::now()->addSecond()->diffForHumans() 'tra 1 secondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tra 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secondo dopo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sec. dopo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secondo prima', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sec. prima', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tra 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 secondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anni 3 mesi 1 g 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'tra 3 anni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mesi fa', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anni 3 mesi 1 g 1 sec. fa', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settimana 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settimana 6 giorni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'tra 1 settimana e 6 giorni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settimane 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in un\'ora', // CarbonInterval::days(2)->forHumans() '2 giorni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 g 3 h', ]; } ================================================ FILE: tests/Localization/IuCaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IuCaTest extends LocalizationTestCase { public const LOCALE = 'iu_CA'; // Inuktitut public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓯᕙᑖᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓈᑦᑎᖑᔭᕐᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓇᒡᒐᔾᔭᐅ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᐱᖓᓲᓕᖅᓯᐅᑦ at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ᕿᑎᖅᑰᑦ at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᐱᖓᓲᓕᖅᓯᐅᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᕿᑎᖅᑰᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᓯᕙᑖᕕᒃ at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last ᓈᑦᑎᖑᔭᕐᕕᒃ at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓇᒡᒐᔾᔭᐅ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓈᑦᑎᖑᔭᕐᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓯᕙᑖᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ᕿᑎᖅᑰᑦ at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ᐱᖓᓲᓕᖅᓯᐅᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 marluk ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 marluk ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 marluk ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 marluk ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 titiqqaralaaq ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 titiqqaralaaq ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 titiqqaralaaq ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 titiqqaralaaq ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ikarraq ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ikarraq ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ikarraq ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ikarraq ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ulloq ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ulloq ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ulloq ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ulloq ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sapaatip akunnera ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sapaatip akunnera ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sapaatip akunnera ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sapaatip akunnera ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 qaammat ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 qaammat ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 qaammat ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 qaammat ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ᐅᑭᐅᖅ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ᐅᑭᐅᖅ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ᐅᑭᐅᖅ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ᐅᑭᐅᖅ ago', // Carbon::now()->addSecond()->diffForHumans() '1 marluk from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 marluk from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 marluk after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 marluk after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 marluk before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 marluk before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 marluk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 marluk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 marluk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 marluk', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 marluk from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 titiqqaralaaq 1 marluk', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ᐅᑭᐅᖅ 3 qaammat 1 ulloq 1 marluk', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ᐅᑭᐅᖅ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 qaammat ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ᐅᑭᐅᖅ 3 qaammat 1 ulloq 1 marluk ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sapaatip akunnera 10 ikarraq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sapaatip akunnera 6 ulloq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sapaatip akunnera 6 ulloq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sapaatip akunnera and 6 ulloq from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sapaatip akunnera 1 ikarraq', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ikarraq from now', // CarbonInterval::days(2)->forHumans() '2 ulloq', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ulloq 3 ikarraq', ]; } ================================================ FILE: tests/Localization/IuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IuTest extends LocalizationTestCase { public const LOCALE = 'iu'; // Inuktitut public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓯᕙᑖᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓈᑦᑎᖑᔭᕐᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓇᒡᒐᔾᔭᐅ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ᐱᖓᓲᓕᖅᓯᐅᑦ at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ᕿᑎᖅᑰᑦ at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᐱᖓᓲᓕᖅᓯᐅᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᕿᑎᖅᑰᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᓯᕙᑖᕕᒃ at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last ᓈᑦᑎᖑᔭᕐᕕᒃ at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓇᒡᒐᔾᔭᐅ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓈᑦᑎᖑᔭᕐᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᓯᕙᑖᕕᒃ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ᕿᑎᖅᑰᑦ at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ᐱᖓᓲᓕᖅᓯᐅᑦ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ᐅᓪᓗᕈᓘᑐᐃᓇᖅ at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 marluk ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 marluk ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 marluk ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 marluk ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 titiqqaralaaq ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 titiqqaralaaq ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 titiqqaralaaq ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 titiqqaralaaq ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ikarraq ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ikarraq ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ikarraq ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ikarraq ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ulloq ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ulloq ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ulloq ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ulloq ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sapaatip akunnera ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sapaatip akunnera ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sapaatip akunnera ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sapaatip akunnera ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 qaammat ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 qaammat ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 qaammat ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 qaammat ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ᐅᑭᐅᖅ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ᐅᑭᐅᖅ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ᐅᑭᐅᖅ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ᐅᑭᐅᖅ ago', // Carbon::now()->addSecond()->diffForHumans() '1 marluk from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 marluk from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 marluk after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 marluk after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 marluk before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 marluk before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 marluk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 marluk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 marluk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 marluk', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 marluk from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 titiqqaralaaq 1 marluk', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ᐅᑭᐅᖅ 3 qaammat 1 ulloq 1 marluk', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ᐅᑭᐅᖅ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 qaammat ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ᐅᑭᐅᖅ 3 qaammat 1 ulloq 1 marluk ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sapaatip akunnera 10 ikarraq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sapaatip akunnera 6 ulloq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sapaatip akunnera 6 ulloq', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sapaatip akunnera and 6 ulloq from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sapaatip akunnera 1 ikarraq', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ikarraq from now', // CarbonInterval::days(2)->forHumans() '2 ulloq', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ulloq 3 ikarraq', ]; } ================================================ FILE: tests/Localization/IwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class IwTest extends LocalizationTestCase { public const LOCALE = 'iw'; // iw public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'יום שבת at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'יום ראשון at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'יום שני at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'יום שלישי at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'יום רביעי at 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'יום חמישי at 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'יום שישי at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'יום שלישי at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'יום רביעי at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'יום חמישי at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'יום שישי at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'יום שבת at 0:00', // Carbon::now()->subDays(2)->calendar() 'Last יום ראשון at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'יום שלישי at 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last יום שלישי at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last יום שני at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last יום ראשון at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last יום שבת at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last יום שישי at 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last יום חמישי at 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last יום רביעי at 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last יום שישי at 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 לפנה״צ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 לפנה״צ, 12:00 לפנה״צ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 לפנה״צ, 1:30 לפנה״צ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 לפנה״צ, 2:00 לפנה״צ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 לפנה״צ, 6:00 לפנה״צ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 לפנה״צ, 10:00 לפנה״צ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 אחה״צ, 12:00 אחה״צ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 אחה״צ, 5:00 אחה״צ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 אחה״צ, 9:30 אחה״צ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 אחה״צ, 11:00 אחה״צ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'לפני 1 שניה', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'לפני 1 שניה', // Carbon::now()->subSeconds(2)->diffForHumans() 'לפני 2 שניה', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'לפני 2 שניה', // Carbon::now()->subMinutes(1)->diffForHumans() 'לפני 1 דקה', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'לפני 1 דקה', // Carbon::now()->subMinutes(2)->diffForHumans() 'לפני 2 דקה', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'לפני 2 דקה', // Carbon::now()->subHours(1)->diffForHumans() 'לפני 1 שעה', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'לפני 1 שעה', // Carbon::now()->subHours(2)->diffForHumans() 'לפני 2 שעה', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'לפני 2 שעה', // Carbon::now()->subDays(1)->diffForHumans() 'לפני 1 יום', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'לפני 1 יום', // Carbon::now()->subDays(2)->diffForHumans() 'לפני 2 יום', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'לפני 2 יום', // Carbon::now()->subWeeks(1)->diffForHumans() 'לפני 1 שבוע', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'לפני 1 שבוע', // Carbon::now()->subWeeks(2)->diffForHumans() 'לפני 2 שבוע', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'לפני 2 שבוע', // Carbon::now()->subMonths(1)->diffForHumans() 'לפני 1 חודש', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'לפני 1 חודש', // Carbon::now()->subMonths(2)->diffForHumans() 'לפני 2 חודש', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'לפני 2 חודש', // Carbon::now()->subYears(1)->diffForHumans() 'לפני 1 שנה', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'לפני 1 שנה', // Carbon::now()->subYears(2)->diffForHumans() 'לפני 2 שנה', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'לפני 2 שנה', // Carbon::now()->addSecond()->diffForHumans() 'בעוד 1 שניה', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'בעוד 1 שניה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 שניה after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 שניה after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 שניה before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 שניה before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 שניה', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 שניה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 שניה', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 שניה', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'בעוד 1 שניה', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 דקה 1 שניה', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 שנה 3 חודש 1 יום 1 שניה', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'בעוד 3 שנה', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'לפני 5 חודש', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'לפני 2 שנה 3 חודש 1 יום 1 שניה', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 שבוע 10 שעה', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 שבוע 6 יום', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 שבוע 6 יום', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'בעוד 1 שבוע and 6 יום', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 שבוע 1 שעה', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'בעוד 1 שעה', // CarbonInterval::days(2)->forHumans() '2 יום', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 יום 3 שעה', ]; } ================================================ FILE: tests/Localization/JaJpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class JaJpTest extends LocalizationTestCase { public const LOCALE = 'ja_JP'; // Japanese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '明日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '土曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週日曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週月曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週火曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週水曜日 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '来週木曜日 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '来週金曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '火曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '水曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '木曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '金曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '土曜日 00:00', // Carbon::now()->subDays(2)->calendar() '日曜日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '昨日 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '今日 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '今日 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) '明日 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '火曜日 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '昨日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '昨日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '火曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '月曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '日曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '先週土曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '先週金曜日 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '先週木曜日 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '先週水曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '先週金曜日 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1日 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2日 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3日 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4日 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5日 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6日 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7日 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11日 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 午前 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 午前, 12:00 午前', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 午前, 1:30 午前', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 午前, 2:00 午前', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 午前, 6:00 午前', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 午前, 10:00 午前', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 午後, 12:00 午後', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 午後, 5:00 午後', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 午後, 9:30 午後', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 午後, 11:00 午後', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() '1分前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1分前', // Carbon::now()->subMinutes(2)->diffForHumans() '2分前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2分前', // Carbon::now()->subHours(1)->diffForHumans() '1時間前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1時間前', // Carbon::now()->subHours(2)->diffForHumans() '2時間前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2時間前', // Carbon::now()->subDays(1)->diffForHumans() '1日前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1日前', // Carbon::now()->subDays(2)->diffForHumans() '2日前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2日前', // Carbon::now()->subWeeks(1)->diffForHumans() '1週間前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1週間前', // Carbon::now()->subWeeks(2)->diffForHumans() '2週間前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2週間前', // Carbon::now()->subMonths(1)->diffForHumans() '1ヶ月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1ヶ月前', // Carbon::now()->subMonths(2)->diffForHumans() '2ヶ月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2ヶ月前', // Carbon::now()->subYears(1)->diffForHumans() '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1年前', // Carbon::now()->subYears(2)->diffForHumans() '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2年前', // Carbon::now()->addSecond()->diffForHumans() '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1分 1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2年 3ヶ月 1日 1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5ヶ月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2年 3ヶ月 1日 1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1週間 10時間', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1週間 6日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1週間 6日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1週間、6日後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2週間 1時間', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1時間後', // CarbonInterval::days(2)->forHumans() '2日', // CarbonInterval::create('P1DT3H')->forHumans(true) '1日 3時間', ]; } ================================================ FILE: tests/Localization/JaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use Carbon\Carbon; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class JaTest extends LocalizationTestCase { public const LOCALE = 'ja'; // Japanese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '明日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '土曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週日曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週月曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週火曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '来週水曜日 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '来週木曜日 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '来週金曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '火曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '水曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '木曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '金曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '土曜日 00:00', // Carbon::now()->subDays(2)->calendar() '日曜日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '昨日 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '今日 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '今日 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) '明日 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '火曜日 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '昨日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '昨日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '火曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '月曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '日曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '先週土曜日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '先週金曜日 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '先週木曜日 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '先週水曜日 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '先週金曜日 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1日 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2日 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3日 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4日 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5日 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6日 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7日 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11日 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 午前 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 午前, 12:00 午前', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 午前, 1:30 午前', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 午前, 2:00 午前', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 午前, 6:00 午前', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 午前, 10:00 午前', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 午後, 12:00 午後', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 午後, 5:00 午後', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 午後, 9:30 午後', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 午後, 11:00 午後', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() '1分前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1分前', // Carbon::now()->subMinutes(2)->diffForHumans() '2分前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2分前', // Carbon::now()->subHours(1)->diffForHumans() '1時間前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1時間前', // Carbon::now()->subHours(2)->diffForHumans() '2時間前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2時間前', // Carbon::now()->subDays(1)->diffForHumans() '1日前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1日前', // Carbon::now()->subDays(2)->diffForHumans() '2日前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2日前', // Carbon::now()->subWeeks(1)->diffForHumans() '1週間前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1週間前', // Carbon::now()->subWeeks(2)->diffForHumans() '2週間前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2週間前', // Carbon::now()->subMonths(1)->diffForHumans() '1ヶ月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1ヶ月前', // Carbon::now()->subMonths(2)->diffForHumans() '2ヶ月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2ヶ月前', // Carbon::now()->subYears(1)->diffForHumans() '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1年前', // Carbon::now()->subYears(2)->diffForHumans() '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2年前', // Carbon::now()->addSecond()->diffForHumans() '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1分 1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2年 3ヶ月 1日 1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5ヶ月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2年 3ヶ月 1日 1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1週間 10時間', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1週間 6日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1週間 6日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1週間、6日後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2週間 1時間', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1時間後', // CarbonInterval::days(2)->forHumans() '2日', // CarbonInterval::create('P1DT3H')->forHumans(true) '1日 3時間', ]; public function testYearWithJapaneseNumbers() { $this->assertSame('二千十五', Carbon::parse('2015-12-23 00:00:00')->locale('ja')->getAltNumber('year')); } } ================================================ FILE: tests/Localization/JgoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class JgoTest extends LocalizationTestCase { public const LOCALE = 'jgo'; // Ngomba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/JmcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class JmcTest extends LocalizationTestCase { public const LOCALE = 'jmc'; // Machame public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapilyi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatanu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapilyi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapilyi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 utuko CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 utuko, 12:00 utuko', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 utuko, 1:30 utuko', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 utuko, 2:00 utuko', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 utuko, 6:00 utuko', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 utuko, 10:00 utuko', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kyiukonyi, 12:00 kyiukonyi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kyiukonyi, 5:00 kyiukonyi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kyiukonyi, 9:30 kyiukonyi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kyiukonyi, 11:00 kyiukonyi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/JvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class JvTest extends LocalizationTestCase { public const LOCALE = 'jv'; // Javanese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mbenjang pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Septu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senen pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Seloso pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rebu pukul 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kemis pukul 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jemuwah pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Seloso pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rebu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kemis pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jemuwah pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Septu pukul 00.00', // Carbon::now()->subDays(2)->calendar() 'Minggu kepengker pukul 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kala wingi pukul 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Dinten puniko pukul 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dinten puniko pukul 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Mbenjang pukul 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Seloso pukul 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kala wingi pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kala wingi pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Seloso kepengker pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Senen kepengker pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Minggu kepengker pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Septu kepengker pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jemuwah kepengker pukul 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Kemis kepengker pukul 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rebu kepengker pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jemuwah kepengker pukul 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 enjing CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 enjing, 12:00 enjing', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 enjing, 1:30 enjing', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 enjing, 2:00 enjing', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 enjing, 6:00 enjing', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 enjing, 10:00 enjing', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 siyang, 12:00 siyang', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 sonten, 5:00 sonten', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ndalu, 9:30 ndalu', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ndalu, 11:00 ndalu', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 detik ingkang kepengker', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 detik ingkang kepengker', // Carbon::now()->subSeconds(2)->diffForHumans() '2 detik ingkang kepengker', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 detik ingkang kepengker', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menit ingkang kepengker', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 menit ingkang kepengker', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menit ingkang kepengker', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 menit ingkang kepengker', // Carbon::now()->subHours(1)->diffForHumans() '1 jam ingkang kepengker', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 jam ingkang kepengker', // Carbon::now()->subHours(2)->diffForHumans() '2 jam ingkang kepengker', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 jam ingkang kepengker', // Carbon::now()->subDays(1)->diffForHumans() '1 dina ingkang kepengker', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dina ingkang kepengker', // Carbon::now()->subDays(2)->diffForHumans() '2 dina ingkang kepengker', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dina ingkang kepengker', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu ingkang kepengker', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 minggu ingkang kepengker', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu ingkang kepengker', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 minggu ingkang kepengker', // Carbon::now()->subMonths(1)->diffForHumans() '1 wulan ingkang kepengker', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 wulan ingkang kepengker', // Carbon::now()->subMonths(2)->diffForHumans() '2 wulan ingkang kepengker', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 wulan ingkang kepengker', // Carbon::now()->subYears(1)->diffForHumans() '1 taun ingkang kepengker', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taun ingkang kepengker', // Carbon::now()->subYears(2)->diffForHumans() '2 taun ingkang kepengker', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taun ingkang kepengker', // Carbon::now()->addSecond()->diffForHumans() 'wonten ing 1 detik', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'wonten ing 1 detik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 detik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 detik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 detik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 detik', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'wonten ing 1 detik', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menit 1 detik', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taun 3 wulan 1 dina 1 detik', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'wonten ing 3 taun', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 wulan ingkang kepengker', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taun 3 wulan 1 dina 1 detik ingkang kepengker', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 dina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 dina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wonten ing 1 minggu lan 6 dina', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'wonten ing setunggal jam', // CarbonInterval::days(2)->forHumans() '2 dina', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dina 3 jam', ]; } ================================================ FILE: tests/Localization/KaGeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KaGeTest extends LocalizationTestCase { public const LOCALE = 'ka_GE'; // Georgian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'ხვალ, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'შაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'კვირას, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'შემდეგ ორშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'შემდეგ სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'შემდეგ ოთხშაბათს, 00:00-ზე', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'შემდეგ ხუთშაბათს, 00:00-ზე', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'შემდეგ პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'შემდეგ სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'შემდეგ ოთხშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'შემდეგ ხუთშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'შემდეგ პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'შემდეგ შაბათს, 00:00-ზე', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'წინა კვირას, 20:49-ზე', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'გუშინ, 22:00-ზე', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'დღეს, 10:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'დღეს, 02:00-ზე', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'ხვალ, 01:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'შემდეგ სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'გუშინ, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'გუშინ, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'წინა სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'წინა ორშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'წინა კვირას, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'წინა შაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'წინა პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'წინა ხუთშაბათს, 00:00-ზე', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'წინა ოთხშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'წინა პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1-ლი 1-ლი 1-ლი 1-ლი 1-ლი', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', 'მე-2 1-ლი', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', 'მე-3 1-ლი', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', 'მე-4 1-ლი', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', 'მე-5 1-ლი', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', 'მე-6 1-ლი', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', 'მე-7 1-ლი', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', 'მე-11 მე-2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', 'მე-40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41-ე', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', 'მე-100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 ღამის CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ღამის, 12:00 ღამის', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ღამის, 1:30 ღამის', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ღამის, 2:00 ღამის', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 დილის, 6:00 დილის', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 დილის, 10:00 დილის', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 შუადღის, 12:00 შუადღის', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 საღამოს, 5:00 საღამოს', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 საღამოს, 9:30 საღამოს', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ღამის, 11:00 ღამის', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 წამის წინ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 წამის წინ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 წამის წინ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 წამის წინ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 წუთის წინ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 წუთის წინ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 წუთის წინ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 წუთის წინ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 საათის წინ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 საათის წინ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 საათის წინ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 საათის წინ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 დღის წინ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 დღის წინ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 დღის წინ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 დღის წინ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 კვირის წინ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 კვირის წინ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 კვირის წინ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 კვირის წინ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 თვის წინ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 თვის წინ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 თვის წინ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 თვის წინ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 წლის წინ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 წლის წინ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 წლის წინ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 წლის წინ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 წამში', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 წამში', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 წამის შემდეგ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 წამის შემდეგ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 წამით ადრე', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 წამით ადრე', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 წამი', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 წამი', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 წამი', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 წამი', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 წამში', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 წუთი 1 წამი', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 წელი 3 თვე 1 დღე 1 წამი', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 წელიწადში', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 თვის წინ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 წლის 3 თვის 1 დღის 1 წამის წინ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 კვირა 10 საათი', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 კვირა 6 დღე', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 კვირა 6 დღე', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 კვირაში და 6 დღეში', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 კვირა 1 საათი', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'საათში', // CarbonInterval::days(2)->forHumans() // '2 days', '2 დღე', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 დღე 3 საათი', ]; } ================================================ FILE: tests/Localization/KaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KaTest extends LocalizationTestCase { public const LOCALE = 'ka'; // Georgian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'ხვალ, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'შაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'კვირას, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'შემდეგ ორშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'შემდეგ სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'შემდეგ ოთხშაბათს, 00:00-ზე', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'შემდეგ ხუთშაბათს, 00:00-ზე', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'შემდეგ პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'შემდეგ სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'შემდეგ ოთხშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'შემდეგ ხუთშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'შემდეგ პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'შემდეგ შაბათს, 00:00-ზე', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'წინა კვირას, 20:49-ზე', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'გუშინ, 22:00-ზე', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'დღეს, 10:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'დღეს, 02:00-ზე', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'ხვალ, 01:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'შემდეგ სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'გუშინ, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'გუშინ, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'წინა სამშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'წინა ორშაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'წინა კვირას, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'წინა შაბათს, 00:00-ზე', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'წინა პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'წინა ხუთშაბათს, 00:00-ზე', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'წინა ოთხშაბათს, 00:00-ზე', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'წინა პარასკევს, 00:00-ზე', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1-ლი 1-ლი 1-ლი 1-ლი 1-ლი', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', 'მე-2 1-ლი', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', 'მე-3 1-ლი', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', 'მე-4 1-ლი', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', 'მე-5 1-ლი', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', 'მე-6 1-ლი', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', 'მე-7 1-ლი', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', 'მე-11 მე-2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', 'მე-40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41-ე', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', 'მე-100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 ღამის CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ღამის, 12:00 ღამის', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ღამის, 1:30 ღამის', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ღამის, 2:00 ღამის', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 დილის, 6:00 დილის', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 დილის, 10:00 დილის', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 შუადღის, 12:00 შუადღის', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 საღამოს, 5:00 საღამოს', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 საღამოს, 9:30 საღამოს', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ღამის, 11:00 ღამის', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 წამის წინ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 წამის წინ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 წამის წინ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 წამის წინ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 წუთის წინ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 წუთის წინ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 წუთის წინ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 წუთის წინ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 საათის წინ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 საათის წინ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 საათის წინ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 საათის წინ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 დღის წინ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 დღის წინ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 დღის წინ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 დღის წინ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 კვირის წინ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 კვირის წინ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 კვირის წინ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 კვირის წინ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 თვის წინ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 თვის წინ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 თვის წინ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 თვის წინ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 წლის წინ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 წლის წინ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 წლის წინ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 წლის წინ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 წამში', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 წამში', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 წამის შემდეგ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 წამის შემდეგ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 წამით ადრე', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 წამით ადრე', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 წამი', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 წამი', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 წამი', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 წამი', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 წამში', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 წუთი 1 წამი', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 წელი 3 თვე 1 დღე 1 წამი', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 წელიწადში', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 თვის წინ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 წლის 3 თვის 1 დღის 1 წამის წინ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 კვირა 10 საათი', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 კვირა 6 დღე', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 კვირა 6 დღე', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 კვირაში და 6 დღეში', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 კვირა 1 საათი', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'საათში', // CarbonInterval::days(2)->forHumans() // '2 days', '2 დღე', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 დღე 3 საათი', ]; } ================================================ FILE: tests/Localization/KabDzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KabDzTest extends LocalizationTestCase { public const LOCALE = 'kab_DZ'; // Kabyle public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sed at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Acer at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Arim at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aram at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad at 12:00 FT', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Amhad at 12:00 FT', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Sem at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aram at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ahad at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Amhad at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sem at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sed at 12:00 FT', // Carbon::now()->subDays(2)->calendar() 'Last Acer at 8:49 MD', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 MD', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 FT', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aram at 12:00 FT', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aram at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Arim at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Acer at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sed at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sem at 12:00 FT', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Amhad at 12:00 FT', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ahad at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Sem at 12:00 FT', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ft CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 FT, 12:00 ft', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 FT, 1:30 ft', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 FT, 2:00 ft', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 FT, 6:00 ft', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 FT, 10:00 ft', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MD, 12:00 md', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MD, 5:00 md', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MD, 9:30 md', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MD, 11:00 md', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tasdidt ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tasdidt ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tasdidt ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tasdidt ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 n tedqiqin ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 n tedqiqin ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 n tedqiqin ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 n tedqiqin ago', // Carbon::now()->subHours(1)->diffForHumans() '1 n tsaɛtin ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 n tsaɛtin ago', // Carbon::now()->subHours(2)->diffForHumans() '2 n tsaɛtin ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 n tsaɛtin ago', // Carbon::now()->subDays(1)->diffForHumans() '1 n wussan ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 n wussan ago', // Carbon::now()->subDays(2)->diffForHumans() '2 n wussan ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 n wussan ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 n ledwaṛ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 n ledwaṛ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 n ledwaṛ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 n ledwaṛ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 n wayyuren ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 n wayyuren ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 n wayyuren ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 n wayyuren ago', // Carbon::now()->subYears(1)->diffForHumans() '1 n yiseggasen ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 n yiseggasen ago', // Carbon::now()->subYears(2)->diffForHumans() '2 n yiseggasen ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 n yiseggasen ago', // Carbon::now()->addSecond()->diffForHumans() '1 tasdidt from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tasdidt from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tasdidt after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tasdidt after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tasdidt before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tasdidt before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tasdidt', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tasdidt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tasdidt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tasdidt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tasdidt from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 n tedqiqin 1 tasdidt', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 n yiseggasen 3 n wayyuren 1 n wussan 1 tasdidt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 n yiseggasen from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 n wayyuren ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 n yiseggasen 3 n wayyuren 1 n wussan 1 tasdidt ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 n ledwaṛ 10 n tsaɛtin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 n ledwaṛ 6 n wussan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 n ledwaṛ 6 n wussan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 n ledwaṛ and 6 n wussan from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 n ledwaṛ 1 n tsaɛtin', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 n tsaɛtin from now', // CarbonInterval::days(2)->forHumans() '2 n wussan', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 n wussan 3 n tsaɛtin', ]; } ================================================ FILE: tests/Localization/KabTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KabTest extends LocalizationTestCase { public const LOCALE = 'kab'; // Kabyle public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sed at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Acer at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Arim at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aram at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad at 12:00 FT', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Amhad at 12:00 FT', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Sem at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aram at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ahad at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Amhad at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sem at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sed at 12:00 FT', // Carbon::now()->subDays(2)->calendar() 'Last Acer at 8:49 MD', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 MD', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 FT', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 FT', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 FT', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aram at 12:00 FT', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aram at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Arim at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Acer at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sed at 12:00 FT', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sem at 12:00 FT', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Amhad at 12:00 FT', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ahad at 12:00 FT', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Sem at 12:00 FT', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ft CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 FT, 12:00 ft', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 FT, 1:30 ft', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 FT, 2:00 ft', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 FT, 6:00 ft', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 FT, 10:00 ft', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MD, 12:00 md', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MD, 5:00 md', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MD, 9:30 md', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MD, 11:00 md', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 tasdidt ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 tasdidt ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 tasdidt ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 tasdidt ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 n tedqiqin ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 n tedqiqin ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 n tedqiqin ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 n tedqiqin ago', // Carbon::now()->subHours(1)->diffForHumans() '1 n tsaɛtin ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 n tsaɛtin ago', // Carbon::now()->subHours(2)->diffForHumans() '2 n tsaɛtin ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 n tsaɛtin ago', // Carbon::now()->subDays(1)->diffForHumans() '1 n wussan ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 n wussan ago', // Carbon::now()->subDays(2)->diffForHumans() '2 n wussan ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 n wussan ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 n ledwaṛ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 n ledwaṛ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 n ledwaṛ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 n ledwaṛ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 n wayyuren ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 n wayyuren ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 n wayyuren ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 n wayyuren ago', // Carbon::now()->subYears(1)->diffForHumans() '1 n yiseggasen ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 n yiseggasen ago', // Carbon::now()->subYears(2)->diffForHumans() '2 n yiseggasen ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 n yiseggasen ago', // Carbon::now()->addSecond()->diffForHumans() '1 tasdidt from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 tasdidt from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 tasdidt after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 tasdidt after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 tasdidt before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 tasdidt before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 tasdidt', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 tasdidt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 tasdidt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 tasdidt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 tasdidt from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 n tedqiqin 1 tasdidt', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 n yiseggasen 3 n wayyuren 1 n wussan 1 tasdidt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 n yiseggasen from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 n wayyuren ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 n yiseggasen 3 n wayyuren 1 n wussan 1 tasdidt ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 n ledwaṛ 10 n tsaɛtin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 n ledwaṛ 6 n wussan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 n ledwaṛ 6 n wussan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 n ledwaṛ and 6 n wussan from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 n ledwaṛ 1 n tsaɛtin', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 n tsaɛtin from now', // CarbonInterval::days(2)->forHumans() '2 n wussan', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 n wussan 3 n tsaɛtin', ]; } ================================================ FILE: tests/Localization/KamTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KamTest extends LocalizationTestCase { public const LOCALE = 'kam'; // Kamba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wa thanthatũ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wa kyumwa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wa kwambĩlĩlya at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wa kelĩ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wa katatũ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Wa kana at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Wa katano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wa kelĩ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wa katatũ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wa kana at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wa katano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wa thanthatũ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Wa kyumwa at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wa kelĩ at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wa kelĩ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wa kwambĩlĩlya at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wa kyumwa at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wa thanthatũ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wa katano at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Wa kana at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wa katatũ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Wa katano at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ĩyakwakya CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ĩyakwakya, 12:00 ĩyakwakya', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Ĩyakwakya, 1:30 ĩyakwakya', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Ĩyakwakya, 2:00 ĩyakwakya', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Ĩyakwakya, 6:00 ĩyakwakya', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Ĩyakwakya, 10:00 ĩyakwakya', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ĩyawĩoo, 12:00 ĩyawĩoo', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ĩyawĩoo, 5:00 ĩyawĩoo', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ĩyawĩoo, 9:30 ĩyawĩoo', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ĩyawĩoo, 11:00 ĩyawĩoo', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KdeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KdeTest extends LocalizationTestCase { public const LOCALE = 'kde'; // Makonde public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Liduva litandi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Liduva lyapili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Liduva lyatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Liduva lyanchechi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Liduva lyannyano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Liduva lyannyano na linji at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Liduva lyannyano na mavili at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Liduva lyanchechi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Liduva lyannyano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Liduva lyannyano na linji at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Liduva lyannyano na mavili at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Liduva litandi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Liduva lyapili at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Liduva lyanchechi at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Liduva lyanchechi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Liduva lyatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Liduva lyapili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Liduva litandi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Liduva lyannyano na mavili at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Liduva lyannyano na linji at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Liduva lyannyano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Liduva lyannyano na mavili at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 muhi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Muhi, 12:00 muhi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Muhi, 1:30 muhi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Muhi, 2:00 muhi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Muhi, 6:00 muhi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Muhi, 10:00 muhi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Chilo, 12:00 chilo', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Chilo, 5:00 chilo', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Chilo, 9:30 chilo', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Chilo, 11:00 chilo', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KeaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KeaTest extends LocalizationTestCase { public const LOCALE = 'kea'; // Kabuverdianu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabadu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dumingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sigunda-fera at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tersa-fera at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kuarta-fera at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'kinta-fera at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sesta-fera at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tersa-fera at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kuarta-fera at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kinta-fera at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sesta-fera at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabadu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dumingu at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tersa-fera at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tersa-fera at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sigunda-fera at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dumingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabadu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sesta-fera at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last kinta-fera at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last kuarta-fera at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last sesta-fera at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a, 1:30 a', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a, 2:00 a', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a, 6:00 a', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a, 10:00 a', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p, 12:00 p', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p, 5:00 p', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p, 9:30 p', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p, 11:00 p', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 dós ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 dós ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 dós ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 dós ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 sugundu ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 sugundu ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 sugundu ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 sugundu ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 diâ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 diâ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 diâ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 diâ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 día dumingu ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 día dumingu ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 día dumingu ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 día dumingu ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 otunu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 otunu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 otunu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 otunu ago', // Carbon::now()->addSecond()->diffForHumans() '1 dós from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 dós from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 dós after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 dós after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 dós before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 dós before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 dós', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 dós', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 dós', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 dós', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 dós from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 sugundu 1 dós', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 otunu 3mos 1 diâ 1 dós', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 otunu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 otunu 3mos 1 diâ 1 dós ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 día dumingu 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 día dumingu 6 diâ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 día dumingu 6 diâ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 día dumingu and 6 diâ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 día dumingu 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 diâ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 diâ 3h', ]; } ================================================ FILE: tests/Localization/KhqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KhqTest extends LocalizationTestCase { public const LOCALE = 'khq'; // Koyra Chiini public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Assabdu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atalata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamiisa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Aljuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamiisa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aljuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Assabdu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Alhadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atalata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atini at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Assabdu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aljuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamiisa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Aljuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 adduha CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Adduha, 12:00 adduha', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Adduha, 1:30 adduha', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Adduha, 2:00 adduha', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Adduha, 6:00 adduha', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Adduha, 10:00 adduha', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Aluula, 12:00 aluula', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Aluula, 5:00 aluula', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Aluula, 9:30 aluula', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Aluula, 11:00 aluula', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KiTest extends LocalizationTestCase { public const LOCALE = 'ki'; // Kikuyu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumamothi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kiumia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumatatũ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumaine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Njumatana at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aramithi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Njumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumaine at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumatana at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aramithi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumamothi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Kiumia at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njumaine at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumaine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumatatũ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kiumia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumamothi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Njumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aramithi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Njumatana at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Njumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 kiroko CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Kiroko, 12:00 kiroko', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Kiroko, 1:30 kiroko', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Kiroko, 2:00 kiroko', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Kiroko, 6:00 kiroko', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Kiroko, 10:00 kiroko', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Hwaĩ-inĩ, 12:00 hwaĩ-inĩ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Hwaĩ-inĩ, 5:00 hwaĩ-inĩ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Hwaĩ-inĩ, 9:30 hwaĩ-inĩ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Hwaĩ-inĩ, 11:00 hwaĩ-inĩ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 igego ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 igego ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 igego ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 igego ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mundu ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mundu ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mundu ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mundu ago', // Carbon::now()->subHours(1)->diffForHumans() '1 thaa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 thaa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 thaa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 thaa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 mũthenya ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 mũthenya ago', // Carbon::now()->subDays(2)->diffForHumans() '2 mũthenya ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 mũthenya ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 kiumia ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 kiumia ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 kiumia ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 kiumia ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mweri ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mweri ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mweri ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mweri ago', // Carbon::now()->subYears(1)->diffForHumans() '1 mĩaka ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 mĩaka ago', // Carbon::now()->subYears(2)->diffForHumans() '2 mĩaka ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 mĩaka ago', // Carbon::now()->addSecond()->diffForHumans() '1 igego from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 igego from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 igego after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 igego after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 igego before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 igego before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 igego', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 igego', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 igego', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 igego', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 igego from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mundu 1 igego', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 mĩaka 3 mweri 1 mũthenya 1 igego', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 mĩaka from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mweri ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 mĩaka 3 mweri 1 mũthenya 1 igego ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 kiumia 10 thaa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 kiumia 6 mũthenya', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 kiumia 6 mũthenya', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 kiumia and 6 mũthenya from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 kiumia 1 thaa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 thaa from now', // CarbonInterval::days(2)->forHumans() '2 mũthenya', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 mũthenya 3 thaa', ]; } ================================================ FILE: tests/Localization/KkKzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KkKzTest extends LocalizationTestCase { public const LOCALE = 'kk_KZ'; // Kazakh public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ертең сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'жексенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'дүйсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сейсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сәрсенбі сағат 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'бейсенбі сағат 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'жұма сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сейсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сәрсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'бейсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'жұма сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сенбі сағат 00:00', // Carbon::now()->subDays(2)->calendar() 'Өткен аптаның жексенбі сағат 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кеше сағат 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Бүгін сағат 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Бүгін сағат 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ертең сағат 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сейсенбі сағат 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Кеше сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кеше сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның сейсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның дүйсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның жексенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның сенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның жұма сағат 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Өткен аптаның бейсенбі сағат 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Өткен аптаның сәрсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Өткен аптаның жұма сағат 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ші 1-ші 1-ші 1-ші 1-ші', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-ші 1-ші', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-ші 1-ші', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ші 1-ші', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ші 1-ші', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-шы 1-ші', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ші 1-ші', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ші 2-ші', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-шы', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ші', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ші', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ші', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунд бұрын', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 се. бұрын', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунд бұрын', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 се. бұрын', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минут бұрын', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 м. бұрын', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минут бұрын', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 м. бұрын', // Carbon::now()->subHours(1)->diffForHumans() '1 сағат бұрын', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 са. бұрын', // Carbon::now()->subHours(2)->diffForHumans() '2 сағат бұрын', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 са. бұрын', // Carbon::now()->subDays(1)->diffForHumans() '1 күн бұрын', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 к. бұрын', // Carbon::now()->subDays(2)->diffForHumans() '2 күн бұрын', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 к. бұрын', // Carbon::now()->subWeeks(1)->diffForHumans() '1 апта бұрын', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ап. бұрын', // Carbon::now()->subWeeks(2)->diffForHumans() '2 апта бұрын', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ап. бұрын', // Carbon::now()->subMonths(1)->diffForHumans() '1 ай бұрын', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ай бұрын', // Carbon::now()->subMonths(2)->diffForHumans() '2 ай бұрын', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ай бұрын', // Carbon::now()->subYears(1)->diffForHumans() '1 жыл бұрын', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ж. бұрын', // Carbon::now()->subYears(2)->diffForHumans() '2 жыл бұрын', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ж. бұрын', // Carbon::now()->addSecond()->diffForHumans() '1 секунд ішінде', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 се. ішінде', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунд кейін', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 се. кейін', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунд бұрын', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 се. бұрын', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 се.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 се.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 се. ішінде', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ж. 3 ай 1 к. 1 се.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 жыл ішінде', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ай бұрын', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ж. 3 ай 1 к. 1 се. бұрын', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 апта 10 сағат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 апта және 6 күн ішінде', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 апта 1 сағат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'бір сағат ішінде', // CarbonInterval::days(2)->forHumans() '2 күн', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 к. 3 са.', ]; } ================================================ FILE: tests/Localization/KkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KkTest extends LocalizationTestCase { public const LOCALE = 'kk'; // Kazakh public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ертең сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'жексенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'дүйсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сейсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сәрсенбі сағат 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'бейсенбі сағат 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'жұма сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сейсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сәрсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'бейсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'жұма сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сенбі сағат 00:00', // Carbon::now()->subDays(2)->calendar() 'Өткен аптаның жексенбі сағат 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кеше сағат 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Бүгін сағат 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Бүгін сағат 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ертең сағат 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сейсенбі сағат 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Кеше сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кеше сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның сейсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның дүйсенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның жексенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның сенбі сағат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптаның жұма сағат 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Өткен аптаның бейсенбі сағат 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Өткен аптаның сәрсенбі сағат 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Өткен аптаның жұма сағат 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ші 1-ші 1-ші 1-ші 1-ші', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-ші 1-ші', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-ші 1-ші', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ші 1-ші', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ші 1-ші', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-шы 1-ші', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ші 1-ші', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ші 2-ші', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-шы', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ші', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ші', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ші', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунд бұрын', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 се. бұрын', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунд бұрын', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 се. бұрын', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минут бұрын', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 м. бұрын', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минут бұрын', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 м. бұрын', // Carbon::now()->subHours(1)->diffForHumans() '1 сағат бұрын', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 са. бұрын', // Carbon::now()->subHours(2)->diffForHumans() '2 сағат бұрын', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 са. бұрын', // Carbon::now()->subDays(1)->diffForHumans() '1 күн бұрын', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 к. бұрын', // Carbon::now()->subDays(2)->diffForHumans() '2 күн бұрын', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 к. бұрын', // Carbon::now()->subWeeks(1)->diffForHumans() '1 апта бұрын', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ап. бұрын', // Carbon::now()->subWeeks(2)->diffForHumans() '2 апта бұрын', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ап. бұрын', // Carbon::now()->subMonths(1)->diffForHumans() '1 ай бұрын', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ай бұрын', // Carbon::now()->subMonths(2)->diffForHumans() '2 ай бұрын', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ай бұрын', // Carbon::now()->subYears(1)->diffForHumans() '1 жыл бұрын', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ж. бұрын', // Carbon::now()->subYears(2)->diffForHumans() '2 жыл бұрын', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ж. бұрын', // Carbon::now()->addSecond()->diffForHumans() '1 секунд ішінде', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 се. ішінде', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунд кейін', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 се. кейін', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунд бұрын', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 се. бұрын', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 се.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 се.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 се. ішінде', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ж. 3 ай 1 к. 1 се.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 жыл ішінде', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ай бұрын', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ж. 3 ай 1 к. 1 се. бұрын', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 апта 10 сағат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 апта және 6 күн ішінде', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 апта 1 сағат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'бір сағат ішінде', // CarbonInterval::days(2)->forHumans() '2 күн', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 к. 3 са.', ]; } ================================================ FILE: tests/Localization/KkjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KkjTest extends LocalizationTestCase { public const LOCALE = 'kkj'; // Kako public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KlGlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KlGlTest extends LocalizationTestCase { public const LOCALE = 'kl_GL'; // Kalaallisut public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'arfininngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sapaat at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ataasinngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'marlunngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pingasunngorneq at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sisamanngorneq at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'tallimanngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marlunngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pingasunngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sisamanngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tallimanngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'arfininngorneq at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sapaat at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marlunngorneq at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last marlunngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ataasinngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sapaat at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last arfininngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tallimanngorneq at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sisamanngorneq at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last pingasunngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last tallimanngorneq at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sikunti matuma siorna', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s matuma siorna', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sikuntit matuma siorna', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s matuma siorna', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutsi matuma siorna', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m matuma siorna', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutsit matuma siorna', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m matuma siorna', // Carbon::now()->subHours(1)->diffForHumans() '1 tiimi matuma siorna', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h matuma siorna', // Carbon::now()->subHours(2)->diffForHumans() '2 tiimit matuma siorna', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h matuma siorna', // Carbon::now()->subDays(1)->diffForHumans() '1 ulloq matuma siorna', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d matuma siorna', // Carbon::now()->subDays(2)->diffForHumans() '2 ullut matuma siorna', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d matuma siorna', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sap. ak. matuma siorna', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w matuma siorna', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sap. ak. matuma siorna', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w matuma siorna', // Carbon::now()->subMonths(1)->diffForHumans() 'qaammat 1 matuma siorna', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo matuma siorna', // Carbon::now()->subMonths(2)->diffForHumans() 'qaammatit 2 matuma siorna', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos matuma siorna', // Carbon::now()->subYears(1)->diffForHumans() 'ukioq 1 matuma siorna', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr matuma siorna', // Carbon::now()->subYears(2)->diffForHumans() 'ukiut 2 matuma siorna', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs matuma siorna', // Carbon::now()->addSecond()->diffForHumans() '1 sikunti from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sikunti after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sikunti before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sikunti', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sikuntit', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutsi 1 sikunti', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ukiut 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos matuma siorna', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s matuma siorna', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sap. ak. 10 tiimit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sap. ak. 6 ullut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sap. ak. 6 ullut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sap. ak. and 6 ullut from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sap. ak. 1 tiimi', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'tiimi from now', // CarbonInterval::days(2)->forHumans() '2 ullut', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KlTest extends LocalizationTestCase { public const LOCALE = 'kl'; // Kalaallisut public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'arfininngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sapaat at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ataasinngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'marlunngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pingasunngorneq at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sisamanngorneq at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'tallimanngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marlunngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pingasunngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sisamanngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tallimanngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'arfininngorneq at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sapaat at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marlunngorneq at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last marlunngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ataasinngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sapaat at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last arfininngorneq at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tallimanngorneq at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sisamanngorneq at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last pingasunngorneq at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last tallimanngorneq at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sikunti matuma siorna', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s matuma siorna', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sikuntit matuma siorna', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s matuma siorna', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutsi matuma siorna', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m matuma siorna', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutsit matuma siorna', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m matuma siorna', // Carbon::now()->subHours(1)->diffForHumans() '1 tiimi matuma siorna', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h matuma siorna', // Carbon::now()->subHours(2)->diffForHumans() '2 tiimit matuma siorna', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h matuma siorna', // Carbon::now()->subDays(1)->diffForHumans() '1 ulloq matuma siorna', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d matuma siorna', // Carbon::now()->subDays(2)->diffForHumans() '2 ullut matuma siorna', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d matuma siorna', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sap. ak. matuma siorna', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w matuma siorna', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sap. ak. matuma siorna', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w matuma siorna', // Carbon::now()->subMonths(1)->diffForHumans() 'qaammat 1 matuma siorna', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo matuma siorna', // Carbon::now()->subMonths(2)->diffForHumans() 'qaammatit 2 matuma siorna', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos matuma siorna', // Carbon::now()->subYears(1)->diffForHumans() 'ukioq 1 matuma siorna', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr matuma siorna', // Carbon::now()->subYears(2)->diffForHumans() 'ukiut 2 matuma siorna', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs matuma siorna', // Carbon::now()->addSecond()->diffForHumans() '1 sikunti from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sikunti after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sikunti before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sikunti', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sikuntit', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutsi 1 sikunti', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ukiut 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos matuma siorna', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s matuma siorna', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sap. ak. 10 tiimit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sap. ak. 6 ullut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sap. ak. 6 ullut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sap. ak. and 6 ullut from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sap. ak. 1 tiimi', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'tiimi from now', // CarbonInterval::days(2)->forHumans() '2 ullut', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KlnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KlnTest extends LocalizationTestCase { public const LOCALE = 'kln'; // Kalenjin public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kolo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kotisap at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kotaai at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Koaeng’ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kosomok at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Koang’wan at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Komuut at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Koaeng’ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kosomok at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Koang’wan at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Komuut at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kolo at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Kotisap at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Koaeng’ at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Koaeng’ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kotaai at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kotisap at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kolo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Komuut at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Koang’wan at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Kosomok at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Komuut at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 krn CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 krn, 12:00 krn', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 krn, 1:30 krn', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 krn, 2:00 krn', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 krn, 6:00 krn', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 krn, 10:00 krn', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 koosk, 12:00 koosk', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 koosk, 5:00 koosk', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 koosk, 9:30 koosk', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 koosk, 11:00 koosk', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 maghatiat ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 maghatiat ago', // Carbon::now()->subYears(2)->diffForHumans() '2 maghatiat ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 maghatiat ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 maghatiat 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 maghatiat from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 maghatiat 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KmKhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KmKhTest extends LocalizationTestCase { public const LOCALE = 'km_KH'; // Central Khmer public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ស្អែក ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'សៅរ៍ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អាទិត្យ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ច័ន្ទ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អង្គារ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ពុធ ម៉ោង 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ព្រហស្បតិ៍ ម៉ោង 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'សុក្រ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'អង្គារ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ពុធ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ព្រហស្បតិ៍ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'សុក្រ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'សៅរ៍ ម៉ោង 00:00', // Carbon::now()->subDays(2)->calendar() 'អាទិត្យ សប្តាហ៍មុន ម៉ោង 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ម្សិលមិញ ម៉ោង 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ថ្ងៃនេះ ម៉ោង 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ថ្ងៃនេះ ម៉ោង 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ស្អែក ម៉ោង 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'អង្គារ ម៉ោង 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ម្សិលមិញ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ម្សិលមិញ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អង្គារ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ច័ន្ទ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អាទិត្យ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'សៅរ៍ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'សុក្រ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ព្រហស្បតិ៍ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ពុធ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'សុក្រ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ទី1 ទី1 ទី1 ទី1 ទី1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ទី2 ទី1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ទី3 ទី1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ទី4 ទី1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ទី5 ទី1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ទី6 ទី1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ទី7 ទី1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ទី11 ទី2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ទី40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ទី41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ទី100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ព្រឹក CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ព្រឹក, 12:00 ព្រឹក', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ព្រឹក, 1:30 ព្រឹក', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ព្រឹក, 2:00 ព្រឹក', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ព្រឹក, 6:00 ព្រឹក', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ព្រឹក, 10:00 ព្រឹក', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ល្ងាច, 12:00 ល្ងាច', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ល្ងាច, 5:00 ល្ងាច', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ល្ងាច, 9:30 ល្ងាច', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ល្ងាច, 11:00 ល្ងាច', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ទី0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 វិនាទីមុន', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 វិនាទីមុន', // Carbon::now()->subSeconds(2)->diffForHumans() '2 វិនាទីមុន', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 វិនាទីមុន', // Carbon::now()->subMinutes(1)->diffForHumans() '1 នាទីមុន', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 នាទីមុន', // Carbon::now()->subMinutes(2)->diffForHumans() '2 នាទីមុន', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 នាទីមុន', // Carbon::now()->subHours(1)->diffForHumans() '1 ម៉ោងមុន', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ម៉ោងមុន', // Carbon::now()->subHours(2)->diffForHumans() '2 ម៉ោងមុន', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ម៉ោងមុន', // Carbon::now()->subDays(1)->diffForHumans() '1 ថ្ងៃមុន', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ថ្ងៃមុន', // Carbon::now()->subDays(2)->diffForHumans() '2 ថ្ងៃមុន', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ថ្ងៃមុន', // Carbon::now()->subWeeks(1)->diffForHumans() '1 សប្តាហ៍មុន', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 សប្តាហ៍មុន', // Carbon::now()->subWeeks(2)->diffForHumans() '2 សប្តាហ៍មុន', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 សប្តាហ៍មុន', // Carbon::now()->subMonths(1)->diffForHumans() '1 ខែមុន', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ខែមុន', // Carbon::now()->subMonths(2)->diffForHumans() '2 ខែមុន', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ខែមុន', // Carbon::now()->subYears(1)->diffForHumans() '1 ឆ្នាំមុន', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ឆ្នាំមុន', // Carbon::now()->subYears(2)->diffForHumans() '2 ឆ្នាំមុន', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ឆ្នាំមុន', // Carbon::now()->addSecond()->diffForHumans() '1 វិនាទីទៀត', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 វិនាទីទៀត', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'នៅ​ក្រោយ 1 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'នៅ​ក្រោយ 1 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'នៅ​មុន 1 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'នៅ​មុន 1 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 វិនាទីទៀត', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 នាទី 1 វិនាទី', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ឆ្នាំ 3 ខែ 1 ថ្ងៃ 1 វិនាទី', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ឆ្នាំទៀត', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ខែមុន', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ឆ្នាំ 3 ខែ 1 ថ្ងៃ 1 វិនាទីមុន', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 សប្តាហ៍ 10 ម៉ោង', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 សប្តាហ៍ 6 ថ្ងៃ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 សប្តាហ៍ 6 ថ្ងៃ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 សប្តាហ៍និង 6 ថ្ងៃទៀត', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 សប្តាហ៍ 1 ម៉ោង', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'មួយម៉ោងទៀត', // CarbonInterval::days(2)->forHumans() '2 ថ្ងៃ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ថ្ងៃ 3 ម៉ោង', ]; } ================================================ FILE: tests/Localization/KmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KmTest extends LocalizationTestCase { public const LOCALE = 'km'; // Central Khmer public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ស្អែក ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'សៅរ៍ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អាទិត្យ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ច័ន្ទ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អង្គារ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ពុធ ម៉ោង 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ព្រហស្បតិ៍ ម៉ោង 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'សុក្រ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'អង្គារ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ពុធ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ព្រហស្បតិ៍ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'សុក្រ ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'សៅរ៍ ម៉ោង 00:00', // Carbon::now()->subDays(2)->calendar() 'អាទិត្យ សប្តាហ៍មុន ម៉ោង 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ម្សិលមិញ ម៉ោង 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ថ្ងៃនេះ ម៉ោង 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ថ្ងៃនេះ ម៉ោង 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ស្អែក ម៉ោង 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'អង្គារ ម៉ោង 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ម្សិលមិញ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ម្សិលមិញ ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អង្គារ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ច័ន្ទ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'អាទិត្យ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'សៅរ៍ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'សុក្រ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ព្រហស្បតិ៍ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ពុធ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'សុក្រ សប្តាហ៍មុន ម៉ោង 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ទី1 ទី1 ទី1 ទី1 ទី1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ទី2 ទី1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ទី3 ទី1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ទី4 ទី1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ទី5 ទី1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ទី6 ទី1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ទី7 ទី1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ទី11 ទី2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ទី40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ទី41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ទី100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ព្រឹក CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ព្រឹក, 12:00 ព្រឹក', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ព្រឹក, 1:30 ព្រឹក', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ព្រឹក, 2:00 ព្រឹក', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ព្រឹក, 6:00 ព្រឹក', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ព្រឹក, 10:00 ព្រឹក', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ល្ងាច, 12:00 ល្ងាច', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ល្ងាច, 5:00 ល្ងាច', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ល្ងាច, 9:30 ល្ងាច', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ល្ងាច, 11:00 ល្ងាច', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ទី0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 វិនាទីមុន', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 វិនាទីមុន', // Carbon::now()->subSeconds(2)->diffForHumans() '2 វិនាទីមុន', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 វិនាទីមុន', // Carbon::now()->subMinutes(1)->diffForHumans() '1 នាទីមុន', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 នាទីមុន', // Carbon::now()->subMinutes(2)->diffForHumans() '2 នាទីមុន', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 នាទីមុន', // Carbon::now()->subHours(1)->diffForHumans() '1 ម៉ោងមុន', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ម៉ោងមុន', // Carbon::now()->subHours(2)->diffForHumans() '2 ម៉ោងមុន', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ម៉ោងមុន', // Carbon::now()->subDays(1)->diffForHumans() '1 ថ្ងៃមុន', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ថ្ងៃមុន', // Carbon::now()->subDays(2)->diffForHumans() '2 ថ្ងៃមុន', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ថ្ងៃមុន', // Carbon::now()->subWeeks(1)->diffForHumans() '1 សប្តាហ៍មុន', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 សប្តាហ៍មុន', // Carbon::now()->subWeeks(2)->diffForHumans() '2 សប្តាហ៍មុន', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 សប្តាហ៍មុន', // Carbon::now()->subMonths(1)->diffForHumans() '1 ខែមុន', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ខែមុន', // Carbon::now()->subMonths(2)->diffForHumans() '2 ខែមុន', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ខែមុន', // Carbon::now()->subYears(1)->diffForHumans() '1 ឆ្នាំមុន', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ឆ្នាំមុន', // Carbon::now()->subYears(2)->diffForHumans() '2 ឆ្នាំមុន', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ឆ្នាំមុន', // Carbon::now()->addSecond()->diffForHumans() '1 វិនាទីទៀត', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 វិនាទីទៀត', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'នៅ​ក្រោយ 1 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'នៅ​ក្រោយ 1 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'នៅ​មុន 1 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'នៅ​មុន 1 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 វិនាទី', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 វិនាទី', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 វិនាទីទៀត', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 នាទី 1 វិនាទី', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ឆ្នាំ 3 ខែ 1 ថ្ងៃ 1 វិនាទី', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ឆ្នាំទៀត', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ខែមុន', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ឆ្នាំ 3 ខែ 1 ថ្ងៃ 1 វិនាទីមុន', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 សប្តាហ៍ 10 ម៉ោង', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 សប្តាហ៍ 6 ថ្ងៃ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 សប្តាហ៍ 6 ថ្ងៃ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 សប្តាហ៍និង 6 ថ្ងៃទៀត', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 សប្តាហ៍ 1 ម៉ោង', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'មួយម៉ោងទៀត', // CarbonInterval::days(2)->forHumans() '2 ថ្ងៃ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ថ្ងៃ 3 ម៉ោង', ]; } ================================================ FILE: tests/Localization/KnInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KnInTest extends LocalizationTestCase { public const LOCALE = 'kn_IN'; // Kannada public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ನಾಳೆ ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಶನಿವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಭಾನುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಸೋಮವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಬುಧವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ಗುರುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಬುಧವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಗುರುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶನಿವಾರ, ರಾತ್ರಿ 12:00', // Carbon::now()->subDays(2)->calendar() 'ಕೊನೆಯ ಭಾನುವಾರ, ರಾತ್ರಿ 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ನಿನ್ನೆ ರಾತ್ರಿ 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ಇಂದು ಮಧ್ಯಾಹ್ನ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಇಂದು ರಾತ್ರಿ 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ನಾಳೆ ರಾತ್ರಿ 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ನಿನ್ನೆ ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ನಿನ್ನೆ ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಸೋಮವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಭಾನುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಶನಿವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ಕೊನೆಯ ಗುರುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ಕೊನೆಯ ಬುಧವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಕೊನೆಯ ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ನೇ 1ನೇ 1ನೇ 1ನೇ 1ನೇ', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2ನೇ 1ನೇ', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3ನೇ 1ನೇ', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4ನೇ 1ನೇ', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5ನೇ 1ನೇ', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6ನೇ 1ನೇ', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7ನೇ 2ನೇ', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11ನೇ 2ನೇ', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ನೇ', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ನೇ', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ನೇ', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ರಾತ್ರಿ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ರಾತ್ರಿ, 12:00 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ರಾತ್ರಿ, 1:30 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ರಾತ್ರಿ, 2:00 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ಬೆಳಿಗ್ಗೆ, 6:00 ಬೆಳಿಗ್ಗೆ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ಮಧ್ಯಾಹ್ನ, 10:00 ಮಧ್ಯಾಹ್ನ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ಮಧ್ಯಾಹ್ನ, 12:00 ಮಧ್ಯಾಹ್ನ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ಸಂಜೆ, 5:00 ಸಂಜೆ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ರಾತ್ರಿ, 9:30 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ರಾತ್ರಿ, 11:00 ರಾತ್ರಿ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0ನೇ', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ಸೆಕೆಂಡ್ ಹಿಂದೆ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ಸೆಕೆಂಡ್ ಹಿಂದೆ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ಸೆಕೆಂಡುಗಳು ಹಿಂದೆ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ಸೆಕೆಂಡುಗಳು ಹಿಂದೆ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ನಿಮಿಷ ಹಿಂದೆ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ನಿಮಿಷ ಹಿಂದೆ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ನಿಮಿಷಗಳು ಹಿಂದೆ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ನಿಮಿಷಗಳು ಹಿಂದೆ', // Carbon::now()->subHours(1)->diffForHumans() '1 ಗಂಟೆ ಹಿಂದೆ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ಗಂಟೆ ಹಿಂದೆ', // Carbon::now()->subHours(2)->diffForHumans() '2 ಗಂಟೆಗಳು ಹಿಂದೆ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ಗಂಟೆಗಳು ಹಿಂದೆ', // Carbon::now()->subDays(1)->diffForHumans() '1 ದಿನ ಹಿಂದೆ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ದಿನ ಹಿಂದೆ', // Carbon::now()->subDays(2)->diffForHumans() '2 ದಿನಗಳು ಹಿಂದೆ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ದಿನಗಳು ಹಿಂದೆ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ವಾರ ಹಿಂದೆ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ವಾರ ಹಿಂದೆ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ವಾರಗಳು ಹಿಂದೆ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ವಾರಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(1)->diffForHumans() '1 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subYears(1)->diffForHumans() '1 ವರ್ಷ ಹಿಂದೆ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ವರ್ಷ ಹಿಂದೆ', // Carbon::now()->subYears(2)->diffForHumans() '2 ವರ್ಷಗಳು ಹಿಂದೆ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ವರ್ಷಗಳು ಹಿಂದೆ', // Carbon::now()->addSecond()->diffForHumans() '1 ಸೆಕೆಂಡ್ ನಂತರ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ಸೆಕೆಂಡ್ ನಂತರ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ಸೆಕೆಂಡ್', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ಸೆಕೆಂಡ್', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ಸೆಕೆಂಡುಗಳು', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ಸೆಕೆಂಡುಗಳು', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ಸೆಕೆಂಡ್ ನಂತರ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ನಿಮಿಷ 1 ಸೆಕೆಂಡ್', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ವರ್ಷಗಳು 3 ತಿಂಗಳು 1 ದಿನ 1 ಸೆಕೆಂಡ್', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ವರ್ಷಗಳು ನಂತರ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ವರ್ಷಗಳು 3 ತಿಂಗಳು 1 ದಿನ 1 ಸೆಕೆಂಡ್ ಹಿಂದೆ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ವಾರ 10 ಗಂಟೆಗಳು', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ವಾರ 6 ದಿನಗಳು', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ವಾರ 6 ದಿನಗಳು', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ವಾರ, 6 ದಿನಗಳು ನಂತರ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ವಾರಗಳು 1 ಗಂಟೆ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ಒಂದು ಗಂಟೆ ನಂತರ', // CarbonInterval::days(2)->forHumans() '2 ದಿನಗಳು', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ದಿನ 3 ಗಂಟೆಗಳು', ]; } ================================================ FILE: tests/Localization/KnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KnTest extends LocalizationTestCase { public const LOCALE = 'kn'; // Kannada public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ನಾಳೆ ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಶನಿವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಭಾನುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಸೋಮವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಬುಧವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ಗುರುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಬುಧವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಗುರುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶನಿವಾರ, ರಾತ್ರಿ 12:00', // Carbon::now()->subDays(2)->calendar() 'ಕೊನೆಯ ಭಾನುವಾರ, ರಾತ್ರಿ 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ನಿನ್ನೆ ರಾತ್ರಿ 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ಇಂದು ಮಧ್ಯಾಹ್ನ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಇಂದು ರಾತ್ರಿ 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ನಾಳೆ ರಾತ್ರಿ 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ನಿನ್ನೆ ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ನಿನ್ನೆ ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಮಂಗಳವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಸೋಮವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಭಾನುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಶನಿವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಕೊನೆಯ ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ಕೊನೆಯ ಗುರುವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ಕೊನೆಯ ಬುಧವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಕೊನೆಯ ಶುಕ್ರವಾರ, ರಾತ್ರಿ 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ನೇ 1ನೇ 1ನೇ 1ನೇ 1ನೇ', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2ನೇ 1ನೇ', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3ನೇ 1ನೇ', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4ನೇ 1ನೇ', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5ನೇ 1ನೇ', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6ನೇ 1ನೇ', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7ನೇ 2ನೇ', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11ನೇ 2ನೇ', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ನೇ', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ನೇ', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ನೇ', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ರಾತ್ರಿ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ರಾತ್ರಿ, 12:00 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ರಾತ್ರಿ, 1:30 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ರಾತ್ರಿ, 2:00 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ಬೆಳಿಗ್ಗೆ, 6:00 ಬೆಳಿಗ್ಗೆ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ಮಧ್ಯಾಹ್ನ, 10:00 ಮಧ್ಯಾಹ್ನ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ಮಧ್ಯಾಹ್ನ, 12:00 ಮಧ್ಯಾಹ್ನ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ಸಂಜೆ, 5:00 ಸಂಜೆ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ರಾತ್ರಿ, 9:30 ರಾತ್ರಿ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ರಾತ್ರಿ, 11:00 ರಾತ್ರಿ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0ನೇ', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ಸೆಕೆಂಡ್ ಹಿಂದೆ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ಸೆಕೆಂಡ್ ಹಿಂದೆ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ಸೆಕೆಂಡುಗಳು ಹಿಂದೆ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ಸೆಕೆಂಡುಗಳು ಹಿಂದೆ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ನಿಮಿಷ ಹಿಂದೆ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ನಿಮಿಷ ಹಿಂದೆ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ನಿಮಿಷಗಳು ಹಿಂದೆ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ನಿಮಿಷಗಳು ಹಿಂದೆ', // Carbon::now()->subHours(1)->diffForHumans() '1 ಗಂಟೆ ಹಿಂದೆ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ಗಂಟೆ ಹಿಂದೆ', // Carbon::now()->subHours(2)->diffForHumans() '2 ಗಂಟೆಗಳು ಹಿಂದೆ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ಗಂಟೆಗಳು ಹಿಂದೆ', // Carbon::now()->subDays(1)->diffForHumans() '1 ದಿನ ಹಿಂದೆ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ದಿನ ಹಿಂದೆ', // Carbon::now()->subDays(2)->diffForHumans() '2 ದಿನಗಳು ಹಿಂದೆ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ದಿನಗಳು ಹಿಂದೆ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ವಾರ ಹಿಂದೆ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ವಾರ ಹಿಂದೆ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ವಾರಗಳು ಹಿಂದೆ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ವಾರಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(1)->diffForHumans() '1 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subYears(1)->diffForHumans() '1 ವರ್ಷ ಹಿಂದೆ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ವರ್ಷ ಹಿಂದೆ', // Carbon::now()->subYears(2)->diffForHumans() '2 ವರ್ಷಗಳು ಹಿಂದೆ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ವರ್ಷಗಳು ಹಿಂದೆ', // Carbon::now()->addSecond()->diffForHumans() '1 ಸೆಕೆಂಡ್ ನಂತರ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ಸೆಕೆಂಡ್ ನಂತರ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ಸೆಕೆಂಡ್', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ಸೆಕೆಂಡ್', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ಸೆಕೆಂಡುಗಳು', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ಸೆಕೆಂಡುಗಳು', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ಸೆಕೆಂಡ್ ನಂತರ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ನಿಮಿಷ 1 ಸೆಕೆಂಡ್', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ವರ್ಷಗಳು 3 ತಿಂಗಳು 1 ದಿನ 1 ಸೆಕೆಂಡ್', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ವರ್ಷಗಳು ನಂತರ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ತಿಂಗಳು ಹಿಂದೆ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ವರ್ಷಗಳು 3 ತಿಂಗಳು 1 ದಿನ 1 ಸೆಕೆಂಡ್ ಹಿಂದೆ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ವಾರ 10 ಗಂಟೆಗಳು', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ವಾರ 6 ದಿನಗಳು', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ವಾರ 6 ದಿನಗಳು', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ವಾರ, 6 ದಿನಗಳು ನಂತರ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ವಾರಗಳು 1 ಗಂಟೆ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ಒಂದು ಗಂಟೆ ನಂತರ', // CarbonInterval::days(2)->forHumans() '2 ದಿನಗಳು', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ದಿನ 3 ಗಂಟೆಗಳು', ]; } ================================================ FILE: tests/Localization/KoKpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KoKpTest extends LocalizationTestCase { public const LOCALE = 'ko_KP'; // Korean public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '내일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '토요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '일요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '월요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '수요일 오전 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '목요일 오전 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '금요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '수요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '목요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '금요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '토요일 오전 12:00', // Carbon::now()->subDays(2)->calendar() '지난주 일요일 오후 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '어제 오후 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '오늘 오전 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '오늘 오전 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) '내일 오전 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '어제 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '어제 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 화요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 월요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 일요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 토요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 금요일 오전 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '지난주 목요일 오전 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '지난주 수요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '지난주 금요일 오전 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1월 1월 1일 1주 1주', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2일 1주', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3일 1주', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4일 1주', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5일 1주', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6일 1주', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7일 1주', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11일 2주', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40일', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41일', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100일', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 오전 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 오전, 12:00 오전', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 오전, 1:30 오전', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 오전, 2:00 오전', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 오전, 6:00 오전', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 오전, 10:00 오전', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 오후, 12:00 오후', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 오후, 5:00 오후', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 오후, 9:30 오후', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 오후, 11:00 오후', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1초 전', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1초 전', // Carbon::now()->subSeconds(2)->diffForHumans() '2초 전', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2초 전', // Carbon::now()->subMinutes(1)->diffForHumans() '1분 전', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1분 전', // Carbon::now()->subMinutes(2)->diffForHumans() '2분 전', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2분 전', // Carbon::now()->subHours(1)->diffForHumans() '1시간 전', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1시간 전', // Carbon::now()->subHours(2)->diffForHumans() '2시간 전', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2시간 전', // Carbon::now()->subDays(1)->diffForHumans() '1일 전', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1일 전', // Carbon::now()->subDays(2)->diffForHumans() '2일 전', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2일 전', // Carbon::now()->subWeeks(1)->diffForHumans() '1주 전', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1주일 전', // Carbon::now()->subWeeks(2)->diffForHumans() '2주 전', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2주일 전', // Carbon::now()->subMonths(1)->diffForHumans() '1개월 전', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1개월 전', // Carbon::now()->subMonths(2)->diffForHumans() '2개월 전', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2개월 전', // Carbon::now()->subYears(1)->diffForHumans() '1년 전', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1년 전', // Carbon::now()->subYears(2)->diffForHumans() '2년 전', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2년 전', // Carbon::now()->addSecond()->diffForHumans() '1초 후', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1초 후', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1초 후', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1초 후', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1초 전', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1초 전', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1초', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1초', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2초', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2초', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1초 후', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1분 1초', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2년 3개월 1일 1초', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3년 후', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5개월 전', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2년 3개월 1일 1초 전', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1주 10시간', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1주 6일', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1주 6일', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1주 6일 후', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2주 1시간', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '한시간 후', // CarbonInterval::days(2)->forHumans() '2일', // CarbonInterval::create('P1DT3H')->forHumans(true) '1일 3시간', ]; } ================================================ FILE: tests/Localization/KoKrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KoKrTest extends LocalizationTestCase { public const LOCALE = 'ko_KR'; // Korean public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '내일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '토요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '일요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '월요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '수요일 오전 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '목요일 오전 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '금요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '수요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '목요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '금요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '토요일 오전 12:00', // Carbon::now()->subDays(2)->calendar() '지난주 일요일 오후 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '어제 오후 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '오늘 오전 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '오늘 오전 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) '내일 오전 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '어제 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '어제 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 화요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 월요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 일요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 토요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 금요일 오전 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '지난주 목요일 오전 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '지난주 수요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '지난주 금요일 오전 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1월 1월 1일 1주 1주', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2일 1주', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3일 1주', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4일 1주', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5일 1주', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6일 1주', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7일 2주', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11일 2주', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40일', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41일', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100일', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 오전 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 오전, 12:00 오전', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 오전, 1:30 오전', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 오전, 2:00 오전', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 오전, 6:00 오전', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 오전, 10:00 오전', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 오후, 12:00 오후', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 오후, 5:00 오후', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 오후, 9:30 오후', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 오후, 11:00 오후', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1초 전', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1초 전', // Carbon::now()->subSeconds(2)->diffForHumans() '2초 전', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2초 전', // Carbon::now()->subMinutes(1)->diffForHumans() '1분 전', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1분 전', // Carbon::now()->subMinutes(2)->diffForHumans() '2분 전', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2분 전', // Carbon::now()->subHours(1)->diffForHumans() '1시간 전', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1시간 전', // Carbon::now()->subHours(2)->diffForHumans() '2시간 전', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2시간 전', // Carbon::now()->subDays(1)->diffForHumans() '1일 전', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1일 전', // Carbon::now()->subDays(2)->diffForHumans() '2일 전', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2일 전', // Carbon::now()->subWeeks(1)->diffForHumans() '1주 전', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1주일 전', // Carbon::now()->subWeeks(2)->diffForHumans() '2주 전', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2주일 전', // Carbon::now()->subMonths(1)->diffForHumans() '1개월 전', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1개월 전', // Carbon::now()->subMonths(2)->diffForHumans() '2개월 전', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2개월 전', // Carbon::now()->subYears(1)->diffForHumans() '1년 전', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1년 전', // Carbon::now()->subYears(2)->diffForHumans() '2년 전', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2년 전', // Carbon::now()->addSecond()->diffForHumans() '1초 후', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1초 후', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1초 후', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1초 후', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1초 전', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1초 전', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1초', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1초', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2초', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2초', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1초 후', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1분 1초', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2년 3개월 1일 1초', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3년 후', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5개월 전', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2년 3개월 1일 1초 전', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1주 10시간', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1주 6일', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1주 6일', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1주 6일 후', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2주 1시간', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '한시간 후', // CarbonInterval::days(2)->forHumans() '2일', // CarbonInterval::create('P1DT3H')->forHumans(true) '1일 3시간', ]; } ================================================ FILE: tests/Localization/KoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KoTest extends LocalizationTestCase { public const LOCALE = 'ko'; // Korean public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '내일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '토요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '일요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '월요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '수요일 오전 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '목요일 오전 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '금요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '수요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '목요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '금요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '토요일 오전 12:00', // Carbon::now()->subDays(2)->calendar() '지난주 일요일 오후 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '어제 오후 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '오늘 오전 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '오늘 오전 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) '내일 오전 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '화요일 오전 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '어제 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '어제 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 화요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 월요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 일요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 토요일 오전 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '지난주 금요일 오전 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '지난주 목요일 오전 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '지난주 수요일 오전 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '지난주 금요일 오전 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1월 1월 1일 1주 1주', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2일 1주', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3일 1주', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4일 1주', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5일 1주', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6일 1주', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7일 2주', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11일 2주', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40일', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41일', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100일', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 오전 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 오전, 12:00 오전', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 오전, 1:30 오전', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 오전, 2:00 오전', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 오전, 6:00 오전', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 오전, 10:00 오전', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 오후, 12:00 오후', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 오후, 5:00 오후', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 오후, 9:30 오후', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 오후, 11:00 오후', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1초 전', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1초 전', // Carbon::now()->subSeconds(2)->diffForHumans() '2초 전', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2초 전', // Carbon::now()->subMinutes(1)->diffForHumans() '1분 전', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1분 전', // Carbon::now()->subMinutes(2)->diffForHumans() '2분 전', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2분 전', // Carbon::now()->subHours(1)->diffForHumans() '1시간 전', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1시간 전', // Carbon::now()->subHours(2)->diffForHumans() '2시간 전', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2시간 전', // Carbon::now()->subDays(1)->diffForHumans() '1일 전', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1일 전', // Carbon::now()->subDays(2)->diffForHumans() '2일 전', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2일 전', // Carbon::now()->subWeeks(1)->diffForHumans() '1주 전', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1주일 전', // Carbon::now()->subWeeks(2)->diffForHumans() '2주 전', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2주일 전', // Carbon::now()->subMonths(1)->diffForHumans() '1개월 전', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1개월 전', // Carbon::now()->subMonths(2)->diffForHumans() '2개월 전', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2개월 전', // Carbon::now()->subYears(1)->diffForHumans() '1년 전', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1년 전', // Carbon::now()->subYears(2)->diffForHumans() '2년 전', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2년 전', // Carbon::now()->addSecond()->diffForHumans() '1초 후', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1초 후', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1초 후', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1초 후', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1초 전', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1초 전', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1초', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1초', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2초', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2초', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1초 후', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1분 1초', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2년 3개월 1일 1초', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3년 후', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5개월 전', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2년 3개월 1일 1초 전', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1주 10시간', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1주 6일', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1주 6일', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1주 6일 후', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2주 1시간', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '한시간 후', // CarbonInterval::days(2)->forHumans() '2일', // CarbonInterval::create('P1DT3H')->forHumans(true) '1일 3시간', ]; } ================================================ FILE: tests/Localization/KokInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KokInTest extends LocalizationTestCase { public const LOCALE = 'kok_IN'; // Konkani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शेनवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आयतार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 म.पू.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बेरेसतार at 12:00 म.पू.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बेरेसतार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शेनवार at 12:00 म.पू.', // Carbon::now()->subDays(2)->calendar() 'Last आयतार at 8:49 म.नं.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 म.नं.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 म.पू.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last आयतार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शेनवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बेरेसतार at 12:00 म.पू.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 म.पू. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 म.पू., 12:00 म.पू.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 म.पू., 1:30 म.पू.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 म.पू., 2:00 म.पू.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 म.पू., 6:00 म.पू.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 म.पू., 10:00 म.पू.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 म.नं., 12:00 म.नं.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 म.नं., 5:00 म.नं.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 म.नं., 9:30 म.नं.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 म.नं., 11:00 म.नं.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 तेंको ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 तेंको ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 तेंको ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 तेंको ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 नोंद ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 नोंद ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 नोंद ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 नोंद ago', // Carbon::now()->subHours(1)->diffForHumans() '1 घंते ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घंते ago', // Carbon::now()->subHours(2)->diffForHumans() '2 घंते ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घंते ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिवसु ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिवसु ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिवसु ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिवसु ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 आदित्यवार ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 आदित्यवार ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 आदित्यवार ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 आदित्यवार ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 मैनो ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 मैनो ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 मैनो ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 मैनो ago', // Carbon::now()->subYears(1)->diffForHumans() '1 वैशाकु ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वैशाकु ago', // Carbon::now()->subYears(2)->diffForHumans() '2 वैशाकु ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वैशाकु ago', // Carbon::now()->addSecond()->diffForHumans() '1 तेंको from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 तेंको from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 तेंको after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 तेंको after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 तेंको before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 तेंको before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 तेंको', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 तेंको', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 तेंको', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 तेंको', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 तेंको from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 नोंद 1 तेंको', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वैशाकु 3 मैनो 1 दिवसु 1 तेंको', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वैशाकु from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 मैनो ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वैशाकु 3 मैनो 1 दिवसु 1 तेंको ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 आदित्यवार 10 घंते', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आदित्यवार 6 दिवसु', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आदित्यवार 6 दिवसु', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 आदित्यवार and 6 दिवसु from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 आदित्यवार 1 घंते', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 घंते from now', // CarbonInterval::days(2)->forHumans() '2 दिवसु', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिवसु 3 घंते', ]; } ================================================ FILE: tests/Localization/KokTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KokTest extends LocalizationTestCase { public const LOCALE = 'kok'; // Konkani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शेनवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आयतार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 म.पू.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बेरेसतार at 12:00 म.पू.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बेरेसतार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शेनवार at 12:00 म.पू.', // Carbon::now()->subDays(2)->calendar() 'Last आयतार at 8:49 म.नं.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 म.नं.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 म.पू.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगळवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last आयतार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शेनवार at 12:00 म.पू.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बेरेसतार at 12:00 म.पू.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 म.पू.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुकरार at 12:00 म.पू.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 म.पू. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 म.पू., 12:00 म.पू.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 म.पू., 1:30 म.पू.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 म.पू., 2:00 म.पू.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 म.पू., 6:00 म.पू.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 म.पू., 10:00 म.पू.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 म.नं., 12:00 म.नं.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 म.नं., 5:00 म.नं.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 म.नं., 9:30 म.नं.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 म.नं., 11:00 म.नं.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 तेंको ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 तेंको ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 तेंको ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 तेंको ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 नोंद ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 नोंद ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 नोंद ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 नोंद ago', // Carbon::now()->subHours(1)->diffForHumans() '1 घंते ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घंते ago', // Carbon::now()->subHours(2)->diffForHumans() '2 घंते ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घंते ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिवसु ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिवसु ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिवसु ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिवसु ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 आदित्यवार ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 आदित्यवार ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 आदित्यवार ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 आदित्यवार ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 मैनो ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 मैनो ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 मैनो ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 मैनो ago', // Carbon::now()->subYears(1)->diffForHumans() '1 वैशाकु ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वैशाकु ago', // Carbon::now()->subYears(2)->diffForHumans() '2 वैशाकु ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वैशाकु ago', // Carbon::now()->addSecond()->diffForHumans() '1 तेंको from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 तेंको from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 तेंको after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 तेंको after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 तेंको before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 तेंको before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 तेंको', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 तेंको', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 तेंको', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 तेंको', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 तेंको from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 नोंद 1 तेंको', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वैशाकु 3 मैनो 1 दिवसु 1 तेंको', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वैशाकु from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 मैनो ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वैशाकु 3 मैनो 1 दिवसु 1 तेंको ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 आदित्यवार 10 घंते', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आदित्यवार 6 दिवसु', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आदित्यवार 6 दिवसु', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 आदित्यवार and 6 दिवसु from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 आदित्यवार 1 घंते', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 घंते from now', // CarbonInterval::days(2)->forHumans() '2 दिवसु', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिवसु 3 घंते', ]; } ================================================ FILE: tests/Localization/KsInDevanagariTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KsInDevanagariTest extends LocalizationTestCase { public const LOCALE = 'ks_IN@devanagari'; // Kashmiri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बटुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आथवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'चॅ़दुरवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ब्वदवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ब्रसवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शोकुरवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ब्वदवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ब्रसवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शोकुरवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बटुवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last आथवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last बोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last चॅ़दुरवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last आथवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last बटुवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शोकुरवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ब्रसवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ब्वदवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शोकुरवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KsInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KsInTest extends LocalizationTestCase { public const LOCALE = 'ks_IN'; // Kashmiri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بٹوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آتهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ژءندروار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بودهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'برىسوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بودهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'برىسوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بٹوار at 12:00 دوپھربرونھ', // Carbon::now()->subDays(2)->calendar() 'Last آتهوار at 8:49 دوپھرپتھ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 دوپھرپتھ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 دوپھربرونھ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ژءندروار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last آتهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last بٹوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last برىسوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last بودهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 دوپھربرونھ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 دوپھربرونھ, 12:00 دوپھربرونھ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 دوپھربرونھ, 1:30 دوپھربرونھ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 دوپھربرونھ, 2:00 دوپھربرونھ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 دوپھربرونھ, 6:00 دوپھربرونھ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 دوپھربرونھ, 10:00 دوپھربرونھ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 دوپھرپتھ, 12:00 دوپھرپتھ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 دوپھرپتھ, 5:00 دوپھرپتھ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 دوپھرپتھ, 9:30 دوپھرپتھ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 دوپھرپتھ, 11:00 دوپھرپتھ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 दोʼयुम ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 दोʼयुम ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 दोʼयुम ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 दोʼयुम ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 فَن ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 فَن ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 فَن ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 فَن ago', // Carbon::now()->subHours(1)->diffForHumans() '1 سۄن ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 سۄن ago', // Carbon::now()->subHours(2)->diffForHumans() '2 سۄن ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 سۄن ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 آتھٕوار ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 آتھٕوار ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 آتھٕوار ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 آتھٕوار ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 रान् ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 रान् ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 रान् ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 रान् ago', // Carbon::now()->subYears(1)->diffForHumans() '1 آب ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 آب ago', // Carbon::now()->subYears(2)->diffForHumans() '2 آب ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 آب ago', // Carbon::now()->addSecond()->diffForHumans() '1 दोʼयुम from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 दोʼयुम from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 दोʼयुम after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 दोʼयुम after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 दोʼयुम before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 दोʼयुम before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 दोʼयुम', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 दोʼयुम', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 दोʼयुम', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 दोʼयुम', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 दोʼयुम from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 فَن 1 दोʼयुम', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 آب 3 रान् 1d 1 दोʼयुम', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 آب from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 रान् ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 آب 3 रान् 1d 1 दोʼयुम ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 آتھٕوار 10 سۄن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 آتھٕوار 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 آتھٕوار 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 آتھٕوار and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 آتھٕوار 1 سۄن', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 سۄن from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3 سۄن', ]; } ================================================ FILE: tests/Localization/KsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KsTest extends LocalizationTestCase { public const LOCALE = 'ks'; // Kashmiri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بٹوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آتهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ژءندروار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بودهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'برىسوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بودهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'برىسوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بٹوار at 12:00 دوپھربرونھ', // Carbon::now()->subDays(2)->calendar() 'Last آتهوار at 8:49 دوپھرپتھ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 دوپھرپتھ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 دوپھربرونھ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last بوءںوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ژءندروار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last آتهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last بٹوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last برىسوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last بودهوار at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last جمع at 12:00 دوپھربرونھ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 دوپھربرونھ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 دوپھربرونھ, 12:00 دوپھربرونھ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 دوپھربرونھ, 1:30 دوپھربرونھ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 دوپھربرونھ, 2:00 دوپھربرونھ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 دوپھربرونھ, 6:00 دوپھربرونھ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 دوپھربرونھ, 10:00 دوپھربرونھ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 دوپھرپتھ, 12:00 دوپھرپتھ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 دوپھرپتھ, 5:00 دوپھرپتھ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 دوپھرپتھ, 9:30 دوپھرپتھ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 دوپھرپتھ, 11:00 دوپھرپتھ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 दोʼयुम ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 दोʼयुम ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 दोʼयुम ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 दोʼयुम ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 فَن ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 فَن ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 فَن ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 فَن ago', // Carbon::now()->subHours(1)->diffForHumans() '1 سۄن ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 سۄن ago', // Carbon::now()->subHours(2)->diffForHumans() '2 سۄن ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 سۄن ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 آتھٕوار ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 آتھٕوار ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 آتھٕوار ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 آتھٕوار ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 रान् ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 रान् ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 रान् ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 रान् ago', // Carbon::now()->subYears(1)->diffForHumans() '1 آب ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 آب ago', // Carbon::now()->subYears(2)->diffForHumans() '2 آب ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 آب ago', // Carbon::now()->addSecond()->diffForHumans() '1 दोʼयुम from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 दोʼयुम from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 दोʼयुम after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 दोʼयुम after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 दोʼयुम before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 दोʼयुम before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 दोʼयुम', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 दोʼयुम', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 दोʼयुम', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 दोʼयुम', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 दोʼयुम from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 فَن 1 दोʼयुम', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 آب 3 रान् 1d 1 दोʼयुम', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 آب from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 रान् ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 آب 3 रान् 1d 1 दोʼयुम ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 آتھٕوار 10 سۄن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 آتھٕوار 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 آتھٕوار 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 آتھٕوار and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 آتھٕوار 1 سۄن', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 سۄن from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3 سۄن', ]; } ================================================ FILE: tests/Localization/KsbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KsbTest extends LocalizationTestCase { public const LOCALE = 'ksb'; // Shambala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaapii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaane at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaane at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumaapii at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaane at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaane at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaapii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumaatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 makeo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 makeo, 12:00 makeo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 makeo, 1:30 makeo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 makeo, 2:00 makeo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 makeo, 6:00 makeo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 makeo, 10:00 makeo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 nyiaghuo, 12:00 nyiaghuo', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 nyiaghuo, 5:00 nyiaghuo', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 nyiaghuo, 9:30 nyiaghuo', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 nyiaghuo, 11:00 nyiaghuo', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KsfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KsfTest extends LocalizationTestCase { public const LOCALE = 'ksf'; // Bafia public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samdí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndǝ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lǝndí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maadí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mɛkrɛdí at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jǝǝdí at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'júmbá at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maadí at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mɛkrɛdí at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jǝǝdí at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'júmbá at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samdí at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sɔ́ndǝ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maadí at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maadí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lǝndí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sɔ́ndǝ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last samdí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last júmbá at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last jǝǝdí at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mɛkrɛdí at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last júmbá at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 sárúwá CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 sárúwá, 12:00 sárúwá', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 sárúwá, 1:30 sárúwá', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 sárúwá, 2:00 sárúwá', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 sárúwá, 6:00 sárúwá', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 sárúwá, 10:00 sárúwá', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 cɛɛ́nko, 12:00 cɛɛ́nko', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 cɛɛ́nko, 5:00 cɛɛ́nko', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 cɛɛ́nko, 9:30 cɛɛ́nko', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 cɛɛ́nko, 11:00 cɛɛ́nko', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/KshTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KshTest extends LocalizationTestCase { public const LOCALE = 'ksh'; // Colognian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samsdaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunndaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mohndaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dinnsdaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Metwoch at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunnersdaach at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friidaach at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinnsdaach at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Metwoch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunnersdaach at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friidaach at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samsdaach at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunndaach at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dinnsdaach at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dinnsdaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mohndaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunndaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samsdaach at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friidaach at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunnersdaach at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Metwoch at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friidaach at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 v.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 v.M., 12:00 v.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 v.M., 1:30 v.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 v.M., 2:00 v.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 v.M., 6:00 v.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 v.M., 10:00 v.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 n.M., 12:00 n.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 n.M., 5:00 n.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 n.M., 9:30 n.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 n.M., 11:00 n.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Sekůndt ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Sekůndt ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Sekůndt ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Sekůndt ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Menutt ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Menutt ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Menutt ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Menutt ago', // Carbon::now()->subHours(1)->diffForHumans() '1 Uhr ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 Uhr ago', // Carbon::now()->subHours(2)->diffForHumans() '2 Uhr ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 Uhr ago', // Carbon::now()->subDays(1)->diffForHumans() '1 Daach ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 Daach ago', // Carbon::now()->subDays(2)->diffForHumans() '2 Daach ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 Daach ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 woch ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 woch ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 woch ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 woch ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Moohnd ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Moohnd ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Moohnd ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Moohnd ago', // Carbon::now()->subYears(1)->diffForHumans() '1 Johr ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 Johr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 Johr ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 Johr ago', // Carbon::now()->addSecond()->diffForHumans() '1 Sekůndt from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Sekůndt from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekůndt after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sekůndt after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekůndt before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sekůndt before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekůndt', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekůndt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekůndt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekůndt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Sekůndt from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Menutt 1 Sekůndt', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 Johr 3 Moohnd 1 Daach 1 Sekůndt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 Johr from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Moohnd ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 Johr 3 Moohnd 1 Daach 1 Sekůndt ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 woch 10 Uhr', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 woch 6 Daach', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 woch 6 Daach', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 woch and 6 Daach from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 woch 1 Uhr', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 Uhr from now', // CarbonInterval::days(2)->forHumans() '2 Daach', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Daach 3 Uhr', ]; } ================================================ FILE: tests/Localization/KuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KuTest extends LocalizationTestCase { public const LOCALE = 'ku'; // Kurdish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'şemî at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'yekşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'duşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'sêşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'çarşem at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'pêncşem at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'în at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'sêşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'çarşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'pêncşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'în at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'şemî at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last yekşem at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'sêşem at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last sêşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last duşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last yekşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last şemî at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last în at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last pêncşem at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last çarşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last în at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'berî 1 saniye', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'berî 1 saniye', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'berî 2 saniye', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'berî 2 saniye', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'berî 1 deqîqe', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'berî 1 deqîqe', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'berî 2 deqîqe', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'berî 2 deqîqe', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'berî 1 saet', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'berî 1 saet', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'berî 2 saet', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'berî 2 saet', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'berî 1 roj', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'berî 1 roj', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'berî 2 roj', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'berî 2 roj', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'berî 1 hefte', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'berî 1 hefte', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'berî 2 hefte', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'berî 2 hefte', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'berî 1 meh', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'berî 1 meh', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'berî 2 meh', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'berî 2 meh', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'berî 1 salê', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'berî 1 salê', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'berî 2 salan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'berî 2 salan', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'di 1 saniye de', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'di 1 saniye de', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 saniye piştî', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 saniye piştî', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 saniye berê', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 saniye berê', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 saniye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 saniye', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'di 1 saniye de', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 deqîqe 1 saniye', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 sal 3 meh 1 roj 1 saniye', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'di 3 salan de', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'berî 5 meh', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'berî 2 salan 3 meh 1 roj 1 saniye', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 hefte 10 saet', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hefte 6 roj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hefte 6 roj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'di 1 hefte û 6 roj de', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 hefte 1 saet', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'di 1 saet de', // CarbonInterval::days(2)->forHumans() // '2 days' '2 roj', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 roj 3 saet', ]; } ================================================ FILE: tests/Localization/KuTrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KuTrTest extends LocalizationTestCase { public const LOCALE = 'ku_TR'; // Kurdish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'şemî at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'yekşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'duşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'sêşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'çarşem at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'pêncşem at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'în at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'sêşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'çarşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'pêncşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'în at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'şemî at 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last yekşem at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'sêşem at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last sêşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last duşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last yekşem at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last şemî at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last în at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last pêncşem at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last çarşem at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last în at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'berî 1 saniye', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'berî 1 saniye', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'berî 2 saniye', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'berî 2 saniye', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'berî 1 deqîqe', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'berî 1 deqîqe', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'berî 2 deqîqe', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'berî 2 deqîqe', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'berî 1 saet', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'berî 1 saet', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'berî 2 saet', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'berî 2 saet', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'berî 1 roj', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'berî 1 roj', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'berî 2 roj', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'berî 2 roj', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'berî 1 hefte', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'berî 1 hefte', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'berî 2 hefte', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'berî 2 hefte', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'berî 1 meh', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'berî 1 meh', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'berî 2 meh', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'berî 2 meh', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'berî 1 salê', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'berî 1 salê', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'berî 2 salan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'berî 2 salan', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'di 1 saniye de', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'di 1 saniye de', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 saniye piştî', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 saniye piştî', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 saniye berê', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 saniye berê', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 saniye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 saniye', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'di 1 saniye de', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 deqîqe 1 saniye', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 sal 3 meh 1 roj 1 saniye', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'di 3 salan de', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'berî 5 meh', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'berî 2 salan 3 meh 1 roj 1 saniye', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 hefte 10 saet', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hefte 6 roj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hefte 6 roj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'di 1 hefte û 6 roj de', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 hefte 1 saet', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'di 1 saet de', // CarbonInterval::days(2)->forHumans() // '2 days' '2 roj', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 roj 3 saet', ]; } ================================================ FILE: tests/Localization/KwGbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KwGbTest extends LocalizationTestCase { public const LOCALE = 'kw_GB'; // Cornish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Sadorn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Sul at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Lun at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Merth at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Merher at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'De Yow at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'De Gwener at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Merth at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Merher at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Yow at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Gwener at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Sadorn at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last De Sul at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Merth at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Merth at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Lun at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Sul at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Sadorn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Gwener at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last De Yow at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last De Merher at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last De Gwener at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 pryjwyth ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 pryjwyth ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 pryjwyth ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 pryjwyth ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mynysen ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mynysen ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mynysen ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mynysen ago', // Carbon::now()->subHours(1)->diffForHumans() '1 eur ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 eur ago', // Carbon::now()->subHours(2)->diffForHumans() '2 eur ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 eur ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dydh ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dydh ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dydh ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dydh ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 seythen ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 seythen ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 seythen ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 seythen ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mis ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mis ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mis ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mis ago', // Carbon::now()->subYears(1)->diffForHumans() '1 bledhen ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 bledhen ago', // Carbon::now()->subYears(2)->diffForHumans() '2 bledhen ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 bledhen ago', // Carbon::now()->addSecond()->diffForHumans() '1 pryjwyth from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 pryjwyth from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 pryjwyth after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 pryjwyth after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 pryjwyth before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 pryjwyth before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 pryjwyth', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 pryjwyth', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 pryjwyth', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 pryjwyth', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 pryjwyth from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mynysen 1 pryjwyth', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 bledhen 3 mis 1 dydh 1 pryjwyth', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 bledhen from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mis ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 bledhen 3 mis 1 dydh 1 pryjwyth ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 seythen 10 eur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seythen 6 dydh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seythen 6 dydh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 seythen and 6 dydh from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 seythen 1 eur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 eur from now', // CarbonInterval::days(2)->forHumans() '2 dydh', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dydh 3 eur', ]; } ================================================ FILE: tests/Localization/KwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KwTest extends LocalizationTestCase { public const LOCALE = 'kw'; // Cornish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Sadorn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Sul at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Lun at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Merth at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'De Merher at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'De Yow at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'De Gwener at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Merth at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Merher at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Yow at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Gwener at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Sadorn at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last De Sul at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'De Merth at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Merth at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Lun at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Sul at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Sadorn at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last De Gwener at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last De Yow at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last De Merher at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last De Gwener at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 pryjwyth ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 pryjwyth ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 pryjwyth ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 pryjwyth ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mynysen ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mynysen ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mynysen ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mynysen ago', // Carbon::now()->subHours(1)->diffForHumans() '1 eur ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 eur ago', // Carbon::now()->subHours(2)->diffForHumans() '2 eur ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 eur ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dydh ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dydh ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dydh ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dydh ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 seythen ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 seythen ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 seythen ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 seythen ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mis ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mis ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mis ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mis ago', // Carbon::now()->subYears(1)->diffForHumans() '1 bledhen ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 bledhen ago', // Carbon::now()->subYears(2)->diffForHumans() '2 bledhen ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 bledhen ago', // Carbon::now()->addSecond()->diffForHumans() '1 pryjwyth from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 pryjwyth from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 pryjwyth after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 pryjwyth after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 pryjwyth before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 pryjwyth before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 pryjwyth', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 pryjwyth', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 pryjwyth', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 pryjwyth', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 pryjwyth from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mynysen 1 pryjwyth', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 bledhen 3 mis 1 dydh 1 pryjwyth', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 bledhen from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mis ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 bledhen 3 mis 1 dydh 1 pryjwyth ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 seythen 10 eur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seythen 6 dydh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seythen 6 dydh', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 seythen and 6 dydh from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 seythen 1 eur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 eur from now', // CarbonInterval::days(2)->forHumans() '2 dydh', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dydh 3 eur', ]; } ================================================ FILE: tests/Localization/KyKgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KyKgTest extends LocalizationTestCase { public const LOCALE = 'ky_KG'; // Kirghiz public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Эртең саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ишемби саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Жекшемби саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дүйшөмбү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шейшемби саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шаршемби саат 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Бейшемби саат 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Жума саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шейшемби саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шаршемби саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Бейшемби саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Жума саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ишемби саат 00:00', // Carbon::now()->subDays(2)->calendar() 'Өткен аптанын Жекшемби күнү саат 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кече саат 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Бүгүн саат 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Бүгүн саат 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Эртең саат 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шейшемби саат 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Кече саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кече саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Шейшемби күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Дүйшөмбү күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Жекшемби күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Ишемби күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Жума күнү саат 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Өткен аптанын Бейшемби күнү саат 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Өткен аптанын Шаршемби күнү саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Өткен аптанын Жума күнү саат 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-чи 1-чи 1-чи 1-чи 1-чи', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-чи 1-чи', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-чү 1-чи', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-чү 1-чи', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-чи 1-чи', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-чы 1-чи', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-чи 1-чи', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-чи 2-чи', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-чы', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-чи', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-чү', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 таңкы CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 таңкы, 12:00 таңкы', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 таңкы, 1:30 таңкы', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 таңкы, 2:00 таңкы', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 таңкы, 6:00 таңкы', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 таңкы, 10:00 таңкы', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 түштөн кийинки, 12:00 түштөн кийинки', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 түштөн кийинки, 5:00 түштөн кийинки', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 түштөн кийинки, 9:30 түштөн кийинки', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 түштөн кийинки, 11:00 түштөн кийинки', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-чү', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунд мурун', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. мурун', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунд мурун', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. мурун', // Carbon::now()->subMinutes(1)->diffForHumans() '1 мүнөт мурун', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мүн. мурун', // Carbon::now()->subMinutes(2)->diffForHumans() '2 мүнөт мурун', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мүн. мурун', // Carbon::now()->subHours(1)->diffForHumans() '1 саат мурун', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 саат. мурун', // Carbon::now()->subHours(2)->diffForHumans() '2 саат мурун', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 саат. мурун', // Carbon::now()->subDays(1)->diffForHumans() '1 күн мурун', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 күн мурун', // Carbon::now()->subDays(2)->diffForHumans() '2 күн мурун', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 күн мурун', // Carbon::now()->subWeeks(1)->diffForHumans() '1 апта мурун', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 апт. мурун', // Carbon::now()->subWeeks(2)->diffForHumans() '2 апта мурун', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 апт. мурун', // Carbon::now()->subMonths(1)->diffForHumans() '1 ай мурун', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ай мурун', // Carbon::now()->subMonths(2)->diffForHumans() '2 ай мурун', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ай мурун', // Carbon::now()->subYears(1)->diffForHumans() '1 жыл мурун', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 жыл мурун', // Carbon::now()->subYears(2)->diffForHumans() '2 жыл мурун', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 жыл мурун', // Carbon::now()->addSecond()->diffForHumans() '1 секунд ичинде', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 сек. ичинде', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 сек. ичинде', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 мүнөт 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 жыл 3 ай 1 күн 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 жыл ичинде', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ай мурун', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 жыл 3 ай 1 күн 1 сек. мурун', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 апта 10 саат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 апта 6 күн ичинде', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 апта 1 саат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'бир саат ичинде', // CarbonInterval::days(2)->forHumans() '2 күн', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 күн 3 саат.', ]; } ================================================ FILE: tests/Localization/KyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class KyTest extends LocalizationTestCase { public const LOCALE = 'ky'; // Kirghiz public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Эртең саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ишемби саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Жекшемби саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дүйшөмбү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шейшемби саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шаршемби саат 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Бейшемби саат 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Жума саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шейшемби саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шаршемби саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Бейшемби саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Жума саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ишемби саат 00:00', // Carbon::now()->subDays(2)->calendar() 'Өткен аптанын Жекшемби күнү саат 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кече саат 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Бүгүн саат 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Бүгүн саат 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Эртең саат 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шейшемби саат 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Кече саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кече саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Шейшемби күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Дүйшөмбү күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Жекшемби күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Ишемби күнү саат 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Өткен аптанын Жума күнү саат 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Өткен аптанын Бейшемби күнү саат 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Өткен аптанын Шаршемби күнү саат 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Өткен аптанын Жума күнү саат 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-чи 1-чи 1-чи 1-чи 1-чи', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-чи 1-чи', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-чү 1-чи', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-чү 1-чи', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-чи 1-чи', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-чы 1-чи', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-чи 1-чи', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-чи 2-чи', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-чы', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-чи', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-чү', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 таңкы CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 таңкы, 12:00 таңкы', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 таңкы, 1:30 таңкы', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 таңкы, 2:00 таңкы', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 таңкы, 6:00 таңкы', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 таңкы, 10:00 таңкы', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 түштөн кийинки, 12:00 түштөн кийинки', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 түштөн кийинки, 5:00 түштөн кийинки', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 түштөн кийинки, 9:30 түштөн кийинки', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 түштөн кийинки, 11:00 түштөн кийинки', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-чү', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунд мурун', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. мурун', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунд мурун', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. мурун', // Carbon::now()->subMinutes(1)->diffForHumans() '1 мүнөт мурун', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мүн. мурун', // Carbon::now()->subMinutes(2)->diffForHumans() '2 мүнөт мурун', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мүн. мурун', // Carbon::now()->subHours(1)->diffForHumans() '1 саат мурун', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 саат. мурун', // Carbon::now()->subHours(2)->diffForHumans() '2 саат мурун', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 саат. мурун', // Carbon::now()->subDays(1)->diffForHumans() '1 күн мурун', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 күн мурун', // Carbon::now()->subDays(2)->diffForHumans() '2 күн мурун', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 күн мурун', // Carbon::now()->subWeeks(1)->diffForHumans() '1 апта мурун', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 апт. мурун', // Carbon::now()->subWeeks(2)->diffForHumans() '2 апта мурун', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 апт. мурун', // Carbon::now()->subMonths(1)->diffForHumans() '1 ай мурун', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ай мурун', // Carbon::now()->subMonths(2)->diffForHumans() '2 ай мурун', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ай мурун', // Carbon::now()->subYears(1)->diffForHumans() '1 жыл мурун', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 жыл мурун', // Carbon::now()->subYears(2)->diffForHumans() '2 жыл мурун', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 жыл мурун', // Carbon::now()->addSecond()->diffForHumans() '1 секунд ичинде', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 сек. ичинде', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 сек. ичинде', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 мүнөт 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 жыл 3 ай 1 күн 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 жыл ичинде', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ай мурун', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 жыл 3 ай 1 күн 1 сек. мурун', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 апта 10 саат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 апта 6 күн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 апта 6 күн ичинде', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 апта 1 саат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'бир саат ичинде', // CarbonInterval::days(2)->forHumans() '2 күн', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 күн 3 саат.', ]; } ================================================ FILE: tests/Localization/LagTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LagTest extends LocalizationTestCase { public const LOCALE = 'lag'; // Langi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamóosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapíiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatátu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaíne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatáano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alamíisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumáa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaíne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatáano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alamíisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumáa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamóosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapíiri at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaíne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumaíne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatátu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapíiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamóosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumáa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alamíisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatáano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumáa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 too CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 TOO, 12:00 too', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 TOO, 1:30 too', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 TOO, 2:00 too', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 TOO, 6:00 too', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 TOO, 10:00 too', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MUU, 12:00 muu', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MUU, 5:00 muu', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MUU, 9:30 muu', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MUU, 11:00 muu', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/LanguagesCoverageTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use Tests\AbstractTestCase; class LanguagesCoverageTest extends AbstractTestCase { public function testAllLanguagesAreTested() { $languages = glob(__DIR__.'/../../src/Carbon/Lang/*.php'); $tests = array_map(function ($file) { return strtolower(substr(basename($file), 0, -8)); }, glob(__DIR__.'/*Test.php')); $tester = $this; $missingLanguages = array_filter($languages, function ($language) use ($tester, $tests) { $file = basename($language); $covered = \in_array( str_replace(['_', '-', '@'], '', strtolower(substr($file, 0, -4))), $tests, true, ); $tester->assertTrue($covered, "Expect $file language file to be covered."); return !$covered; }); $this->assertCount(0, $missingLanguages, 'Expect to have 0 languages uncovered.'); } } ================================================ FILE: tests/Localization/LbLuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LbLuTest extends LocalizationTestCase { public const LOCALE = 'lb_LU'; // Luxembourgish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Muer um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonndeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Méindeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mëttwoch um 0:00 Auer', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donneschdeg um 0:00 Auer', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freideg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mëttwoch um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donneschdeg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freideg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschdeg um 0:00 Auer', // Carbon::now()->subDays(2)->calendar() 'Leschte Sonndeg um 20:49 Auer', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gëschter um 22:00 Auer', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Haut um 10:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Haut um 2:00 Auer', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Muer um 1:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Gëschter um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gëschter um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschten Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Méindeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Sonndeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Samschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Freideg um 0:00 Auer', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Leschten Donneschdeg um 0:00 Auer', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Leschte Mëttwoch um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Leschte Freideg um 0:00 Auer', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 moies CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 moies, 12:00 moies', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 moies, 1:30 moies', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 moies, 2:00 moies', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 moies, 6:00 moies', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 moies, 10:00 moies', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mëttes, 12:00 mëttes', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 mëttes, 5:00 mëttes', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 mëttes, 9:30 mëttes', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 mëttes, 11:00 mëttes', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'virun 1 Sekonn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'virun 1Sek', // Carbon::now()->subSeconds(2)->diffForHumans() 'virun 2 Sekonnen', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'virun 2Sek', // Carbon::now()->subMinutes(1)->diffForHumans() 'virun 1 Minutt', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'virun 1M', // Carbon::now()->subMinutes(2)->diffForHumans() 'virun 2 Minutten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'virun 2M', // Carbon::now()->subHours(1)->diffForHumans() 'virun 1 Stonn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'virun 1Sto', // Carbon::now()->subHours(2)->diffForHumans() 'virun 2 Stonnen', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'virun 2Sto', // Carbon::now()->subDays(1)->diffForHumans() 'virun 1 Dag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'virun 1D', // Carbon::now()->subDays(2)->diffForHumans() 'virun 2 Deeg', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'virun 2D', // Carbon::now()->subWeeks(1)->diffForHumans() 'virun 1 Woch', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'virun 1Wo', // Carbon::now()->subWeeks(2)->diffForHumans() 'virun 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'virun 2Wo', // Carbon::now()->subMonths(1)->diffForHumans() 'virun 1 Mount', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'virun 1Mo', // Carbon::now()->subMonths(2)->diffForHumans() 'virun 2 Méint', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'virun 2Mo', // Carbon::now()->subYears(1)->diffForHumans() 'virun 1 Joer', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'virun 1J', // Carbon::now()->subYears(2)->diffForHumans() 'virun 2 Joer', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'virun 2J', // Carbon::now()->addSecond()->diffForHumans() 'an 1 Sekonn', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'an 1Sek', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekonn duerno', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1Sek duerno', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekonn virdrun', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1Sek virdrun', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekonn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1Sek', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekonnen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2Sek', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'an 1Sek', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minutt 1 Sekonn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2J 3Mo 1D 1Sek', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'an 3 Joer', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'virun 5Mo', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'virun 2J 3Mo 1D 1Sek', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woch 10 Stonnen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woch 6 Deeg', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woch 6 Deeg', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'an 1 Woch an 6 Deeg', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stonn', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an 1 Stonn', // CarbonInterval::days(2)->forHumans() '2 Deeg', // CarbonInterval::create('P1DT3H')->forHumans(true) '1D 3Sto', ]; } ================================================ FILE: tests/Localization/LbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LbTest extends LocalizationTestCase { public const LOCALE = 'lb'; // Luxembourgish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Muer um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonndeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Méindeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mëttwoch um 0:00 Auer', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donneschdeg um 0:00 Auer', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freideg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mëttwoch um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donneschdeg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freideg um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschdeg um 0:00 Auer', // Carbon::now()->subDays(2)->calendar() 'Leschte Sonndeg um 20:49 Auer', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gëschter um 22:00 Auer', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Haut um 10:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Haut um 2:00 Auer', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Muer um 1:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Gëschter um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Gëschter um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschten Dënschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Méindeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Sonndeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Samschdeg um 0:00 Auer', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Leschte Freideg um 0:00 Auer', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Leschten Donneschdeg um 0:00 Auer', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Leschte Mëttwoch um 0:00 Auer', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Leschte Freideg um 0:00 Auer', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 moies CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 moies, 12:00 moies', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 moies, 1:30 moies', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 moies, 2:00 moies', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 moies, 6:00 moies', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 moies, 10:00 moies', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mëttes, 12:00 mëttes', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 mëttes, 5:00 mëttes', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 mëttes, 9:30 mëttes', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 mëttes, 11:00 mëttes', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'virun 1 Sekonn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'virun 1Sek', // Carbon::now()->subSeconds(2)->diffForHumans() 'virun 2 Sekonnen', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'virun 2Sek', // Carbon::now()->subMinutes(1)->diffForHumans() 'virun 1 Minutt', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'virun 1M', // Carbon::now()->subMinutes(2)->diffForHumans() 'virun 2 Minutten', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'virun 2M', // Carbon::now()->subHours(1)->diffForHumans() 'virun 1 Stonn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'virun 1Sto', // Carbon::now()->subHours(2)->diffForHumans() 'virun 2 Stonnen', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'virun 2Sto', // Carbon::now()->subDays(1)->diffForHumans() 'virun 1 Dag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'virun 1D', // Carbon::now()->subDays(2)->diffForHumans() 'virun 2 Deeg', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'virun 2D', // Carbon::now()->subWeeks(1)->diffForHumans() 'virun 1 Woch', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'virun 1Wo', // Carbon::now()->subWeeks(2)->diffForHumans() 'virun 2 Wochen', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'virun 2Wo', // Carbon::now()->subMonths(1)->diffForHumans() 'virun 1 Mount', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'virun 1Mo', // Carbon::now()->subMonths(2)->diffForHumans() 'virun 2 Méint', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'virun 2Mo', // Carbon::now()->subYears(1)->diffForHumans() 'virun 1 Joer', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'virun 1J', // Carbon::now()->subYears(2)->diffForHumans() 'virun 2 Joer', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'virun 2J', // Carbon::now()->addSecond()->diffForHumans() 'an 1 Sekonn', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'an 1Sek', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekonn duerno', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1Sek duerno', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekonn virdrun', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1Sek virdrun', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekonn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1Sek', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekonnen', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2Sek', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'an 1Sek', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minutt 1 Sekonn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2J 3Mo 1D 1Sek', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'an 3 Joer', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'virun 5Mo', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'virun 2J 3Mo 1D 1Sek', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Woch 10 Stonnen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woch 6 Deeg', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Woch 6 Deeg', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'an 1 Woch an 6 Deeg', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Wochen 1 Stonn', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an 1 Stonn', // CarbonInterval::days(2)->forHumans() '2 Deeg', // CarbonInterval::create('P1DT3H')->forHumans(true) '1D 3Sto', ]; } ================================================ FILE: tests/Localization/LgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LgTest extends LocalizationTestCase { public const LOCALE = 'lg'; // Ganda public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lwamukaaga at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabiiti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Balaza at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lwakusatu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Lwakuna at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakusatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakuna at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwamukaaga at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sabiiti at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Balaza at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabiiti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lwamukaaga at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Lwakuna at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Lwakusatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 kyʼokubiri ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 kyʼokubiri ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 kyʼokubiri ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 kyʼokubiri ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ddakiika 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ddakiika 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ddakiika 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ddakiika 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'saawa 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saawa 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saawa 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saawa 2 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 lunaku ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 lunaku ago', // Carbon::now()->subDays(2)->diffForHumans() '2 lunaku ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 lunaku ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sabbiiti ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sabbiiti ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sabbiiti ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sabbiiti ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 njuba ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 njuba ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 njuba ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 njuba ago', // Carbon::now()->subYears(1)->diffForHumans() '1 mwaaka ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 mwaaka ago', // Carbon::now()->subYears(2)->diffForHumans() '2 mwaaka ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 mwaaka ago', // Carbon::now()->addSecond()->diffForHumans() '1 kyʼokubiri from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 kyʼokubiri from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 kyʼokubiri after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 kyʼokubiri after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 kyʼokubiri before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 kyʼokubiri before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 kyʼokubiri', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 kyʼokubiri', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 kyʼokubiri', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 kyʼokubiri', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 kyʼokubiri from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ddakiika 1 1 kyʼokubiri', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 mwaaka 3 njuba 1 lunaku 1 kyʼokubiri', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 mwaaka from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 njuba ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 mwaaka 3 njuba 1 lunaku 1 kyʼokubiri ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sabbiiti saawa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sabbiiti 6 lunaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sabbiiti 6 lunaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sabbiiti and 6 lunaku from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sabbiiti saawa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saawa 1 from now', // CarbonInterval::days(2)->forHumans() '2 lunaku', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 lunaku saawa 3', ]; } ================================================ FILE: tests/Localization/LgUgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LgUgTest extends LocalizationTestCase { public const LOCALE = 'lg_UG'; // Ganda public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lwamukaaga at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabiiti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Balaza at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lwakusatu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Lwakuna at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakusatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakuna at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwamukaaga at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sabiiti at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lwakubiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Balaza at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabiiti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lwamukaaga at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Lwakuna at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Lwakusatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Lwakutaano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 kyʼokubiri ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 kyʼokubiri ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 kyʼokubiri ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 kyʼokubiri ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ddakiika 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ddakiika 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ddakiika 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ddakiika 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'saawa 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saawa 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saawa 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saawa 2 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 lunaku ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 lunaku ago', // Carbon::now()->subDays(2)->diffForHumans() '2 lunaku ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 lunaku ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sabbiiti ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sabbiiti ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sabbiiti ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sabbiiti ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 njuba ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 njuba ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 njuba ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 njuba ago', // Carbon::now()->subYears(1)->diffForHumans() '1 mwaaka ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 mwaaka ago', // Carbon::now()->subYears(2)->diffForHumans() '2 mwaaka ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 mwaaka ago', // Carbon::now()->addSecond()->diffForHumans() '1 kyʼokubiri from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 kyʼokubiri from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 kyʼokubiri after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 kyʼokubiri after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 kyʼokubiri before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 kyʼokubiri before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 kyʼokubiri', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 kyʼokubiri', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 kyʼokubiri', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 kyʼokubiri', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 kyʼokubiri from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ddakiika 1 1 kyʼokubiri', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 mwaaka 3 njuba 1 lunaku 1 kyʼokubiri', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 mwaaka from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 njuba ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 mwaaka 3 njuba 1 lunaku 1 kyʼokubiri ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sabbiiti saawa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sabbiiti 6 lunaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sabbiiti 6 lunaku', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sabbiiti and 6 lunaku from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sabbiiti saawa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saawa 1 from now', // CarbonInterval::days(2)->forHumans() '2 lunaku', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 lunaku saawa 3', ]; } ================================================ FILE: tests/Localization/LiNlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LiNlTest extends LocalizationTestCase { public const LOCALE = 'li_NL'; // Limburgish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaoterdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zóndig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maondig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'daensdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'goonsdig at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'dónderdig at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vriedig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'daensdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'goonsdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dónderdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vriedig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaoterdig at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last zóndig at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'daensdig at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last daensdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maondig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last zóndig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last zaoterdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vriedig at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last dónderdig at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last goonsdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vriedig at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Secónd ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Secónd ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Secónd ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Secónd ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 momênt ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 momênt ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 momênt ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 momênt ago', // Carbon::now()->subHours(1)->diffForHumans() '1 oer ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oer ago', // Carbon::now()->subHours(2)->diffForHumans() '2 oer ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oer ago', // Carbon::now()->subDays(1)->diffForHumans() '1 daag ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 daag ago', // Carbon::now()->subDays(2)->diffForHumans() '2 daag ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 daag ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 waek ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 waek ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 waek ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 waek ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 maond ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 maond ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 maond ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 maond ago', // Carbon::now()->subYears(1)->diffForHumans() '1 jaor ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 jaor ago', // Carbon::now()->subYears(2)->diffForHumans() '2 jaor ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 jaor ago', // Carbon::now()->addSecond()->diffForHumans() '1 Secónd from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Secónd from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Secónd after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Secónd after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Secónd before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Secónd before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Secónd', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Secónd', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Secónd', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Secónd', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Secónd from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 momênt 1 Secónd', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 jaor 3 maond 1 daag 1 Secónd', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jaor from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 maond ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 jaor 3 maond 1 daag 1 Secónd ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 waek 10 oer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 waek 6 daag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 waek 6 daag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 waek and 6 daag from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 waek 1 oer', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 oer from now', // CarbonInterval::days(2)->forHumans() '2 daag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 daag 3 oer', ]; } ================================================ FILE: tests/Localization/LiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LiTest extends LocalizationTestCase { public const LOCALE = 'li'; // Limburgish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaoterdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zóndig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maondig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'daensdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'goonsdig at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'dónderdig at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vriedig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'daensdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'goonsdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dónderdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vriedig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaoterdig at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last zóndig at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'daensdig at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last daensdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last maondig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last zóndig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last zaoterdig at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vriedig at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last dónderdig at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last goonsdig at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vriedig at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Secónd ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Secónd ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Secónd ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Secónd ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 momênt ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 momênt ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 momênt ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 momênt ago', // Carbon::now()->subHours(1)->diffForHumans() '1 oer ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oer ago', // Carbon::now()->subHours(2)->diffForHumans() '2 oer ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oer ago', // Carbon::now()->subDays(1)->diffForHumans() '1 daag ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 daag ago', // Carbon::now()->subDays(2)->diffForHumans() '2 daag ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 daag ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 waek ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 waek ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 waek ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 waek ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 maond ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 maond ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 maond ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 maond ago', // Carbon::now()->subYears(1)->diffForHumans() '1 jaor ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 jaor ago', // Carbon::now()->subYears(2)->diffForHumans() '2 jaor ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 jaor ago', // Carbon::now()->addSecond()->diffForHumans() '1 Secónd from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Secónd from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Secónd after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Secónd after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Secónd before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Secónd before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Secónd', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Secónd', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Secónd', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Secónd', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Secónd from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 momênt 1 Secónd', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 jaor 3 maond 1 daag 1 Secónd', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jaor from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 maond ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 jaor 3 maond 1 daag 1 Secónd ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 waek 10 oer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 waek 6 daag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 waek 6 daag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 waek and 6 daag from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 waek 1 oer', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 oer from now', // CarbonInterval::days(2)->forHumans() '2 daag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 daag 3 oer', ]; } ================================================ FILE: tests/Localization/LijItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LijItTest extends LocalizationTestCase { public const LOCALE = 'lij_IT'; // Ligurian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabbo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenega at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lûnedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercUrdì at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'zêggia at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venardì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercUrdì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zêggia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venardì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabbo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last domenega at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lûnedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last domenega at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabbo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last venardì at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last zêggia at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mercUrdì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last venardì at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segondo ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segondo ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segondo ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segondo ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menûo ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 menûo ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menûo ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 menûo ago', // Carbon::now()->subHours(1)->diffForHumans() '1 reléuio ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 reléuio ago', // Carbon::now()->subHours(2)->diffForHumans() '2 reléuio ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 reléuio ago', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 giorno ago', // Carbon::now()->subDays(2)->diffForHumans() '2 giorno ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 giorno ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settemannha ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 settemannha ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settemannha ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 settemannha ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 meize ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 meize ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 meize ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 meize ago', // Carbon::now()->subYears(1)->diffForHumans() '1 etæ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 etæ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 etæ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 etæ ago', // Carbon::now()->addSecond()->diffForHumans() '1 segondo from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segondo from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segondo after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segondo after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segondo before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segondo before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segondo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segondo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segondo from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menûo 1 segondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 etæ 3 meize 1 giorno 1 segondo', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 etæ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 meize ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 etæ 3 meize 1 giorno 1 segondo ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settemannha 10 reléuio', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settemannha 6 giorno', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settemannha 6 giorno', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 settemannha and 6 giorno from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settemannha 1 reléuio', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 reléuio from now', // CarbonInterval::days(2)->forHumans() '2 giorno', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 giorno 3 reléuio', ]; } ================================================ FILE: tests/Localization/LijTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LijTest extends LocalizationTestCase { public const LOCALE = 'lij'; // Ligurian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabbo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domenega at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lûnedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mercUrdì at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'zêggia at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venardì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mercUrdì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zêggia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venardì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabbo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last domenega at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martedì at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lûnedì at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last domenega at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabbo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last venardì at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last zêggia at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mercUrdì at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last venardì at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segondo ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segondo ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segondo ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segondo ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menûo ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 menûo ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menûo ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 menûo ago', // Carbon::now()->subHours(1)->diffForHumans() '1 reléuio ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 reléuio ago', // Carbon::now()->subHours(2)->diffForHumans() '2 reléuio ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 reléuio ago', // Carbon::now()->subDays(1)->diffForHumans() '1 giorno ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 giorno ago', // Carbon::now()->subDays(2)->diffForHumans() '2 giorno ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 giorno ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 settemannha ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 settemannha ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 settemannha ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 settemannha ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 meize ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 meize ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 meize ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 meize ago', // Carbon::now()->subYears(1)->diffForHumans() '1 etæ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 etæ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 etæ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 etæ ago', // Carbon::now()->addSecond()->diffForHumans() '1 segondo from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segondo from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segondo after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segondo after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segondo before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segondo before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segondo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segondo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segondo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segondo', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segondo from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menûo 1 segondo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 etæ 3 meize 1 giorno 1 segondo', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 etæ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 meize ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 etæ 3 meize 1 giorno 1 segondo ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 settemannha 10 reléuio', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settemannha 6 giorno', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 settemannha 6 giorno', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 settemannha and 6 giorno from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 settemannha 1 reléuio', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 reléuio from now', // CarbonInterval::days(2)->forHumans() '2 giorno', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 giorno 3 reléuio', ]; } ================================================ FILE: tests/Localization/LktTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LktTest extends LocalizationTestCase { public const LOCALE = 'lkt'; // Lakota public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 icinuŋpa ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 icinuŋpa ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 icinuŋpa ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 icinuŋpa ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 číkʼala ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 číkʼala ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 číkʼala ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 číkʼala ago', // Carbon::now()->subHours(1)->diffForHumans() '1 maza škaŋškaŋ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 maza škaŋškaŋ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 maza škaŋškaŋ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 maza škaŋškaŋ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 aŋpétu ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 aŋpétu ago', // Carbon::now()->subDays(2)->diffForHumans() '2 aŋpétu ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 aŋpétu ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 šakówiŋ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 šakówiŋ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 šakówiŋ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 šakówiŋ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 haŋwí ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 haŋwí ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 haŋwí ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 haŋwí ago', // Carbon::now()->subYears(1)->diffForHumans() '1 waníyetu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 waníyetu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 waníyetu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 waníyetu ago', // Carbon::now()->addSecond()->diffForHumans() '1 icinuŋpa from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 icinuŋpa from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 icinuŋpa after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 icinuŋpa after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 icinuŋpa before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 icinuŋpa before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 icinuŋpa', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 icinuŋpa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 icinuŋpa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 icinuŋpa', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 icinuŋpa from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 číkʼala 1 icinuŋpa', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 waníyetu 3 haŋwí 1 aŋpétu 1 icinuŋpa', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 waníyetu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 haŋwí ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 waníyetu 3 haŋwí 1 aŋpétu 1 icinuŋpa ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 šakówiŋ 10 maza škaŋškaŋ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 šakówiŋ 6 aŋpétu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 šakówiŋ 6 aŋpétu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 šakówiŋ and 6 aŋpétu from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 šakówiŋ 1 maza škaŋškaŋ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 maza škaŋškaŋ from now', // CarbonInterval::days(2)->forHumans() '2 aŋpétu', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 aŋpétu 3 maza škaŋškaŋ', ]; } ================================================ FILE: tests/Localization/LnAoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LnAoTest extends LocalizationTestCase { public const LOCALE = 'ln_AO'; // Lingala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa yambo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mpɔ́sɔ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last eyenga at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ mwa yambo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last eyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ntɔ́ngɔ́ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ntɔ́ngɔ́, 12:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ntɔ́ngɔ́, 1:30 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ntɔ́ngɔ́, 2:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ntɔ́ngɔ́, 6:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ntɔ́ngɔ́, 10:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mpókwa, 12:00 mpókwa', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 mpókwa, 5:00 mpókwa', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 mpókwa, 9:30 mpókwa', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 mpókwa, 11:00 mpókwa', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'segɔnde 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'segɔnde 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'segɔnde 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'segɔnde 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'ngonga 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ngonga 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'ngonga 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ngonga 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'mokɔlɔ 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'mokɔlɔ 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'mokɔlɔ 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'mokɔlɔ 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mpɔ́sɔ 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mpɔ́sɔ 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'sánzá 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'sánzá 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'sánzá 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'sánzá 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'mbula 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'mbula 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'mbula 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'mbula 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segɔnde 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'segɔnde 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segɔnde 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'segɔnde 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segɔnde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'segɔnde 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'segɔnde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'segɔnde 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'segɔnde 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 segɔnde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mbula 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'sánzá 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 ngonga 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mpɔ́sɔ 1 and mokɔlɔ 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 2 ngonga 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ngonga 1 from now', // CarbonInterval::days(2)->forHumans() 'mokɔlɔ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'mokɔlɔ 1 ngonga 3', ]; } ================================================ FILE: tests/Localization/LnCdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LnCdTest extends LocalizationTestCase { public const LOCALE = 'ln_CD'; // Lingala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lomíngo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mosálá mɔ̌kɔ́ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Misálá míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Misálá mísáto at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Misálá mínei at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Misálá mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá míbalé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá mínei at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mpɔ́sɔ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lomíngo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá míbalé at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Misálá míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mosálá mɔ̌kɔ́ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lomíngo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Misálá mítáno at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Misálá mínei at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Misálá mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Misálá mítáno at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'segɔnde 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'segɔnde 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'segɔnde 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'segɔnde 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'ngonga 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ngonga 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'ngonga 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ngonga 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'mokɔlɔ 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'mokɔlɔ 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'mokɔlɔ 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'mokɔlɔ 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mpɔ́sɔ 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mpɔ́sɔ 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'sánzá 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'sánzá 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'sánzá 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'sánzá 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'mbula 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'mbula 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'mbula 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'mbula 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segɔnde 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'segɔnde 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segɔnde 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'segɔnde 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segɔnde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'segɔnde 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'segɔnde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'segɔnde 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'segɔnde 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 segɔnde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mbula 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'sánzá 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 ngonga 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mpɔ́sɔ 1 and mokɔlɔ 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 2 ngonga 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ngonga 1 from now', // CarbonInterval::days(2)->forHumans() 'mokɔlɔ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'mokɔlɔ 1 ngonga 3', ]; } ================================================ FILE: tests/Localization/LnCfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LnCfTest extends LocalizationTestCase { public const LOCALE = 'ln_CF'; // Lingala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa yambo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mpɔ́sɔ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last eyenga at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ mwa yambo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last eyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ntɔ́ngɔ́ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ntɔ́ngɔ́, 12:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ntɔ́ngɔ́, 1:30 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ntɔ́ngɔ́, 2:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ntɔ́ngɔ́, 6:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ntɔ́ngɔ́, 10:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mpókwa, 12:00 mpókwa', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 mpókwa, 5:00 mpókwa', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 mpókwa, 9:30 mpókwa', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 mpókwa, 11:00 mpókwa', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'segɔnde 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'segɔnde 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'segɔnde 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'segɔnde 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'ngonga 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ngonga 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'ngonga 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ngonga 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'mokɔlɔ 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'mokɔlɔ 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'mokɔlɔ 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'mokɔlɔ 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mpɔ́sɔ 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mpɔ́sɔ 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'sánzá 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'sánzá 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'sánzá 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'sánzá 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'mbula 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'mbula 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'mbula 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'mbula 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segɔnde 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'segɔnde 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segɔnde 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'segɔnde 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segɔnde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'segɔnde 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'segɔnde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'segɔnde 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'segɔnde 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 segɔnde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mbula 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'sánzá 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 ngonga 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mpɔ́sɔ 1 and mokɔlɔ 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 2 ngonga 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ngonga 1 from now', // CarbonInterval::days(2)->forHumans() 'mokɔlɔ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'mokɔlɔ 1 ngonga 3', ]; } ================================================ FILE: tests/Localization/LnCgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LnCgTest extends LocalizationTestCase { public const LOCALE = 'ln_CG'; // Lingala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'eyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa yambo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mpɔ́sɔ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last eyenga at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ mwa míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ mwa yambo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last eyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last mokɔlɔ ya mínéi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mokɔlɔ mwa mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mokɔlɔ ya mítáno at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ntɔ́ngɔ́ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ntɔ́ngɔ́, 12:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ntɔ́ngɔ́, 1:30 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ntɔ́ngɔ́, 2:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ntɔ́ngɔ́, 6:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ntɔ́ngɔ́, 10:00 ntɔ́ngɔ́', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mpókwa, 12:00 mpókwa', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 mpókwa, 5:00 mpókwa', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 mpókwa, 9:30 mpókwa', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 mpókwa, 11:00 mpókwa', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'segɔnde 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'segɔnde 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'segɔnde 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'segɔnde 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'ngonga 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ngonga 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'ngonga 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ngonga 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'mokɔlɔ 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'mokɔlɔ 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'mokɔlɔ 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'mokɔlɔ 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mpɔ́sɔ 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mpɔ́sɔ 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'sánzá 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'sánzá 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'sánzá 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'sánzá 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'mbula 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'mbula 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'mbula 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'mbula 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segɔnde 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'segɔnde 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segɔnde 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'segɔnde 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segɔnde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'segɔnde 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'segɔnde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'segɔnde 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'segɔnde 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 segɔnde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mbula 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'sánzá 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 ngonga 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mpɔ́sɔ 1 and mokɔlɔ 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 2 ngonga 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ngonga 1 from now', // CarbonInterval::days(2)->forHumans() 'mokɔlɔ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'mokɔlɔ 1 ngonga 3', ]; } ================================================ FILE: tests/Localization/LnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LnTest extends LocalizationTestCase { public const LOCALE = 'ln'; // Lingala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lomíngo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mosálá mɔ̌kɔ́ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Misálá míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Misálá mísáto at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Misálá mínei at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Misálá mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá míbalé at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá mínei at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá mítáno at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mpɔ́sɔ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lomíngo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Misálá míbalé at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Misálá míbalé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mosálá mɔ̌kɔ́ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lomíngo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mpɔ́sɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Misálá mítáno at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Misálá mínei at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Misálá mísáto at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Misálá mítáno at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'segɔnde 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'segɔnde 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'segɔnde 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'segɔnde 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'miniti 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'miniti 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'miniti 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'miniti 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'ngonga 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ngonga 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'ngonga 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ngonga 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'mokɔlɔ 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'mokɔlɔ 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'mokɔlɔ 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'mokɔlɔ 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mpɔ́sɔ 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mpɔ́sɔ 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mpɔ́sɔ 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'sánzá 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'sánzá 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'sánzá 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'sánzá 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'mbula 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'mbula 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'mbula 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'mbula 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'segɔnde 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'segɔnde 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'segɔnde 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'segɔnde 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'segɔnde 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segɔnde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'segɔnde 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'segɔnde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'segɔnde 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'segɔnde 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'miniti 1 segɔnde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'mbula 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'sánzá 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'mbula 2 sánzá 3 mokɔlɔ 1 segɔnde 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 ngonga 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 1 mokɔlɔ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mpɔ́sɔ 1 and mokɔlɔ 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mpɔ́sɔ 2 ngonga 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ngonga 1 from now', // CarbonInterval::days(2)->forHumans() 'mokɔlɔ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'mokɔlɔ 1 ngonga 3', ]; } ================================================ FILE: tests/Localization/LoLaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LoLaTest extends LocalizationTestCase { public const LOCALE = 'lo_LA'; // Lao public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ອື່ນເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນເສົາໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອາທິດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນຈັນໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອັງຄານໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນພຸດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ວັນພະຫັດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ວັນສຸກໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນອັງຄານໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນພຸດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນພະຫັດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນສຸກໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນເສົາໜ້າເວລາ 00:00', // Carbon::now()->subDays(2)->calendar() 'ວັນອາທິດແລ້ວນີ້ເວລາ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ວານນີ້ເວລາ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ມື້ນີ້ເວລາ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ນີ້ເວລາ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ມື້ອື່ນເວລາ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນອັງຄານໜ້າເວລາ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ມື້ວານນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ວານນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອັງຄານແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນຈັນແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອາທິດແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນເສົາແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນສຸກແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ວັນພະຫັດແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ວັນພຸດແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນສຸກແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ທີ່1 ທີ່1 ທີ່1 ທີ່1 ທີ່1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ທີ່2 ທີ່1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ທີ່3 ທີ່1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ທີ່4 ທີ່1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ທີ່5 ທີ່1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ທີ່6 ທີ່1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ທີ່7 ທີ່2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ທີ່11 ທີ່2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ທີ່40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ທີ່41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ທີ່100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ຕອນເຊົ້າ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ຕອນເຊົ້າ, 12:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ຕອນເຊົ້າ, 1:30 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ຕອນເຊົ້າ, 2:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ຕອນເຊົ້າ, 6:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ຕອນເຊົ້າ, 10:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ຕອນແລງ, 12:00 ຕອນແລງ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ຕອນແລງ, 5:00 ຕອນແລງ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ຕອນແລງ, 9:30 ຕອນແລງ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ຕອນແລງ, 11:00 ຕອນແລງ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ທີ່0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ວິນາທີຜ່ານມາ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ວິ.ຜ່ານມາ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ວິນາທີຜ່ານມາ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ວິ.ຜ່ານມາ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ນາທີຜ່ານມາ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ນທ.ຜ່ານມາ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ນາທີຜ່ານມາ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ນທ.ຜ່ານມາ', // Carbon::now()->subHours(1)->diffForHumans() '1 ຊົ່ວໂມງຜ່ານມາ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ຊມ.ຜ່ານມາ', // Carbon::now()->subHours(2)->diffForHumans() '2 ຊົ່ວໂມງຜ່ານມາ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ຊມ.ຜ່ານມາ', // Carbon::now()->subDays(1)->diffForHumans() '1 ມື້ຜ່ານມາ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ມື້ຜ່ານມາ', // Carbon::now()->subDays(2)->diffForHumans() '2 ມື້ຜ່ານມາ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ມື້ຜ່ານມາ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ອາທິດຜ່ານມາ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ອທ.ຜ່ານມາ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ອາທິດຜ່ານມາ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ອທ.ຜ່ານມາ', // Carbon::now()->subMonths(1)->diffForHumans() '1 ເດືອນຜ່ານມາ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ດ.ຜ່ານມາ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ເດືອນຜ່ານມາ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ດ.ຜ່ານມາ', // Carbon::now()->subYears(1)->diffForHumans() '1 ປີຜ່ານມາ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ປີຜ່ານມາ', // Carbon::now()->subYears(2)->diffForHumans() '2 ປີຜ່ານມາ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ປີຜ່ານມາ', // Carbon::now()->addSecond()->diffForHumans() 'ອີກ 1 ວິນາທີ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ອີກ 1 ວິ.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ວິນາທີ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ວິ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ວິນາທີ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ວິ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ອີກ 1 ວິ.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ນາທີ 1 ວິນາທີ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ປີ 3 ດ. 1 ມື້ 1 ວິ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ອີກ 3 ປີ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ດ.ຜ່ານມາ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ປີ 3 ດ. 1 ມື້ 1 ວິ.ຜ່ານມາ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ອາທິດ 10 ຊົ່ວໂມງ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ອາທິດ 6 ມື້', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ອາທິດ 6 ມື້', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ອີກ 1 ອາທິດແລະ 6 ມື້', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ອາທິດ 1 ຊົ່ວໂມງ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ອີກ 1 ຊົ່ວໂມງ', // CarbonInterval::days(2)->forHumans() '2 ມື້', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ມື້ 3 ຊມ.', ]; } ================================================ FILE: tests/Localization/LoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LoTest extends LocalizationTestCase { public const LOCALE = 'lo'; // Lao public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ອື່ນເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນເສົາໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອາທິດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນຈັນໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອັງຄານໜ້າເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນພຸດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ວັນພະຫັດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ວັນສຸກໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນອັງຄານໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນພຸດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນພະຫັດໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນສຸກໜ້າເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນເສົາໜ້າເວລາ 00:00', // Carbon::now()->subDays(2)->calendar() 'ວັນອາທິດແລ້ວນີ້ເວລາ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ວານນີ້ເວລາ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ມື້ນີ້ເວລາ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ນີ້ເວລາ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ມື້ອື່ນເວລາ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນອັງຄານໜ້າເວລາ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ມື້ວານນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ມື້ວານນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອັງຄານແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນຈັນແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນອາທິດແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນເສົາແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ວັນສຸກແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ວັນພະຫັດແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ວັນພຸດແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ວັນສຸກແລ້ວນີ້ເວລາ 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ທີ່1 ທີ່1 ທີ່1 ທີ່1 ທີ່1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ທີ່2 ທີ່1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ທີ່3 ທີ່1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ທີ່4 ທີ່1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ທີ່5 ທີ່1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ທີ່6 ທີ່1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ທີ່7 ທີ່2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ທີ່11 ທີ່2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ທີ່40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ທີ່41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ທີ່100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ຕອນເຊົ້າ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ຕອນເຊົ້າ, 12:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ຕອນເຊົ້າ, 1:30 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ຕອນເຊົ້າ, 2:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ຕອນເຊົ້າ, 6:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ຕອນເຊົ້າ, 10:00 ຕອນເຊົ້າ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ຕອນແລງ, 12:00 ຕອນແລງ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ຕອນແລງ, 5:00 ຕອນແລງ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ຕອນແລງ, 9:30 ຕອນແລງ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ຕອນແລງ, 11:00 ຕອນແລງ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ທີ່0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ວິນາທີຜ່ານມາ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ວິ.ຜ່ານມາ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ວິນາທີຜ່ານມາ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ວິ.ຜ່ານມາ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ນາທີຜ່ານມາ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ນທ.ຜ່ານມາ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ນາທີຜ່ານມາ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ນທ.ຜ່ານມາ', // Carbon::now()->subHours(1)->diffForHumans() '1 ຊົ່ວໂມງຜ່ານມາ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ຊມ.ຜ່ານມາ', // Carbon::now()->subHours(2)->diffForHumans() '2 ຊົ່ວໂມງຜ່ານມາ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ຊມ.ຜ່ານມາ', // Carbon::now()->subDays(1)->diffForHumans() '1 ມື້ຜ່ານມາ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ມື້ຜ່ານມາ', // Carbon::now()->subDays(2)->diffForHumans() '2 ມື້ຜ່ານມາ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ມື້ຜ່ານມາ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ອາທິດຜ່ານມາ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ອທ.ຜ່ານມາ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ອາທິດຜ່ານມາ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ອທ.ຜ່ານມາ', // Carbon::now()->subMonths(1)->diffForHumans() '1 ເດືອນຜ່ານມາ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ດ.ຜ່ານມາ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ເດືອນຜ່ານມາ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ດ.ຜ່ານມາ', // Carbon::now()->subYears(1)->diffForHumans() '1 ປີຜ່ານມາ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ປີຜ່ານມາ', // Carbon::now()->subYears(2)->diffForHumans() '2 ປີຜ່ານມາ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ປີຜ່ານມາ', // Carbon::now()->addSecond()->diffForHumans() 'ອີກ 1 ວິນາທີ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ອີກ 1 ວິ.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ວິນາທີ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ວິ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ວິນາທີ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ວິ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ອີກ 1 ວິ.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ນາທີ 1 ວິນາທີ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ປີ 3 ດ. 1 ມື້ 1 ວິ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ອີກ 3 ປີ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ດ.ຜ່ານມາ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ປີ 3 ດ. 1 ມື້ 1 ວິ.ຜ່ານມາ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ອາທິດ 10 ຊົ່ວໂມງ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ອາທິດ 6 ມື້', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ອາທິດ 6 ມື້', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ອີກ 1 ອາທິດແລະ 6 ມື້', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ອາທິດ 1 ຊົ່ວໂມງ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ອີກ 1 ຊົ່ວໂມງ', // CarbonInterval::days(2)->forHumans() '2 ມື້', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ມື້ 3 ຊມ.', ]; } ================================================ FILE: tests/Localization/LocalizationTestCase.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use InvalidArgumentException; use PHPUnit\Framework\Attributes\Group; use Tests\AbstractTestCase; /** * @SuppressWarnings(NumberOfChildren) */ abstract class LocalizationTestCase extends AbstractTestCase { public const LOCALE = 'en'; public const LOCALES = [ 'aa' => 'Afar', 'ab' => 'Abkhazian', 'ae' => 'Avestan', 'af' => 'Afrikaans', 'ak' => 'Akan', 'am' => 'Amharic', 'an' => 'Aragonese', 'ar' => 'Arabic', 'as' => 'Assamese', 'av' => 'Avaric', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'be' => 'Belarusian', 'bg' => 'Bulgarian', 'bh' => 'Bihari', 'bi' => 'Bislama', 'bm' => 'Bambara', 'bn' => 'Bengali', 'bo' => 'Tibetan', 'br' => 'Breton', 'bs' => 'Bosnian', 'ca' => 'Catalan', 'ce' => 'Chechen', 'ch' => 'Chamorro', 'co' => 'Corsican', 'cr' => 'Cree', 'cs' => 'Czech', 'cu' => 'OldChurchSlavonic', 'cv' => 'Chuvash', 'cy' => 'Welsh', 'da' => 'Danish', 'de' => 'German', 'dv' => 'Divehi', 'dz' => 'Dzongkha', 'ee' => 'Ewe', 'el' => 'Greek', 'en' => 'English', 'eo' => 'Esperanto', 'es' => 'Spanish', 'et' => 'Estonian', 'eu' => 'Basque', 'fa' => 'Persian', 'ff' => 'Fulah', 'fi' => 'Finnish', 'fj' => 'Fijian', 'fo' => 'Faroese', 'fr' => 'French', 'fy' => 'WesternFrisian', 'ga' => 'Irish', 'gd' => 'ScottishGaelic', 'gl' => 'Galician', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'gv' => 'Manx', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hi' => 'Hindi', 'ho' => 'HiriMotu', 'hr' => 'Croatian', 'ht' => 'Haitian', 'hu' => 'Hungarian', 'hy' => 'Armenian', 'hz' => 'Herero', 'ia' => 'Interlingua', 'id' => 'Indonesian', 'ie' => 'Interlingue', 'ig' => 'Igbo', 'ii' => 'SichuanYi', 'ik' => 'Inupiaq', 'io' => 'Ido', 'is' => 'Icelandic', 'it' => 'Italian', 'iu' => 'Inuktitut', 'ja' => 'Japanese', 'jv' => 'Javanese', 'ka' => 'Georgian', 'kg' => 'Kongo', 'ki' => 'Kikuyu', 'kj' => 'Kwanyama', 'kk' => 'Kazakh', 'kl' => 'Kalaallisut', 'km' => 'Khmer', 'kn' => 'Kannada', 'ko' => 'Korean', 'kr' => 'Kanuri', 'ks' => 'Kashmiri', 'ku' => 'Kurdish', 'kv' => 'Komi', 'kw' => 'Cornish', 'ky' => 'Kirghiz', 'la' => 'Latin', 'lb' => 'Luxembourgish', 'lg' => 'Ganda', 'li' => 'Limburgish', 'ln' => 'Lingala', 'lo' => 'Lao', 'lt' => 'Lithuanian', 'lu' => 'LubaKatanga', 'lv' => 'Latvian', 'mg' => 'Malagasy', 'mh' => 'Marshallese', 'mi' => 'Maori', 'mk' => 'Macedonian', 'ml' => 'Malayalam', 'mn' => 'Mongolian', 'mo' => 'Moldavian', 'mr' => 'Marathi', 'ms' => 'Malay', 'mt' => 'Maltese', 'my' => 'Burmese', 'na' => 'Nauru', 'nb' => 'NorwegianBokmal', 'nd' => 'NorthNdebele', 'ne' => 'Nepali', 'ng' => 'Ndonga', 'nl' => 'Dutch', 'nn' => 'NorwegianNynorsk', 'no' => 'Norwegian', 'nr' => 'SouthNdebele', 'nv' => 'Navajo', 'ny' => 'Chichewa', 'oc' => 'Occitan', 'oj' => 'Ojibwa', 'om' => 'Oromo', 'or' => 'Oriya', 'os' => 'Ossetian', 'pa' => 'Panjabi', 'pi' => 'Pali', 'pl' => 'Polish', 'ps' => 'Pashto', 'pt' => 'Portuguese', 'qu' => 'Quechua', 'rc' => 'Reunionese', 'rm' => 'Romansh', 'rn' => 'Kirundi', 'ro' => 'Romanian', 'ru' => 'Russian', 'rw' => 'Kinyarwanda', 'sa' => 'Sanskrit', 'sc' => 'Sardinian', 'sd' => 'Sindhi', 'se' => 'NorthernSami', 'sg' => 'Sango', 'sh' => 'SerboCroatian', 'si' => 'Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'sm' => 'Samoan', 'sn' => 'Shona', 'so' => 'Somali', 'sq' => 'Albanian', 'sr' => 'Serbian', 'ss' => 'Swati', 'st' => 'Sotho', 'su' => 'Sundanese', 'sv' => 'Swedish', 'sw' => 'Swahili', 'ta' => 'Tamil', 'te' => 'Telugu', 'tg' => 'Tajik', 'th' => 'Thai', 'ti' => 'Tigrinya', 'tk' => 'Turkmen', 'tl' => 'Tagalog', 'tn' => 'Tswana', 'to' => 'Tonga', 'tr' => 'Turkish', 'ts' => 'Tsonga', 'tt' => 'Tatar', 'tw' => 'Twi', 'ty' => 'Tahitian', 'ug' => 'Uighur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapuk', 'wa' => 'Walloon', 'wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang', 'zh' => 'Chinese', 'zu' => 'Zulu', 'gom' => 'Konkani Latin script', ]; public const TESTS = [ '{class}::parse(\'2018-01-04 00:00:00\')->addDays(1)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->addDays(2)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->addDays(3)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->addDays(4)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->addDays(5)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->addDays(6)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-05 00:00:00\')->addDays(6)->calendar({class}::parse(\'2018-01-05 00:00:00\'))', '{class}::parse(\'2018-01-06 00:00:00\')->addDays(6)->calendar({class}::parse(\'2018-01-06 00:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->addDays(2)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->addDays(3)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->addDays(4)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->addDays(5)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->addDays(6)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::now()->subDays(2)->calendar()', '{class}::parse(\'2018-01-04 00:00:00\')->subHours(2)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 12:00:00\')->subHours(2)->calendar({class}::parse(\'2018-01-04 12:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->addHours(2)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 23:00:00\')->addHours(2)->calendar({class}::parse(\'2018-01-04 23:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->addDays(2)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::parse(\'2018-01-08 00:00:00\')->subDay()->calendar({class}::parse(\'2018-01-08 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->subDays(1)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->subDays(2)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->subDays(3)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->subDays(4)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->subDays(5)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-04 00:00:00\')->subDays(6)->calendar({class}::parse(\'2018-01-04 00:00:00\'))', '{class}::parse(\'2018-01-03 00:00:00\')->subDays(6)->calendar({class}::parse(\'2018-01-03 00:00:00\'))', '{class}::parse(\'2018-01-02 00:00:00\')->subDays(6)->calendar({class}::parse(\'2018-01-02 00:00:00\'))', '{class}::parse(\'2018-01-07 00:00:00\')->subDays(2)->calendar({class}::parse(\'2018-01-07 00:00:00\'))', '{class}::parse(\'2018-01-01 00:00:00\')->isoFormat(\'Qo Mo Do Wo wo\')', '{class}::parse(\'2018-01-02 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-01-03 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-01-04 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-01-05 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-01-06 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-01-07 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-01-11 00:00:00\')->isoFormat(\'Do wo\')', '{class}::parse(\'2018-02-09 00:00:00\')->isoFormat(\'DDDo\')', '{class}::parse(\'2018-02-10 00:00:00\')->isoFormat(\'DDDo\')', '{class}::parse(\'2018-04-10 00:00:00\')->isoFormat(\'DDDo\')', '{class}::parse(\'2018-02-10 00:00:00\', \'Europe/Paris\')->isoFormat(\'h:mm a z\')', '{class}::parse(\'2018-02-10 00:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 01:30:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 02:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 06:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 10:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 12:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 17:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 21:30:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-02-10 23:00:00\')->isoFormat(\'h:mm A, h:mm a\')', '{class}::parse(\'2018-01-01 00:00:00\')->ordinal(\'hour\')', '{class}::now()->subSeconds(1)->diffForHumans()', '{class}::now()->subSeconds(1)->diffForHumans(null, false, true)', '{class}::now()->subSeconds(2)->diffForHumans()', '{class}::now()->subSeconds(2)->diffForHumans(null, false, true)', '{class}::now()->subMinutes(1)->diffForHumans()', '{class}::now()->subMinutes(1)->diffForHumans(null, false, true)', '{class}::now()->subMinutes(2)->diffForHumans()', '{class}::now()->subMinutes(2)->diffForHumans(null, false, true)', '{class}::now()->subHours(1)->diffForHumans()', '{class}::now()->subHours(1)->diffForHumans(null, false, true)', '{class}::now()->subHours(2)->diffForHumans()', '{class}::now()->subHours(2)->diffForHumans(null, false, true)', '{class}::now()->subDays(1)->diffForHumans()', '{class}::now()->subDays(1)->diffForHumans(null, false, true)', '{class}::now()->subDays(2)->diffForHumans()', '{class}::now()->subDays(2)->diffForHumans(null, false, true)', '{class}::now()->subWeeks(1)->diffForHumans()', '{class}::now()->subWeeks(1)->diffForHumans(null, false, true)', '{class}::now()->subWeeks(2)->diffForHumans()', '{class}::now()->subWeeks(2)->diffForHumans(null, false, true)', '{class}::now()->subMonths(1)->diffForHumans()', '{class}::now()->subMonths(1)->diffForHumans(null, false, true)', '{class}::now()->subMonths(2)->diffForHumans()', '{class}::now()->subMonths(2)->diffForHumans(null, false, true)', '{class}::now()->subYears(1)->diffForHumans()', '{class}::now()->subYears(1)->diffForHumans(null, false, true)', '{class}::now()->subYears(2)->diffForHumans()', '{class}::now()->subYears(2)->diffForHumans(null, false, true)', '{class}::now()->addSecond()->diffForHumans()', '{class}::now()->addSecond()->diffForHumans(null, false, true)', '{class}::now()->addSecond()->diffForHumans({class}::now())', '{class}::now()->addSecond()->diffForHumans({class}::now(), false, true)', '{class}::now()->diffForHumans({class}::now()->addSecond())', '{class}::now()->diffForHumans({class}::now()->addSecond(), false, true)', '{class}::now()->addSecond()->diffForHumans({class}::now(), true)', '{class}::now()->addSecond()->diffForHumans({class}::now(), true, true)', '{class}::now()->diffForHumans({class}::now()->addSecond()->addSecond(), true)', '{class}::now()->diffForHumans({class}::now()->addSecond()->addSecond(), true, true)', '{class}::now()->addSecond()->diffForHumans(null, false, true, 1)', '{class}::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)', '{class}::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)', '{class}::now()->addYears(3)->diffForHumans(null, null, false, 4)', '{class}::now()->subMonths(5)->diffForHumans(null, null, true, 4)', '{class}::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)', '{class}::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)', '{class}::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)', '{class}::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)', '{class}::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])', '{class}::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)', '{class}::now()->addHour()->diffForHumans(["aUnit" => true])', 'CarbonInterval::days(2)->forHumans()', 'CarbonInterval::create(\'P1DT3H\')->forHumans(true)', ]; public const CASES = []; protected function setUp(): void { parent::setUp(); Carbon::setLocale(static::LOCALE); if (!$this->areSameLocales(Carbon::getLocale(), static::LOCALE)) { throw new InvalidArgumentException('Locale '.static::LOCALE.' not found'); } CarbonImmutable::setLocale(static::LOCALE); if (!$this->areSameLocales(CarbonImmutable::getLocale(), static::LOCALE)) { throw new InvalidArgumentException('Locale '.static::LOCALE.' not found'); } CarbonInterval::setLocale(static::LOCALE); if (!$this->areSameLocales(CarbonInterval::getLocale(), static::LOCALE)) { throw new InvalidArgumentException('Locale '.static::LOCALE.' not found'); } } #[Group('language')] public function testLanguage() { $this->wrapWithNonDstDate(function () { $date = Carbon::parse('2018-05-15 20:49:13.881726'); Carbon::setTestNow($this->now = $date); $date = CarbonImmutable::parse('2018-05-15 20:49:13.881726'); CarbonImmutable::setTestNow($this->immutableNow = $date); foreach (static::TESTS as $index => $test) { foreach ([Carbon::class, CarbonImmutable::class] as $class) { $test = str_replace('{class}', $class, $test); $result = eval("use Carbon\CarbonInterval; return $test;"); $expected = static::CASES[$index]; $locale = static::LOCALE; $key = preg_replace('/^([^_]+)_.*$/', '$1', static::LOCALE); if (isset(static::LOCALES[$key])) { $locale = static::LOCALES[$key].' ('.$locale.')'; } $this->assertSame( $expected, $result, 'In '.$locale.', '.str_replace('Carbon\\', '', $test).' should return '.$expected, ); } } }); } } ================================================ FILE: tests/Localization/LrcIqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LrcIqTest extends LocalizationTestCase { public const LOCALE = 'lrc_IQ'; // Northern Luri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 هنر ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 هنر ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 هنر ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 هنر ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 هنر 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/LrcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LrcTest extends LocalizationTestCase { public const LOCALE = 'lrc'; // Northern Luri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 هنر ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 هنر ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 هنر ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 هنر ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 هنر 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/LtLtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LtLtTest extends LocalizationTestCase { public const LOCALE = 'lt_LT'; // Lithuanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Rytoj 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'šeštadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'sekmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'pirmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'antradienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'trečiadienį 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'ketvirtadienį 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'penktadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'antradienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'trečiadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'ketvirtadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'penktadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'šeštadienį 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Paskutinį sekmadienį 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Vakar 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Šiandien 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Šiandien 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Rytoj 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'antradienį 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Vakar 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Vakar 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Paskutinį antradienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Paskutinį pirmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Paskutinį sekmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Paskutinį šeštadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Paskutinį penktadienį 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Paskutinį ketvirtadienį 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Paskutinį trečiadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Paskutinį penktadienį 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1-as 1-as 1-as 1-as 1-as', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2-as 1-as', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3-ias 1-as', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4-as 1-as', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5-as 1-as', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6-as 1-as', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7-as 1-as', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11-as 2-as', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40-as', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-as', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-as', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 priešpiet CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 priešpiet, 12:00 priešpiet', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 priešpiet, 1:30 priešpiet', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 priešpiet, 2:00 priešpiet', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 priešpiet, 6:00 priešpiet', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 priešpiet, 10:00 priešpiet', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 popiet, 12:00 popiet', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 popiet, 5:00 popiet', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 popiet, 9:30 popiet', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 popiet, 11:00 popiet', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0-is', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'prieš 1 sekundę', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'prieš 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'prieš 2 sekundes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'prieš 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'prieš 1 minutę', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'prieš 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'prieš 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'prieš 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'prieš 1 valandą', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'prieš 1 val.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'prieš 2 valandas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'prieš 2 val.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'prieš 1 dieną', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'prieš 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'prieš 2 dienas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'prieš 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'prieš 1 savaitę', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'prieš 1 sav.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'prieš 2 savaites', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'prieš 2 sav.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'prieš 1 mėnesį', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'prieš 1 mėn.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'prieš 2 mėnesius', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'prieš 2 mėn.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'prieš 1 metus', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'prieš 1 m.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'prieš 2 metus', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'prieš 2 m.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 sekundė nuo dabar', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 sek. nuo dabar', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'po 1 sekundė', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'po 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'už 1 sekundės', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'už 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundė', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekundės', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 sek. nuo dabar', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minutė 1 sekundė', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 m. 3 mėn. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 metai nuo dabar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'prieš 5 mėn.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'prieš 2 m. 3 mėn. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 savaitė 10 valandų', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 savaitė 6 dienos', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 savaitė 6 dienos', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 savaitė ir 6 dienos nuo dabar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 savaitės 1 valanda', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1 valanda nuo dabar', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dienos', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 val.', ]; } ================================================ FILE: tests/Localization/LtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LtTest extends LocalizationTestCase { public const LOCALE = 'lt'; // Lithuanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Rytoj 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'šeštadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'sekmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'pirmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'antradienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'trečiadienį 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'ketvirtadienį 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'penktadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'antradienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'trečiadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'ketvirtadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'penktadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'šeštadienį 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Paskutinį sekmadienį 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Vakar 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Šiandien 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Šiandien 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Rytoj 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'antradienį 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Vakar 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Vakar 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Paskutinį antradienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Paskutinį pirmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Paskutinį sekmadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Paskutinį šeštadienį 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Paskutinį penktadienį 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Paskutinį ketvirtadienį 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Paskutinį trečiadienį 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Paskutinį penktadienį 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1-as 1-as 1-as 1-as 1-as', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2-as 1-as', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3-ias 1-as', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4-as 1-as', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5-as 1-as', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6-as 1-as', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7-as 1-as', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11-as 2-as', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40-as', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41-as', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100-as', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 priešpiet CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 priešpiet, 12:00 priešpiet', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 priešpiet, 1:30 priešpiet', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 priešpiet, 2:00 priešpiet', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 priešpiet, 6:00 priešpiet', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 priešpiet, 10:00 priešpiet', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 popiet, 12:00 popiet', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 popiet, 5:00 popiet', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 popiet, 9:30 popiet', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 popiet, 11:00 popiet', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0-is', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'prieš 1 sekundę', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'prieš 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'prieš 2 sekundes', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'prieš 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'prieš 1 minutę', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'prieš 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'prieš 2 minutes', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'prieš 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'prieš 1 valandą', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'prieš 1 val.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'prieš 2 valandas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'prieš 2 val.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'prieš 1 dieną', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'prieš 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'prieš 2 dienas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'prieš 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'prieš 1 savaitę', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'prieš 1 sav.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'prieš 2 savaites', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'prieš 2 sav.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'prieš 1 mėnesį', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'prieš 1 mėn.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'prieš 2 mėnesius', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'prieš 2 mėn.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'prieš 1 metus', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'prieš 1 m.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'prieš 2 metus', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'prieš 2 m.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 sekundė nuo dabar', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 sek. nuo dabar', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'po 1 sekundė', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'po 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'už 1 sekundės', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'už 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundė', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekundės', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 sek. nuo dabar', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minutė 1 sekundė', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 m. 3 mėn. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 metai nuo dabar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'prieš 5 mėn.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'prieš 2 m. 3 mėn. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 savaitė 10 valandų', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 savaitė 6 dienos', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 savaitė 6 dienos', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 savaitė ir 6 dienos nuo dabar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 savaitės 1 valanda', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1 valanda nuo dabar', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dienos', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 val.', ]; } ================================================ FILE: tests/Localization/LuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LuTest extends LocalizationTestCase { public const LOCALE = 'lu'; // LubaKatanga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lubingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lumingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nkodya at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ndàayà at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ndangù at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Njòwa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ngòvya at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ndàayà at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ndangù at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Njòwa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ngòvya at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lubingu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Lumingu at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ndàayà at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ndàayà at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Nkodya at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lumingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lubingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ngòvya at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Njòwa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ndangù at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ngòvya at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 dinda CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Dinda, 12:00 dinda', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Dinda, 1:30 dinda', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Dinda, 2:00 dinda', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Dinda, 6:00 dinda', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Dinda, 10:00 dinda', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Dilolo, 12:00 dilolo', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Dilolo, 5:00 dilolo', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Dilolo, 9:30 dilolo', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Dilolo, 11:00 dilolo', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/LuoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LuoTest extends LocalizationTestCase { public const LOCALE = 'luo'; // Luo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ngeso at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapil at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wuok Tich at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tich Ariyo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tich Adek at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Tich Ang’wen at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Tich Abich at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tich Ariyo at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tich Adek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tich Ang’wen at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tich Abich at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ngeso at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapil at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tich Ariyo at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tich Ariyo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wuok Tich at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapil at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ngeso at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tich Abich at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Tich Ang’wen at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Tich Adek at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Tich Abich at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 od CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 OD, 12:00 od', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 OD, 1:30 od', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 OD, 2:00 od', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 OD, 6:00 od', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 OD, 10:00 od', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 OT, 12:00 ot', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 OT, 5:00 ot', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 OT, 9:30 ot', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 OT, 11:00 ot', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'nus dakika 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'nus dakika 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'nus dakika 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'nus dakika 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'dakika 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'dakika 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'dakika 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'dakika 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'seche 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'seche 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'seche 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'seche 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ndalo 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ndalo 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ndalo 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ndalo 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'jumbe 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'jumbe 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'jumbe 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'jumbe 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'dweche 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'dweche 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'dweche 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'dweche 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'higni 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'higni 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'higni 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'higni 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'nus dakika 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'nus dakika 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'nus dakika 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'nus dakika 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'nus dakika 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'nus dakika 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'nus dakika 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'nus dakika 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'nus dakika 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'nus dakika 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'nus dakika 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'dakika 1 nus dakika 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'higni 2 dweche 3 ndalo 1 nus dakika 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'higni 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'dweche 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'higni 2 dweche 3 ndalo 1 nus dakika 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'jumbe 1 seche 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'jumbe 1 ndalo 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'jumbe 1 ndalo 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'jumbe 1 and ndalo 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'jumbe 2 seche 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'seche 1 from now', // CarbonInterval::days(2)->forHumans() 'ndalo 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ndalo 1 seche 3', ]; } ================================================ FILE: tests/Localization/LuyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LuyTest extends LocalizationTestCase { public const LOCALE = 'luy'; // Luyia public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Murwa wa Kanne at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Murwa wa Katano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Murwa wa Kanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Murwa wa Katano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapiri at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Murwa wa Katano at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Murwa wa Kanne at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Murwa wa Katano at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/LvLvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LvLvTest extends LocalizationTestCase { public const LOCALE = 'lv_LV'; // Latvian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'rīt plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'sestdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'svētdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'nākošo pirmdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'nākošo otrdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'nākošo trešdien plkst. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'nākošo ceturtdien plkst. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'nākošo piektdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'nākošo otrdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'nākošo trešdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'nākošo ceturtdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'nākošo piektdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'nākošo sestdien plkst. 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'pagājušo svētdien plkst. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'vakar plkst. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'šodien plkst. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'šodien plkst. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'rīt plkst. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'nākošo otrdien plkst. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'vakar plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'vakar plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'pagājušo otrdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'pagājušo pirmdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'pagājušo svētdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'pagājušo sestdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'pagājušo piektdien plkst. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'pagājušo ceturtdien plkst. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'pagājušo trešdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'pagājušo piektdien plkst. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 priekšpusdiena CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 priekšpusdiena, 12:00 priekšpusdiena', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 priekšpusdiena, 1:30 priekšpusdiena', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 priekšpusdiena, 2:00 priekšpusdiena', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 priekšpusdiena, 6:00 priekšpusdiena', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 priekšpusdiena, 10:00 priekšpusdiena', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 pēcpusdiena, 12:00 pēcpusdiena', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 pēcpusdiena, 5:00 pēcpusdiena', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 pēcpusdiena, 9:30 pēcpusdiena', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 pēcpusdiena, 11:00 pēcpusdiena', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'pirms 1 sekundes', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'pirms 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'pirms 2 sekundēm', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'pirms 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'pirms 1 minūtes', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'pirms 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'pirms 2 minūtēm', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'pirms 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'pirms 1 stundas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'pirms 1 st.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'pirms 2 stundām', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'pirms 2 st.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'pirms 1 dienas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'pirms 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'pirms 2 dienām', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'pirms 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'pirms 1 nedēļas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'pirms 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'pirms 2 nedēļām', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'pirms 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'pirms 1 mēneša', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'pirms 1 mēn.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'pirms 2 mēnešiem', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'pirms 2 mēn.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'pirms 1 gada', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'pirms 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'pirms 2 gadiem', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'pirms 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'pēc 1 sekundes', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'pēc 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekundi vēlāk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. vēlāk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekundi agrāk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. agrāk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekundes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'pēc 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minūte 1 sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 g. 3 mēn. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'pēc 3 gadiem', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'pirms 5 mēn.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'pirms 2 g. 3 mēn. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 nedēļa 10 stundas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 nedēļa 6 dienas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 nedēļa 6 dienas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'pēc 1 nedēļas un 6 dienām', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 nedēļas 1 stunda', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'pēc stundas', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dienas', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d. 3 st.', ]; } ================================================ FILE: tests/Localization/LvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LvTest extends LocalizationTestCase { public const LOCALE = 'lv'; // Latvian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'rīt plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'sestdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'svētdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'nākošo pirmdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'nākošo otrdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'nākošo trešdien plkst. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'nākošo ceturtdien plkst. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'nākošo piektdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'nākošo otrdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'nākošo trešdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'nākošo ceturtdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'nākošo piektdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'nākošo sestdien plkst. 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'pagājušo svētdien plkst. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'vakar plkst. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'šodien plkst. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'šodien plkst. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'rīt plkst. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'nākošo otrdien plkst. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'vakar plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'vakar plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'pagājušo otrdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'pagājušo pirmdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'pagājušo svētdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'pagājušo sestdien plkst. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'pagājušo piektdien plkst. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'pagājušo ceturtdien plkst. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'pagājušo trešdien plkst. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'pagājušo piektdien plkst. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 priekšpusdiena CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 priekšpusdiena, 12:00 priekšpusdiena', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 priekšpusdiena, 1:30 priekšpusdiena', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 priekšpusdiena, 2:00 priekšpusdiena', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 priekšpusdiena, 6:00 priekšpusdiena', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 priekšpusdiena, 10:00 priekšpusdiena', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 pēcpusdiena, 12:00 pēcpusdiena', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 pēcpusdiena, 5:00 pēcpusdiena', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 pēcpusdiena, 9:30 pēcpusdiena', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 pēcpusdiena, 11:00 pēcpusdiena', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'pirms 1 sekundes', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'pirms 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'pirms 2 sekundēm', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'pirms 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'pirms 1 minūtes', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'pirms 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'pirms 2 minūtēm', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'pirms 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'pirms 1 stundas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'pirms 1 st.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'pirms 2 stundām', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'pirms 2 st.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'pirms 1 dienas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'pirms 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'pirms 2 dienām', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'pirms 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'pirms 1 nedēļas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'pirms 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'pirms 2 nedēļām', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'pirms 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'pirms 1 mēneša', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'pirms 1 mēn.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'pirms 2 mēnešiem', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'pirms 2 mēn.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'pirms 1 gada', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'pirms 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'pirms 2 gadiem', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'pirms 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'pēc 1 sekundes', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'pēc 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekundi vēlāk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. vēlāk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekundi agrāk', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. agrāk', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekunde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekundes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'pēc 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minūte 1 sekunde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 g. 3 mēn. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'pēc 3 gadiem', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'pirms 5 mēn.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'pirms 2 g. 3 mēn. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 nedēļa 10 stundas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 nedēļa 6 dienas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 nedēļa 6 dienas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'pēc 1 nedēļas un 6 dienām', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 nedēļas 1 stunda', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'pēc stundas', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dienas', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d. 3 st.', ]; } ================================================ FILE: tests/Localization/LzhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LzhTest extends LocalizationTestCase { public const LOCALE = 'lzh'; // Literary Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週六 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週日 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週一 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週二 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週三 at 12:00 朝', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '週四 at 12:00 朝', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '週五 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週二 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週三 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週四 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週五 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週六 at 12:00 朝', // Carbon::now()->subDays(2)->calendar() 'Last 週日 at 8:49 暮', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 暮', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 朝', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週二 at 12:00 朝', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週二 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週一 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週日 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週六 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週五 at 12:00 朝', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 週四 at 12:00 朝', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 週三 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 週五 at 12:00 朝', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 朝 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 朝, 12:00 朝', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 朝, 1:30 朝', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 朝, 2:00 朝', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 朝, 6:00 朝', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 朝, 10:00 朝', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 暮, 12:00 暮', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 暮, 5:00 暮', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 暮, 9:30 暮', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 暮, 11:00 暮', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 楚 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 楚 ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 楚 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 楚 ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 點 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 點 ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 點 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 點 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 氧 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 氧 ago', // Carbon::now()->subHours(2)->diffForHumans() '2 氧 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 氧 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 日(曆法) ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 日(曆法) ago', // Carbon::now()->subDays(2)->diffForHumans() '2 日(曆法) ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 日(曆法) ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 星期 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 星期 ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 星期 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 星期 ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 月 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 月 ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 月 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 月 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 夏 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 夏 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 夏 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 夏 ago', // Carbon::now()->addSecond()->diffForHumans() '1 楚 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 楚 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 楚 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 楚 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 楚 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 楚 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 楚', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 楚', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 楚', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 楚', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 楚 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 點 1 楚', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 夏 3 月 1 日(曆法) 1 楚', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 夏 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 月 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 夏 3 月 1 日(曆法) 1 楚 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 星期 10 氧', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 星期 6 日(曆法)', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 星期 6 日(曆法)', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 星期 and 6 日(曆法) from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 星期 1 氧', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 氧 from now', // CarbonInterval::days(2)->forHumans() '2 日(曆法)', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 日(曆法) 3 氧', ]; } ================================================ FILE: tests/Localization/LzhTwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class LzhTwTest extends LocalizationTestCase { public const LOCALE = 'lzh_TW'; // Literary Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週六 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週日 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週一 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週二 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '週三 at 12:00 朝', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '週四 at 12:00 朝', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '週五 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週二 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週三 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週四 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週五 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週六 at 12:00 朝', // Carbon::now()->subDays(2)->calendar() 'Last 週日 at 8:49 暮', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 暮', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 朝', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 朝', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 朝', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '週二 at 12:00 朝', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週二 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週一 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週日 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週六 at 12:00 朝', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 週五 at 12:00 朝', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 週四 at 12:00 朝', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 週三 at 12:00 朝', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 週五 at 12:00 朝', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 朝 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 朝, 12:00 朝', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 朝, 1:30 朝', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 朝, 2:00 朝', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 朝, 6:00 朝', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 朝, 10:00 朝', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 暮, 12:00 暮', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 暮, 5:00 暮', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 暮, 9:30 暮', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 暮, 11:00 暮', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 楚 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 楚 ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 楚 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 楚 ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 點 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 點 ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 點 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 點 ago', // Carbon::now()->subHours(1)->diffForHumans() '1 氧 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 氧 ago', // Carbon::now()->subHours(2)->diffForHumans() '2 氧 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 氧 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 日(曆法) ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 日(曆法) ago', // Carbon::now()->subDays(2)->diffForHumans() '2 日(曆法) ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 日(曆法) ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 星期 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 星期 ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 星期 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 星期 ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 月 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 月 ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 月 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 月 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 夏 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 夏 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 夏 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 夏 ago', // Carbon::now()->addSecond()->diffForHumans() '1 楚 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 楚 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 楚 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 楚 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 楚 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 楚 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 楚', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 楚', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 楚', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 楚', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 楚 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 點 1 楚', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 夏 3 月 1 日(曆法) 1 楚', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 夏 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 月 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 夏 3 月 1 日(曆法) 1 楚 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 星期 10 氧', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 星期 6 日(曆法)', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 星期 6 日(曆法)', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 星期 and 6 日(曆法) from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 星期 1 氧', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 氧 from now', // CarbonInterval::days(2)->forHumans() '2 日(曆法)', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 日(曆法) 3 氧', ]; } ================================================ FILE: tests/Localization/MagInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MagInTest extends LocalizationTestCase { public const LOCALE = 'mag_IN'; // Magahi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सनिचर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'एतवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुध at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिफे at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुध at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिफे at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सनिचर at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last एतवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last एतवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सनिचर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिफे at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुध at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MagTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MagTest extends LocalizationTestCase { public const LOCALE = 'mag'; // Magahi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सनिचर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'एतवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुध at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिफे at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुध at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिफे at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सनिचर at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last एतवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last एतवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सनिचर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिफे at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुध at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last सूक at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MaiInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MaiInTest extends LocalizationTestCase { public const LOCALE = 'mai_IN'; // Maithili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनीदिन at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविदिन at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 समय ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 समय ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 समय ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 समय ago', // Carbon::now()->subHours(1)->diffForHumans() '1 घण्टा ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिन ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 महिना ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ऋतु ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ऋतु ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ऋतु ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ऋतु ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 समय 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ऋतु 3 महिना 1 दिन 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ऋतु from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ऋतु 3 महिना 1 दिन 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 श्रेणी:क्यालेन्डर 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 श्रेणी:क्यालेन्डर 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 श्रेणी:क्यालेन्डर 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 श्रेणी:क्यालेन्डर and 6 दिन from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 श्रेणी:क्यालेन्डर 1 घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 घण्टा from now', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/MaiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MaiTest extends LocalizationTestCase { public const LOCALE = 'mai'; // Maithili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनीदिन at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविदिन at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतीदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रदिन at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 समय ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 समय ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 समय ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 समय ago', // Carbon::now()->subHours(1)->diffForHumans() '1 घण्टा ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिन ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 श्रेणी:क्यालेन्डर ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 महिना ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ऋतु ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ऋतु ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ऋतु ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ऋतु ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 समय 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ऋतु 3 महिना 1 दिन 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ऋतु from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ऋतु 3 महिना 1 दिन 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 श्रेणी:क्यालेन्डर 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 श्रेणी:क्यालेन्डर 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 श्रेणी:क्यालेन्डर 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 श्रेणी:क्यालेन्डर and 6 दिन from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 श्रेणी:क्यालेन्डर 1 घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 घण्टा from now', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/MasTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MasTest extends LocalizationTestCase { public const LOCALE = 'mas'; // Masai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamósi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapílí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatátu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumane at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatánɔ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alaámisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumáa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumane at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatánɔ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alaámisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumáa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamósi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapílí at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumane at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumane at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatátu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapílí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamósi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumáa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alaámisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatánɔ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumáa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ɛnkakɛnyá CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ɛnkakɛnyá, 12:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Ɛnkakɛnyá, 1:30 ɛnkakɛnyá', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Ɛnkakɛnyá, 2:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Ɛnkakɛnyá, 6:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Ɛnkakɛnyá, 10:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ɛndámâ, 12:00 ɛndámâ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ɛndámâ, 5:00 ɛndámâ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ɛndámâ, 9:30 ɛndámâ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ɛndámâ, 11:00 ɛndámâ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 are ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 are ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 are ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 are ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 esahabu ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 esahabu ago', // Carbon::now()->subHours(2)->diffForHumans() '2 esahabu ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 esahabu ago', // Carbon::now()->subDays(1)->diffForHumans() '1 enkolongʼ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 enkolongʼ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 enkolongʼ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 enkolongʼ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 engolongeare orwiki ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 engolongeare orwiki ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 engolongeare orwiki ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 engolongeare orwiki ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 olapa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 olapa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 olapa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 olapa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 olameyu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 olameyu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 olameyu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 olameyu ago', // Carbon::now()->addSecond()->diffForHumans() '1 are from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 are from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 are after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 are after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 are before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 are before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 are', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 are', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 are', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 are', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 are from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 are', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 olameyu 3 olapa 1 enkolongʼ 1 are', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 olameyu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 olapa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 olameyu 3 olapa 1 enkolongʼ 1 are ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 engolongeare orwiki 10 esahabu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 engolongeare orwiki 6 enkolongʼ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 engolongeare orwiki 6 enkolongʼ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 engolongeare orwiki and 6 enkolongʼ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 engolongeare orwiki 1 esahabu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 esahabu from now', // CarbonInterval::days(2)->forHumans() '2 enkolongʼ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 enkolongʼ 3 esahabu', ]; } ================================================ FILE: tests/Localization/MasTzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MasTzTest extends LocalizationTestCase { public const LOCALE = 'mas_TZ'; // Masai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamósi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapílí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatátu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumane at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatánɔ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alaámisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumáa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumane at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatánɔ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alaámisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumáa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamósi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapílí at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumane at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumane at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatátu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapílí at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamósi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumáa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alaámisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatánɔ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jumáa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ɛnkakɛnyá CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ɛnkakɛnyá, 12:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Ɛnkakɛnyá, 1:30 ɛnkakɛnyá', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Ɛnkakɛnyá, 2:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Ɛnkakɛnyá, 6:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Ɛnkakɛnyá, 10:00 ɛnkakɛnyá', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ɛndámâ, 12:00 ɛndámâ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ɛndámâ, 5:00 ɛndámâ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ɛndámâ, 9:30 ɛndámâ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ɛndámâ, 11:00 ɛndámâ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 are ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 are ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 are ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 are ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 esahabu ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 esahabu ago', // Carbon::now()->subHours(2)->diffForHumans() '2 esahabu ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 esahabu ago', // Carbon::now()->subDays(1)->diffForHumans() '1 enkolongʼ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 enkolongʼ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 enkolongʼ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 enkolongʼ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 engolongeare orwiki ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 engolongeare orwiki ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 engolongeare orwiki ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 engolongeare orwiki ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 olapa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 olapa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 olapa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 olapa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 olameyu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 olameyu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 olameyu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 olameyu ago', // Carbon::now()->addSecond()->diffForHumans() '1 are from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 are from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 are after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 are after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 are before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 are before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 are', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 are', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 are', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 are', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 are from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 are', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 olameyu 3 olapa 1 enkolongʼ 1 are', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 olameyu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 olapa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 olameyu 3 olapa 1 enkolongʼ 1 are ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 engolongeare orwiki 10 esahabu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 engolongeare orwiki 6 enkolongʼ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 engolongeare orwiki 6 enkolongʼ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 engolongeare orwiki and 6 enkolongʼ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 engolongeare orwiki 1 esahabu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 esahabu from now', // CarbonInterval::days(2)->forHumans() '2 enkolongʼ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 enkolongʼ 3 esahabu', ]; } ================================================ FILE: tests/Localization/MeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MeTest extends LocalizationTestCase { public const LOCALE = 'me'; // me public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sjutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedjelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sjutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošle nedjelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedjelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srijede u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'prije 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'prije 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'prije 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'prije 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'prije 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'prije 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'prije 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'prije 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'prije 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'prije 1 nedjelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'prije 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'prije 2 nedjelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'prije 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'prije 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'prije 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'prije 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'prije 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekund nakon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 sek. nakon', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund prije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 sek. prije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'prije 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'prije 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedjelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedjelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedjelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedjelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedjelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/MerTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MerTest extends LocalizationTestCase { public const LOCALE = 'mer'; // Meru public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kiumia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Muramuko at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wairi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wethatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Wena at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Wetano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wairi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wethatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wena at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wetano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Kiumia at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wairi at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wairi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Muramuko at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kiumia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wetano at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Wena at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wethatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Wetano at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 rũ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 RŨ, 12:00 rũ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 RŨ, 1:30 rũ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 RŨ, 2:00 rũ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 RŨ, 6:00 rũ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 RŨ, 10:00 rũ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ŨG, 12:00 ũg', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ŨG, 5:00 ũg', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ŨG, 9:30 ũg', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ŨG, 11:00 ũg', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 gikeno ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 gikeno ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 gikeno ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 gikeno ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 monto ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 monto ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 monto ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 monto ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 muchaara ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 muchaara ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 muchaara ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 muchaara ago', // Carbon::now()->subYears(1)->diffForHumans() '1 murume ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 murume ago', // Carbon::now()->subYears(2)->diffForHumans() '2 murume ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 murume ago', // Carbon::now()->addSecond()->diffForHumans() '1 gikeno from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 gikeno from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 gikeno after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 gikeno after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 gikeno before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 gikeno before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 gikeno', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 gikeno', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 gikeno', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 gikeno', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 gikeno from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 monto 1 gikeno', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 murume 3 muchaara 1d 1 gikeno', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 murume from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 muchaara ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 murume 3 muchaara 1d 1 gikeno ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MfeMuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MfeMuTest extends LocalizationTestCase { public const LOCALE = 'mfe_MU'; // Morisyen public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimans at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lindi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'merkredi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'zedi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'merkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samdi at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dimans at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mardi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lindi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dimans at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last zedi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last merkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 déziém ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 déziém ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 déziém ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 déziém ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minitt ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minitt ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minitt ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minitt ago', // Carbon::now()->subHours(1)->diffForHumans() '1 -er-tan ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 -er-tan ago', // Carbon::now()->subHours(2)->diffForHumans() '2 -er-tan ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 -er-tan ago', // Carbon::now()->subDays(1)->diffForHumans() '1 zour ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 zour ago', // Carbon::now()->subDays(2)->diffForHumans() '2 zour ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 zour ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sémenn ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sémenn ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sémenn ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sémenn ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mwa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mwa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mwa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mwa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 banané ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 banané ago', // Carbon::now()->subYears(2)->diffForHumans() '2 banané ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 banané ago', // Carbon::now()->addSecond()->diffForHumans() '1 déziém from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 déziém from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 déziém after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 déziém after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 déziém before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 déziém before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 déziém', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 déziém', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 déziém', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 déziém', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 déziém from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minitt 1 déziém', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 banané 3 mwa 1 zour 1 déziém', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 banané from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mwa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 banané 3 mwa 1 zour 1 déziém ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sémenn 10 -er-tan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sémenn 6 zour', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sémenn 6 zour', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sémenn and 6 zour from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sémenn 1 -er-tan', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 -er-tan from now', // CarbonInterval::days(2)->forHumans() '2 zour', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 zour 3 -er-tan', ]; } ================================================ FILE: tests/Localization/MfeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MfeTest extends LocalizationTestCase { public const LOCALE = 'mfe'; // Morisyen public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimans at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lindi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'merkredi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'zedi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'merkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vandredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'samdi at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dimans at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mardi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lindi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dimans at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last samdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last zedi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last merkredi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vandredi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 déziém ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 déziém ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 déziém ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 déziém ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minitt ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minitt ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minitt ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minitt ago', // Carbon::now()->subHours(1)->diffForHumans() '1 -er-tan ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 -er-tan ago', // Carbon::now()->subHours(2)->diffForHumans() '2 -er-tan ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 -er-tan ago', // Carbon::now()->subDays(1)->diffForHumans() '1 zour ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 zour ago', // Carbon::now()->subDays(2)->diffForHumans() '2 zour ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 zour ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sémenn ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sémenn ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sémenn ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sémenn ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mwa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mwa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mwa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mwa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 banané ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 banané ago', // Carbon::now()->subYears(2)->diffForHumans() '2 banané ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 banané ago', // Carbon::now()->addSecond()->diffForHumans() '1 déziém from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 déziém from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 déziém after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 déziém after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 déziém before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 déziém before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 déziém', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 déziém', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 déziém', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 déziém', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 déziém from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minitt 1 déziém', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 banané 3 mwa 1 zour 1 déziém', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 banané from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mwa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 banané 3 mwa 1 zour 1 déziém ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sémenn 10 -er-tan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sémenn 6 zour', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sémenn 6 zour', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sémenn and 6 zour from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sémenn 1 -er-tan', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 -er-tan from now', // CarbonInterval::days(2)->forHumans() '2 zour', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 zour 3 -er-tan', ]; } ================================================ FILE: tests/Localization/MgMgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MgMgTest extends LocalizationTestCase { public const LOCALE = 'mg_MG'; // Malagasy public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabotsy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alahady at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alatsinainy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'talata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alarobia at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'alakamisy at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'zoma at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talata at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alarobia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alakamisy at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zoma at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabotsy at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last alahady at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talata at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last talata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last alatsinainy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last alahady at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabotsy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last zoma at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last alakamisy at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last alarobia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last zoma at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segondra ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segondra ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segondra ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segondra ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minitra ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minitra ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minitra ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minitra ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ora ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ora ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ora ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ora ago', // Carbon::now()->subDays(1)->diffForHumans() '1 andro ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 andro ago', // Carbon::now()->subDays(2)->diffForHumans() '2 andro ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 andro ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 herinandro ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 herinandro ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 herinandro ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 herinandro ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 volana ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 volana ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 volana ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 volana ago', // Carbon::now()->subYears(1)->diffForHumans() '1 taona ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taona ago', // Carbon::now()->subYears(2)->diffForHumans() '2 taona ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taona ago', // Carbon::now()->addSecond()->diffForHumans() '1 segondra from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segondra from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segondra after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segondra after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segondra before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segondra before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segondra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segondra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segondra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segondra', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segondra from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minitra 1 segondra', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taona 3 volana 1 andro 1 segondra', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 taona from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 volana ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taona 3 volana 1 andro 1 segondra ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 herinandro 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 herinandro 6 andro', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 herinandro 6 andro', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 herinandro and 6 andro from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 herinandro 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ora from now', // CarbonInterval::days(2)->forHumans() '2 andro', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 andro 3 ora', ]; } ================================================ FILE: tests/Localization/MgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MgTest extends LocalizationTestCase { public const LOCALE = 'mg'; // Malagasy public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sabotsy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alahady at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alatsinainy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'talata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alarobia at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'alakamisy at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'zoma at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talata at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alarobia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alakamisy at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zoma at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sabotsy at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last alahady at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talata at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last talata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last alatsinainy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last alahady at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sabotsy at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last zoma at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last alakamisy at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last alarobia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last zoma at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segondra ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 segondra ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segondra ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 segondra ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minitra ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minitra ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minitra ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minitra ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ora ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ora ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ora ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ora ago', // Carbon::now()->subDays(1)->diffForHumans() '1 andro ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 andro ago', // Carbon::now()->subDays(2)->diffForHumans() '2 andro ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 andro ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 herinandro ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 herinandro ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 herinandro ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 herinandro ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 volana ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 volana ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 volana ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 volana ago', // Carbon::now()->subYears(1)->diffForHumans() '1 taona ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taona ago', // Carbon::now()->subYears(2)->diffForHumans() '2 taona ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taona ago', // Carbon::now()->addSecond()->diffForHumans() '1 segondra from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 segondra from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segondra after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segondra after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segondra before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segondra before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segondra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segondra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segondra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segondra', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 segondra from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minitra 1 segondra', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taona 3 volana 1 andro 1 segondra', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 taona from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 volana ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taona 3 volana 1 andro 1 segondra ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 herinandro 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 herinandro 6 andro', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 herinandro 6 andro', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 herinandro and 6 andro from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 herinandro 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ora from now', // CarbonInterval::days(2)->forHumans() '2 andro', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 andro 3 ora', ]; } ================================================ FILE: tests/Localization/MghTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MghTest extends LocalizationTestCase { public const LOCALE = 'mgh'; // Makhuwa-Meetto public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabato at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Arahamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arahamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sabato at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabato at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Arahamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 wichishu CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 wichishu, 12:00 wichishu', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 wichishu, 1:30 wichishu', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 wichishu, 2:00 wichishu', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 wichishu, 6:00 wichishu', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 wichishu, 10:00 wichishu', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 mchochil’l, 12:00 mchochil’l', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 mchochil’l, 5:00 mchochil’l', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 mchochil’l, 9:30 mchochil’l', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 mchochil’l, 11:00 mchochil’l', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MgoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MgoTest extends LocalizationTestCase { public const LOCALE = 'mgo'; // Metaʼ public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aneg 7 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aneg 1 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aneg 2 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aneg 3 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aneg 4 at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aneg 5 at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Aneg 6 at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aneg 3 at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aneg 4 at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aneg 5 at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aneg 6 at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aneg 7 at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Aneg 1 at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aneg 3 at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aneg 3 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aneg 2 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aneg 1 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aneg 7 at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aneg 6 at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aneg 5 at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Aneg 4 at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Aneg 6 at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MhrRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MhrRuTest extends LocalizationTestCase { public const LOCALE = 'mhr_RU'; // Eastern Mari public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шуматкече at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Рушарня at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шочмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вӱргече at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Изарня at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Кугарня at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Вӱргече at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Изарня at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кугарня at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шуматкече at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Рушарня at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шочмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Рушарня at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шуматкече at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Кугарня at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Изарня at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Вӱргече at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Кугарня at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 кокымшан ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 кокымшан ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 кокымшан ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 кокымшан ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минут ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 минут ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минут ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 минут ago', // Carbon::now()->subHours(1)->diffForHumans() '1 час ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 час ago', // Carbon::now()->subHours(2)->diffForHumans() '2 час ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 час ago', // Carbon::now()->subDays(1)->diffForHumans() '1 кече ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 кече ago', // Carbon::now()->subDays(2)->diffForHumans() '2 кече ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 кече ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 арня ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 арня ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 арня ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 арня ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Тылзе ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Тылзе ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Тылзе ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Тылзе ago', // Carbon::now()->subYears(1)->diffForHumans() '1 идалык ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 идалык ago', // Carbon::now()->subYears(2)->diffForHumans() '2 идалык ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 идалык ago', // Carbon::now()->addSecond()->diffForHumans() '1 кокымшан from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 кокымшан from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 кокымшан after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 кокымшан after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 кокымшан before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 кокымшан before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 кокымшан', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 кокымшан', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 кокымшан', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 кокымшан', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 кокымшан from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 кокымшан', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 идалык 3 Тылзе 1 кече 1 кокымшан', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 идалык from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Тылзе ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 идалык 3 Тылзе 1 кече 1 кокымшан ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 арня 10 час', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 арня 6 кече', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 арня 6 кече', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 арня and 6 кече from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 арня 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 час from now', // CarbonInterval::days(2)->forHumans() '2 кече', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 кече 3 час', ]; } ================================================ FILE: tests/Localization/MhrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MhrTest extends LocalizationTestCase { public const LOCALE = 'mhr'; // Eastern Mari public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шуматкече at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Рушарня at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Шочмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вӱргече at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Изарня at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Кугарня at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Вӱргече at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Изарня at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кугарня at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Шуматкече at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Рушарня at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Кушкыжмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шочмо at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Рушарня at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Шуматкече at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Кугарня at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Изарня at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Вӱргече at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Кугарня at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 кокымшан ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 кокымшан ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 кокымшан ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 кокымшан ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минут ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 минут ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минут ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 минут ago', // Carbon::now()->subHours(1)->diffForHumans() '1 час ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 час ago', // Carbon::now()->subHours(2)->diffForHumans() '2 час ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 час ago', // Carbon::now()->subDays(1)->diffForHumans() '1 кече ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 кече ago', // Carbon::now()->subDays(2)->diffForHumans() '2 кече ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 кече ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 арня ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 арня ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 арня ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 арня ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Тылзе ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Тылзе ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Тылзе ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Тылзе ago', // Carbon::now()->subYears(1)->diffForHumans() '1 идалык ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 идалык ago', // Carbon::now()->subYears(2)->diffForHumans() '2 идалык ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 идалык ago', // Carbon::now()->addSecond()->diffForHumans() '1 кокымшан from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 кокымшан from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 кокымшан after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 кокымшан after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 кокымшан before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 кокымшан before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 кокымшан', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 кокымшан', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 кокымшан', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 кокымшан', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 кокымшан from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 кокымшан', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 идалык 3 Тылзе 1 кече 1 кокымшан', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 идалык from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Тылзе ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 идалык 3 Тылзе 1 кече 1 кокымшан ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 арня 10 час', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 арня 6 кече', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 арня 6 кече', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 арня and 6 кече from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 арня 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 час from now', // CarbonInterval::days(2)->forHumans() '2 кече', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 кече 3 час', ]; } ================================================ FILE: tests/Localization/MiNzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MiNzTest extends LocalizationTestCase { public const LOCALE = 'mi_NZ'; // Maori public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'apopo i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hātarei i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rātapu i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mane i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tūrei i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wenerei i 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Tāite i 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Paraire i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūrei i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wenerei i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tāite i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Paraire i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Hātarei i 00:00', // Carbon::now()->subDays(2)->calendar() 'Rātapu whakamutunga i 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'inanahi i 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i teie mahana, i 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i teie mahana, i 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'apopo i 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūrei i 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'inanahi i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'inanahi i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tūrei whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mane whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rātapu whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hātarei whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Paraire whakamutunga i 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Tāite whakamutunga i 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Wenerei whakamutunga i 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Paraire whakamutunga i 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 hēkona i mua', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 hēkona i mua', // Carbon::now()->subSeconds(2)->diffForHumans() '2 hēkona i mua', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 hēkona i mua', // Carbon::now()->subMinutes(1)->diffForHumans() '1 meneti i mua', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 meneti i mua', // Carbon::now()->subMinutes(2)->diffForHumans() '2 meneti i mua', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 meneti i mua', // Carbon::now()->subHours(1)->diffForHumans() '1 haora i mua', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 haora i mua', // Carbon::now()->subHours(2)->diffForHumans() '2 haora i mua', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 haora i mua', // Carbon::now()->subDays(1)->diffForHumans() '1 ra i mua', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ra i mua', // Carbon::now()->subDays(2)->diffForHumans() '2 ra i mua', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ra i mua', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wiki i mua', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 wiki i mua', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wiki i mua', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 wiki i mua', // Carbon::now()->subMonths(1)->diffForHumans() '1 marama i mua', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 marama i mua', // Carbon::now()->subMonths(2)->diffForHumans() '2 marama i mua', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 marama i mua', // Carbon::now()->subYears(1)->diffForHumans() '1 tau i mua', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tau i mua', // Carbon::now()->subYears(2)->diffForHumans() '2 tau i mua', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tau i mua', // Carbon::now()->addSecond()->diffForHumans() 'i roto i 1 hēkona', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'i roto i 1 hēkona', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 hēkona', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 hēkona', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 hēkona', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 hēkona', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'i roto i 1 hēkona', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 meneti 1 hēkona', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tau 3 marama 1 ra 1 hēkona', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'i roto i 3 tau', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 marama i mua', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tau 3 marama 1 ra 1 hēkona i mua', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wiki 10 haora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wiki 6 ra', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wiki 6 ra', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'i roto i 1 wiki me te 6 ra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wiki 1 haora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'i roto i te haora', // CarbonInterval::days(2)->forHumans() '2 ra', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ra 3 haora', ]; } ================================================ FILE: tests/Localization/MiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MiTest extends LocalizationTestCase { public const LOCALE = 'mi'; // Maori public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'apopo i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hātarei i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rātapu i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mane i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tūrei i 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wenerei i 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Tāite i 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Paraire i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūrei i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wenerei i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tāite i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Paraire i 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Hātarei i 00:00', // Carbon::now()->subDays(2)->calendar() 'Rātapu whakamutunga i 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'inanahi i 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i teie mahana, i 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i teie mahana, i 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'apopo i 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūrei i 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'inanahi i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'inanahi i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tūrei whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mane whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rātapu whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hātarei whakamutunga i 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Paraire whakamutunga i 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Tāite whakamutunga i 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Wenerei whakamutunga i 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Paraire whakamutunga i 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() '1 hēkona i mua', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 hēkona i mua', // Carbon::now()->subSeconds(2)->diffForHumans() '2 hēkona i mua', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 hēkona i mua', // Carbon::now()->subMinutes(1)->diffForHumans() '1 meneti i mua', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 meneti i mua', // Carbon::now()->subMinutes(2)->diffForHumans() '2 meneti i mua', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 meneti i mua', // Carbon::now()->subHours(1)->diffForHumans() '1 haora i mua', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 haora i mua', // Carbon::now()->subHours(2)->diffForHumans() '2 haora i mua', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 haora i mua', // Carbon::now()->subDays(1)->diffForHumans() '1 ra i mua', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ra i mua', // Carbon::now()->subDays(2)->diffForHumans() '2 ra i mua', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ra i mua', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wiki i mua', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 wiki i mua', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wiki i mua', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 wiki i mua', // Carbon::now()->subMonths(1)->diffForHumans() '1 marama i mua', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 marama i mua', // Carbon::now()->subMonths(2)->diffForHumans() '2 marama i mua', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 marama i mua', // Carbon::now()->subYears(1)->diffForHumans() '1 tau i mua', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tau i mua', // Carbon::now()->subYears(2)->diffForHumans() '2 tau i mua', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tau i mua', // Carbon::now()->addSecond()->diffForHumans() 'i roto i 1 hēkona', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'i roto i 1 hēkona', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 hēkona', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 hēkona', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 hēkona', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 hēkona', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'i roto i 1 hēkona', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 meneti 1 hēkona', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tau 3 marama 1 ra 1 hēkona', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'i roto i 3 tau', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 marama i mua', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tau 3 marama 1 ra 1 hēkona i mua', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wiki 10 haora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wiki 6 ra', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wiki 6 ra', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'i roto i 1 wiki me te 6 ra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wiki 1 haora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'i roto i te haora', // CarbonInterval::days(2)->forHumans() '2 ra', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ra 3 haora', ]; } ================================================ FILE: tests/Localization/MiqNiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MiqNiTest extends LocalizationTestCase { public const LOCALE = 'miq_NI'; // Mískito public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'satadi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sandi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mundi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tiusdi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wensde at 12:00 VM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tausde at 12:00 VM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'praidi at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiusdi at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wensde at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tausde at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'praidi at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'satadi at 12:00 VM', // Carbon::now()->subDays(2)->calendar() 'Last sandi at 8:49 NM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 NM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 VM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiusdi at 12:00 VM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tiusdi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mundi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sandi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last satadi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last praidi at 12:00 VM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tausde at 12:00 VM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last wensde at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last praidi at 12:00 VM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 53rd', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 53rd', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 53rd', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 53rd', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 53rd', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 53rd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 1st', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 kati ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 kati ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 kati ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 kati ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3 kati 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 kati ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3 kati 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MiqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MiqTest extends LocalizationTestCase { public const LOCALE = 'miq'; // Mískito public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'satadi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sandi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mundi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tiusdi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wensde at 12:00 VM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tausde at 12:00 VM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'praidi at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiusdi at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wensde at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tausde at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'praidi at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'satadi at 12:00 VM', // Carbon::now()->subDays(2)->calendar() 'Last sandi at 8:49 NM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 NM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 VM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 VM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 VM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tiusdi at 12:00 VM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tiusdi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mundi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sandi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last satadi at 12:00 VM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last praidi at 12:00 VM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tausde at 12:00 VM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last wensde at 12:00 VM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last praidi at 12:00 VM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 53rd', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 53rd', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 53rd', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 53rd', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 53rd', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 53rd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 1st', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 vm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 VM, 12:00 vm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 VM, 1:30 vm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 VM, 2:00 vm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 VM, 6:00 vm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 VM, 10:00 vm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 NM, 12:00 nm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 NM, 5:00 nm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 NM, 9:30 nm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 NM, 11:00 nm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 kati ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 kati ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 kati ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 kati ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3 kati 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 kati ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3 kati 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MjwInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MjwInTest extends LocalizationTestCase { public const LOCALE = 'mjw_IN'; // Karbi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bhomti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bhomkuru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Urmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Durmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Thelang at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Theman at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Bhomta at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Durmi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thelang at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Theman at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bhomta at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bhomti at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Bhomkuru at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Durmi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Durmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Urmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bhomkuru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bhomti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bhomta at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Theman at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Thelang at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Bhomta at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MjwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MjwTest extends LocalizationTestCase { public const LOCALE = 'mjw'; // Karbi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bhomti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bhomkuru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Urmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Durmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Thelang at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Theman at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Bhomta at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Durmi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thelang at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Theman at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bhomta at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bhomti at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Bhomkuru at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Durmi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Durmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Urmi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bhomkuru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bhomti at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bhomta at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Theman at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Thelang at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Bhomta at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MkMkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MkMkTest extends LocalizationTestCase { public const LOCALE = 'mk_MK'; // Macedonian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Утре во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во сабота во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во недела во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во понеделник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во среда во 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Во четврток во 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Во петок во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во вторник во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во среда во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во четврток во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во петок во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во сабота во 0:00', // Carbon::now()->subDays(2)->calendar() 'Изминатата недела во 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера во 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Денес во 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Денес во 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Утре во 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во вторник во 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатиот вторник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатиот понеделник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатата недела во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатата сабота во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатиот петок во 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Изминатиот четврток во 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Изминатата среда во 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Изминатиот петок во 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ви 1-ви 1-ви 1-ви 1-ви', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-ри 1-ви', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-ти 1-ви', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ти 1-ви', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ти 1-ви', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ти 1-ви', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ми 1-ви', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ти 2-ри', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ти', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ви', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ен', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ев', // Carbon::now()->subSeconds(1)->diffForHumans() 'пред 1 секунда', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'пред 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() 'пред 2 секунди', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'пред 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() 'пред 1 минута', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'пред 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() 'пред 2 минути', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'пред 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() 'пред 1 час', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'пред 1 час', // Carbon::now()->subHours(2)->diffForHumans() 'пред 2 часа', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'пред 2 часа', // Carbon::now()->subDays(1)->diffForHumans() 'пред 1 ден', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'пред 1 ден', // Carbon::now()->subDays(2)->diffForHumans() 'пред 2 дена', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'пред 2 дена', // Carbon::now()->subWeeks(1)->diffForHumans() 'пред 1 седмица', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'пред 1 седмица', // Carbon::now()->subWeeks(2)->diffForHumans() 'пред 2 седмици', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'пред 2 седмици', // Carbon::now()->subMonths(1)->diffForHumans() 'пред 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'пред 1 месец', // Carbon::now()->subMonths(2)->diffForHumans() 'пред 2 месеци', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'пред 2 месеци', // Carbon::now()->subYears(1)->diffForHumans() 'пред 1 година', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'пред 1 год.', // Carbon::now()->subYears(2)->diffForHumans() 'пред 2 години', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'пред 2 год.', // Carbon::now()->addSecond()->diffForHumans() 'после 1 секунда', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'после 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'по 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'по 1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'пред 1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'пред 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунди', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'после 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 год. 3 месеци 1 ден 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'после 3 години', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'пред 5 месеци', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'пред 2 год. 3 месеци 1 ден 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 седмица 10 часа', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дена', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дена', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'после 1 седмица и 6 дена', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 седмици 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'после час', // CarbonInterval::days(2)->forHumans() '2 дена', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ден 3 часа', ]; } ================================================ FILE: tests/Localization/MkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MkTest extends LocalizationTestCase { public const LOCALE = 'mk'; // Macedonian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Утре во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во сабота во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во недела во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во понеделник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во среда во 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Во четврток во 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Во петок во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во вторник во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во среда во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во четврток во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во петок во 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во сабота во 0:00', // Carbon::now()->subDays(2)->calendar() 'Изминатата недела во 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера во 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Денес во 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Денес во 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Утре во 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Во вторник во 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатиот вторник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатиот понеделник во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатата недела во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатата сабота во 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Изминатиот петок во 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Изминатиот четврток во 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Изминатата среда во 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Изминатиот петок во 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ви 1-ви 1-ви 1-ви 1-ви', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-ри 1-ви', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-ти 1-ви', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ти 1-ви', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ти 1-ви', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ти 1-ви', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ми 1-ви', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ти 2-ри', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ти', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ви', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ен', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ев', // Carbon::now()->subSeconds(1)->diffForHumans() 'пред 1 секунда', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'пред 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() 'пред 2 секунди', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'пред 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() 'пред 1 минута', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'пред 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() 'пред 2 минути', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'пред 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() 'пред 1 час', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'пред 1 час', // Carbon::now()->subHours(2)->diffForHumans() 'пред 2 часа', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'пред 2 часа', // Carbon::now()->subDays(1)->diffForHumans() 'пред 1 ден', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'пред 1 ден', // Carbon::now()->subDays(2)->diffForHumans() 'пред 2 дена', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'пред 2 дена', // Carbon::now()->subWeeks(1)->diffForHumans() 'пред 1 седмица', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'пред 1 седмица', // Carbon::now()->subWeeks(2)->diffForHumans() 'пред 2 седмици', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'пред 2 седмици', // Carbon::now()->subMonths(1)->diffForHumans() 'пред 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'пред 1 месец', // Carbon::now()->subMonths(2)->diffForHumans() 'пред 2 месеци', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'пред 2 месеци', // Carbon::now()->subYears(1)->diffForHumans() 'пред 1 година', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'пред 1 год.', // Carbon::now()->subYears(2)->diffForHumans() 'пред 2 години', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'пред 2 год.', // Carbon::now()->addSecond()->diffForHumans() 'после 1 секунда', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'после 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'по 1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'по 1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'пред 1 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'пред 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунди', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'после 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 год. 3 месеци 1 ден 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'после 3 години', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'пред 5 месеци', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'пред 2 год. 3 месеци 1 ден 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 седмица 10 часа', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дена', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 седмица 6 дена', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'после 1 седмица и 6 дена', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 седмици 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'после час', // CarbonInterval::days(2)->forHumans() '2 дена', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ден 3 часа', ]; } ================================================ FILE: tests/Localization/MlInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MlInTest extends LocalizationTestCase { public const LOCALE = 'ml_IN'; // Malayalam public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'നാളെ രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ശനിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഞായറാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'തിങ്കളാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ബുധനാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'വ്യാഴാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ബുധനാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'വ്യാഴാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ശനിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::now()->subDays(2)->calendar() 'കഴിഞ്ഞ ഞായറാഴ്ച, രാത്രി 8:49 -നു', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഇന്നലെ രാത്രി 10:00 -നു', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ഇന്ന് രാവിലെ 10:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഇന്ന് രാത്രി 2:00 -നു', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'നാളെ രാത്രി 1:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ഇന്നലെ രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഇന്നലെ രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ തിങ്കളാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ ഞായറാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ ശനിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'കഴിഞ്ഞ വ്യാഴാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'കഴിഞ്ഞ ബുധനാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'കഴിഞ്ഞ വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 രാത്രി CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 രാത്രി, 12:00 രാത്രി', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 രാത്രി, 1:30 രാത്രി', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 രാത്രി, 2:00 രാത്രി', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 രാവിലെ, 6:00 രാവിലെ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 രാവിലെ, 10:00 രാവിലെ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ഉച്ച കഴിഞ്ഞ്, 12:00 ഉച്ച കഴിഞ്ഞ്', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 വൈകുന്നേരം, 5:00 വൈകുന്നേരം', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 രാത്രി, 9:30 രാത്രി', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 രാത്രി, 11:00 രാത്രി', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subSeconds(2)->diffForHumans() '2 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subMinutes(1)->diffForHumans() '1 മിനിറ്റ് മുൻപ്', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 മിനിറ്റ് മുൻപ്', // Carbon::now()->subMinutes(2)->diffForHumans() '2 മിനിറ്റ് മുൻപ്', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 മിനിറ്റ് മുൻപ്', // Carbon::now()->subHours(1)->diffForHumans() '1 മണിക്കൂർ മുൻപ്', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 മണിക്കൂർ മുൻപ്', // Carbon::now()->subHours(2)->diffForHumans() '2 മണിക്കൂർ മുൻപ്', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 മണിക്കൂർ മുൻപ്', // Carbon::now()->subDays(1)->diffForHumans() '1 ദിവസം മുൻപ്', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ദിവസം മുൻപ്', // Carbon::now()->subDays(2)->diffForHumans() '2 ദിവസം മുൻപ്', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ദിവസം മുൻപ്', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ആഴ്ച മുൻപ്', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ആഴ്ച മുൻപ്', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ആഴ്ച മുൻപ്', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ആഴ്ച മുൻപ്', // Carbon::now()->subMonths(1)->diffForHumans() '1 മാസം മുൻപ്', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 മാസം മുൻപ്', // Carbon::now()->subMonths(2)->diffForHumans() '2 മാസം മുൻപ്', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 മാസം മുൻപ്', // Carbon::now()->subYears(1)->diffForHumans() '1 വർഷം മുൻപ്', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 വർഷം മുൻപ്', // Carbon::now()->subYears(2)->diffForHumans() '2 വർഷം മുൻപ്', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 വർഷം മുൻപ്', // Carbon::now()->addSecond()->diffForHumans() '1 സെക്കൻഡ് കഴിഞ്ഞ്', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 സെക്കൻഡ് കഴിഞ്ഞ്', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 സെക്കൻഡ്', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 സെക്കൻഡ്', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 സെക്കൻഡ്', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 സെക്കൻഡ്', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 സെക്കൻഡ് കഴിഞ്ഞ്', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 മിനിറ്റ് 1 സെക്കൻഡ്', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 വർഷം 3 മാസം 1 ദിവസം 1 സെക്കൻഡ്', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 വർഷം കഴിഞ്ഞ്', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 മാസം മുൻപ്', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 വർഷം 3 മാസം 1 ദിവസം 1 സെക്കൻഡ് മുൻപ്', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ആഴ്ച 10 മണിക്കൂർ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ആഴ്ച 6 ദിവസം', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ആഴ്ച 6 ദിവസം', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ആഴ്ച, 6 ദിവസം കഴിഞ്ഞ്', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ആഴ്ച 1 മണിക്കൂർ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ഒരു മണിക്കൂർ കഴിഞ്ഞ്', // CarbonInterval::days(2)->forHumans() '2 ദിവസം', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ദിവസം 3 മണിക്കൂർ', ]; } ================================================ FILE: tests/Localization/MlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MlTest extends LocalizationTestCase { public const LOCALE = 'ml'; // Malayalam public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'നാളെ രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ശനിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഞായറാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'തിങ്കളാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ബുധനാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'വ്യാഴാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ബുധനാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'വ്യാഴാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ശനിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::now()->subDays(2)->calendar() 'കഴിഞ്ഞ ഞായറാഴ്ച, രാത്രി 8:49 -നു', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഇന്നലെ രാത്രി 10:00 -നു', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ഇന്ന് രാവിലെ 10:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഇന്ന് രാത്രി 2:00 -നു', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'നാളെ രാത്രി 1:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ഇന്നലെ രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ഇന്നലെ രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ ചൊവ്വാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ തിങ്കളാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ ഞായറാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ ശനിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'കഴിഞ്ഞ വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'കഴിഞ്ഞ വ്യാഴാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'കഴിഞ്ഞ ബുധനാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'കഴിഞ്ഞ വെള്ളിയാഴ്ച, രാത്രി 12:00 -നു', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 രാത്രി CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 രാത്രി, 12:00 രാത്രി', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 രാത്രി, 1:30 രാത്രി', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 രാത്രി, 2:00 രാത്രി', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 രാവിലെ, 6:00 രാവിലെ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 രാവിലെ, 10:00 രാവിലെ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ഉച്ച കഴിഞ്ഞ്, 12:00 ഉച്ച കഴിഞ്ഞ്', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 വൈകുന്നേരം, 5:00 വൈകുന്നേരം', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 രാത്രി, 9:30 രാത്രി', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 രാത്രി, 11:00 രാത്രി', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subSeconds(2)->diffForHumans() '2 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 സെക്കൻഡ് മുൻപ്', // Carbon::now()->subMinutes(1)->diffForHumans() '1 മിനിറ്റ് മുൻപ്', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 മിനിറ്റ് മുൻപ്', // Carbon::now()->subMinutes(2)->diffForHumans() '2 മിനിറ്റ് മുൻപ്', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 മിനിറ്റ് മുൻപ്', // Carbon::now()->subHours(1)->diffForHumans() '1 മണിക്കൂർ മുൻപ്', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 മണിക്കൂർ മുൻപ്', // Carbon::now()->subHours(2)->diffForHumans() '2 മണിക്കൂർ മുൻപ്', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 മണിക്കൂർ മുൻപ്', // Carbon::now()->subDays(1)->diffForHumans() '1 ദിവസം മുൻപ്', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ദിവസം മുൻപ്', // Carbon::now()->subDays(2)->diffForHumans() '2 ദിവസം മുൻപ്', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ദിവസം മുൻപ്', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ആഴ്ച മുൻപ്', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ആഴ്ച മുൻപ്', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ആഴ്ച മുൻപ്', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ആഴ്ച മുൻപ്', // Carbon::now()->subMonths(1)->diffForHumans() '1 മാസം മുൻപ്', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 മാസം മുൻപ്', // Carbon::now()->subMonths(2)->diffForHumans() '2 മാസം മുൻപ്', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 മാസം മുൻപ്', // Carbon::now()->subYears(1)->diffForHumans() '1 വർഷം മുൻപ്', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 വർഷം മുൻപ്', // Carbon::now()->subYears(2)->diffForHumans() '2 വർഷം മുൻപ്', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 വർഷം മുൻപ്', // Carbon::now()->addSecond()->diffForHumans() '1 സെക്കൻഡ് കഴിഞ്ഞ്', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 സെക്കൻഡ് കഴിഞ്ഞ്', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 സെക്കൻഡ്', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 സെക്കൻഡ്', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 സെക്കൻഡ്', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 സെക്കൻഡ്', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 സെക്കൻഡ് കഴിഞ്ഞ്', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 മിനിറ്റ് 1 സെക്കൻഡ്', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 വർഷം 3 മാസം 1 ദിവസം 1 സെക്കൻഡ്', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 വർഷം കഴിഞ്ഞ്', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 മാസം മുൻപ്', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 വർഷം 3 മാസം 1 ദിവസം 1 സെക്കൻഡ് മുൻപ്', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ആഴ്ച 10 മണിക്കൂർ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ആഴ്ച 6 ദിവസം', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ആഴ്ച 6 ദിവസം', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ആഴ്ച, 6 ദിവസം കഴിഞ്ഞ്', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ആഴ്ച 1 മണിക്കൂർ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ഒരു മണിക്കൂർ കഴിഞ്ഞ്', // CarbonInterval::days(2)->forHumans() '2 ദിവസം', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ദിവസം 3 മണിക്കൂർ', ]; } ================================================ FILE: tests/Localization/MnMnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MnMnTest extends LocalizationTestCase { public const LOCALE = 'mn_MN'; // Mongolian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Бямба at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ням at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Даваа at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Мягмар at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Лхагва at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Пүрэв at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Баасан at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Мягмар at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Лхагва at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Пүрэв at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Баасан at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Бямба at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Ням at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Мягмар at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Мягмар at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Даваа at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ням at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Бямба at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Баасан at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Пүрэв at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Лхагва at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Баасан at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 өглөө CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 өглөө, 12:00 өглөө', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 өглөө, 1:30 өглөө', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 өглөө, 2:00 өглөө', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 өглөө, 6:00 өглөө', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 өглөө, 10:00 өглөө', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 орой, 12:00 орой', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 орой, 5:00 орой', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 орой, 9:30 орой', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 орой, 11:00 орой', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секундын өмнө', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1с өмнө', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секундын өмнө', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2с өмнө', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минутын өмнө', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1м өмнө', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минутын өмнө', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2м өмнө', // Carbon::now()->subHours(1)->diffForHumans() '1 цагийн өмнө', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1ц өмнө', // Carbon::now()->subHours(2)->diffForHumans() '2 цагийн өмнө', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2ц өмнө', // Carbon::now()->subDays(1)->diffForHumans() '1 хоногийн өмнө', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 хоногийн өмнө', // Carbon::now()->subDays(2)->diffForHumans() '2 хоногийн өмнө', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 хоногийн өмнө', // Carbon::now()->subWeeks(1)->diffForHumans() '1 долоо хоногийн өмнө', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 долоо хоногийн өмнө', // Carbon::now()->subWeeks(2)->diffForHumans() '2 долоо хоногийн өмнө', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 долоо хоногийн өмнө', // Carbon::now()->subMonths(1)->diffForHumans() '1 сарын өмнө', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 сарын өмнө', // Carbon::now()->subMonths(2)->diffForHumans() '2 сарын өмнө', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 сарын өмнө', // Carbon::now()->subYears(1)->diffForHumans() '1 жилийн өмнө', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 жилийн өмнө', // Carbon::now()->subYears(2)->diffForHumans() '2 жилийн өмнө', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 жилийн өмнө', // Carbon::now()->addSecond()->diffForHumans() 'одоогоос 1 секундын дараа', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'одоогоос 1с', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секундын дараа', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1с дараа', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секундын өмнө', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1с өмнө', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1с', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2с', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'одоогоос 1с', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 жил 3 сар 1 өдөр 1с', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'одоогоос 3 жилийн дараа', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 сарын өмнө', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 жил 3 сар 1 өдөр 1с өмнө', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 долоо хоног 10 цаг', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 долоо хоног 6 өдөр', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 долоо хоног 6 өдөр', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'одоогоос 1 долоо хоног, 6 хоногийн дараа', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 долоо хоног 1 цаг', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'одоогоос 1 цагийн дараа', // CarbonInterval::days(2)->forHumans() '2 өдөр', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 өдөр 3ц', ]; } ================================================ FILE: tests/Localization/MnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MnTest extends LocalizationTestCase { public const LOCALE = 'mn'; // Mongolian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Бямба at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ням at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Даваа at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Мягмар at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Лхагва at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Пүрэв at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Баасан at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Мягмар at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Лхагва at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Пүрэв at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Баасан at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Бямба at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Ням at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Мягмар at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Мягмар at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Даваа at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ням at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Бямба at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Баасан at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Пүрэв at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Лхагва at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Баасан at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 өглөө CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 өглөө, 12:00 өглөө', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 өглөө, 1:30 өглөө', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 өглөө, 2:00 өглөө', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 өглөө, 6:00 өглөө', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 өглөө, 10:00 өглөө', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 орой, 12:00 орой', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 орой, 5:00 орой', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 орой, 9:30 орой', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 орой, 11:00 орой', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секундын өмнө', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1с өмнө', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секундын өмнө', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2с өмнө', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минутын өмнө', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1м өмнө', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минутын өмнө', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2м өмнө', // Carbon::now()->subHours(1)->diffForHumans() '1 цагийн өмнө', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1ц өмнө', // Carbon::now()->subHours(2)->diffForHumans() '2 цагийн өмнө', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2ц өмнө', // Carbon::now()->subDays(1)->diffForHumans() '1 хоногийн өмнө', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 хоногийн өмнө', // Carbon::now()->subDays(2)->diffForHumans() '2 хоногийн өмнө', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 хоногийн өмнө', // Carbon::now()->subWeeks(1)->diffForHumans() '1 долоо хоногийн өмнө', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 долоо хоногийн өмнө', // Carbon::now()->subWeeks(2)->diffForHumans() '2 долоо хоногийн өмнө', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 долоо хоногийн өмнө', // Carbon::now()->subMonths(1)->diffForHumans() '1 сарын өмнө', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 сарын өмнө', // Carbon::now()->subMonths(2)->diffForHumans() '2 сарын өмнө', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 сарын өмнө', // Carbon::now()->subYears(1)->diffForHumans() '1 жилийн өмнө', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 жилийн өмнө', // Carbon::now()->subYears(2)->diffForHumans() '2 жилийн өмнө', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 жилийн өмнө', // Carbon::now()->addSecond()->diffForHumans() 'одоогоос 1 секундын дараа', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'одоогоос 1с', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секундын дараа', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1с дараа', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секундын өмнө', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1с өмнө', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1с', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2с', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'одоогоос 1с', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 жил 3 сар 1 өдөр 1с', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'одоогоос 3 жилийн дараа', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 сарын өмнө', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 жил 3 сар 1 өдөр 1с өмнө', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 долоо хоног 10 цаг', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 долоо хоног 6 өдөр', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 долоо хоног 6 өдөр', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'одоогоос 1 долоо хоног, 6 хоногийн дараа', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 долоо хоног 1 цаг', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'одоогоос 1 цагийн дараа', // CarbonInterval::days(2)->forHumans() '2 өдөр', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 өдөр 3ц', ]; } ================================================ FILE: tests/Localization/MniInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MniInTest extends LocalizationTestCase { public const LOCALE = 'mni_IN'; // Manipuri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'থাংজ at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'নোংমাইজিং at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'নিংথৌকাবা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'য়ুমশকৈশা at 12:00 এ.ম.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'শগোলশেন at 12:00 এ.ম.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'য়ুমশকৈশা at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'শগোলশেন at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'থাংজ at 12:00 এ.ম.', // Carbon::now()->subDays(2)->calendar() 'Last নোংমাইজিং at 8:49 প.ম.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 প.ম.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 এ.ম.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last নিংথৌকাবা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last নোংমাইজিং at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last থাংজ at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last শগোলশেন at 12:00 এ.ম.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last য়ুমশকৈশা at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 এ.ম. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 এ.ম., 12:00 এ.ম.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 এ.ম., 1:30 এ.ম.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 এ.ম., 2:00 এ.ম.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 এ.ম., 6:00 এ.ম.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 এ.ম., 10:00 এ.ম.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 প.ম., 12:00 প.ম.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 প.ম., 5:00 প.ম.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 প.ম., 9:30 প.ম.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 প.ম., 11:00 প.ম.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ইসিং ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ইসিং ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ইসিং ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ইসিং ago', // Carbon::now()->addSecond()->diffForHumans() '1 ꯅꯤꯡꯊꯧꯀꯥꯕ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ইসিং 3mos 1d 1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ইসিং from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ইসিং 3mos 1d 1 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MniTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MniTest extends LocalizationTestCase { public const LOCALE = 'mni'; // Manipuri public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'থাংজ at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'নোংমাইজিং at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'নিংথৌকাবা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'য়ুমশকৈশা at 12:00 এ.ম.', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'শগোলশেন at 12:00 এ.ম.', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'য়ুমশকৈশা at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'শগোলশেন at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'থাংজ at 12:00 এ.ম.', // Carbon::now()->subDays(2)->calendar() 'Last নোংমাইজিং at 8:49 প.ম.', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 প.ম.', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 এ.ম.', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last লৈবাকপোকপা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last নিংথৌকাবা at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last নোংমাইজিং at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last থাংজ at 12:00 এ.ম.', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last শগোলশেন at 12:00 এ.ম.', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last য়ুমশকৈশা at 12:00 এ.ম.', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ইরাই at 12:00 এ.ম.', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 এ.ম. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 এ.ম., 12:00 এ.ম.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 এ.ম., 1:30 এ.ম.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 এ.ম., 2:00 এ.ম.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 এ.ম., 6:00 এ.ম.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 এ.ম., 10:00 এ.ম.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 প.ম., 12:00 প.ম.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 প.ম., 5:00 প.ম.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 প.ম., 9:30 প.ম.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 প.ম., 11:00 প.ম.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ইসিং ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ইসিং ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ইসিং ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ইসিং ago', // Carbon::now()->addSecond()->diffForHumans() '1 ꯅꯤꯡꯊꯧꯀꯥꯕ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ꯅꯤꯡꯊꯧꯀꯥꯕ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ইসিং 3mos 1d 1 ꯅꯤꯡꯊꯧꯀꯥꯕ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ইসিং from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ইসিং 3mos 1d 1 ꯅꯤꯡꯊꯧꯀꯥꯕ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MoTest extends LocalizationTestCase { public const LOCALE = 'mo'; // Moldavian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mâine la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sâmbătă la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'duminică la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luni la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miercuri la 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'joi la 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vineri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miercuri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'joi la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vineri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sâmbătă la 0:00', // Carbon::now()->subDays(2)->calendar() 'fosta duminică la 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'azi la 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'azi la 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mâine la 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ieri la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta marți la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta luni la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta duminică la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta sâmbătă la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta vineri la 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'fosta joi la 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'fosta miercuri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fosta vineri la 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secundă în urmă', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. în urmă', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secundă în urmă', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. în urmă', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut în urmă', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 m. în urmă', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minut în urmă', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 m. în urmă', // Carbon::now()->subHours(1)->diffForHumans() '1 oră în urmă', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. în urmă', // Carbon::now()->subHours(2)->diffForHumans() '2 oră în urmă', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. în urmă', // Carbon::now()->subDays(1)->diffForHumans() '1 zi în urmă', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 z. în urmă', // Carbon::now()->subDays(2)->diffForHumans() '2 zi în urmă', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 z. în urmă', // Carbon::now()->subWeeks(1)->diffForHumans() '1 săptămână în urmă', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 săp. în urmă', // Carbon::now()->subWeeks(2)->diffForHumans() '2 săptămână în urmă', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 săp. în urmă', // Carbon::now()->subMonths(1)->diffForHumans() '1 lună în urmă', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 l. în urmă', // Carbon::now()->subMonths(2)->diffForHumans() '2 lună în urmă', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 l. în urmă', // Carbon::now()->subYears(1)->diffForHumans() '1 an în urmă', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 a. în urmă', // Carbon::now()->subYears(2)->diffForHumans() '2 an în urmă', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 a. în urmă', // Carbon::now()->addSecond()->diffForHumans() 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'peste 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'peste 1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'acum 1 secundă', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'acum 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secundă', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'peste 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 secundă', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a. 3 l. 1 z. 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'peste 3 an', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 l. în urmă', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 a. 3 l. 1 z. 1 sec. în urmă', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 săptămână 10 oră', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'peste 1 săptămână și 6 zi', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 săptămână 1 oră', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'peste o oră', // CarbonInterval::days(2)->forHumans() '2 zi', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 z. 3 o.', ]; } ================================================ FILE: tests/Localization/MrInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MrInTest extends LocalizationTestCase { public const LOCALE = 'mr_IN'; // Marathi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'उद्या रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'गुरूवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गुरूवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार, रात्री 12:00 वाजता', // Carbon::now()->subDays(2)->calendar() 'मागील रविवार, रात्री 8:49 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'काल रात्री 10:00 वाजता', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज दुपारी 10:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज रात्री 2:00 वाजता', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'उद्या रात्री 1:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'काल रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'काल रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील सोमवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील रविवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील शनिवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'मागील गुरूवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'मागील बुधवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मागील शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 रात्री CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 रात्री, 12:00 रात्री', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 रात्री, 1:30 रात्री', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 रात्री, 2:00 रात्री', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 सकाळी, 6:00 सकाळी', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 दुपारी, 10:00 दुपारी', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 दुपारी, 12:00 दुपारी', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 सायंकाळी, 5:00 सायंकाळी', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 रात्री, 9:30 रात्री', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 रात्री, 11:00 रात्री', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 सेकंदपूर्वी', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकंदपूर्वी', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकंदपूर्वी', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकंदपूर्वी', // Carbon::now()->subMinutes(1)->diffForHumans() '1 मिनिटेपूर्वी', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनिटेपूर्वी', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनिटेपूर्वी', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनिटेपूर्वी', // Carbon::now()->subHours(1)->diffForHumans() '1 तासपूर्वी', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 तासपूर्वी', // Carbon::now()->subHours(2)->diffForHumans() '2 तासपूर्वी', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 तासपूर्वी', // Carbon::now()->subDays(1)->diffForHumans() '1 दिवसपूर्वी', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिवसपूर्वी', // Carbon::now()->subDays(2)->diffForHumans() '2 दिवसपूर्वी', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिवसपूर्वी', // Carbon::now()->subWeeks(1)->diffForHumans() '1 आठवडापूर्वी', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 आठवडापूर्वी', // Carbon::now()->subWeeks(2)->diffForHumans() '2 आठवडेपूर्वी', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 आठवडेपूर्वी', // Carbon::now()->subMonths(1)->diffForHumans() '1 महिनापूर्वी', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिनापूर्वी', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिनेपूर्वी', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिनेपूर्वी', // Carbon::now()->subYears(1)->diffForHumans() '1 वर्षपूर्वी', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्षपूर्वी', // Carbon::now()->subYears(2)->diffForHumans() '2 वर्षपूर्वी', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्षपूर्वी', // Carbon::now()->addSecond()->diffForHumans() '1 सेकंदमध्ये', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकंदमध्ये', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 सेकंदनंतर', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकंदनंतर', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 सेकंदपूर्वी', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकंदपूर्वी', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 सेकंद', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकंद', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकंद', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकंद', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकंदमध्ये', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 मिनिटे 1 सेकंद', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 महिने 1 दिवस 1 सेकंद', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वर्षमध्ये', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिनेपूर्वी', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 महिने 1 दिवस 1 सेकंदपूर्वी', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 आठवडा 10 तास', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आठवडा 6 दिवस', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आठवडा 6 दिवस', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 आठवडा आणि 6 दिवसमध्ये', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 आठवडे 1 तास', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 तासमध्ये', // CarbonInterval::days(2)->forHumans() '2 दिवस', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिवस 3 तास', ]; } ================================================ FILE: tests/Localization/MrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MrTest extends LocalizationTestCase { public const LOCALE = 'mr'; // Marathi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'उद्या रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'गुरूवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गुरूवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार, रात्री 12:00 वाजता', // Carbon::now()->subDays(2)->calendar() 'मागील रविवार, रात्री 8:49 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'काल रात्री 10:00 वाजता', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज दुपारी 10:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज रात्री 2:00 वाजता', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'उद्या रात्री 1:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'काल रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'काल रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील मंगळवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील सोमवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील रविवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील शनिवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मागील शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'मागील गुरूवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'मागील बुधवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मागील शुक्रवार, रात्री 12:00 वाजता', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 रात्री CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 रात्री, 12:00 रात्री', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 रात्री, 1:30 रात्री', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 रात्री, 2:00 रात्री', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 सकाळी, 6:00 सकाळी', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 दुपारी, 10:00 दुपारी', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 दुपारी, 12:00 दुपारी', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 सायंकाळी, 5:00 सायंकाळी', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 रात्री, 9:30 रात्री', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 रात्री, 11:00 रात्री', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 सेकंदपूर्वी', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकंदपूर्वी', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकंदपूर्वी', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकंदपूर्वी', // Carbon::now()->subMinutes(1)->diffForHumans() '1 मिनिटेपूर्वी', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनिटेपूर्वी', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनिटेपूर्वी', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनिटेपूर्वी', // Carbon::now()->subHours(1)->diffForHumans() '1 तासपूर्वी', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 तासपूर्वी', // Carbon::now()->subHours(2)->diffForHumans() '2 तासपूर्वी', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 तासपूर्वी', // Carbon::now()->subDays(1)->diffForHumans() '1 दिवसपूर्वी', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिवसपूर्वी', // Carbon::now()->subDays(2)->diffForHumans() '2 दिवसपूर्वी', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिवसपूर्वी', // Carbon::now()->subWeeks(1)->diffForHumans() '1 आठवडापूर्वी', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 आठवडापूर्वी', // Carbon::now()->subWeeks(2)->diffForHumans() '2 आठवडेपूर्वी', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 आठवडेपूर्वी', // Carbon::now()->subMonths(1)->diffForHumans() '1 महिनापूर्वी', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिनापूर्वी', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिनेपूर्वी', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिनेपूर्वी', // Carbon::now()->subYears(1)->diffForHumans() '1 वर्षपूर्वी', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्षपूर्वी', // Carbon::now()->subYears(2)->diffForHumans() '2 वर्षपूर्वी', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्षपूर्वी', // Carbon::now()->addSecond()->diffForHumans() '1 सेकंदमध्ये', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकंदमध्ये', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 सेकंदनंतर', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकंदनंतर', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 सेकंदपूर्वी', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकंदपूर्वी', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 सेकंद', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकंद', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकंद', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकंद', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकंदमध्ये', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 मिनिटे 1 सेकंद', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 महिने 1 दिवस 1 सेकंद', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वर्षमध्ये', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिनेपूर्वी', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 महिने 1 दिवस 1 सेकंदपूर्वी', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 आठवडा 10 तास', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आठवडा 6 दिवस', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 आठवडा 6 दिवस', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 आठवडा आणि 6 दिवसमध्ये', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 आठवडे 1 तास', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 तासमध्ये', // CarbonInterval::days(2)->forHumans() '2 दिवस', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिवस 3 तास', ]; } ================================================ FILE: tests/Localization/MsBnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MsBnTest extends LocalizationTestCase { public const LOCALE = 'ms_BN'; // Malay public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Esok pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 12:00 a', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Khamis pukul 12:00 a', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaat pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Khamis pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 12:00 a', // Carbon::now()->subDays(2)->calendar() 'Ahad lepas pukul 8:49 p', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 10:00 p', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10:00 a', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 2:00 a', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Esok pukul 1:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 12:00 a', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kelmarin pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaat lepas pukul 12:00 a', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Khamis lepas pukul 12:00 a', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lepas pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat lepas pukul 12:00 a', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a, 1:30 a', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a, 2:00 a', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a, 6:00 a', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a, 10:00 a', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p, 12:00 p', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p, 5:00 p', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p, 9:30 p', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p, 11:00 p', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 saat yang lepas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 saat yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit yang lepas', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lepas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 jam yang lepas', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lepas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 hari yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 minggu yang lepas', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lepas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 bulan yang lepas', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lepas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tahun yang lepas', // Carbon::now()->addSecond()->diffForHumans() '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 saat kemudian', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 saat kemudian', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 saat sebelum', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 saat sebelum', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 saat', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 saat dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 saat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tahun 3 bulan 1 hari 1 saat', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 bulan yang lepas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tahun 3 bulan 1 hari 1 saat yang lepas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 hari 3 jam', ]; } ================================================ FILE: tests/Localization/MsMyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MsMyTest extends LocalizationTestCase { public const LOCALE = 'ms_MY'; // Malay public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Esok pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Khamis pukul 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Khamis pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 00.00', // Carbon::now()->subDays(2)->calendar() 'Ahad lepas pukul 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Esok pukul 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kelmarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaat lepas pukul 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Khamis lepas pukul 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lepas pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat lepas pukul 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 tengah malam CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 tengah malam, 12:00 tengah malam', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 pagi, 1:30 pagi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 pagi, 2:00 pagi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 pagi, 6:00 pagi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 pagi, 10:00 pagi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 tengah hari, 12:00 tengah hari', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 petang, 5:00 petang', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 malam, 9:30 malam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 malam, 11:00 malam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 saat yang lepas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 saat yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit yang lepas', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lepas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 jam yang lepas', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lepas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 hari yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 minggu yang lepas', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lepas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 bulan yang lepas', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lepas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tahun yang lepas', // Carbon::now()->addSecond()->diffForHumans() '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 saat kemudian', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 saat kemudian', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 saat sebelum', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 saat sebelum', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 saat', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 saat dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 saat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tahun 3 bulan 1 hari 1 saat', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 bulan yang lepas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tahun 3 bulan 1 hari 1 saat yang lepas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 hari 3 jam', ]; } ================================================ FILE: tests/Localization/MsSgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MsSgTest extends LocalizationTestCase { public const LOCALE = 'ms_SG'; // Malay public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Esok pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 12:00 a', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Khamis pukul 12:00 a', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaat pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Khamis pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 12:00 a', // Carbon::now()->subDays(2)->calendar() 'Ahad lepas pukul 8:49 p', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 10:00 p', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10:00 a', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 2:00 a', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Esok pukul 1:00 a', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 12:00 a', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kelmarin pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lepas pukul 12:00 a', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaat lepas pukul 12:00 a', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Khamis lepas pukul 12:00 a', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lepas pukul 12:00 a', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat lepas pukul 12:00 a', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a, 1:30 a', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a, 2:00 a', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a, 6:00 a', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a, 10:00 a', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p, 12:00 p', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p, 5:00 p', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p, 9:30 p', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p, 11:00 p', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 saat yang lepas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 saat yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit yang lepas', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lepas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 jam yang lepas', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lepas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 hari yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 minggu yang lepas', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lepas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 bulan yang lepas', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lepas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tahun yang lepas', // Carbon::now()->addSecond()->diffForHumans() '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 saat kemudian', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 saat kemudian', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 saat sebelum', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 saat sebelum', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 saat', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 saat dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 saat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tahun 3 bulan 1 hari 1 saat', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 bulan yang lepas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tahun 3 bulan 1 hari 1 saat yang lepas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 hari 3 jam', ]; } ================================================ FILE: tests/Localization/MsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MsTest extends LocalizationTestCase { public const LOCALE = 'ms'; // Malay public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Esok pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Khamis pukul 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jumaat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rabu pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Khamis pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabtu pukul 00.00', // Carbon::now()->subDays(2)->calendar() 'Ahad lepas pukul 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hari ini pukul 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hari ini pukul 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Esok pukul 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selasa pukul 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Kelmarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kelmarin pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selasa lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Isnin lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ahad lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabtu lepas pukul 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumaat lepas pukul 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Khamis lepas pukul 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Rabu lepas pukul 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumaat lepas pukul 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 tengah malam CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 tengah malam, 12:00 tengah malam', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 pagi, 1:30 pagi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 pagi, 2:00 pagi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 pagi, 6:00 pagi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 pagi, 10:00 pagi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 tengah hari, 12:00 tengah hari', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 petang, 5:00 petang', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 malam, 9:30 malam', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 malam, 11:00 malam', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 saat yang lepas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 saat yang lepas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 saat yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit yang lepas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit yang lepas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit yang lepas', // Carbon::now()->subHours(1)->diffForHumans() '1 jam yang lepas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans() '2 jam yang lepas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 jam yang lepas', // Carbon::now()->subDays(1)->diffForHumans() '1 hari yang lepas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans() '2 hari yang lepas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 hari yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 minggu yang lepas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 minggu yang lepas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 minggu yang lepas', // Carbon::now()->subMonths(1)->diffForHumans() '1 bulan yang lepas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans() '2 bulan yang lepas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 bulan yang lepas', // Carbon::now()->subYears(1)->diffForHumans() '1 tahun yang lepas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans() '2 tahun yang lepas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tahun yang lepas', // Carbon::now()->addSecond()->diffForHumans() '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 saat dari sekarang', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 saat kemudian', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 saat kemudian', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 saat sebelum', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 saat sebelum', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 saat', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 saat dari sekarang', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 saat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tahun 3 bulan 1 hari 1 saat', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tahun dari sekarang', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 bulan yang lepas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tahun 3 bulan 1 hari 1 saat yang lepas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 minggu 10 jam', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 minggu 6 hari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 minggu dan 6 hari dari sekarang', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 minggu 1 jam', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sejam dari sekarang', // CarbonInterval::days(2)->forHumans() '2 hari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 hari 3 jam', ]; } ================================================ FILE: tests/Localization/MtMtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MtMtTest extends LocalizationTestCase { public const LOCALE = 'mt_MT'; // Maltese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Għada fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Is-Sibt fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-Ħadd fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tnejn fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tlieta fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'L-Erbgħa fil-00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Il-Ħamis fil-00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Il-Ġimgħa fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'It-Tlieta fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'L-Erbgħa fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Il-Ħamis fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Il-Ġimgħa fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Is-Sibt fil-00:00', // Carbon::now()->subDays(2)->calendar() 'Il-Ħadd li għadda fil-20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-bieraħ fil-22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Illum fil-10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Illum fil-02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Għada fil-01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'It-Tlieta fil-00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Il-bieraħ fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-bieraħ fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tlieta li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tnejn li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-Ħadd li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Is-Sibt li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-Ġimgħa li għadda fil-00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Il-Ħamis li għadda fil-00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'L-Erbgħa li għadda fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Il-Ġimgħa li għadda fil-00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'ftit sekondi ilu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sek. ilu', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekondi ilu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sek. ilu', // Carbon::now()->subMinutes(1)->diffForHumans() 'minuta ilu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'min. ilu', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti ilu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. ilu', // Carbon::now()->subHours(1)->diffForHumans() 'siegħa ilu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'siegħa ilu', // Carbon::now()->subHours(2)->diffForHumans() '2 siegħat ilu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sigħat ilu', // Carbon::now()->subDays(1)->diffForHumans() 'ġurnata ilu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ġurnata ilu', // Carbon::now()->subDays(2)->diffForHumans() '2 ġranet ilu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ġranet ilu', // Carbon::now()->subWeeks(1)->diffForHumans() 'gimgħa ilu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ġimgħa ilu', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ġimgħat ilu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ġimgħat ilu', // Carbon::now()->subMonths(1)->diffForHumans() 'xahar ilu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 xahar ilu', // Carbon::now()->subMonths(2)->diffForHumans() '2 xhur ilu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 xhur ilu', // Carbon::now()->subYears(1)->diffForHumans() 'sena ilu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'sa sena ilu', // Carbon::now()->subYears(2)->diffForHumans() '2 sni ilu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 snin ilu', // Carbon::now()->addSecond()->diffForHumans() 'f’ ftit sekondi', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'f’ sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ftit sekondi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'f’ sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minuta ftit sekondi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 snin 3 xhur ġurnata sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'f’ 3 sni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 xhur ilu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 snin 3 xhur ġurnata sek. ilu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'gimgħa 10 siegħat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'gimgħa 6 ġranet', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'gimgħa 6 ġranet', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'f’ gimgħa u 6 ġranet', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ġimgħat siegħa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'f’ siegħa', // CarbonInterval::days(2)->forHumans() '2 ġranet', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ġurnata 3 sigħat', ]; } ================================================ FILE: tests/Localization/MtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MtTest extends LocalizationTestCase { public const LOCALE = 'mt'; // Maltese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Għada fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Is-Sibt fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-Ħadd fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tnejn fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tlieta fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'L-Erbgħa fil-00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Il-Ħamis fil-00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Il-Ġimgħa fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'It-Tlieta fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'L-Erbgħa fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Il-Ħamis fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Il-Ġimgħa fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Is-Sibt fil-00:00', // Carbon::now()->subDays(2)->calendar() 'Il-Ħadd li għadda fil-20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-bieraħ fil-22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Illum fil-10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Illum fil-02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Għada fil-01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'It-Tlieta fil-00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Il-bieraħ fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-bieraħ fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tlieta li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'It-Tnejn li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-Ħadd li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Is-Sibt li għadda fil-00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Il-Ġimgħa li għadda fil-00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Il-Ħamis li għadda fil-00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'L-Erbgħa li għadda fil-00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Il-Ġimgħa li għadda fil-00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'ftit sekondi ilu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sek. ilu', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekondi ilu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sek. ilu', // Carbon::now()->subMinutes(1)->diffForHumans() 'minuta ilu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'min. ilu', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti ilu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. ilu', // Carbon::now()->subHours(1)->diffForHumans() 'siegħa ilu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'siegħa ilu', // Carbon::now()->subHours(2)->diffForHumans() '2 siegħat ilu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sigħat ilu', // Carbon::now()->subDays(1)->diffForHumans() 'ġurnata ilu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ġurnata ilu', // Carbon::now()->subDays(2)->diffForHumans() '2 ġranet ilu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ġranet ilu', // Carbon::now()->subWeeks(1)->diffForHumans() 'gimgħa ilu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ġimgħa ilu', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ġimgħat ilu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ġimgħat ilu', // Carbon::now()->subMonths(1)->diffForHumans() 'xahar ilu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 xahar ilu', // Carbon::now()->subMonths(2)->diffForHumans() '2 xhur ilu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 xhur ilu', // Carbon::now()->subYears(1)->diffForHumans() 'sena ilu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'sa sena ilu', // Carbon::now()->subYears(2)->diffForHumans() '2 sni ilu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 snin ilu', // Carbon::now()->addSecond()->diffForHumans() 'f’ ftit sekondi', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'f’ sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ftit sekondi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekondi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'f’ sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minuta ftit sekondi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 snin 3 xhur ġurnata sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'f’ 3 sni', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 xhur ilu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 snin 3 xhur ġurnata sek. ilu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'gimgħa 10 siegħat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'gimgħa 6 ġranet', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'gimgħa 6 ġranet', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'f’ gimgħa u 6 ġranet', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ġimgħat siegħa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'f’ siegħa', // CarbonInterval::days(2)->forHumans() '2 ġranet', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ġurnata 3 sigħat', ]; } ================================================ FILE: tests/Localization/MuaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MuaTest extends LocalizationTestCase { public const LOCALE = 'mua'; // Mundang public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Comzyeɓsuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Com’yakke at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Comlaaɗii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Comzyiiɗii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Comkolle at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Comkaldǝɓlii at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Comgaisuu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Comzyiiɗii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Comkolle at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Comkaldǝɓlii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Comgaisuu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Comzyeɓsuu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Com’yakke at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Comzyiiɗii at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Comzyiiɗii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Comlaaɗii at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Com’yakke at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Comzyeɓsuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Comgaisuu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Comkaldǝɓlii at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Comkolle at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Comgaisuu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 comme CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 comme, 12:00 comme', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 comme, 1:30 comme', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 comme, 2:00 comme', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 comme, 6:00 comme', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 comme, 10:00 comme', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 lilli, 12:00 lilli', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 lilli, 5:00 lilli', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 lilli, 9:30 lilli', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 lilli, 11:00 lilli', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/MyMmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MyMmTest extends LocalizationTestCase { public const LOCALE = 'my_MM'; // Burmese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'မနက်ဖြန် ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'စနေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'တနင်္ဂနွေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'တနင်္လာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'ဗုဒ္ဓဟူး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'ကြာသပတေး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'ဗုဒ္ဓဟူး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'ကြာသပတေး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'စနေ ၁၂:၀၀ နံနက် မှာ', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'ပြီးခဲ့သော တနင်္ဂနွေ ၀၈:၄၉ ညနေ မှာ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'မနေ.က ၁၀:၀၀ ညနေ မှာ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'ယနေ. ၁၀:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'ယနေ. ၀၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'မနက်ဖြန် ၀၁:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'မနေ.က ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'မနေ.က ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'ပြီးခဲ့သော အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'ပြီးခဲ့သော တနင်္လာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'ပြီးခဲ့သော တနင်္ဂနွေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'ပြီးခဲ့သော စနေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'ပြီးခဲ့သော သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'ပြီးခဲ့သော ကြာသပတေး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'ပြီးခဲ့သော ဗုဒ္ဓဟူး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'ပြီးခဲ့သော သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st', '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 နံနက် CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 နံနက်, 12:00 နံနက်', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 နံနက်, 1:30 နံနက်', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 နံနက်, 2:00 နံနက်', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 နံနက်, 6:00 နံနက်', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 နံနက်, 10:00 နံနက်', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 ညနေ, 12:00 ညနေ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 ညနေ, 5:00 ညနေ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 ညနေ, 9:30 ညနေ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ညနေ, 11:00 ညနေ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'လွန်ခဲ့သော 1 စက္ကန့် က', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'လွန်ခဲ့သော 1 စက္ကန့် က', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'လွန်ခဲ့သော 2 စက္ကန့် က', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'လွန်ခဲ့သော 2 စက္ကန့် က', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'လွန်ခဲ့သော 1 မိနစ် က', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'လွန်ခဲ့သော 1 မိနစ် က', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'လွန်ခဲ့သော 2 မိနစ် က', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'လွန်ခဲ့သော 2 မိနစ် က', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'လွန်ခဲ့သော 1 နာရီ က', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'လွန်ခဲ့သော 1 နာရီ က', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'လွန်ခဲ့သော 2 နာရီ က', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'လွန်ခဲ့သော 2 နာရီ က', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'လွန်ခဲ့သော 1 ရက် က', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'လွန်ခဲ့သော 1 ရက် က', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'လွန်ခဲ့သော 2 ရက် က', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'လွန်ခဲ့သော 2 ရက် က', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'လွန်ခဲ့သော 1 ပတ် က', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'လွန်ခဲ့သော 1 ပတ် က', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'လွန်ခဲ့သော 2 ပတ် က', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'လွန်ခဲ့သော 2 ပတ် က', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'လွန်ခဲ့သော 1 လ က', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'လွန်ခဲ့သော 1 လ က', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'လွန်ခဲ့သော 2 လ က', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'လွန်ခဲ့သော 2 လ က', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'လွန်ခဲ့သော 1 နှစ် က', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'လွန်ခဲ့သော 1 နှစ် က', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'လွန်ခဲ့သော 2 နှစ် က', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'လွန်ခဲ့သော 2 နှစ် က', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'လာမည့် 1 စက္ကန့် မှာ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'လာမည့် 1 စက္ကန့် မှာ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 စက္ကန့် ကြာပြီးနောက်', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 စက္ကန့် ကြာပြီးနောက်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 စက္ကန့် မတိုင်ခင်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 စက္ကန့် မတိုင်ခင်', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 စက္ကန့်', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 စက္ကန့်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 စက္ကန့်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 စက္ကန့်', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'လာမည့် 1 စက္ကန့် မှာ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 မိနစ် 1 စက္ကန့်', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 နှစ် 3 လ 1 ရက် 1 စက္ကန့်', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'လာမည့် 3 နှစ် မှာ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'လွန်ခဲ့သော 5 လ က', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'လွန်ခဲ့သော 2 နှစ် 3 လ 1 ရက် 1 စက္ကန့် က', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 ပတ် 10 နာရီ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ပတ် 6 ရက်', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ပတ် 6 ရက်', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'လာမည့် 1 ပတ် 6 ရက် မှာ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 ပတ် 1 နာရီ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'လာမည့် တစ်နာရီ မှာ', // CarbonInterval::days(2)->forHumans() // '2 days', '2 ရက်', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 ရက် 3 နာရီ', ]; } ================================================ FILE: tests/Localization/MyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MyTest extends LocalizationTestCase { public const LOCALE = 'my'; // Burmese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'မနက်ဖြန် ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'စနေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'တနင်္ဂနွေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'တနင်္လာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'ဗုဒ္ဓဟူး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'ကြာသပတေး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'ဗုဒ္ဓဟူး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'ကြာသပတေး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'စနေ ၁၂:၀၀ နံနက် မှာ', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'ပြီးခဲ့သော တနင်္ဂနွေ ၀၈:၄၉ ညနေ မှာ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'မနေ.က ၁၀:၀၀ ညနေ မှာ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'ယနေ. ၁၀:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'ယနေ. ၀၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'မနက်ဖြန် ၀၁:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'မနေ.က ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'မနေ.က ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'ပြီးခဲ့သော အင်္ဂါ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'ပြီးခဲ့သော တနင်္လာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'ပြီးခဲ့သော တနင်္ဂနွေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'ပြီးခဲ့သော စနေ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'ပြီးခဲ့သော သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'ပြီးခဲ့သော ကြာသပတေး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'ပြီးခဲ့သော ဗုဒ္ဓဟူး ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'ပြီးခဲ့သော သောကြာ ၁၂:၀၀ နံနက် မှာ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st', '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 နံနက် CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 နံနက်, 12:00 နံနက်', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 နံနက်, 1:30 နံနက်', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 နံနက်, 2:00 နံနက်', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 နံနက်, 6:00 နံနက်', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 နံနက်, 10:00 နံနက်', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 ညနေ, 12:00 ညနေ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 ညနေ, 5:00 ညနေ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 ညနေ, 9:30 ညနေ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ညနေ, 11:00 ညနေ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', 'လွန်ခဲ့သော 1 စက္ကန့် က', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', 'လွန်ခဲ့သော 1 စက္ကန့် က', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', 'လွန်ခဲ့သော 2 စက္ကန့် က', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', 'လွန်ခဲ့သော 2 စက္ကန့် က', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', 'လွန်ခဲ့သော 1 မိနစ် က', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', 'လွန်ခဲ့သော 1 မိနစ် က', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', 'လွန်ခဲ့သော 2 မိနစ် က', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', 'လွန်ခဲ့သော 2 မိနစ် က', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', 'လွန်ခဲ့သော 1 နာရီ က', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', 'လွန်ခဲ့သော 1 နာရီ က', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', 'လွန်ခဲ့သော 2 နာရီ က', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', 'လွန်ခဲ့သော 2 နာရီ က', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', 'လွန်ခဲ့သော 1 ရက် က', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', 'လွန်ခဲ့သော 1 ရက် က', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', 'လွန်ခဲ့သော 2 ရက် က', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', 'လွန်ခဲ့သော 2 ရက် က', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', 'လွန်ခဲ့သော 1 ပတ် က', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', 'လွန်ခဲ့သော 1 ပတ် က', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', 'လွန်ခဲ့သော 2 ပတ် က', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', 'လွန်ခဲ့သော 2 ပတ် က', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', 'လွန်ခဲ့သော 1 လ က', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', 'လွန်ခဲ့သော 1 လ က', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', 'လွန်ခဲ့သော 2 လ က', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', 'လွန်ခဲ့သော 2 လ က', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', 'လွန်ခဲ့သော 1 နှစ် က', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', 'လွန်ခဲ့သော 1 နှစ် က', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', 'လွန်ခဲ့သော 2 နှစ် က', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', 'လွန်ခဲ့သော 2 နှစ် က', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'လာမည့် 1 စက္ကန့် မှာ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'လာမည့် 1 စက္ကန့် မှာ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 စက္ကန့် ကြာပြီးနောက်', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 စက္ကန့် ကြာပြီးနောက်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 စက္ကန့် မတိုင်ခင်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 စက္ကန့် မတိုင်ခင်', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 စက္ကန့်', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 စက္ကန့်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 စက္ကန့်', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 စက္ကန့်', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'လာမည့် 1 စက္ကန့် မှာ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 မိနစ် 1 စက္ကန့်', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 နှစ် 3 လ 1 ရက် 1 စက္ကန့်', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'လာမည့် 3 နှစ် မှာ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', 'လွန်ခဲ့သော 5 လ က', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', 'လွန်ခဲ့သော 2 နှစ် 3 လ 1 ရက် 1 စက္ကန့် က', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 ပတ် 10 နာရီ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ပတ် 6 ရက်', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ပတ် 6 ရက်', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'လာမည့် 1 ပတ် 6 ရက် မှာ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 ပတ် 1 နာရီ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'လာမည့် တစ်နာရီ မှာ', // CarbonInterval::days(2)->forHumans() // '2 days', '2 ရက်', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 ရက် 3 နာရီ', ]; } ================================================ FILE: tests/Localization/MznTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class MznTest extends LocalizationTestCase { public const LOCALE = 'mzn'; // Mazanderani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'فردا ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'یکشنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'دوشنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'چهارشنبه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'پنجشنبه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'جمعه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'شنبه ساعت 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'یکشنبه پیش ساعت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'دیروز ساعت 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'امروز ساعت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'امروز ساعت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'فردا ساعت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'سه‌شنبه ساعت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'دیروز ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'سه‌شنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'دوشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'یکشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'شنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'پنجشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'چهارشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'جمعه پیش ساعت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', ':timeم :timeم :timeم :timeم :timeم', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', ':timeم :timeم', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', ':timeم :timeم', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', ':timeم :timeم', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', ':timeم :timeم', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', ':timeم :timeم', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', ':timeم :timeم', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', ':timeم :timeم', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', ':timeم', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', ':timeم', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', ':timeم', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 قبل از ظهر CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 قبل از ظهر, 12:00 قبل از ظهر', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 قبل از ظهر, 1:30 قبل از ظهر', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 قبل از ظهر, 2:00 قبل از ظهر', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 قبل از ظهر, 6:00 قبل از ظهر', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 قبل از ظهر, 10:00 قبل از ظهر', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 بعد از ظهر, 12:00 بعد از ظهر', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 بعد از ظهر, 5:00 بعد از ظهر', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 بعد از ظهر, 9:30 بعد از ظهر', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 بعد از ظهر, 11:00 بعد از ظهر', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', ':timeم', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 ثانیه پیش', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 دقیقه پیش', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ساعت پیش', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ساعت پیش', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 روز پیش', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 روز پیش', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 روز پیش', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 روز پیش', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 هفته پیش', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 هفته پیش', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ماه پیش', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 ماه پیش', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 سال پیش', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 سال پیش', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 سال پیش', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 سال پیش', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 ثانیه پس از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 ثانیه پس از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 ثانیه پیش از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 ثانیه پیش از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 ثانیه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 ثانیه', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 ثانیه دیگر', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 دقیقه 1 ثانیه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 سال 3 ماه 1 روز 1 ثانیه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 سال دیگر', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 ماه پیش', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 سال 3 ماه 1 روز 1 ثانیه پیش', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 هفته 10 ساعت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 هفته و 6 روز دیگر', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 هفته 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'یک ساعت دیگر', // CarbonInterval::days(2)->forHumans() // '2 days', '2 روز', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 روز 3 ساعت', ]; } ================================================ FILE: tests/Localization/NanTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NanTest extends LocalizationTestCase { public const LOCALE = 'nan'; // Min Nan Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜六 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜日 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜一 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜三 at 12:00 頂晡', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '禮拜四 at 12:00 頂晡', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜三 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜四 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜六 at 12:00 頂晡', // Carbon::now()->subDays(2)->calendar() 'Last 禮拜日 at 8:49 下晡', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 下晡', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 頂晡', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜一 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜日 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜六 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 禮拜四 at 12:00 頂晡', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 禮拜三 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 頂晡 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 頂晡, 12:00 頂晡', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 頂晡, 1:30 頂晡', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 頂晡, 2:00 頂晡', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 頂晡, 6:00 頂晡', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 頂晡, 10:00 頂晡', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 下晡, 12:00 下晡', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 下晡, 5:00 下晡', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 下晡, 9:30 下晡', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 下晡, 11:00 下晡', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Bió ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Bió ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Bió ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Bió ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Hun-cheng ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Hun-cheng ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Hun-cheng ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Hun-cheng ago', // Carbon::now()->subHours(1)->diffForHumans() '1 tiám-cheng ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 tiám-cheng ago', // Carbon::now()->subHours(2)->diffForHumans() '2 tiám-cheng ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 tiám-cheng ago', // Carbon::now()->subDays(1)->diffForHumans() '1 日 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 日 ago', // Carbon::now()->subDays(2)->diffForHumans() '2 日 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 日 ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 lé-pài ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 lé-pài ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 lé-pài ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 lé-pài ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 goe̍h ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 goe̍h ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 goe̍h ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 goe̍h ago', // Carbon::now()->subYears(1)->diffForHumans() '1 年 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 年 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 年 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 年 ago', // Carbon::now()->addSecond()->diffForHumans() '1 Bió from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Bió from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Bió after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Bió after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Bió before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Bió before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Bió', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Bió', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Bió', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Bió', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Bió from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Hun-cheng 1 Bió', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 年 3 goe̍h 1 日 1 Bió', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 年 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 goe̍h ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 年 3 goe̍h 1 日 1 Bió ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 lé-pài 10 tiám-cheng', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lé-pài 6 日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lé-pài 6 日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 lé-pài and 6 日 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 lé-pài 1 tiám-cheng', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 tiám-cheng from now', // CarbonInterval::days(2)->forHumans() '2 日', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 日 3 tiám-cheng', ]; } ================================================ FILE: tests/Localization/NanTwLatinTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NanTwLatinTest extends LocalizationTestCase { public const LOCALE = 'nan_TW@latin'; // Min Nan Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pài-la̍k at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lé-pài-ji̍t at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pài-it at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pài-jī at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pài-saⁿ at 12:00 téng-po͘', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'pài-sì at 12:00 téng-po͘', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pài-gō͘ at 12:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pài-jī at 12:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pài-saⁿ at 12:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pài-sì at 12:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pài-gō͘ at 12:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pài-la̍k at 12:00 téng-po͘', // Carbon::now()->subDays(2)->calendar() 'Last lé-pài-ji̍t at 8:49 ē-po͘', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ē-po͘', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 téng-po͘', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pài-jī at 12:00 téng-po͘', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pài-jī at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pài-it at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lé-pài-ji̍t at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pài-la̍k at 12:00 téng-po͘', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pài-gō͘ at 12:00 téng-po͘', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last pài-sì at 12:00 téng-po͘', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last pài-saⁿ at 12:00 téng-po͘', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pài-gō͘ at 12:00 téng-po͘', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 téng-po͘ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 téng-po͘, 12:00 téng-po͘', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 téng-po͘, 1:30 téng-po͘', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 téng-po͘, 2:00 téng-po͘', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 téng-po͘, 6:00 téng-po͘', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 téng-po͘, 10:00 téng-po͘', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ē-po͘, 12:00 ē-po͘', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ē-po͘, 5:00 ē-po͘', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ē-po͘, 9:30 ē-po͘', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ē-po͘, 11:00 ē-po͘', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/NanTwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NanTwTest extends LocalizationTestCase { public const LOCALE = 'nan_TW'; // Min Nan Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜六 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜日 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜一 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '禮拜三 at 12:00 頂晡', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '禮拜四 at 12:00 頂晡', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜三 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜四 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜六 at 12:00 頂晡', // Carbon::now()->subDays(2)->calendar() 'Last 禮拜日 at 8:49 下晡', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 下晡', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 頂晡', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜二 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜一 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜日 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜六 at 12:00 頂晡', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last 禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last 禮拜四 at 12:00 頂晡', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last 禮拜三 at 12:00 頂晡', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last 禮拜五 at 12:00 頂晡', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 頂晡 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 頂晡, 12:00 頂晡', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 頂晡, 1:30 頂晡', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 頂晡, 2:00 頂晡', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 頂晡, 6:00 頂晡', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 頂晡, 10:00 頂晡', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 下晡, 12:00 下晡', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 下晡, 5:00 下晡', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 下晡, 9:30 下晡', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 下晡, 11:00 下晡', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Bió ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Bió ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Bió ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Bió ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Hun-cheng ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Hun-cheng ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Hun-cheng ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Hun-cheng ago', // Carbon::now()->subHours(1)->diffForHumans() '1 tiám-cheng ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 tiám-cheng ago', // Carbon::now()->subHours(2)->diffForHumans() '2 tiám-cheng ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 tiám-cheng ago', // Carbon::now()->subDays(1)->diffForHumans() '1 日 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 日 ago', // Carbon::now()->subDays(2)->diffForHumans() '2 日 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 日 ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 lé-pài ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 lé-pài ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 lé-pài ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 lé-pài ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 goe̍h ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 goe̍h ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 goe̍h ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 goe̍h ago', // Carbon::now()->subYears(1)->diffForHumans() '1 年 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 年 ago', // Carbon::now()->subYears(2)->diffForHumans() '2 年 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 年 ago', // Carbon::now()->addSecond()->diffForHumans() '1 Bió from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Bió from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Bió after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Bió after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Bió before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Bió before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Bió', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Bió', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Bió', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Bió', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Bió from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Hun-cheng 1 Bió', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 年 3 goe̍h 1 日 1 Bió', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 年 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 goe̍h ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 年 3 goe̍h 1 日 1 Bió ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 lé-pài 10 tiám-cheng', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lé-pài 6 日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 lé-pài 6 日', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 lé-pài and 6 日 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 lé-pài 1 tiám-cheng', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 tiám-cheng from now', // CarbonInterval::days(2)->forHumans() '2 日', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 日 3 tiám-cheng', ]; } ================================================ FILE: tests/Localization/NaqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NaqTest extends LocalizationTestCase { public const LOCALE = 'naq'; // Nama public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Satertaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sontaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mantaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Denstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wunstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dondertaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fraitaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Denstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wunstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dondertaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fraitaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Satertaxtsees at 12:00 ǁgoagas', // Carbon::now()->subDays(2)->calendar() 'Last Sontaxtsees at 8:49 ǃuias', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ǃuias', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ǁgoagas', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Denstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Denstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mantaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sontaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Satertaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fraitaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dondertaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wunstaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fraitaxtsees at 12:00 ǁgoagas', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ǁgoagas CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ǁgoagas, 12:00 ǁgoagas', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ǁgoagas, 1:30 ǁgoagas', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ǁgoagas, 2:00 ǁgoagas', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ǁgoagas, 6:00 ǁgoagas', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ǁgoagas, 10:00 ǁgoagas', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ǃuias, 12:00 ǃuias', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ǃuias, 5:00 ǃuias', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ǃuias, 9:30 ǃuias', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ǃuias, 11:00 ǃuias', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutga ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minutga ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutga ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minutga ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ǂgaes ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ǂgaes ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ǂgaes ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ǂgaes ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ǀhobas ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ǀhobas ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ǀhobas ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ǀhobas ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 hû ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 hû ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 hû ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 hû ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ǁaub ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ǁaub ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ǁaub ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ǁaub ago', // Carbon::now()->subYears(1)->diffForHumans() '1 kurigu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 kurigu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 kurigu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 kurigu ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutga 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 kurigu 3 ǁaub 1 ǀhobas 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 kurigu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ǁaub ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 kurigu 3 ǁaub 1 ǀhobas 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 hû 10 ǂgaes', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hû 6 ǀhobas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hû 6 ǀhobas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 hû and 6 ǀhobas from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 hû 1 ǂgaes', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ǂgaes from now', // CarbonInterval::days(2)->forHumans() '2 ǀhobas', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ǀhobas 3 ǂgaes', ]; } ================================================ FILE: tests/Localization/NbNoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NbNoTest extends LocalizationTestCase { public const LOCALE = 'nb_NO'; // Norwegian Bokmål public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'forrige søndag kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige fredag kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'forrige torsdag kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'forrige onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'forrige fredag kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sek siden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sek siden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutt siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min siden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min siden', // Carbon::now()->subHours(1)->diffForHumans() '1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t siden', // Carbon::now()->subHours(2)->diffForHumans() '2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t siden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() '2 dager siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 uke siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 uker siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() '1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 md. siden', // Carbon::now()->subMonths(2)->diffForHumans() '2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 md. siden', // Carbon::now()->subYears(1)->diffForHumans() '1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 år siden', // Carbon::now()->subYears(2)->diffForHumans() '2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 sek', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund etter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sek etter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sek før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 sek', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutt 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 md. 1 d. 1 sek', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 md. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 år 3 md. 1 d. 1 sek siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uke 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uke og 6 dager', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uker 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dager', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t', ]; } ================================================ FILE: tests/Localization/NbSjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NbSjTest extends LocalizationTestCase { public const LOCALE = 'nb_SJ'; // Norwegian Bokmål public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'forrige søndag kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige fredag kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'forrige torsdag kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'forrige onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'forrige fredag kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sek siden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sek siden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutt siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min siden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min siden', // Carbon::now()->subHours(1)->diffForHumans() '1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t siden', // Carbon::now()->subHours(2)->diffForHumans() '2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t siden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() '2 dager siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 uke siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 uker siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() '1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 md. siden', // Carbon::now()->subMonths(2)->diffForHumans() '2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 md. siden', // Carbon::now()->subYears(1)->diffForHumans() '1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 år siden', // Carbon::now()->subYears(2)->diffForHumans() '2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 sek', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund etter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sek etter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sek før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 sek', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutt 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 md. 1 d. 1 sek', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 md. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 år 3 md. 1 d. 1 sek siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uke 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uke og 6 dager', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uker 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dager', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t', ]; } ================================================ FILE: tests/Localization/NbTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NbTest extends LocalizationTestCase { public const LOCALE = 'nb'; // Norwegian Bokmål public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'forrige søndag kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'forrige fredag kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'forrige torsdag kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'forrige onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'forrige fredag kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sek siden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sek siden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutt siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min siden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min siden', // Carbon::now()->subHours(1)->diffForHumans() '1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t siden', // Carbon::now()->subHours(2)->diffForHumans() '2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t siden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() '2 dager siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 uke siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 uker siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() '1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 md. siden', // Carbon::now()->subMonths(2)->diffForHumans() '2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 md. siden', // Carbon::now()->subYears(1)->diffForHumans() '1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 år siden', // Carbon::now()->subYears(2)->diffForHumans() '2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 sek', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund etter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sek etter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sek før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 sek', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutt 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 md. 1 d. 1 sek', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 md. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 år 3 md. 1 d. 1 sek siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uke 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uke og 6 dager', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uker 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dager', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t', ]; } ================================================ FILE: tests/Localization/NdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NdTest extends LocalizationTestCase { public const LOCALE = 'nd'; // NorthNdebele public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mgqibelo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonto at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mvulo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sibili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sithathu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Sine at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Sihlanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sibili at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sithathu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sine at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sihlanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mgqibelo at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sonto at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sibili at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sibili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mvulo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sonto at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mgqibelo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sihlanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Sine at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Sithathu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Sihlanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'imizuzwana engu-1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'imizuzwana engu-1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'imizuzwana engu-2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'imizuzwana engu-2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'imizuzu engu-1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'imizuzu engu-1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'imizuzu engu-2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'imizuzu engu-2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'amahola angu-1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'amahola angu-1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'amahola angu-2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'amahola angu-2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'kwamalanga angu-1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'kwamalanga angu-1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'kwamalanga angu-2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'kwamalanga angu-2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'amaviki angu-1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'amaviki angu-1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'amaviki angu-2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'amaviki angu-2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'inyanga ezingu-1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'inyanga ezingu-1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'inyanga ezingu-2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'inyanga ezingu-2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'okweminyaka engu-1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'okweminyaka engu-1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'okweminyaka engu-2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'okweminyaka engu-2 ago', // Carbon::now()->addSecond()->diffForHumans() 'imizuzwana engu-1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'imizuzwana engu-1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'imizuzwana engu-1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'imizuzwana engu-1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'imizuzwana engu-1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'imizuzwana engu-1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'imizuzwana engu-1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'imizuzwana engu-1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'imizuzwana engu-2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'imizuzwana engu-2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'imizuzwana engu-1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'imizuzu engu-1 imizuzwana engu-1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'okweminyaka engu-2 inyanga ezingu-3 kwamalanga angu-1 imizuzwana engu-1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'okweminyaka engu-3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'inyanga ezingu-5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'okweminyaka engu-2 inyanga ezingu-3 kwamalanga angu-1 imizuzwana engu-1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'amaviki angu-1 amahola angu-10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'amaviki angu-1 kwamalanga angu-6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'amaviki angu-1 kwamalanga angu-6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'amaviki angu-1 and kwamalanga angu-6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'amaviki angu-2 amahola angu-1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'amahola angu-1 from now', // CarbonInterval::days(2)->forHumans() 'kwamalanga angu-2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'kwamalanga angu-1 amahola angu-3', ]; } ================================================ FILE: tests/Localization/NdsDeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NdsDeTest extends LocalizationTestCase { public const LOCALE = 'nds_DE'; // Low German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sünnavend at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sünndag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maandag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Middeweek at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunnersdag at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freedag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Middeweek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunnersdag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freedag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sünnavend at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sünndag at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dingsdag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Maandag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sünndag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sünnavend at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Freedag at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunnersdag at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Middeweek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Freedag at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'vör 1 Sekunn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vör 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'vör 2 Sekunn', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vör 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'vör 1 Minuut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vör 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'vör 2 Minuut', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vör 2m', // Carbon::now()->subHours(1)->diffForHumans() 'vör 1 Stünn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vör 1St', // Carbon::now()->subHours(2)->diffForHumans() 'vör 2 Stünn', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vör 2St', // Carbon::now()->subDays(1)->diffForHumans() 'vör 1 Dag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vör 1D', // Carbon::now()->subDays(2)->diffForHumans() 'vör 2 Dag', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vör 2D', // Carbon::now()->subWeeks(1)->diffForHumans() 'vör 1 Week', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vör 1W', // Carbon::now()->subWeeks(2)->diffForHumans() 'vör 2 Week', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vör 2W', // Carbon::now()->subMonths(1)->diffForHumans() 'vör 1 Maand', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vör 1M', // Carbon::now()->subMonths(2)->diffForHumans() 'vör 2 Maand', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vör 2M', // Carbon::now()->subYears(1)->diffForHumans() 'vör 1 Johr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vör 1J', // Carbon::now()->subYears(2)->diffForHumans() 'vör 2 Johr', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vör 2J', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunn', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunn later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunn vörher', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s vörher', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minuut 1 Sekunn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2J 3M 1D 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Johr', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vör 5M', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vör 2J 3M 1D 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Week 10 Stünn', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Week 6 Dag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Week 6 Dag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Week and 6 Dag', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Week 1 Stünn', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in een Stünn', // CarbonInterval::days(2)->forHumans() '2 Dag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1D 3St', ]; } ================================================ FILE: tests/Localization/NdsNlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NdsNlTest extends LocalizationTestCase { public const LOCALE = 'nds_NL'; // Low German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sinnowend at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sinndag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mondag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Meddwäakj at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Donnadag at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friedag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Meddwäakj at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Donnadag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friedag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sinnowend at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sinndag at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dingsdag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mondag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sinndag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sinnowend at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friedag at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Donnadag at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Meddwäakj at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friedag at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/NdsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NdsTest extends LocalizationTestCase { public const LOCALE = 'nds'; // Low German public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sünnavend at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sünndag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maandag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Middeweek at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Dunnersdag at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Freedag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Middeweek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dunnersdag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Freedag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sünnavend at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sünndag at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dingsdag at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dingsdag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Maandag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sünndag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sünnavend at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Freedag at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Dunnersdag at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Middeweek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Freedag at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'vör 1 Sekunn', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'vör 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'vör 2 Sekunn', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'vör 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'vör 1 Minuut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'vör 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'vör 2 Minuut', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'vör 2m', // Carbon::now()->subHours(1)->diffForHumans() 'vör 1 Stünn', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'vör 1St', // Carbon::now()->subHours(2)->diffForHumans() 'vör 2 Stünn', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'vör 2St', // Carbon::now()->subDays(1)->diffForHumans() 'vör 1 Dag', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'vör 1D', // Carbon::now()->subDays(2)->diffForHumans() 'vör 2 Dag', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'vör 2D', // Carbon::now()->subWeeks(1)->diffForHumans() 'vör 1 Week', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vör 1W', // Carbon::now()->subWeeks(2)->diffForHumans() 'vör 2 Week', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vör 2W', // Carbon::now()->subMonths(1)->diffForHumans() 'vör 1 Maand', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'vör 1M', // Carbon::now()->subMonths(2)->diffForHumans() 'vör 2 Maand', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'vör 2M', // Carbon::now()->subYears(1)->diffForHumans() 'vör 1 Johr', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'vör 1J', // Carbon::now()->subYears(2)->diffForHumans() 'vör 2 Johr', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'vör 2J', // Carbon::now()->addSecond()->diffForHumans() 'in 1 Sekunn', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'in 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekunn later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekunn vörher', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s vörher', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekunn', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekunn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'in 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Minuut 1 Sekunn', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2J 3M 1D 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'in 3 Johr', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'vör 5M', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'vör 2J 3M 1D 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Week 10 Stünn', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Week 6 Dag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Week 6 Dag', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'in 1 Week and 6 Dag', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Week 1 Stünn', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'in een Stünn', // CarbonInterval::days(2)->forHumans() '2 Dag', // CarbonInterval::create('P1DT3H')->forHumans(true) '1D 3St', ]; } ================================================ FILE: tests/Localization/NeInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NeInTest extends LocalizationTestCase { public const LOCALE = 'ne_IN'; // Nepali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'भोलि 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो शनिबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो आइतबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो सोमबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो मङ्गलबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो बुधबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'आउँदो बिहिबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'आउँदो शुक्रबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो मङ्गलबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो बुधबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो बिहिबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो शुक्रबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो शनिबार, 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'गएको आइतबार, 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'हिजो 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'भोलि 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो मङ्गलबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'हिजो 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'हिजो 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको मङ्गलबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको सोमबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको आइतबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको शनिबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको शुक्रबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'गएको बिहिबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'गएको बुधबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गएको शुक्रबार, 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'केही क्षण अगाडि', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकेण्ड अगाडि', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकेण्ड अगाडि', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकेण्ड अगाडि', // Carbon::now()->subMinutes(1)->diffForHumans() 'एक मिनेट अगाडि', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनेट अगाडि', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनेट अगाडि', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनेट अगाडि', // Carbon::now()->subHours(1)->diffForHumans() 'एक घण्टा अगाडि', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा अगाडि', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा अगाडि', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा अगाडि', // Carbon::now()->subDays(1)->diffForHumans() 'एक दिन अगाडि', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन अगाडि', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन अगाडि', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन अगाडि', // Carbon::now()->subWeeks(1)->diffForHumans() '1 हप्ता अगाडि', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 हप्ता अगाडि', // Carbon::now()->subWeeks(2)->diffForHumans() '2 हप्ता अगाडि', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 हप्ता अगाडि', // Carbon::now()->subMonths(1)->diffForHumans() 'एक महिना अगाडि', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना अगाडि', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना अगाडि', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना अगाडि', // Carbon::now()->subYears(1)->diffForHumans() 'एक बर्ष अगाडि', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष अगाडि', // Carbon::now()->subYears(2)->diffForHumans() '2 बर्ष अगाडि', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्ष अगाडि', // Carbon::now()->addSecond()->diffForHumans() 'केही क्षणमा', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकेण्डमा', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'केही क्षण पछि', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकेण्ड पछि', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'केही क्षण अघि', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकेण्ड अघि', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'केही क्षण', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकेण्ड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकेण्ड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकेण्ड', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकेण्डमा', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'एक मिनेट केही क्षण', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 महिना 1 दिन 1 सेकेण्ड', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 बर्षमा', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना अगाडि', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 महिना 1 दिन 1 सेकेण्ड अगाडि', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 हप्ता 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 हप्ता 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 हप्ता 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 हप्ता र 6 दिनमा', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 हप्ता एक घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'एक घण्टामा', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/NeNpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NeNpTest extends LocalizationTestCase { public const LOCALE = 'ne_NP'; // Nepali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'भोलि रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो शनिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो आइतबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो सोमबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो बुधबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'आउँदो बिहिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'आउँदो शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो बुधबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो बिहिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो शनिबार, रातिको 12:00 बजे', // Carbon::now()->subDays(2)->calendar() 'गएको आइतबार, रातिको 8:49 बजे', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'हिजो रातिको 10:00 बजे', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज बिहानको 10:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज रातिको 2:00 बजे', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'भोलि रातिको 1:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'हिजो रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'हिजो रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको सोमबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको आइतबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको शनिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'गएको बिहिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'गएको बुधबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गएको शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 राति CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 राति, 12:00 राति', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 राति, 1:30 राति', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 राति, 2:00 राति', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 बिहान, 6:00 बिहान', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 बिहान, 10:00 बिहान', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 दिउँसो, 12:00 दिउँसो', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 साँझ, 5:00 साँझ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 राति, 9:30 राति', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 राति, 11:00 राति', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'केही क्षण अगाडि', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकेण्ड अगाडि', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकेण्ड अगाडि', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकेण्ड अगाडि', // Carbon::now()->subMinutes(1)->diffForHumans() 'एक मिनेट अगाडि', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनेट अगाडि', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनेट अगाडि', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनेट अगाडि', // Carbon::now()->subHours(1)->diffForHumans() 'एक घण्टा अगाडि', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा अगाडि', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा अगाडि', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा अगाडि', // Carbon::now()->subDays(1)->diffForHumans() 'एक दिन अगाडि', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन अगाडि', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन अगाडि', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन अगाडि', // Carbon::now()->subWeeks(1)->diffForHumans() '1 हप्ता अगाडि', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 हप्ता अगाडि', // Carbon::now()->subWeeks(2)->diffForHumans() '2 हप्ता अगाडि', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 हप्ता अगाडि', // Carbon::now()->subMonths(1)->diffForHumans() 'एक महिना अगाडि', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना अगाडि', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना अगाडि', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना अगाडि', // Carbon::now()->subYears(1)->diffForHumans() 'एक बर्ष अगाडि', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष अगाडि', // Carbon::now()->subYears(2)->diffForHumans() '2 बर्ष अगाडि', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्ष अगाडि', // Carbon::now()->addSecond()->diffForHumans() 'केही क्षणमा', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकेण्डमा', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'केही क्षण पछि', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकेण्ड पछि', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'केही क्षण अघि', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकेण्ड अघि', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'केही क्षण', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकेण्ड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकेण्ड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकेण्ड', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकेण्डमा', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'एक मिनेट केही क्षण', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 महिना 1 दिन 1 सेकेण्ड', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 बर्षमा', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना अगाडि', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 महिना 1 दिन 1 सेकेण्ड अगाडि', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 हप्ता 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 हप्ता 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 हप्ता 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 हप्ता र 6 दिनमा', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 हप्ता एक घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'एक घण्टामा', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/NeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NeTest extends LocalizationTestCase { public const LOCALE = 'ne'; // Nepali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'भोलि रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो शनिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो आइतबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो सोमबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आउँदो बुधबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'आउँदो बिहिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'आउँदो शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो बुधबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो बिहिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो शनिबार, रातिको 12:00 बजे', // Carbon::now()->subDays(2)->calendar() 'गएको आइतबार, रातिको 8:49 बजे', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'हिजो रातिको 10:00 बजे', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'आज बिहानको 10:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आज रातिको 2:00 बजे', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'भोलि रातिको 1:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'आउँदो मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'हिजो रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'हिजो रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको मङ्गलबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको सोमबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको आइतबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको शनिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'गएको शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'गएको बिहिबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'गएको बुधबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'गएको शुक्रबार, रातिको 12:00 बजे', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 राति CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 राति, 12:00 राति', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 राति, 1:30 राति', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 राति, 2:00 राति', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 बिहान, 6:00 बिहान', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 बिहान, 10:00 बिहान', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 दिउँसो, 12:00 दिउँसो', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 साँझ, 5:00 साँझ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 राति, 9:30 राति', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 राति, 11:00 राति', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'केही क्षण अगाडि', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 सेकेण्ड अगाडि', // Carbon::now()->subSeconds(2)->diffForHumans() '2 सेकेण्ड अगाडि', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 सेकेण्ड अगाडि', // Carbon::now()->subMinutes(1)->diffForHumans() 'एक मिनेट अगाडि', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 मिनेट अगाडि', // Carbon::now()->subMinutes(2)->diffForHumans() '2 मिनेट अगाडि', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 मिनेट अगाडि', // Carbon::now()->subHours(1)->diffForHumans() 'एक घण्टा अगाडि', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा अगाडि', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा अगाडि', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा अगाडि', // Carbon::now()->subDays(1)->diffForHumans() 'एक दिन अगाडि', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन अगाडि', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन अगाडि', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन अगाडि', // Carbon::now()->subWeeks(1)->diffForHumans() '1 हप्ता अगाडि', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 हप्ता अगाडि', // Carbon::now()->subWeeks(2)->diffForHumans() '2 हप्ता अगाडि', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 हप्ता अगाडि', // Carbon::now()->subMonths(1)->diffForHumans() 'एक महिना अगाडि', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 महिना अगाडि', // Carbon::now()->subMonths(2)->diffForHumans() '2 महिना अगाडि', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 महिना अगाडि', // Carbon::now()->subYears(1)->diffForHumans() 'एक बर्ष अगाडि', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष अगाडि', // Carbon::now()->subYears(2)->diffForHumans() '2 बर्ष अगाडि', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्ष अगाडि', // Carbon::now()->addSecond()->diffForHumans() 'केही क्षणमा', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 सेकेण्डमा', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'केही क्षण पछि', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 सेकेण्ड पछि', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'केही क्षण अघि', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 सेकेण्ड अघि', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'केही क्षण', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 सेकेण्ड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 सेकेण्ड', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 सेकेण्ड', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 सेकेण्डमा', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'एक मिनेट केही क्षण', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 महिना 1 दिन 1 सेकेण्ड', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 बर्षमा', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 महिना अगाडि', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 महिना 1 दिन 1 सेकेण्ड अगाडि', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 हप्ता 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 हप्ता 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 हप्ता 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 हप्ता र 6 दिनमा', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 हप्ता एक घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'एक घण्टामा', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/NhnMxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NhnMxTest extends LocalizationTestCase { public const LOCALE = 'nhn_MX'; // Central Nahuatl public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'chicuaceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'teoilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'yeilhuitl at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'nahuilhuitl at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'yeilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'nahuilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'chicuaceilhuitl at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last teoilhuitl at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last teoilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last chicuaceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last nahuilhuitl at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last yeilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ome ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ome ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ome ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ome ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 toltecayotl ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 toltecayotl ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 toltecayotl ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 toltecayotl ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 tonatih ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 tonatih ago', // Carbon::now()->subDays(2)->diffForHumans() '2 tonatih ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 tonatih ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tonalli ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tonalli ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tonalli ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tonalli ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 metztli ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 metztli ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 metztli ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 metztli ago', // Carbon::now()->subYears(1)->diffForHumans() '1 xihuitl ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 xihuitl ago', // Carbon::now()->subYears(2)->diffForHumans() '2 xihuitl ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 xihuitl ago', // Carbon::now()->addSecond()->diffForHumans() '1 ome from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ome from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ome after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ome after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ome before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ome before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ome', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ome', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ome', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ome', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ome from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 toltecayotl 1 ome', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 xihuitl 3 metztli 1 tonatih 1 ome', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 xihuitl from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 metztli ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 xihuitl 3 metztli 1 tonatih 1 ome ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tonalli 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tonalli 6 tonatih', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tonalli 6 tonatih', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tonalli and 6 tonatih from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tonalli 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 tonatih', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 tonatih 3h', ]; } ================================================ FILE: tests/Localization/NhnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NhnTest extends LocalizationTestCase { public const LOCALE = 'nhn'; // Central Nahuatl public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'chicuaceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'teoilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'yeilhuitl at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'nahuilhuitl at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'yeilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'nahuilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'chicuaceilhuitl at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last teoilhuitl at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last omeilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last teoilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last chicuaceilhuitl at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last nahuilhuitl at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last yeilhuitl at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last macuililhuitl at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ome ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ome ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ome ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ome ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 toltecayotl ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 toltecayotl ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 toltecayotl ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 toltecayotl ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 tonatih ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 tonatih ago', // Carbon::now()->subDays(2)->diffForHumans() '2 tonatih ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 tonatih ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tonalli ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tonalli ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tonalli ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tonalli ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 metztli ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 metztli ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 metztli ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 metztli ago', // Carbon::now()->subYears(1)->diffForHumans() '1 xihuitl ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 xihuitl ago', // Carbon::now()->subYears(2)->diffForHumans() '2 xihuitl ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 xihuitl ago', // Carbon::now()->addSecond()->diffForHumans() '1 ome from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ome from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ome after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ome after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ome before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ome before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ome', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ome', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ome', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ome', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ome from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 toltecayotl 1 ome', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 xihuitl 3 metztli 1 tonatih 1 ome', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 xihuitl from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 metztli ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 xihuitl 3 metztli 1 tonatih 1 ome ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tonalli 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tonalli 6 tonatih', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tonalli 6 tonatih', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tonalli and 6 tonatih from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tonalli 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 tonatih', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 tonatih 3h', ]; } ================================================ FILE: tests/Localization/NiuNuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NiuNuTest extends LocalizationTestCase { public const LOCALE = 'niu_NU'; // Niuean public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Faiumu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Tapu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Gofua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Ua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Lotu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aho Tuloto at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Ua at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Lotu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Tuloto at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Faiumu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Aho Tapu at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Ua at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Ua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Gofua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Tapu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Faiumu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aho Tuloto at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Aho Lotu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekone ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekone ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekone ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekone ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 e tulā ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 e tulā ago', // Carbon::now()->subHours(2)->diffForHumans() '2 e tulā ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 e tulā ago', // Carbon::now()->subDays(1)->diffForHumans() '1 aho ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 aho ago', // Carbon::now()->subDays(2)->diffForHumans() '2 aho ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 aho ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 faahi tapu ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 faahi tapu ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 faahi tapu ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 faahi tapu ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 tau ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tau ago', // Carbon::now()->subYears(2)->diffForHumans() '2 tau ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tau ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekone from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekone from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekone after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekone after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekone before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekone before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekone', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekone', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekone', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekone', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekone from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuti 1 sekone', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tau 3 mahina 1 aho 1 sekone', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tau from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tau 3 mahina 1 aho 1 sekone ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 faahi tapu 10 e tulā', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 faahi tapu 6 aho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 faahi tapu 6 aho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 faahi tapu and 6 aho from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 faahi tapu 1 e tulā', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 e tulā from now', // CarbonInterval::days(2)->forHumans() '2 aho', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 aho 3 e tulā', ]; } ================================================ FILE: tests/Localization/NiuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NiuTest extends LocalizationTestCase { public const LOCALE = 'niu'; // Niuean public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Faiumu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Tapu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Gofua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Ua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aho Lotu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aho Tuloto at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Ua at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Lotu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Tuloto at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Faiumu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Aho Tapu at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aho Ua at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Ua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Gofua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Tapu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Faiumu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aho Tuloto at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Aho Lotu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Aho Falaile at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekone ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekone ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekone ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekone ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 e tulā ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 e tulā ago', // Carbon::now()->subHours(2)->diffForHumans() '2 e tulā ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 e tulā ago', // Carbon::now()->subDays(1)->diffForHumans() '1 aho ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 aho ago', // Carbon::now()->subDays(2)->diffForHumans() '2 aho ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 aho ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 faahi tapu ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 faahi tapu ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 faahi tapu ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 faahi tapu ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 tau ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tau ago', // Carbon::now()->subYears(2)->diffForHumans() '2 tau ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tau ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekone from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekone from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekone after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekone after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekone before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekone before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekone', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekone', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekone', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekone', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekone from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuti 1 sekone', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tau 3 mahina 1 aho 1 sekone', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tau from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tau 3 mahina 1 aho 1 sekone ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 faahi tapu 10 e tulā', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 faahi tapu 6 aho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 faahi tapu 6 aho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 faahi tapu and 6 aho from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 faahi tapu 1 e tulā', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 e tulā from now', // CarbonInterval::days(2)->forHumans() '2 aho', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 aho 3 e tulā', ]; } ================================================ FILE: tests/Localization/NlAwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlAwTest extends LocalizationTestCase { public const LOCALE = 'nl_AW'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlBeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlBeTest extends LocalizationTestCase { public const LOCALE = 'nl_BE'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlBqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlBqTest extends LocalizationTestCase { public const LOCALE = 'nl_BQ'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlCwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlCwTest extends LocalizationTestCase { public const LOCALE = 'nl_CW'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlNlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlNlTest extends LocalizationTestCase { public const LOCALE = 'nl_NL'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlSrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlSrTest extends LocalizationTestCase { public const LOCALE = 'nl_SR'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlSxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlSxTest extends LocalizationTestCase { public const LOCALE = 'nl_SX'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; } ================================================ FILE: tests/Localization/NlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use Carbon\Carbon; use Carbon\CarbonInterval; use Carbon\CarbonPeriod; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NlTest extends LocalizationTestCase { public const LOCALE = 'nl'; // Dutch public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'morgen om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'donderdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vrijdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'zaterdag om 00:00', // Carbon::now()->subDays(2)->calendar() 'afgelopen zondag om 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'vandaag om 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vandaag om 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'morgen om 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dinsdag om 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gisteren om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen dinsdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen maandag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zondag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen zaterdag om 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'afgelopen donderdag om 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'afgelopen woensdag om 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'afgelopen vrijdag om 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1ste 1ste 1ste 1ste 1ste', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2de 1ste', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3de 1ste', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4de 1ste', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5de 1ste', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6de 1ste', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7de 1ste', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11de 2de', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40ste', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41ste', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100ste', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 \'s ochtends CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s ochtends, 12:00 \'s ochtends', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 \'s ochtends, 1:30 \'s ochtends', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 \'s ochtends, 2:00 \'s ochtends', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 \'s ochtends, 6:00 \'s ochtends', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 \'s ochtends, 10:00 \'s ochtends', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 \'s middags, 12:00 \'s middags', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 \'s middags, 5:00 \'s middags', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 \'s middags, 9:30 \'s middags', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 \'s middags, 11:00 \'s middags', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0de', // Carbon::now()->subSeconds(1)->diffForHumans() '1 seconde geleden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s geleden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconden geleden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s geleden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuut geleden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1min geleden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuten geleden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2min geleden', // Carbon::now()->subHours(1)->diffForHumans() '1 uur geleden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1u geleden', // Carbon::now()->subHours(2)->diffForHumans() '2 uur geleden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2u geleden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag geleden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d geleden', // Carbon::now()->subDays(2)->diffForHumans() '2 dagen geleden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d geleden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week geleden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w geleden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weken geleden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w geleden', // Carbon::now()->subMonths(1)->diffForHumans() '1 maand geleden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mnd geleden', // Carbon::now()->subMonths(2)->diffForHumans() '2 maanden geleden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mnd geleden', // Carbon::now()->subYears(1)->diffForHumans() '1 jaar geleden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1j geleden', // Carbon::now()->subYears(2)->diffForHumans() '2 jaar geleden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2j geleden', // Carbon::now()->addSecond()->diffForHumans() 'over 1 seconde', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'over 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 seconde later', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s later', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 seconde eerder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s eerder', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 seconde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconden', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'over 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuut 1 seconde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2j 3mnd 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'over 3 jaar', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mnd geleden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2j 3mnd 1d 1s geleden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 uur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 dagen', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'over 1 week en 6 dagen', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weken 1 uur', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'over een uur', // CarbonInterval::days(2)->forHumans() '2 dagen', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3u', ]; public function testPeriod() { $this->assertSame('4 keer elke week van 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P7D'))); $this->assertSame('4 keer elk jaar van 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P1Y'))); $this->assertSame('4 keer elke 2 jaar van 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P2Y'))); $this->assertSame('4 keer elk jaar en 6 maanden van 2012-07-01 12:00:00', (string) (CarbonPeriod::create('R4/2012-07-01T12:00:00/P1Y6M'))); $this->assertSame('Elke dag en 5 uur van 2015-09-30 12:50:00 tot 2015-10-03 19:00:00', (string) (CarbonPeriod::create( Carbon::parse('2015-09-30 12:50'), CarbonInterval::day()->hours(5), Carbon::parse('2015-10-03 19:00'), ))); $this->assertSame('Elk uur en 30 minuten van 2015-09-30 12:50:00 tot 2015-10-03 19:00:00', (string) (CarbonPeriod::create( Carbon::parse('2015-09-30 12:50'), CarbonInterval::hour()->minutes(30), Carbon::parse('2015-10-03 19:00'), ))); $this->assertSame('Elke 4 uur en 30 minuten van 2015-09-30 12:50:00 tot 2015-10-03 19:00:00', (string) (CarbonPeriod::create( Carbon::parse('2015-09-30 12:50'), CarbonInterval::hours(4)->minutes(30), Carbon::parse('2015-10-03 19:00'), ))); } } ================================================ FILE: tests/Localization/NmgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NmgTest extends LocalizationTestCase { public const LOCALE = 'nmg'; // Kwasio public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sásadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mɔ́ndɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndɔ mafú mába at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndɔ mafú málal at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sɔ́ndɔ mafú mána at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'mabágá má sukul at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ mafú mába at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ mafú málal at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ mafú mána at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mabágá má sukul at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sásadi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sɔ́ndɔ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sɔ́ndɔ mafú mába at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sɔ́ndɔ mafú mába at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mɔ́ndɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sɔ́ndɔ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sásadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mabágá má sukul at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sɔ́ndɔ mafú mána at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last sɔ́ndɔ mafú málal at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last mabágá má sukul at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 maná CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 maná, 12:00 maná', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 maná, 1:30 maná', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 maná, 2:00 maná', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 maná, 6:00 maná', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 maná, 10:00 maná', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kugú, 12:00 kugú', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kugú, 5:00 kugú', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kugú, 9:30 kugú', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kugú, 11:00 kugú', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/NnNoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NnNoTest extends LocalizationTestCase { public const LOCALE = 'nn_NO'; // NorwegianNynorsk public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'I morgon klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'laurdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'sundag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'måndag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'tysdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'onsdag klokka 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'torsdag klokka 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'fredag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'tysdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'onsdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'torsdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'fredag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'laurdag klokka 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Føregåande sundag klokka 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'I går klokka 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'I dag klokka 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'I dag klokka 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'I morgon klokka 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'tysdag klokka 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'I går klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'I går klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Føregåande tysdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Føregåande måndag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Føregåande sundag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Føregåande laurdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Føregåande fredag klokka 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Føregåande torsdag klokka 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Føregåande onsdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Føregåande fredag klokka 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 f.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 f.m., 12:00 f.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 f.m., 1:30 f.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 f.m., 2:00 f.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 f.m., 6:00 f.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 f.m., 10:00 f.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 e.m., 12:00 e.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 e.m., 5:00 e.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 e.m., 9:30 e.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 e.m., 11:00 e.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 sekund sidan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s sidan', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 sekund sidan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s sidan', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minutt sidan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m sidan', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutt sidan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m sidan', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 time sidan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1t sidan', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 timar sidan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2t sidan', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 dag sidan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d sidan', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 dagar sidan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d sidan', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 veke sidan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1v sidan', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 veker sidan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2v sidan', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 månad sidan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 md sidan', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 månader sidan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 md sidan', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 år sidan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 år sidan', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 år sidan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 år sidan', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'om 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekund etter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s etter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'om 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minutt 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 år 3 md 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 md sidan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 år 3 md 1d 1s sidan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 veke 10 timar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 veke 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 veke 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'om 1 veke og 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 veker 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'om ein time', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3t', ]; } ================================================ FILE: tests/Localization/NnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NnTest extends LocalizationTestCase { public const LOCALE = 'nn'; // NorwegianNynorsk public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'I morgon klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'laurdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'sundag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'måndag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'tysdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'onsdag klokka 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'torsdag klokka 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'fredag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'tysdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'onsdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'torsdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'fredag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'laurdag klokka 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Føregåande sundag klokka 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'I går klokka 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'I dag klokka 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'I dag klokka 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'I morgon klokka 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'tysdag klokka 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'I går klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'I går klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Føregåande tysdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Føregåande måndag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Føregåande sundag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Føregåande laurdag klokka 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Føregåande fredag klokka 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Føregåande torsdag klokka 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Føregåande onsdag klokka 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Føregåande fredag klokka 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 f.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 f.m., 12:00 f.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 f.m., 1:30 f.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 f.m., 2:00 f.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 f.m., 6:00 f.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 f.m., 10:00 f.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 e.m., 12:00 e.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 e.m., 5:00 e.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 e.m., 9:30 e.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 e.m., 11:00 e.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 sekund sidan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s sidan', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 sekund sidan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s sidan', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minutt sidan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m sidan', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutt sidan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m sidan', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 time sidan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1t sidan', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 timar sidan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2t sidan', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 dag sidan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d sidan', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 dagar sidan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d sidan', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 veke sidan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1v sidan', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 veker sidan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2v sidan', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 månad sidan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 md sidan', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 månader sidan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 md sidan', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 år sidan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 år sidan', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 år sidan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 år sidan', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'om 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekund etter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s etter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekund', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'om 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minutt 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 år 3 md 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 md sidan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 år 3 md 1d 1s sidan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 veke 10 timar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 veke 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 veke 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'om 1 veke og 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 veker 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'om ein time', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3t', ]; } ================================================ FILE: tests/Localization/NnhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NnhTest extends LocalizationTestCase { public const LOCALE = 'nnh'; // Ngiemboon public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 mbaʼámbaʼ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 mbaʼámbaʼ, 12:00 mbaʼámbaʼ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 mbaʼámbaʼ, 1:30 mbaʼámbaʼ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 mbaʼámbaʼ, 2:00 mbaʼámbaʼ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 mbaʼámbaʼ, 6:00 mbaʼámbaʼ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 mbaʼámbaʼ, 10:00 mbaʼámbaʼ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ncwònzém, 12:00 ncwònzém', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ncwònzém, 5:00 ncwònzém', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ncwònzém, 9:30 ncwònzém', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ncwònzém, 11:00 ncwònzém', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/NoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NoTest extends LocalizationTestCase { public const LOCALE = 'no'; // Norwegian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i morgen kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på lørdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på søndag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på mandag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på onsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på torsdag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på fredag kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på lørdag kl. 00:00', // Carbon::now()->subDays(2)->calendar() 'i søndags kl. 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'i dag kl. 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i dag kl. 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'i morgen kl. 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'på tirsdag kl. 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i går kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i tirsdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i mandags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i søndags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i lørdags kl. 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'i torsdags kl. 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'i onsdags kl. 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'i fredags kl. 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekund siden', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sek siden', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekunder siden', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sek siden', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutt siden', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min siden', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutter siden', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min siden', // Carbon::now()->subHours(1)->diffForHumans() '1 time siden', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 t siden', // Carbon::now()->subHours(2)->diffForHumans() '2 timer siden', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 t siden', // Carbon::now()->subDays(1)->diffForHumans() '1 dag siden', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. siden', // Carbon::now()->subDays(2)->diffForHumans() '2 dager siden', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. siden', // Carbon::now()->subWeeks(1)->diffForHumans() '1 uke siden', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 u. siden', // Carbon::now()->subWeeks(2)->diffForHumans() '2 uker siden', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 u. siden', // Carbon::now()->subMonths(1)->diffForHumans() '1 måned siden', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 md. siden', // Carbon::now()->subMonths(2)->diffForHumans() '2 måneder siden', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 md. siden', // Carbon::now()->subYears(1)->diffForHumans() '1 år siden', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 år siden', // Carbon::now()->subYears(2)->diffForHumans() '2 år siden', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 år siden', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 sek', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund etter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sek etter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund før', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sek før', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sek', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sek', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 sek', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutt 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 md. 1 d. 1 sek', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 md. siden', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 år 3 md. 1 d. 1 sek siden', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 uke 10 timer', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 uke 6 dager', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 uke og 6 dager', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 uker 1 time', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en time', // CarbonInterval::days(2)->forHumans() '2 dager', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 t', ]; } ================================================ FILE: tests/Localization/NrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NrTest extends LocalizationTestCase { public const LOCALE = 'nr'; // SouthNdebele public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'umGqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uLesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lesithathu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'uLesine at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLesibili at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLesine at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'umGqibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last uSonto at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLesibili at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uLesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last umGqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last uLesine at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last lesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/NrZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NrZaTest extends LocalizationTestCase { public const LOCALE = 'nr_ZA'; // SouthNdebele public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'umGqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uLesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lesithathu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'uLesine at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLesibili at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLesine at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'umGqibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last uSonto at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLesibili at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uLesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last umGqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last uLesine at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last lesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ngoLesihlanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/NsoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NsoTest extends LocalizationTestCase { public const LOCALE = 'nso'; // Northern Sotho public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mokibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'LaMorena at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mošupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mokibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last LaMorena at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mošupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last LaMorena at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mokibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Labone at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 motsotswana ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 motsotswana ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 motsotswana ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 motsotswana ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Motsotso ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Motsotso ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Motsotso ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Motsotso ago', // Carbon::now()->subHours(1)->diffForHumans() '1 Iri ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 Iri ago', // Carbon::now()->subHours(2)->diffForHumans() '2 Iri ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 Iri ago', // Carbon::now()->subDays(1)->diffForHumans() '1 Letšatši ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 Letšatši ago', // Carbon::now()->subDays(2)->diffForHumans() '2 Letšatši ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 Letšatši ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Beke ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Beke ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Beke ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Beke ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Kgwedi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Kgwedi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ngwaga ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ngwaga ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ngwaga ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ngwaga ago', // Carbon::now()->addSecond()->diffForHumans() '1 motsotswana from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 motsotswana from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 motsotswana after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 motsotswana after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 motsotswana before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 motsotswana before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 motsotswana', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 motsotswana', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 motsotswana', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 motsotswana', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 motsotswana from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Motsotso 1 motsotswana', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ngwaga 3 Kgwedi 1 Letšatši 1 motsotswana', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ngwaga from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Kgwedi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ngwaga 3 Kgwedi 1 Letšatši 1 motsotswana ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Beke 10 Iri', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Beke 6 Letšatši', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Beke 6 Letšatši', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Beke and 6 Letšatši from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Beke 1 Iri', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 Iri from now', // CarbonInterval::days(2)->forHumans() '2 Letšatši', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Letšatši 3 Iri', ]; } ================================================ FILE: tests/Localization/NsoZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NsoZaTest extends LocalizationTestCase { public const LOCALE = 'nso_ZA'; // Northern Sotho public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mokibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'LaMorena at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mošupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mokibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last LaMorena at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mošupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last LaMorena at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mokibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Labone at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 motsotswana ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 motsotswana ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 motsotswana ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 motsotswana ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 Motsotso ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 Motsotso ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 Motsotso ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 Motsotso ago', // Carbon::now()->subHours(1)->diffForHumans() '1 Iri ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 Iri ago', // Carbon::now()->subHours(2)->diffForHumans() '2 Iri ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 Iri ago', // Carbon::now()->subDays(1)->diffForHumans() '1 Letšatši ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 Letšatši ago', // Carbon::now()->subDays(2)->diffForHumans() '2 Letšatši ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 Letšatši ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Beke ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Beke ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Beke ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Beke ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Kgwedi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Kgwedi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ngwaga ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ngwaga ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ngwaga ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ngwaga ago', // Carbon::now()->addSecond()->diffForHumans() '1 motsotswana from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 motsotswana from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 motsotswana after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 motsotswana after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 motsotswana before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 motsotswana before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 motsotswana', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 motsotswana', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 motsotswana', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 motsotswana', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 motsotswana from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 Motsotso 1 motsotswana', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ngwaga 3 Kgwedi 1 Letšatši 1 motsotswana', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ngwaga from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Kgwedi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ngwaga 3 Kgwedi 1 Letšatši 1 motsotswana ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Beke 10 Iri', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Beke 6 Letšatši', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Beke 6 Letšatši', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Beke and 6 Letšatši from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Beke 1 Iri', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 Iri from now', // CarbonInterval::days(2)->forHumans() '2 Letšatši', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 Letšatši 3 Iri', ]; } ================================================ FILE: tests/Localization/NusTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NusTest extends LocalizationTestCase { public const LOCALE = 'nus'; // Nuer public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bäkɛl lätni at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Cäŋ kuɔth at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jiec la̱t at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Rɛw lätni at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Diɔ̱k lätni at 12:00 rw', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ŋuaan lätni at 12:00 rw', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Dhieec lätni at 12:00 rw', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rɛw lätni at 12:00 rw', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Diɔ̱k lätni at 12:00 rw', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ŋuaan lätni at 12:00 rw', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Dhieec lätni at 12:00 rw', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bäkɛl lätni at 12:00 rw', // Carbon::now()->subDays(2)->calendar() 'Last Cäŋ kuɔth at 8:49 tŋ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 tŋ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 rw', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 rw', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 rw', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Rɛw lätni at 12:00 rw', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Rɛw lätni at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jiec la̱t at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Cäŋ kuɔth at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bäkɛl lätni at 12:00 rw', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dhieec lätni at 12:00 rw', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Ŋuaan lätni at 12:00 rw', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Diɔ̱k lätni at 12:00 rw', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Dhieec lätni at 12:00 rw', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 rw CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 RW, 12:00 rw', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 RW, 1:30 rw', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 RW, 2:00 rw', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 RW, 6:00 rw', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 RW, 10:00 rw', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 TŊ, 12:00 tŋ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 TŊ, 5:00 tŋ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 TŊ, 9:30 tŋ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 TŊ, 11:00 tŋ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 pay ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 pay ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 pay ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 pay ago', // Carbon::now()->subYears(1)->diffForHumans() '1 jiök ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 jiök ago', // Carbon::now()->subYears(2)->diffForHumans() '2 jiök ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 jiök ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 jiök 3 pay 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jiök from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 pay ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 jiök 3 pay 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/NynTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class NynTest extends LocalizationTestCase { public const LOCALE = 'nyn'; // Nyankole public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwamukaaga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sande at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwokubanza at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwakabiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Orwakashatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Orwakana at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Orwakataano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakabiri at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakashatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakana at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakataano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwamukaaga at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sande at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Orwakabiri at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwakabiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwokubanza at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sande at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwamukaaga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Orwakataano at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Orwakana at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Orwakashatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Orwakataano at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/OcFrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OcFrTest extends LocalizationTestCase { public const LOCALE = 'oc_FR'; // Occitan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Deman a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dissabte a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimenge a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'diluns a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimars a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimècres a 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'dijòus a 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'divendres a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dimars a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dimècres a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dijòus a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'divendres a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dissabte a 0:00', // Carbon::now()->subDays(2)->calendar() 'dimenge passat a 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ièr a 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Uèi a 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Uèi a 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Deman a 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dimars a 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ièr a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ièr a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimars passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'diluns passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimenge passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dissabte passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'divendres passat a 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'dijòus passat a 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'dimècres passat a 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'divendres passat a 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1èr 1èr 1èr 1èra 1èra', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1èra', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3en 1èra', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4en 1èra', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5en 1èra', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6en 1èra', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7en 1èra', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11en 2nda', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40en', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41en', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100en', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0en', // Carbon::now()->subSeconds(1)->diffForHumans() 'fa 1 segonda', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'fa 1 segonda', // Carbon::now()->subSeconds(2)->diffForHumans() 'fa 2 segondas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'fa 2 segondas', // Carbon::now()->subMinutes(1)->diffForHumans() 'fa 1 minuta', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'fa 1 minuta', // Carbon::now()->subMinutes(2)->diffForHumans() 'fa 2 minutas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'fa 2 minutas', // Carbon::now()->subHours(1)->diffForHumans() 'fa 1 ora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'fa 1 ora', // Carbon::now()->subHours(2)->diffForHumans() 'fa 2 oras', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'fa 2 oras', // Carbon::now()->subDays(1)->diffForHumans() 'fa 1 jorn', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'fa 1 jorn', // Carbon::now()->subDays(2)->diffForHumans() 'fa 2 jorns', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'fa 2 jorns', // Carbon::now()->subWeeks(1)->diffForHumans() 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() 'fa 2 setmanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'fa 2 setmanas', // Carbon::now()->subMonths(1)->diffForHumans() 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'fa 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'fa 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'fa 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'fa 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'fa 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'fa 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'd\'aquí 1 segonda', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'd\'aquí 1 segonda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segonda aprèp', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segonda aprèp', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segonda abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segonda abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segonda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segonda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segondas', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segondas', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'd\'aquí 1 segonda', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 segonda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 meses 1 jorn 1 segonda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'd\'aquí 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'fa 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'fa 2 ans 3 meses 1 jorn 1 segonda', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 setmana 10 oras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setmana 6 jorns', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setmana 6 jorns', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'd\'aquí 1 setmana e 6 jorns', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 setmanas 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'd\'aquí una ora', // CarbonInterval::days(2)->forHumans() '2 jorns', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 jorn 3 oras', ]; } ================================================ FILE: tests/Localization/OcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OcTest extends LocalizationTestCase { public const LOCALE = 'oc'; // Occitan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Deman a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dissabte a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimenge a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'diluns a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimars a 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimècres a 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'dijòus a 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'divendres a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dimars a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dimècres a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dijòus a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'divendres a 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dissabte a 0:00', // Carbon::now()->subDays(2)->calendar() 'dimenge passat a 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ièr a 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Uèi a 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Uèi a 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Deman a 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'dimars a 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ièr a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ièr a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimars passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'diluns passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimenge passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dissabte passat a 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'divendres passat a 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'dijòus passat a 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'dimècres passat a 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'divendres passat a 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1èr 1èr 1èr 1èra 1èra', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1èra', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3en 1èra', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4en 1èra', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5en 1èra', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6en 1èra', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7en 1èra', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11en 2nda', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40en', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41en', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100en', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0en', // Carbon::now()->subSeconds(1)->diffForHumans() 'fa 1 segonda', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'fa 1 segonda', // Carbon::now()->subSeconds(2)->diffForHumans() 'fa 2 segondas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'fa 2 segondas', // Carbon::now()->subMinutes(1)->diffForHumans() 'fa 1 minuta', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'fa 1 minuta', // Carbon::now()->subMinutes(2)->diffForHumans() 'fa 2 minutas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'fa 2 minutas', // Carbon::now()->subHours(1)->diffForHumans() 'fa 1 ora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'fa 1 ora', // Carbon::now()->subHours(2)->diffForHumans() 'fa 2 oras', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'fa 2 oras', // Carbon::now()->subDays(1)->diffForHumans() 'fa 1 jorn', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'fa 1 jorn', // Carbon::now()->subDays(2)->diffForHumans() 'fa 2 jorns', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'fa 2 jorns', // Carbon::now()->subWeeks(1)->diffForHumans() 'fa 1 setmana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'fa 1 setmana', // Carbon::now()->subWeeks(2)->diffForHumans() 'fa 2 setmanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'fa 2 setmanas', // Carbon::now()->subMonths(1)->diffForHumans() 'fa 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'fa 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'fa 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'fa 2 meses', // Carbon::now()->subYears(1)->diffForHumans() 'fa 1 an', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'fa 1 an', // Carbon::now()->subYears(2)->diffForHumans() 'fa 2 ans', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'fa 2 ans', // Carbon::now()->addSecond()->diffForHumans() 'd\'aquí 1 segonda', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'd\'aquí 1 segonda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segonda aprèp', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 segonda aprèp', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segonda abans', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 segonda abans', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segonda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 segonda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segondas', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 segondas', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'd\'aquí 1 segonda', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 segonda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ans 3 meses 1 jorn 1 segonda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'd\'aquí 3 ans', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'fa 5 meses', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'fa 2 ans 3 meses 1 jorn 1 segonda', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 setmana 10 oras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setmana 6 jorns', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 setmana 6 jorns', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'd\'aquí 1 setmana e 6 jorns', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 setmanas 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'd\'aquí una ora', // CarbonInterval::days(2)->forHumans() '2 jorns', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 jorn 3 oras', ]; } ================================================ FILE: tests/Localization/OmEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OmEtTest extends LocalizationTestCase { public const LOCALE = 'om_ET'; // Oromo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sanbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dilbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wiixata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Roobii at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jimaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Roobii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jimaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sanbata at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Dilbata at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Qibxata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wiixata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dilbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sanbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jimaata at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Roobii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jimaata at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 wd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 WD, 12:00 wd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 WD, 1:30 wd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 WD, 2:00 wd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 WD, 6:00 wd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 WD, 10:00 wd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 WB, 12:00 wb', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 WB, 5:00 wb', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 WB, 9:30 wb', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 WB, 11:00 wb', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sekoondii 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sekoondii 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sekoondii 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sekoondii 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'daqiiqaa 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'daqiiqaa 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'daqiiqaa 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'daqiiqaa 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'saʼaatii 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saʼaatii 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saʼaatii 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saʼaatii 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'guyyaa 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'guyyaa 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'guyyaa 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'guyyaa 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'torban 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'torban 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'torban 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'torban 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ji’a 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ji’a 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ji’a 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ji’a 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'wggoota 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'wggoota 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'wggoota 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'wggoota 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sekoondii 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sekoondii 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekoondii 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sekoondii 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekoondii 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sekoondii 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekoondii 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sekoondii 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekoondii 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sekoondii 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sekoondii 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'daqiiqaa 1 sekoondii 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'wggoota 2 ji’a 3 guyyaa 1 sekoondii 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'wggoota 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ji’a 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'wggoota 2 ji’a 3 guyyaa 1 sekoondii 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'torban 1 saʼaatii 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'torban 1 guyyaa 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'torban 1 guyyaa 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'torban 1 and guyyaa 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'torban 2 saʼaatii 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saʼaatii 1 from now', // CarbonInterval::days(2)->forHumans() 'guyyaa 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'guyyaa 1 saʼaatii 3', ]; } ================================================ FILE: tests/Localization/OmKeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OmKeTest extends LocalizationTestCase { public const LOCALE = 'om_KE'; // Oromo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sanbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dilbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wiixata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Roobii at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jimaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Roobii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jimaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sanbata at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Dilbata at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Qibxata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wiixata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dilbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sanbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jimaata at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Roobii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jimaata at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 wd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 WD, 12:00 wd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 WD, 1:30 wd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 WD, 2:00 wd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 WD, 6:00 wd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 WD, 10:00 wd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 WB, 12:00 wb', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 WB, 5:00 wb', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 WB, 9:30 wb', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 WB, 11:00 wb', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sekoondii 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sekoondii 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sekoondii 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sekoondii 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'daqiiqaa 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'daqiiqaa 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'daqiiqaa 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'daqiiqaa 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'saʼaatii 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saʼaatii 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saʼaatii 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saʼaatii 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'guyyaa 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'guyyaa 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'guyyaa 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'guyyaa 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'torban 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'torban 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'torban 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'torban 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ji’a 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ji’a 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ji’a 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ji’a 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'wggoota 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'wggoota 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'wggoota 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'wggoota 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sekoondii 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sekoondii 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekoondii 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sekoondii 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekoondii 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sekoondii 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekoondii 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sekoondii 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekoondii 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sekoondii 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sekoondii 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'daqiiqaa 1 sekoondii 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'wggoota 2 ji’a 3 guyyaa 1 sekoondii 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'wggoota 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ji’a 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'wggoota 2 ji’a 3 guyyaa 1 sekoondii 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'torban 1 saʼaatii 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'torban 1 guyyaa 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'torban 1 guyyaa 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'torban 1 and guyyaa 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'torban 2 saʼaatii 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saʼaatii 1 from now', // CarbonInterval::days(2)->forHumans() 'guyyaa 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'guyyaa 1 saʼaatii 3', ]; } ================================================ FILE: tests/Localization/OmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OmTest extends LocalizationTestCase { public const LOCALE = 'om'; // Oromo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sanbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dilbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wiixata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Roobii at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kamiisa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Jimaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Roobii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kamiisa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jimaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sanbata at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Dilbata at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qibxata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Qibxata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Wiixata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dilbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sanbata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jimaata at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kamiisa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Roobii at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Jimaata at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 wd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 WD, 12:00 wd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 WD, 1:30 wd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 WD, 2:00 wd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 WD, 6:00 wd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 WD, 10:00 wd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 WB, 12:00 wb', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 WB, 5:00 wb', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 WB, 9:30 wb', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 WB, 11:00 wb', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sekoondii 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sekoondii 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sekoondii 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sekoondii 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'daqiiqaa 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'daqiiqaa 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'daqiiqaa 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'daqiiqaa 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'saʼaatii 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saʼaatii 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saʼaatii 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saʼaatii 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'guyyaa 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'guyyaa 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'guyyaa 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'guyyaa 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'torban 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'torban 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'torban 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'torban 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ji’a 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ji’a 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ji’a 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ji’a 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'wggoota 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'wggoota 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'wggoota 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'wggoota 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sekoondii 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sekoondii 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekoondii 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sekoondii 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekoondii 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sekoondii 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekoondii 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sekoondii 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekoondii 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sekoondii 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sekoondii 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'daqiiqaa 1 sekoondii 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'wggoota 2 ji’a 3 guyyaa 1 sekoondii 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'wggoota 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ji’a 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'wggoota 2 ji’a 3 guyyaa 1 sekoondii 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'torban 1 saʼaatii 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'torban 1 guyyaa 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'torban 1 guyyaa 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'torban 1 and guyyaa 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'torban 2 saʼaatii 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saʼaatii 1 from now', // CarbonInterval::days(2)->forHumans() 'guyyaa 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'guyyaa 1 saʼaatii 3', ]; } ================================================ FILE: tests/Localization/OrInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OrInTest extends LocalizationTestCase { public const LOCALE = 'or_IN'; // Oriya public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'Tomorrow at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'ଶନିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'ରବିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'ସୋମବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'ବୁଧବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'ଗୁରୁବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'ବୁଧବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'ଗୁରୁବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'ଶନିବାର at ୧୨:୦ AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'Last ରବିବାର at ୮:୪୯ PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'Yesterday at ୧୦:୦ PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'Today at ୧୦:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'Today at ୨:୦ AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'Tomorrow at ୧:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'Yesterday at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'Yesterday at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'Last ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'Last ସୋମବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'Last ରବିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'Last ଶନିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'Last ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'Last ଗୁରୁବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'Last ବୁଧବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'Last ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 ସେକଣ୍ଢ ପୂର୍ବେ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 ସେ. ପୂର୍ବେ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 ସେକଣ୍ଢ ପୂର୍ବେ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 ସେ. ପୂର୍ବେ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 ମିନଟ ପୂର୍ବେ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 ମି. ପୂର୍ବେ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 ମିନଟ ପୂର୍ବେ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 ମି. ପୂର୍ବେ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ଘଣ୍ତ ପୂର୍ବେ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ଘ. ପୂର୍ବେ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ଘଣ୍ତ ପୂର୍ବେ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ଘ. ପୂର୍ବେ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 ଦିନ ପୂର୍ବେ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 ଦିନ ପୂର୍ବେ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 ଦିନ ପୂର୍ବେ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 ଦିନ ପୂର୍ବେ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 ସପ୍ତାହ ପୂର୍ବେ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 ସପ୍ତା. ପୂର୍ବେ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 ସପ୍ତାହ ପୂର୍ବେ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 ସପ୍ତା. ପୂର୍ବେ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ମାସ ପୂର୍ବେ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 ମା. ପୂର୍ବେ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ମାସ ପୂର୍ବେ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 ମା. ପୂର୍ବେ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 ବର୍ଷ ପୂର୍ବେ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 ବ. ପୂର୍ବେ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 ବର୍ଷ ପୂର୍ବେ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 ବ. ପୂର୍ବେ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 ସେକଣ୍ଢରେ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 ସେ.ରେ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 ସେକଣ୍ଢ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 ସେ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 ସେକଣ୍ଢ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 ସେ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 ସେ.ରେ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 ମିନଟ 1 ସେକଣ୍ଢ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 ବ. 3 ମା. 1 ଦିନ 1 ସେ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 ବର୍ଷରେ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 ମା. ପୂର୍ବେ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 ବ. 3 ମା. 1 ଦିନ 1 ସେ. ପୂର୍ବେ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 ସପ୍ତାହ 10 ଘଣ୍ତ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ସପ୍ତାହ 6 ଦିନ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ସପ୍ତାହ 6 ଦିନ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 ସପ୍ତାହ 6 ଦିନରେ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 ସପ୍ତାହ 1 ଘଣ୍ତ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', '1 ଘଣ୍ତରେ', // CarbonInterval::days(2)->forHumans() // '2 days', '2 ଦିନ', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 ଦିନ 3 ଘ.', ]; } ================================================ FILE: tests/Localization/OrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OrTest extends LocalizationTestCase { public const LOCALE = 'or'; // Oriya public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'Tomorrow at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'ଶନିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'ରବିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'ସୋମବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'ବୁଧବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'ଗୁରୁବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'ବୁଧବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'ଗୁରୁବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'ଶନିବାର at ୧୨:୦ AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'Last ରବିବାର at ୮:୪୯ PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'Yesterday at ୧୦:୦ PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'Today at ୧୦:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'Today at ୨:୦ AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'Tomorrow at ୧:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'Yesterday at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'Yesterday at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'Last ମଙ୍ଗଳବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'Last ସୋମବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'Last ରବିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'Last ଶନିବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'Last ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'Last ଗୁରୁବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'Last ବୁଧବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'Last ଶୁକ୍ରବାର at ୧୨:୦ AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 ସେକଣ୍ଢ ପୂର୍ବେ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 ସେ. ପୂର୍ବେ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 ସେକଣ୍ଢ ପୂର୍ବେ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 ସେ. ପୂର୍ବେ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 ମିନଟ ପୂର୍ବେ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 ମି. ପୂର୍ବେ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 ମିନଟ ପୂର୍ବେ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 ମି. ପୂର୍ବେ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ଘଣ୍ତ ପୂର୍ବେ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ଘ. ପୂର୍ବେ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ଘଣ୍ତ ପୂର୍ବେ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ଘ. ପୂର୍ବେ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 ଦିନ ପୂର୍ବେ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 ଦିନ ପୂର୍ବେ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 ଦିନ ପୂର୍ବେ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 ଦିନ ପୂର୍ବେ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 ସପ୍ତାହ ପୂର୍ବେ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 ସପ୍ତା. ପୂର୍ବେ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 ସପ୍ତାହ ପୂର୍ବେ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 ସପ୍ତା. ପୂର୍ବେ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ମାସ ପୂର୍ବେ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 ମା. ପୂର୍ବେ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ମାସ ପୂର୍ବେ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 ମା. ପୂର୍ବେ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 ବର୍ଷ ପୂର୍ବେ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 ବ. ପୂର୍ବେ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 ବର୍ଷ ପୂର୍ବେ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 ବ. ପୂର୍ବେ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 ସେକଣ୍ଢରେ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1 ସେ.ରେ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 ସେକଣ୍ଢ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 ସେ.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 ସେକଣ୍ଢ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 ସେ.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1 ସେ.ରେ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 ମିନଟ 1 ସେକଣ୍ଢ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 ବ. 3 ମା. 1 ଦିନ 1 ସେ.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 ବର୍ଷରେ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 ମା. ପୂର୍ବେ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 ବ. 3 ମା. 1 ଦିନ 1 ସେ. ପୂର୍ବେ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 ସପ୍ତାହ 10 ଘଣ୍ତ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ସପ୍ତାହ 6 ଦିନ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 ସପ୍ତାହ 6 ଦିନ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 ସପ୍ତାହ 6 ଦିନରେ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 ସପ୍ତାହ 1 ଘଣ୍ତ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', '1 ଘଣ୍ତରେ', // CarbonInterval::days(2)->forHumans() // '2 days', '2 ଦିନ', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 ଦିନ 3 ଘ.', ]; } ================================================ FILE: tests/Localization/OsRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OsRuTest extends LocalizationTestCase { public const LOCALE = 'os_RU'; // Ossetian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сабат at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Хуыцаубон at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Къуырисæр at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дыццæг at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Æртыццæг at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Цыппæрæм at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Дыццæг at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Æртыццæг at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Цыппæрæм at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Сабат at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Хуыцаубон at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Дыццæг at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Дыццæг at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Къуырисæр at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Хуыцаубон at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Сабат at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Цыппæрæм at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Æртыццæг at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 æндæр ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 æндæр ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 æндæр ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 æндæр ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 гыццыл ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 гыццыл ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 гыццыл ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 гыццыл ago', // Carbon::now()->subHours(1)->diffForHumans() '1 сахат ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 сахат ago', // Carbon::now()->subHours(2)->diffForHumans() '2 сахат ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 сахат ago', // Carbon::now()->subDays(1)->diffForHumans() '1 бон ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 бон ago', // Carbon::now()->subDays(2)->diffForHumans() '2 бон ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 бон ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 къуыри ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 къуыри ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 къуыри ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 къуыри ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 мӕй ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мӕй ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 мӕй ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мӕй ago', // Carbon::now()->subYears(1)->diffForHumans() '1 аз ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 аз ago', // Carbon::now()->subYears(2)->diffForHumans() '2 аз ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 аз ago', // Carbon::now()->addSecond()->diffForHumans() '1 æндæр from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 æндæр from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 æндæр after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 æндæр after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 æндæр before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 æндæр before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 æндæр', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 æндæр', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 æндæр', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 æндæр', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 æндæр from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 гыццыл 1 æндæр', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 аз 3 мӕй 1 бон 1 æндæр', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 аз from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мӕй ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 аз 3 мӕй 1 бон 1 æндæр ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 къуыри 10 сахат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 къуыри 6 бон', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 къуыри 6 бон', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 къуыри and 6 бон from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 къуыри 1 сахат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 сахат from now', // CarbonInterval::days(2)->forHumans() '2 бон', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 бон 3 сахат', ]; } ================================================ FILE: tests/Localization/OsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class OsTest extends LocalizationTestCase { public const LOCALE = 'os'; // Ossetian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сабат at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Хуыцаубон at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Къуырисæр at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дыццæг at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Æртыццæг at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Цыппæрæм at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Дыццæг at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Æртыццæг at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Цыппæрæм at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Сабат at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Хуыцаубон at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Дыццæг at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Дыццæг at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Къуырисæр at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Хуыцаубон at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Сабат at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Цыппæрæм at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Æртыццæг at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Майрæмбон at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 æндæр ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 æндæр ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 æндæр ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 æндæр ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 гыццыл ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 гыццыл ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 гыццыл ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 гыццыл ago', // Carbon::now()->subHours(1)->diffForHumans() '1 сахат ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 сахат ago', // Carbon::now()->subHours(2)->diffForHumans() '2 сахат ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 сахат ago', // Carbon::now()->subDays(1)->diffForHumans() '1 бон ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 бон ago', // Carbon::now()->subDays(2)->diffForHumans() '2 бон ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 бон ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 къуыри ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 къуыри ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 къуыри ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 къуыри ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 мӕй ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мӕй ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 мӕй ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мӕй ago', // Carbon::now()->subYears(1)->diffForHumans() '1 аз ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 аз ago', // Carbon::now()->subYears(2)->diffForHumans() '2 аз ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 аз ago', // Carbon::now()->addSecond()->diffForHumans() '1 æндæр from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 æндæр from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 æндæр after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 æндæр after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 æндæр before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 æндæр before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 æндæр', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 æндæр', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 æндæр', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 æндæр', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 æндæр from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 гыццыл 1 æндæр', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 аз 3 мӕй 1 бон 1 æндæр', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 аз from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мӕй ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 аз 3 мӕй 1 бон 1 æндæр ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 къуыри 10 сахат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 къуыри 6 бон', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 къуыри 6 бон', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 къуыри and 6 бон from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 къуыри 1 сахат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 сахат from now', // CarbonInterval::days(2)->forHumans() '2 бон', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 бон 3 сахат', ]; } ================================================ FILE: tests/Localization/PaArabTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PaArabTest extends LocalizationTestCase { public const LOCALE = 'pa_Arab'; // Panjabi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'کل بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'ہفتہ بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'اتوار بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'پیر بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'منگل بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'بُدھ بوقت 12:00 صبح', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'جمعرات بوقت 12:00 صبح', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'جمعہ بوقت 12:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'منگل بوقت 12:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'بُدھ بوقت 12:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'جمعرات بوقت 12:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'جمعہ بوقت 12:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'ہفتہ بوقت 12:00 صبح', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'گذشتہ اتوار بوقت 8:49 شام', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'گذشتہ روز بوقت 10:00 شام', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'آج بوقت 10:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'آج بوقت 2:00 صبح', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'کل بوقت 1:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'منگل بوقت 12:00 صبح', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'گذشتہ روز بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'گذشتہ روز بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'گذشتہ منگل بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'گذشتہ پیر بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'گذشتہ اتوار بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'گذشتہ ہفتہ بوقت 12:00 صبح', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'گذشتہ جمعہ بوقت 12:00 صبح', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'گذشتہ جمعرات بوقت 12:00 صبح', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'گذشتہ بُدھ بوقت 12:00 صبح', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'گذشتہ جمعہ بوقت 12:00 صبح', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 صبح CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 صبح, 12:00 صبح', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 صبح, 1:30 صبح', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 صبح, 2:00 صبح', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 صبح, 6:00 صبح', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 صبح, 10:00 صبح', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 شام, 12:00 شام', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 شام, 5:00 شام', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 شام, 9:30 شام', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 شام, 11:00 شام', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 سیکنڈ قبل', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 سیکنڈ قبل', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 منٹ قبل', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 منٹ قبل', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 گھنٹے قبل', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 گھنٹے قبل', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 دن قبل', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 دن قبل', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 دن قبل', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 دن قبل', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 ہفتے قبل', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ہفتے قبل', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ماہ قبل', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ماہ قبل', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 سال قبل', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 سال قبل', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 سال قبل', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 سال قبل', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 سیکنڈ بعد', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 سیکنڈ پہلے', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 سیکنڈ پہلے', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 سیکنڈ بعد', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 منٹ 1 سیکنڈ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 سال 3 ماہ 1 دن 1 سیکنڈ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 سال بعد', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ماہ قبل', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 سال 3 ماہ 1 دن 1 سیکنڈ قبل', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 ہفتے 10 گھنٹے', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 ہفتے اور 6 دن بعد', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ہفتے 1 گھنٹے', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'ایک گھنٹہ بعد', // CarbonInterval::days(2)->forHumans() // '2 days' '2 دن', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 دن 3 گھنٹے', ]; } ================================================ FILE: tests/Localization/PaGuruTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PaGuruTest extends LocalizationTestCase { public const LOCALE = 'pa_Guru'; // Panjabi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'ਕਲ 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'ਅਗਲਾ ਸ਼ਨਿੱਚਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'ਅਗਲਾ ਐਤਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'ਅਗਲਾ ਸੋਮਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'ਅਗਲਾ ਮੰਗਲਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'ਅਗਲਾ ਬੁੱਧਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'ਅਗਲਾ ਵੀਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'ਅਗਲਾ ਸ਼ੁੱਕਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ਅਗਲਾ ਮੰਗਲਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'ਅਗਲਾ ਬੁੱਧਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'ਅਗਲਾ ਵੀਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'ਅਗਲਾ ਸ਼ੁੱਕਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'ਅਗਲਾ ਸ਼ਨਿੱਚਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'ਪਿਛਲੇ ਐਤਵਾਰ, 8:49 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'ਕਲ 10:00 ਰਾਤ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'ਅਜ 10:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'ਅਜ 2:00 ਰਾਤ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'ਕਲ 1:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ਅਗਲਾ ਮੰਗਲਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'ਕਲ 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'ਕਲ 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'ਪਿਛਲੇ ਮੰਗਲਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'ਪਿਛਲੇ ਸੋਮਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'ਪਿਛਲੇ ਐਤਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'ਪਿਛਲੇ ਸ਼ਨਿੱਚਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'ਪਿਛਲੇ ਸ਼ੁੱਕਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'ਪਿਛਲੇ ਵੀਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'ਪਿਛਲੇ ਬੁੱਧਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'ਪਿਛਲੇ ਸ਼ੁੱਕਰਵਾਰ, 12:00 ਰਾਤ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ਰਾਤ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 ਰਾਤ, 12:00 ਰਾਤ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 ਰਾਤ, 1:30 ਰਾਤ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 ਰਾਤ, 2:00 ਰਾਤ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 ਸਵੇਰ, 6:00 ਸਵੇਰ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 ਦੁਪਹਿਰ, 10:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ਦੁਪਹਿਰ, 12:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ਸ਼ਾਮ, 5:00 ਸ਼ਾਮ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ਰਾਤ, 9:30 ਰਾਤ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ਰਾਤ, 11:00 ਰਾਤ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'ਇਕ ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'ਇਕ ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'ਇੱਕ ਘੰਟਾ ਪਹਿਲਾਂ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'ਇੱਕ ਘੰਟਾ ਪਹਿਲਾਂ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 ਘੰਟੇ ਪਹਿਲਾਂ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 ਘੰਟੇ ਪਹਿਲਾਂ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'ਇੱਕ ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'ਇੱਕ ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'ਹਫਤਾ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'ਹਫਤਾ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ਹਫ਼ਤੇ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ਹਫ਼ਤੇ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'ਇੱਕ ਮਹੀਨਾ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'ਇੱਕ ਮਹੀਨਾ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'ਇੱਕ ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'ਇੱਕ ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਬਾਅਦ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਬਾਅਦ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਪਹਿਲਾਂ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਪਹਿਲਾਂ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' 'ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' 'ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ਸਕਿੰਟ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 ਸਕਿੰਟ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' 'ਇਕ ਮਿੰਟ ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 ਸਾਲ 3 ਮਹੀਨੇ ਇੱਕ ਦਿਨ ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 ਸਾਲ ਵਿੱਚ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 ਸਾਲ 3 ਮਹੀਨੇ ਇੱਕ ਦਿਨ ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' 'ਹਫਤਾ 10 ਘੰਟੇ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'ਹਫਤਾ 6 ਦਿਨ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'ਹਫਤਾ 6 ਦਿਨ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'ਹਫਤਾ ਅਤੇ 6 ਦਿਨ ਵਿੱਚ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ਹਫ਼ਤੇ ਇੱਕ ਘੰਟਾ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'ਇੱਕ ਘੰਟਾ ਵਿੱਚ', // CarbonInterval::days(2)->forHumans() // '2 days' '2 ਦਿਨ', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' 'ਇੱਕ ਦਿਨ 3 ਘੰਟੇ', ]; } ================================================ FILE: tests/Localization/PaInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PaInTest extends LocalizationTestCase { public const LOCALE = 'pa_IN'; // Panjabi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'ਕਲ ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'ਅਗਲਾ ਸ਼ਨੀਚਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'ਅਗਲਾ ਐਤਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'ਅਗਲਾ ਸੋਮਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'ਅਗਲਾ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'ਅਗਲਾ ਬੁਧਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'ਅਗਲਾ ਵੀਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'ਅਗਲਾ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ਅਗਲਾ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'ਅਗਲਾ ਬੁਧਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'ਅਗਲਾ ਵੀਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'ਅਗਲਾ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'ਅਗਲਾ ਸ਼ਨੀਚਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'ਪਿਛਲੇ ਐਤਵਾਰ, ਰਾਤ 8:49 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'ਕਲ ਰਾਤ 10:00 ਵਜੇ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'ਅਜ ਦੁਪਹਿਰ 10:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'ਅਜ ਰਾਤ 2:00 ਵਜੇ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'ਕਲ ਰਾਤ 1:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'ਅਗਲਾ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'ਕਲ ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'ਕਲ ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'ਪਿਛਲੇ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'ਪਿਛਲੇ ਸੋਮਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'ਪਿਛਲੇ ਐਤਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'ਪਿਛਲੇ ਸ਼ਨੀਚਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'ਪਿਛਲੇ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'ਪਿਛਲੇ ਵੀਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'ਪਿਛਲੇ ਬੁਧਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'ਪਿਛਲੇ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ਰਾਤ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 ਰਾਤ, 12:00 ਰਾਤ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 ਰਾਤ, 1:30 ਰਾਤ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 ਰਾਤ, 2:00 ਰਾਤ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 ਸਵੇਰ, 6:00 ਸਵੇਰ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 ਦੁਪਹਿਰ, 10:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ਦੁਪਹਿਰ, 12:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ਸ਼ਾਮ, 5:00 ਸ਼ਾਮ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ਰਾਤ, 9:30 ਰਾਤ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ਰਾਤ, 11:00 ਰਾਤ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'ਇਕ ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'ਇਕ ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'ਇੱਕ ਘੰਟਾ ਪਹਿਲਾਂ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'ਇੱਕ ਘੰਟਾ ਪਹਿਲਾਂ', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 ਘੰਟੇ ਪਹਿਲਾਂ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 ਘੰਟੇ ਪਹਿਲਾਂ', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'ਇੱਕ ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'ਇੱਕ ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'ਹਫਤਾ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'ਹਫਤਾ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ਹਫ਼ਤੇ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ਹਫ਼ਤੇ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'ਇੱਕ ਮਹੀਨਾ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'ਇੱਕ ਮਹੀਨਾ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'ਇੱਕ ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'ਇੱਕ ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਬਾਅਦ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਬਾਅਦ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਪਹਿਲਾਂ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਪਹਿਲਾਂ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' 'ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' 'ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ਸਕਿੰਟ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 ਸਕਿੰਟ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' 'ਇਕ ਮਿੰਟ ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 ਸਾਲ 3 ਮਹੀਨੇ ਇੱਕ ਦਿਨ ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 ਸਾਲ ਵਿੱਚ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 ਸਾਲ 3 ਮਹੀਨੇ ਇੱਕ ਦਿਨ ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' 'ਹਫਤਾ 10 ਘੰਟੇ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'ਹਫਤਾ 6 ਦਿਨ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' 'ਹਫਤਾ 6 ਦਿਨ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'ਹਫਤਾ ਅਤੇ 6 ਦਿਨ ਵਿੱਚ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ਹਫ਼ਤੇ ਇੱਕ ਘੰਟਾ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'ਇੱਕ ਘੰਟਾ ਵਿੱਚ', // CarbonInterval::days(2)->forHumans() // '2 days' '2 ਦਿਨ', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' 'ਇੱਕ ਦਿਨ 3 ਘੰਟੇ', ]; } ================================================ FILE: tests/Localization/PaPkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PaPkTest extends LocalizationTestCase { public const LOCALE = 'pa_PK'; // Panjabi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'کل بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'هفته بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'اتوار بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'پير بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'منگل بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'بدھ بوقت 12:00 ص', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'جمعرات بوقت 12:00 ص', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'جمعه بوقت 12:00 ص', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'منگل بوقت 12:00 ص', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'بدھ بوقت 12:00 ص', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'جمعرات بوقت 12:00 ص', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'جمعه بوقت 12:00 ص', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'هفته بوقت 12:00 ص', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'گذشتہ اتوار بوقت 8:49 ش', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'گذشتہ روز بوقت 10:00 ش', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'آج بوقت 10:00 ص', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'آج بوقت 2:00 ص', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'کل بوقت 1:00 ص', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'منگل بوقت 12:00 ص', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'گذشتہ روز بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'گذشتہ روز بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'گذشتہ منگل بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'گذشتہ پير بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'گذشتہ اتوار بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'گذشتہ هفته بوقت 12:00 ص', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'گذشتہ جمعه بوقت 12:00 ص', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'گذشتہ جمعرات بوقت 12:00 ص', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'گذشتہ بدھ بوقت 12:00 ص', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'گذشتہ جمعه بوقت 12:00 ص', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ش, 12:00 ش', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ش, 5:00 ش', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ش, 9:30 ش', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ش, 11:00 ش', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 سیکنڈ قبل', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 سیکنڈ قبل', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 منٹ قبل', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 منٹ قبل', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 گھنٹے قبل', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 گھنٹے قبل', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 دن قبل', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 دن قبل', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 دن قبل', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 دن قبل', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 ہفتے قبل', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ہفتے قبل', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ماہ قبل', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ماہ قبل', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 سال قبل', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 سال قبل', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 سال قبل', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 سال قبل', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 سیکنڈ بعد', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 سیکنڈ پہلے', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 سیکنڈ پہلے', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 سیکنڈ بعد', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 منٹ 1 سیکنڈ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 سال 3 ماہ 1 دن 1 سیکنڈ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 سال بعد', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ماہ قبل', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 سال 3 ماہ 1 دن 1 سیکنڈ قبل', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 ہفتے 10 گھنٹے', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 ہفتے اور 6 دن بعد', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ہفتے 1 گھنٹے', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'ایک گھنٹہ بعد', // CarbonInterval::days(2)->forHumans() // '2 days' '2 دن', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 دن 3 گھنٹے', ]; } ================================================ FILE: tests/Localization/PaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PaTest extends LocalizationTestCase { public const LOCALE = 'pa'; // Panjabi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਕਲ ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਅਗਲਾ ਸ਼ਨੀਚਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਅਗਲਾ ਐਤਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਅਗਲਾ ਸੋਮਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਅਗਲਾ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਅਗਲਾ ਬੁਧਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ਅਗਲਾ ਵੀਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ਅਗਲਾ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਅਗਲਾ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਅਗਲਾ ਬੁਧਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਅਗਲਾ ਵੀਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਅਗਲਾ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਅਗਲਾ ਸ਼ਨੀਚਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::now()->subDays(2)->calendar() 'ਪਿਛਲੇ ਐਤਵਾਰ, ਰਾਤ 8:49 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਕਲ ਰਾਤ 10:00 ਵਜੇ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ਅਜ ਦੁਪਹਿਰ 10:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਅਜ ਰਾਤ 2:00 ਵਜੇ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ਕਲ ਰਾਤ 1:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਅਗਲਾ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ਕਲ ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਕਲ ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਪਿਛਲੇ ਮੰਗਲਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਪਿਛਲੇ ਸੋਮਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਪਿਛਲੇ ਐਤਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਪਿਛਲੇ ਸ਼ਨੀਚਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ਪਿਛਲੇ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ਪਿਛਲੇ ਵੀਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ਪਿਛਲੇ ਬੁਧਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ਪਿਛਲੇ ਸ਼ੁੱਕਰਵਾਰ, ਰਾਤ 12:00 ਵਜੇ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ਰਾਤ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ਰਾਤ, 12:00 ਰਾਤ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ਰਾਤ, 1:30 ਰਾਤ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ਰਾਤ, 2:00 ਰਾਤ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ਸਵੇਰ, 6:00 ਸਵੇਰ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ਦੁਪਹਿਰ, 10:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ਦੁਪਹਿਰ, 12:00 ਦੁਪਹਿਰ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ਸ਼ਾਮ, 5:00 ਸ਼ਾਮ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ਰਾਤ, 9:30 ਰਾਤ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ਰਾਤ, 11:00 ਰਾਤ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(1)->diffForHumans() 'ਇਕ ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ਇਕ ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ਮਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->subHours(1)->diffForHumans() 'ਇੱਕ ਘੰਟਾ ਪਹਿਲਾਂ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ਇੱਕ ਘੰਟਾ ਪਹਿਲਾਂ', // Carbon::now()->subHours(2)->diffForHumans() '2 ਘੰਟੇ ਪਹਿਲਾਂ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ਘੰਟੇ ਪਹਿਲਾਂ', // Carbon::now()->subDays(1)->diffForHumans() 'ਇੱਕ ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ਇੱਕ ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(2)->diffForHumans() '2 ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ਦਿਨ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(1)->diffForHumans() 'ਹਫਤਾ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ਹਫਤਾ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ਹਫ਼ਤੇ ਪਹਿਲਾਂ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ਹਫ਼ਤੇ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(1)->diffForHumans() 'ਇੱਕ ਮਹੀਨਾ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ਇੱਕ ਮਹੀਨਾ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(2)->diffForHumans() '2 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subYears(1)->diffForHumans() 'ਇੱਕ ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ਇੱਕ ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->diffForHumans() '2 ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ਸਾਲ ਪਹਿਲਾਂ', // Carbon::now()->addSecond()->diffForHumans() 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਬਾਅਦ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਬਾਅਦ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਪਹਿਲਾਂ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'ਕੁਝ ਸਕਿੰਟ ਤੋਂ ਪਹਿਲਾਂ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ਸਕਿੰਟ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ਸਕਿੰਟ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ਇਕ ਮਿੰਟ ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ਸਾਲ 3 ਮਹੀਨੇ ਇੱਕ ਦਿਨ ਕੁਝ ਸਕਿੰਟ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ਸਾਲ ਵਿੱਚ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ਮਹੀਨੇ ਪਹਿਲਾਂ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ਸਾਲ 3 ਮਹੀਨੇ ਇੱਕ ਦਿਨ ਕੁਝ ਸਕਿੰਟ ਪਹਿਲਾਂ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'ਹਫਤਾ 10 ਘੰਟੇ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ਹਫਤਾ 6 ਦਿਨ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ਹਫਤਾ 6 ਦਿਨ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ਹਫਤਾ ਅਤੇ 6 ਦਿਨ ਵਿੱਚ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ਹਫ਼ਤੇ ਇੱਕ ਘੰਟਾ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ਇੱਕ ਘੰਟਾ ਵਿੱਚ', // CarbonInterval::days(2)->forHumans() '2 ਦਿਨ', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ਇੱਕ ਦਿਨ 3 ਘੰਟੇ', ]; } ================================================ FILE: tests/Localization/PapAwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PapAwTest extends LocalizationTestCase { public const LOCALE = 'pap_AW'; // Papiamento public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'djasabra at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'djadomingo at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'djaluna at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'djawebs at 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'djarason at 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'djabierne at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'djawebs at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'djarason at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'djabierne at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'djasabra at 00.00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last djadomingo at 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last djamars at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last djaluna at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last djadomingo at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last djasabra at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last djabierne at 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last djarason at 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last djawebs at 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last djabierne at 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekònde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sekònde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekònde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sekònde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minüt 1 sekònde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 aña 3 luna 1 dia 1 sekònde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 siman 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 siman 6 dia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 siman 6 dia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 siman 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'from_now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dia', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 dia 3 ora', ]; } ================================================ FILE: tests/Localization/PapCwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PapCwTest extends LocalizationTestCase { public const LOCALE = 'pap_CW'; // Papiamento public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'djasabra at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'djadomingo at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'djaluna at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'djawebs at 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'djarason at 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'djabierne at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'djawebs at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'djarason at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'djabierne at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'djasabra at 00.00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last djadomingo at 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last djamars at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last djaluna at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last djadomingo at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last djasabra at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last djabierne at 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last djarason at 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last djawebs at 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last djabierne at 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekònde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sekònde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekònde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sekònde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minüt 1 sekònde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 aña 3 luna 1 dia 1 sekònde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 siman 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 siman 6 dia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 siman 6 dia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 siman 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'from_now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dia', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 dia 3 ora', ]; } ================================================ FILE: tests/Localization/PapTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PapTest extends LocalizationTestCase { public const LOCALE = 'pap'; // Papiamento public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'djasabra at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'djadomingo at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'djaluna at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'djawebs at 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'djarason at 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'djabierne at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'djawebs at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'djarason at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'djabierne at 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'djasabra at 00.00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last djadomingo at 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'djamars at 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last djamars at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last djaluna at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last djadomingo at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last djasabra at 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last djabierne at 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last djarason at 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last djawebs at 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last djabierne at 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekònde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sekònde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekònde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sekònde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minüt 1 sekònde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 aña 3 luna 1 dia 1 sekònde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 siman 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 siman 6 dia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 siman 6 dia', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 siman 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'from_now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dia', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 dia 3 ora', ]; } ================================================ FILE: tests/Localization/PlPlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PlPlTest extends LocalizationTestCase { public const LOCALE = 'pl_PL'; // Polish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'Jutro o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'W sobotę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'W niedzielę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'W poniedziałek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'We wtorek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'W środę o 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'W czwartek o 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'W piątek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'We wtorek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'W środę o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'W czwartek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'W piątek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'W sobotę o 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'W zeszłą niedzielę o 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'Wczoraj o 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'Dziś o 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'Dziś o 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'Jutro o 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'We wtorek o 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'Wczoraj o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'Wczoraj o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'W zeszły wtorek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'W zeszły poniedziałek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'W zeszłą niedzielę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'W zeszłą sobotę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'W zeszły piątek o 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'W zeszły czwartek o 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'W zeszłą środę o 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'W zeszły piątek o 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 przed południem CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 przed południem, 12:00 przed południem', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 przed południem, 1:30 przed południem', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 przed południem, 2:00 przed południem', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 przed południem, 6:00 przed południem', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 przed południem, 10:00 przed południem', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 po południu, 12:00 po południu', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 po południu, 5:00 po południu', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 po południu, 9:30 po południu', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 po południu, 11:00 po południu', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 sekunda temu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 sek. temu', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 sekundy temu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 sek. temu', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 minuta temu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 min temu', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 minuty temu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 min temu', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 godzina temu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 godz. temu', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 godziny temu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 godz. temu', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 dzień temu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 d temu', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 dni temu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 d temu', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 tydzień temu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 tyg. temu', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 tygodnie temu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 tyg. temu', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 miesiąc temu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 mies. temu', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 miesiące temu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 mies. temu', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 rok temu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 r temu', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 lata temu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 l temu', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'za 1 sekundę', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekunda po', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. po', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekunda przed', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. przed', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekundy', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 l 3 mies. 1 d 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'za 3 lata', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 mies. temu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 l 3 mies. 1 d 1 sek. temu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 tydzień 10 godzin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tydzień 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tydzień 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'za 1 tydzień i 6 dni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 tygodnie 1 godzina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'za godzinę', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dni', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 godz.', ]; } ================================================ FILE: tests/Localization/PlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PlTest extends LocalizationTestCase { public const LOCALE = 'pl'; // Polish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'Jutro o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'W sobotę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'W niedzielę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'W poniedziałek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'We wtorek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'W środę o 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'W czwartek o 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'W piątek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'We wtorek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'W środę o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'W czwartek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'W piątek o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'W sobotę o 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'W zeszłą niedzielę o 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'Wczoraj o 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'Dziś o 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'Dziś o 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'Jutro o 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'We wtorek o 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'Wczoraj o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'Wczoraj o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'W zeszły wtorek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'W zeszły poniedziałek o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'W zeszłą niedzielę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'W zeszłą sobotę o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'W zeszły piątek o 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'W zeszły czwartek o 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'W zeszłą środę o 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'W zeszły piątek o 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 przed południem CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 przed południem, 12:00 przed południem', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 przed południem, 1:30 przed południem', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 przed południem, 2:00 przed południem', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 przed południem, 6:00 przed południem', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 przed południem, 10:00 przed południem', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 po południu, 12:00 po południu', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 po południu, 5:00 po południu', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 po południu, 9:30 po południu', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 po południu, 11:00 po południu', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 sekunda temu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 sek. temu', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 sekundy temu', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 sek. temu', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 minuta temu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 min temu', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 minuty temu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 min temu', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 godzina temu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 godz. temu', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 godziny temu', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 godz. temu', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 dzień temu', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 d temu', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 dni temu', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 d temu', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 tydzień temu', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 tyg. temu', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 tygodnie temu', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 tyg. temu', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 miesiąc temu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 mies. temu', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 miesiące temu', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 mies. temu', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 rok temu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 r temu', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 lata temu', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 l temu', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'za 1 sekundę', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 sekunda po', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 sek. po', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 sekunda przed', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 sek. przed', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 sekundy', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 l 3 mies. 1 d 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'za 3 lata', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 mies. temu', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 l 3 mies. 1 d 1 sek. temu', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 tydzień 10 godzin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tydzień 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 tydzień 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'za 1 tydzień i 6 dni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 tygodnie 1 godzina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'za godzinę', // CarbonInterval::days(2)->forHumans() // '2 days', '2 dni', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 d 3 godz.', ]; } ================================================ FILE: tests/Localization/PrgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PrgTest extends LocalizationTestCase { public const LOCALE = 'prg'; // Prussian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 kitan ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 kitan ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 kitan ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 kitan ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 līkuts ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 līkuts ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 līkuts ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 līkuts ago', // Carbon::now()->subHours(1)->diffForHumans() '1 bruktēt ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 bruktēt ago', // Carbon::now()->subHours(2)->diffForHumans() '2 bruktēt ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 bruktēt ago', // Carbon::now()->subDays(1)->diffForHumans() '1 di ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 di ago', // Carbon::now()->subDays(2)->diffForHumans() '2 di ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 di ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 sawaītin ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 sawaītin ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 sawaītin ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 sawaītin ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mēniks ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mēniks ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mēniks ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mēniks ago', // Carbon::now()->subYears(1)->diffForHumans() '1 meta ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 meta ago', // Carbon::now()->subYears(2)->diffForHumans() '2 meta ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 meta ago', // Carbon::now()->addSecond()->diffForHumans() '1 kitan from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 kitan from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 kitan after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 kitan after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 kitan before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 kitan before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 kitan', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 kitan', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 kitan', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 kitan', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 kitan from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 līkuts 1 kitan', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 meta 3 mēniks 1 di 1 kitan', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 meta from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mēniks ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 meta 3 mēniks 1 di 1 kitan ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 sawaītin 10 bruktēt', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sawaītin 6 di', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 sawaītin 6 di', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 sawaītin and 6 di from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 sawaītin 1 bruktēt', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 bruktēt from now', // CarbonInterval::days(2)->forHumans() '2 di', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 di 3 bruktēt', ]; } ================================================ FILE: tests/Localization/PsAfTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PsAfTest extends LocalizationTestCase { public const LOCALE = 'ps_AF'; // Pashto public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'خالي at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اتوار at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ګل at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'نهه at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'شورو at 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'زيارت at 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمعه at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'نهه at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'شورو at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'زيارت at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعه at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'خالي at 0:00', // Carbon::now()->subDays(2)->calendar() 'Last اتوار at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'نهه at 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last نهه at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ګل at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last اتوار at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last خالي at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last جمعه at 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last زيارت at 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last شورو at 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last جمعه at 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 غ.م. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 غ.م., 12:00 غ.م.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 غ.م., 1:30 غ.م.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 غ.م., 2:00 غ.م.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 غ.م., 6:00 غ.م.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 غ.م., 10:00 غ.م.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 غ.و., 12:00 غ.و.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 غ.و., 5:00 غ.و.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 غ.و., 9:30 غ.و.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 غ.و., 11:00 غ.و.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ثانيه دمخه', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1ثانيه دمخه', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ثانيې دمخه', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2ثانيې دمخه', // Carbon::now()->subMinutes(1)->diffForHumans() '1 دقيقه دمخه', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1دقيقه دمخه', // Carbon::now()->subMinutes(2)->diffForHumans() '2 دقيقې دمخه', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2دقيقې دمخه', // Carbon::now()->subHours(1)->diffForHumans() '1 ساعت دمخه', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1ساعت دمخه', // Carbon::now()->subHours(2)->diffForHumans() '2 ساعته دمخه', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2ساعته دمخه', // Carbon::now()->subDays(1)->diffForHumans() '1 ورځ دمخه', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1ورځ دمخه', // Carbon::now()->subDays(2)->diffForHumans() '2 ورځي دمخه', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2ورځي دمخه', // Carbon::now()->subWeeks(1)->diffForHumans() '1 اونۍ دمخه', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1اونۍ دمخه', // Carbon::now()->subWeeks(2)->diffForHumans() '2 اونۍ دمخه', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2اونۍ دمخه', // Carbon::now()->subMonths(1)->diffForHumans() '1 مياشت دمخه', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1مياشت دمخه', // Carbon::now()->subMonths(2)->diffForHumans() '2 مياشتي دمخه', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2مياشتي دمخه', // Carbon::now()->subYears(1)->diffForHumans() '1 کال دمخه', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1کال دمخه', // Carbon::now()->subYears(2)->diffForHumans() '2 کاله دمخه', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2کاله دمخه', // Carbon::now()->addSecond()->diffForHumans() '1 ثانيه له اوس څخه', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1ثانيه له اوس څخه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ثانيه وروسته', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1ثانيه وروسته', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ثانيه دمخه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1ثانيه دمخه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ثانيه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1ثانيه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ثانيې', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2ثانيې', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1ثانيه له اوس څخه', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 دقيقه 1 ثانيه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2کاله 3مياشتي 1ورځ 1ثانيه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 کاله له اوس څخه', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5مياشتي دمخه', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2کاله 3مياشتي 1ورځ 1ثانيه دمخه', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 اونۍ 10 ساعته', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 اونۍ 6 ورځي', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 اونۍ 6 ورځي', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 اونۍ او 6 ورځي له اوس څخه', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 اونۍ 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ساعت له اوس څخه', // CarbonInterval::days(2)->forHumans() '2 ورځي', // CarbonInterval::create('P1DT3H')->forHumans(true) '1ورځ 3ساعته', ]; } ================================================ FILE: tests/Localization/PsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PsTest extends LocalizationTestCase { public const LOCALE = 'ps'; // Pashto public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'خالي at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اتوار at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ګل at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'نهه at 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'شورو at 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'زيارت at 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمعه at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'نهه at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'شورو at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'زيارت at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعه at 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'خالي at 0:00', // Carbon::now()->subDays(2)->calendar() 'Last اتوار at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'نهه at 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last نهه at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ګل at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last اتوار at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last خالي at 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last جمعه at 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last زيارت at 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last شورو at 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last جمعه at 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 غ.م. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 غ.م., 12:00 غ.م.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 غ.م., 1:30 غ.م.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 غ.م., 2:00 غ.م.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 غ.م., 6:00 غ.م.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 غ.م., 10:00 غ.م.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 غ.و., 12:00 غ.و.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 غ.و., 5:00 غ.و.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 غ.و., 9:30 غ.و.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 غ.و., 11:00 غ.و.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ثانيه دمخه', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1ثانيه دمخه', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ثانيې دمخه', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2ثانيې دمخه', // Carbon::now()->subMinutes(1)->diffForHumans() '1 دقيقه دمخه', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1دقيقه دمخه', // Carbon::now()->subMinutes(2)->diffForHumans() '2 دقيقې دمخه', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2دقيقې دمخه', // Carbon::now()->subHours(1)->diffForHumans() '1 ساعت دمخه', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1ساعت دمخه', // Carbon::now()->subHours(2)->diffForHumans() '2 ساعته دمخه', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2ساعته دمخه', // Carbon::now()->subDays(1)->diffForHumans() '1 ورځ دمخه', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1ورځ دمخه', // Carbon::now()->subDays(2)->diffForHumans() '2 ورځي دمخه', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2ورځي دمخه', // Carbon::now()->subWeeks(1)->diffForHumans() '1 اونۍ دمخه', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1اونۍ دمخه', // Carbon::now()->subWeeks(2)->diffForHumans() '2 اونۍ دمخه', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2اونۍ دمخه', // Carbon::now()->subMonths(1)->diffForHumans() '1 مياشت دمخه', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1مياشت دمخه', // Carbon::now()->subMonths(2)->diffForHumans() '2 مياشتي دمخه', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2مياشتي دمخه', // Carbon::now()->subYears(1)->diffForHumans() '1 کال دمخه', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1کال دمخه', // Carbon::now()->subYears(2)->diffForHumans() '2 کاله دمخه', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2کاله دمخه', // Carbon::now()->addSecond()->diffForHumans() '1 ثانيه له اوس څخه', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1ثانيه له اوس څخه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ثانيه وروسته', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1ثانيه وروسته', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ثانيه دمخه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1ثانيه دمخه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ثانيه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1ثانيه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ثانيې', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2ثانيې', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1ثانيه له اوس څخه', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 دقيقه 1 ثانيه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2کاله 3مياشتي 1ورځ 1ثانيه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 کاله له اوس څخه', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5مياشتي دمخه', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2کاله 3مياشتي 1ورځ 1ثانيه دمخه', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 اونۍ 10 ساعته', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 اونۍ 6 ورځي', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 اونۍ 6 ورځي', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 اونۍ او 6 ورځي له اوس څخه', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 اونۍ 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ساعت له اوس څخه', // CarbonInterval::days(2)->forHumans() '2 ورځي', // CarbonInterval::create('P1DT3H')->forHumans(true) '1ورځ 3ساعته', ]; } ================================================ FILE: tests/Localization/PtAoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtAoTest extends LocalizationTestCase { public const LOCALE = 'pt_AO'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtBrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtBrTest extends LocalizationTestCase { public const LOCALE = 'pt_BR'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtChTest extends LocalizationTestCase { public const LOCALE = 'pt_CH'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtCvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtCvTest extends LocalizationTestCase { public const LOCALE = 'pt_CV'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtGqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtGqTest extends LocalizationTestCase { public const LOCALE = 'pt_GQ'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtGwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtGwTest extends LocalizationTestCase { public const LOCALE = 'pt_GW'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtLuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtLuTest extends LocalizationTestCase { public const LOCALE = 'pt_LU'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtMoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtMoTest extends LocalizationTestCase { public const LOCALE = 'pt_MO'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtMzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtMzTest extends LocalizationTestCase { public const LOCALE = 'pt_MZ'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtPtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtPtTest extends LocalizationTestCase { public const LOCALE = 'pt_PT'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtStTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtStTest extends LocalizationTestCase { public const LOCALE = 'pt_ST'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtTest extends LocalizationTestCase { public const LOCALE = 'pt'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/PtTlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class PtTlTest extends LocalizationTestCase { public const LOCALE = 'pt_TL'; // Portuguese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Amanhã às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'quinta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sexta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado às 00:00', // Carbon::now()->subDays(2)->calendar() 'Último domingo às 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hoje às 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hoje às 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Amanhã às 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'terça-feira às 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ontem às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última terça-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última segunda-feira às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último domingo às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Último sábado às 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Última quinta-feira às 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Última quarta-feira às 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Última sexta-feira às 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'há 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'há 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'há 2 segundos', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'há 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'há 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'há 1min', // Carbon::now()->subMinutes(2)->diffForHumans() 'há 2 minutos', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'há 2min', // Carbon::now()->subHours(1)->diffForHumans() 'há 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'há 1h', // Carbon::now()->subHours(2)->diffForHumans() 'há 2 horas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'há 2h', // Carbon::now()->subDays(1)->diffForHumans() 'há 1 dia', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'há 1d', // Carbon::now()->subDays(2)->diffForHumans() 'há 2 dias', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'há 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'há 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'há 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'há 2 semanas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'há 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'há 1 mês', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'há 1m', // Carbon::now()->subMonths(2)->diffForHumans() 'há 2 meses', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'há 2m', // Carbon::now()->subYears(1)->diffForHumans() 'há 1 ano', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'há 1a', // Carbon::now()->subYears(2)->diffForHumans() 'há 2 anos', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'há 2a', // Carbon::now()->addSecond()->diffForHumans() 'em 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'em 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo depois', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s depois', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundos', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'em 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2a 3m 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'em 3 anos', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'há 5m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'há 2a 3m 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 horas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 dias', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'em 1 semana e 6 dias', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semanas 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'em uma hora', // CarbonInterval::days(2)->forHumans() '2 dias', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/QuBoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class QuBoTest extends LocalizationTestCase { public const LOCALE = 'qu_BO'; // Quechua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 00:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minuto', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 hora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 día', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semana', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 mes', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 mes', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 año', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 año', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 año 3 mes 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 año', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 mes', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 año 3 mes 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 día', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/QuEcTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class QuEcTest extends LocalizationTestCase { public const LOCALE = 'qu_EC'; // Quechua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 00:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minuto', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 hora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 día', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semana', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 mes', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 mes', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 año', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 año', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 año 3 mes 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 año', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 mes', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 año 3 mes 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 día', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/QuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class QuTest extends LocalizationTestCase { public const LOCALE = 'qu'; // Quechua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mañana a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sábado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'domingo a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunes a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miércoles a las 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'jueves a las 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'viernes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miércoles a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'jueves a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'viernes a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sábado a las 00:00', // Carbon::now()->subDays(2)->calendar() 'el domingo pasado a las 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'hoy a las 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'hoy a las 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mañana a las 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martes a las 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ayer a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ayer a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el martes pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el lunes pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el domingo pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el sábado pasado a las 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'el viernes pasado a las 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'el jueves pasado a las 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'el miércoles pasado a las 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'el viernes pasado a las 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 2º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a. m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a. m., 12:00 a. m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a. m., 1:30 a. m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a. m., 2:00 a. m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a. m., 6:00 a. m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a. m., 10:00 a. m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p. m., 12:00 p. m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p. m., 5:00 p. m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p. m., 9:30 p. m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p. m., 11:00 p. m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'hace 1 segundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'hace 1s', // Carbon::now()->subSeconds(2)->diffForHumans() 'hace 2 segundo', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'hace 2s', // Carbon::now()->subMinutes(1)->diffForHumans() 'hace 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'hace 1m', // Carbon::now()->subMinutes(2)->diffForHumans() 'hace 2 minuto', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'hace 2m', // Carbon::now()->subHours(1)->diffForHumans() 'hace 1 hora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'hace 1h', // Carbon::now()->subHours(2)->diffForHumans() 'hace 2 hora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'hace 2h', // Carbon::now()->subDays(1)->diffForHumans() 'hace 1 día', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'hace 1d', // Carbon::now()->subDays(2)->diffForHumans() 'hace 2 día', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'hace 2d', // Carbon::now()->subWeeks(1)->diffForHumans() 'hace 1 semana', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'hace 1sem', // Carbon::now()->subWeeks(2)->diffForHumans() 'hace 2 semana', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'hace 2sem', // Carbon::now()->subMonths(1)->diffForHumans() 'hace 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'hace 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'hace 2 mes', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'hace 2 mes', // Carbon::now()->subYears(1)->diffForHumans() 'hace 1 año', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'hace 1 año', // Carbon::now()->subYears(2)->diffForHumans() 'hace 2 año', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'hace 2 año', // Carbon::now()->addSecond()->diffForHumans() 'en 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'en 1s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 segundo después', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s después', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 segundo antes', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s antes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'en 1s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 año 3 mes 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'en 3 año', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'hace 5 mes', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'hace 2 año 3 mes 1d 1s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 semana 10 hora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 semana 6 día', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'en 1 semana y 6 día', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 semana 1 hora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'en una hora', // CarbonInterval::days(2)->forHumans() '2 día', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/QuzPeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class QuzPeTest extends LocalizationTestCase { public const LOCALE = 'quz_PE'; // Cusco Quechua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sawatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tuminku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miyirkulis at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'juywis at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiyirnis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miyirkulis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'juywis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiyirnis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sawatu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last tuminku at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martis at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tuminku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sawatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wiyirnis at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last juywis at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last miyirkulis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last wiyirnis at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 iskay ñiqin ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 iskay ñiqin ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 iskay ñiqin ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 iskay ñiqin ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 uchuy ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 uchuy ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 uchuy ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 uchuy ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ura ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ura ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ura ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ura ago', // Carbon::now()->subDays(1)->diffForHumans() '1 pʼunchaw ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 pʼunchaw ago', // Carbon::now()->subDays(2)->diffForHumans() '2 pʼunchaw ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 pʼunchaw ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 simana ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 simana ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 simana ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 simana ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 killa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 killa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 killa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 killa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 wata ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 wata ago', // Carbon::now()->subYears(2)->diffForHumans() '2 wata ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 wata ago', // Carbon::now()->addSecond()->diffForHumans() '1 iskay ñiqin from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 iskay ñiqin from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 iskay ñiqin after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 iskay ñiqin after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 iskay ñiqin before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 iskay ñiqin before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 iskay ñiqin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 iskay ñiqin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 iskay ñiqin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 iskay ñiqin', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 iskay ñiqin from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 uchuy 1 iskay ñiqin', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 wata 3 killa 1 pʼunchaw 1 iskay ñiqin', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 wata from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 killa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 wata 3 killa 1 pʼunchaw 1 iskay ñiqin ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 simana 10 ura', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 simana 6 pʼunchaw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 simana 6 pʼunchaw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 simana and 6 pʼunchaw from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 simana 1 ura', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ura from now', // CarbonInterval::days(2)->forHumans() '2 pʼunchaw', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 pʼunchaw 3 ura', ]; } ================================================ FILE: tests/Localization/QuzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class QuzTest extends LocalizationTestCase { public const LOCALE = 'quz'; // Cusco Quechua public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sawatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tuminku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miyirkulis at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'juywis at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiyirnis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miyirkulis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'juywis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiyirnis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sawatu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last tuminku at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'martis at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tuminku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sawatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wiyirnis at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last juywis at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last miyirkulis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last wiyirnis at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 iskay ñiqin ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 iskay ñiqin ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 iskay ñiqin ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 iskay ñiqin ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 uchuy ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 uchuy ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 uchuy ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 uchuy ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ura ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ura ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ura ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ura ago', // Carbon::now()->subDays(1)->diffForHumans() '1 pʼunchaw ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 pʼunchaw ago', // Carbon::now()->subDays(2)->diffForHumans() '2 pʼunchaw ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 pʼunchaw ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 simana ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 simana ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 simana ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 simana ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 killa ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 killa ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 killa ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 killa ago', // Carbon::now()->subYears(1)->diffForHumans() '1 wata ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 wata ago', // Carbon::now()->subYears(2)->diffForHumans() '2 wata ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 wata ago', // Carbon::now()->addSecond()->diffForHumans() '1 iskay ñiqin from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 iskay ñiqin from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 iskay ñiqin after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 iskay ñiqin after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 iskay ñiqin before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 iskay ñiqin before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 iskay ñiqin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 iskay ñiqin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 iskay ñiqin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 iskay ñiqin', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 iskay ñiqin from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 uchuy 1 iskay ñiqin', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 wata 3 killa 1 pʼunchaw 1 iskay ñiqin', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 wata from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 killa ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 wata 3 killa 1 pʼunchaw 1 iskay ñiqin ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 simana 10 ura', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 simana 6 pʼunchaw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 simana 6 pʼunchaw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 simana and 6 pʼunchaw from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 simana 1 ura', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ura from now', // CarbonInterval::days(2)->forHumans() '2 pʼunchaw', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 pʼunchaw 3 ura', ]; } ================================================ FILE: tests/Localization/RajInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RajInTest extends LocalizationTestCase { public const LOCALE = 'raj_IN'; // Rajasthani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 दुनियांण ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 दुनियांण ago', // Carbon::now()->subHours(2)->diffForHumans() '2 दुनियांण ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 दुनियांण ago', // Carbon::now()->subDays(1)->diffForHumans() '1 अेक ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 अेक ago', // Carbon::now()->subDays(2)->diffForHumans() '2 अेक ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 अेक ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 निवाज ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 निवाज ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 निवाज ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 निवाज ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 सूरज ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 सूरज ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 सूरज ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 सूरज ago', // Carbon::now()->subYears(1)->diffForHumans() '1 आंहू ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 आंहू ago', // Carbon::now()->subYears(2)->diffForHumans() '2 आंहू ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 आंहू ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 आंहू 3 सूरज 1 अेक 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 आंहू from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 सूरज ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 आंहू 3 सूरज 1 अेक 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 निवाज 10 दुनियांण', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 निवाज 6 अेक', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 निवाज 6 अेक', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 निवाज and 6 अेक from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 निवाज 1 दुनियांण', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 दुनियांण from now', // CarbonInterval::days(2)->forHumans() '2 अेक', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 अेक 3 दुनियांण', ]; } ================================================ FILE: tests/Localization/RajTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RajTest extends LocalizationTestCase { public const LOCALE = 'raj'; // Rajasthani public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगल्लवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतिवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 दुनियांण ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 दुनियांण ago', // Carbon::now()->subHours(2)->diffForHumans() '2 दुनियांण ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 दुनियांण ago', // Carbon::now()->subDays(1)->diffForHumans() '1 अेक ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 अेक ago', // Carbon::now()->subDays(2)->diffForHumans() '2 अेक ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 अेक ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 निवाज ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 निवाज ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 निवाज ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 निवाज ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 सूरज ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 सूरज ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 सूरज ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 सूरज ago', // Carbon::now()->subYears(1)->diffForHumans() '1 आंहू ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 आंहू ago', // Carbon::now()->subYears(2)->diffForHumans() '2 आंहू ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 आंहू ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 आंहू 3 सूरज 1 अेक 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 आंहू from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 सूरज ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 आंहू 3 सूरज 1 अेक 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 निवाज 10 दुनियांण', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 निवाज 6 अेक', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 निवाज 6 अेक', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 निवाज and 6 अेक from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 निवाज 1 दुनियांण', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 दुनियांण from now', // CarbonInterval::days(2)->forHumans() '2 अेक', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 अेक 3 दुनियांण', ]; } ================================================ FILE: tests/Localization/RmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RmTest extends LocalizationTestCase { public const LOCALE = 'rm'; // Romansh public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sonda at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dumengia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'glindesdi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mardi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mesemna at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'gievgia at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'venderdi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mesemna at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gievgia at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'venderdi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sonda at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dumengia at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mardi at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mardi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last glindesdi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dumengia at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sonda at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last venderdi at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last gievgia at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mesemna at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last venderdi at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 avantmezdi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 avantmezdi, 12:00 avantmezdi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 avantmezdi, 1:30 avantmezdi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 avantmezdi, 2:00 avantmezdi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 avantmezdi, 6:00 avantmezdi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 avantmezdi, 10:00 avantmezdi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 suentermezdi, 12:00 suentermezdi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 suentermezdi, 5:00 suentermezdi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 suentermezdi, 9:30 suentermezdi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 suentermezdi, 11:00 suentermezdi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secunda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secunda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuta ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 oura ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 oura ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 di ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 di ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 emna ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 emna ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mais ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mais ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 onn ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 onn ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 secunda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secunda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secunda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 secunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 onn from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 emna 10 oura', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 emna 6 di', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 emna 6 di', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 emna e 6 di from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 emna 1 oura', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 di', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/RnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RnTest extends LocalizationTestCase { public const LOCALE = 'rn'; // Kirundi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku wa gatandatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku w’indwi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku wa mbere at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku wa kabiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku wa gatatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ku wa kane at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ku wa gatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ku wa kabiri at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ku wa gatatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ku wa kane at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ku wa gatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ku wa gatandatu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Ku w’indwi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ku wa kabiri at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku wa kabiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku wa mbere at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku w’indwi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku wa gatandatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku wa gatanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Ku wa kane at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ku wa gatatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ku wa gatanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 z.mu. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Z.MU., 12:00 z.mu.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Z.MU., 1:30 z.mu.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Z.MU., 2:00 z.mu.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Z.MU., 6:00 z.mu.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Z.MU., 10:00 z.mu.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Z.MW., 12:00 z.mw.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Z.MW., 5:00 z.mw.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Z.MW., 9:30 z.mw.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Z.MW., 11:00 z.mw.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'inguvu 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'inguvu 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'inguvu 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'inguvu 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'iminuta 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'iminuta 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'iminuta 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'iminuta 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'amasaha 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'amasaha 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'amasaha 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'amasaha 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'imisi 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'imisi 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'imisi 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'imisi 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'indwi 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'indwi 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'indwi 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'indwi 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'amezi 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'amezi 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'amezi 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'amezi 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'imyaka 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'imyaka 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'imyaka 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'imyaka 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'inguvu 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'inguvu 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'inguvu 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'inguvu 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'inguvu 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'inguvu 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'inguvu 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'inguvu 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'inguvu 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'inguvu 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'inguvu 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'iminuta 1 inguvu 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'imyaka 2 amezi 3 imisi 1 inguvu 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'imyaka 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'amezi 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'imyaka 2 amezi 3 imisi 1 inguvu 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'indwi 1 amasaha 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'indwi 1 imisi 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'indwi 1 imisi 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'indwi 1 and imisi 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'indwi 2 amasaha 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'amasaha 1 from now', // CarbonInterval::days(2)->forHumans() 'imisi 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'imisi 1 amasaha 3', ]; } ================================================ FILE: tests/Localization/RoMdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RoMdTest extends LocalizationTestCase { public const LOCALE = 'ro_MD'; // Romanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mâine la 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sâmbătă la 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'duminică la 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luni la 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'marți la 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miercuri la 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'joi la 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vineri la 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miercuri la 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'joi la 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vineri la 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sâmbătă la 00:00', // Carbon::now()->subDays(2)->calendar() 'fosta duminică la 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'azi la 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'azi la 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mâine la 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ieri la 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta marți la 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta luni la 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta duminică la 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta sâmbătă la 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta vineri la 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'fosta joi la 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'fosta miercuri la 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fosta vineri la 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secundă în urmă', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. în urmă', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secunde în urmă', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. în urmă', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut în urmă', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 m. în urmă', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minute în urmă', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 m. în urmă', // Carbon::now()->subHours(1)->diffForHumans() '1 oră în urmă', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. în urmă', // Carbon::now()->subHours(2)->diffForHumans() '2 ore în urmă', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. în urmă', // Carbon::now()->subDays(1)->diffForHumans() '1 zi în urmă', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 z. în urmă', // Carbon::now()->subDays(2)->diffForHumans() '2 zile în urmă', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 z. în urmă', // Carbon::now()->subWeeks(1)->diffForHumans() '1 săptămână în urmă', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 săp. în urmă', // Carbon::now()->subWeeks(2)->diffForHumans() '2 săptămâni în urmă', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 săp. în urmă', // Carbon::now()->subMonths(1)->diffForHumans() '1 lună în urmă', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 l. în urmă', // Carbon::now()->subMonths(2)->diffForHumans() '2 luni în urmă', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 l. în urmă', // Carbon::now()->subYears(1)->diffForHumans() '1 an în urmă', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 a. în urmă', // Carbon::now()->subYears(2)->diffForHumans() '2 ani în urmă', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 a. în urmă', // Carbon::now()->addSecond()->diffForHumans() 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'peste 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'peste 1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'acum 1 secundă', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'acum 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'peste 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 secundă', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a. 3 l. 1 z. 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'peste 3 ani', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 l. în urmă', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 a. 3 l. 1 z. 1 sec. în urmă', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 săptămână 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zile', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zile', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'peste 1 săptămână și 6 zile', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 săptămâni 1 oră', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'peste o oră', // CarbonInterval::days(2)->forHumans() '2 zile', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 z. 3 o.', ]; } ================================================ FILE: tests/Localization/RoRoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RoRoTest extends LocalizationTestCase { public const LOCALE = 'ro_RO'; // Romanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mâine la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sâmbătă la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'duminică la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luni la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miercuri la 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'joi la 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vineri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miercuri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'joi la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vineri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sâmbătă la 0:00', // Carbon::now()->subDays(2)->calendar() 'fosta duminică la 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'azi la 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'azi la 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mâine la 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ieri la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta marți la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta luni la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta duminică la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta sâmbătă la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta vineri la 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'fosta joi la 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'fosta miercuri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fosta vineri la 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secundă în urmă', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. în urmă', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secunde în urmă', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. în urmă', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut în urmă', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 m. în urmă', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minute în urmă', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 m. în urmă', // Carbon::now()->subHours(1)->diffForHumans() '1 oră în urmă', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. în urmă', // Carbon::now()->subHours(2)->diffForHumans() '2 ore în urmă', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. în urmă', // Carbon::now()->subDays(1)->diffForHumans() '1 zi în urmă', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 z. în urmă', // Carbon::now()->subDays(2)->diffForHumans() '2 zile în urmă', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 z. în urmă', // Carbon::now()->subWeeks(1)->diffForHumans() '1 săptămână în urmă', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 săp. în urmă', // Carbon::now()->subWeeks(2)->diffForHumans() '2 săptămâni în urmă', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 săp. în urmă', // Carbon::now()->subMonths(1)->diffForHumans() '1 lună în urmă', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 l. în urmă', // Carbon::now()->subMonths(2)->diffForHumans() '2 luni în urmă', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 l. în urmă', // Carbon::now()->subYears(1)->diffForHumans() '1 an în urmă', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 a. în urmă', // Carbon::now()->subYears(2)->diffForHumans() '2 ani în urmă', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 a. în urmă', // Carbon::now()->addSecond()->diffForHumans() 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'peste 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'peste 1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'acum 1 secundă', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'acum 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'peste 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 secundă', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a. 3 l. 1 z. 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'peste 3 ani', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 l. în urmă', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 a. 3 l. 1 z. 1 sec. în urmă', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 săptămână 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zile', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zile', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'peste 1 săptămână și 6 zile', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 săptămâni 1 oră', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'peste o oră', // CarbonInterval::days(2)->forHumans() '2 zile', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 z. 3 o.', ]; } ================================================ FILE: tests/Localization/RoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RoTest extends LocalizationTestCase { public const LOCALE = 'ro'; // Romanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mâine la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sâmbătă la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'duminică la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'luni la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'miercuri la 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'joi la 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vineri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'miercuri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'joi la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vineri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sâmbătă la 0:00', // Carbon::now()->subDays(2)->calendar() 'fosta duminică la 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'azi la 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'azi la 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'mâine la 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'marți la 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ieri la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieri la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta marți la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta luni la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta duminică la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta sâmbătă la 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'fosta vineri la 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'fosta joi la 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'fosta miercuri la 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'fosta vineri la 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a.m. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a.m., 12:00 a.m.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a.m., 1:30 a.m.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a.m., 2:00 a.m.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a.m., 6:00 a.m.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a.m., 10:00 a.m.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p.m., 12:00 p.m.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p.m., 5:00 p.m.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p.m., 9:30 p.m.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p.m., 11:00 p.m.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secundă în urmă', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sec. în urmă', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secunde în urmă', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sec. în urmă', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut în urmă', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 m. în urmă', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minute în urmă', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 m. în urmă', // Carbon::now()->subHours(1)->diffForHumans() '1 oră în urmă', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. în urmă', // Carbon::now()->subHours(2)->diffForHumans() '2 ore în urmă', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. în urmă', // Carbon::now()->subDays(1)->diffForHumans() '1 zi în urmă', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 z. în urmă', // Carbon::now()->subDays(2)->diffForHumans() '2 zile în urmă', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 z. în urmă', // Carbon::now()->subWeeks(1)->diffForHumans() '1 săptămână în urmă', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 săp. în urmă', // Carbon::now()->subWeeks(2)->diffForHumans() '2 săptămâni în urmă', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 săp. în urmă', // Carbon::now()->subMonths(1)->diffForHumans() '1 lună în urmă', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 l. în urmă', // Carbon::now()->subMonths(2)->diffForHumans() '2 luni în urmă', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 l. în urmă', // Carbon::now()->subYears(1)->diffForHumans() '1 an în urmă', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 a. în urmă', // Carbon::now()->subYears(2)->diffForHumans() '2 ani în urmă', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 a. în urmă', // Carbon::now()->addSecond()->diffForHumans() 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'peste 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'peste 1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'peste 1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'acum 1 secundă', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'acum 1 sec.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secundă', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sec.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sec.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'peste 1 sec.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 secundă', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 a. 3 l. 1 z. 1 sec.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'peste 3 ani', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 l. în urmă', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 a. 3 l. 1 z. 1 sec. în urmă', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 săptămână 10 ore', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zile', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 săptămână 6 zile', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'peste 1 săptămână și 6 zile', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 săptămâni 1 oră', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'peste o oră', // CarbonInterval::days(2)->forHumans() '2 zile', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 z. 3 o.', ]; } ================================================ FILE: tests/Localization/RofTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RofTest extends LocalizationTestCase { public const LOCALE = 'rof'; // Rombo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ijumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ijumapili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ijumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ijumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ijumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Ijumapili at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumapili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ijumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 kang’ama CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kang’ama, 12:00 kang’ama', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 kang’ama, 1:30 kang’ama', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 kang’ama, 2:00 kang’ama', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 kang’ama, 6:00 kang’ama', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 kang’ama, 10:00 kang’ama', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kingoto, 12:00 kingoto', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kingoto, 5:00 kingoto', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kingoto, 9:30 kingoto', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kingoto, 11:00 kingoto', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/RuByTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuByTest extends LocalizationTestCase { public const LOCALE = 'ru_BY'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субботу, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятницу, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятницу, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RuKgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuKgTest extends LocalizationTestCase { public const LOCALE = 'ru_KG'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субботу, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятницу, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятницу, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RuKzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuKzTest extends LocalizationTestCase { public const LOCALE = 'ru_KZ'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субботу, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятницу, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятницу, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RuMdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuMdTest extends LocalizationTestCase { public const LOCALE = 'ru_MD'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субботу, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятницу, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятницу, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RuRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuRuTest extends LocalizationTestCase { public const LOCALE = 'ru_RU'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субботу, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятницу, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятницу, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuTest extends LocalizationTestCase { public const LOCALE = 'ru'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятницу, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субботу, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субботу, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятницу, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среду, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятницу, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RuUaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RuUaTest extends LocalizationTestCase { public const LOCALE = 'ru_UA'; // Russian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В суббота, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую среда, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую пятница, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую среда, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую пятница, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую суббота, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую суббота, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую пятница, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую среда, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В пятница, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунды назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуты назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 часа назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 дня назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 недели назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяца назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 года назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунды', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 года', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 часов', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 дней', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 дней', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 недели 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 дня', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/RwRwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RwRwTest extends LocalizationTestCase { public const LOCALE = 'rw_RW'; // Kinyarwanda public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa gatandatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku cyumweru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa mbere at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa gatatu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kuwa kane at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa gatatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa kane at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa gatandatu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Ku cyumweru at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa mbere at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku cyumweru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa gatandatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kuwa kane at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Kuwa gatatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 vuna ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 vuna ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 vuna ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 vuna ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 -nzinya ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 -nzinya ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 -nzinya ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 -nzinya ago', // Carbon::now()->subHours(1)->diffForHumans() 'saha 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saha 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saha 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saha 2 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 nsi ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 nsi ago', // Carbon::now()->subDays(2)->diffForHumans() '2 nsi ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 nsi ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 icyumweru ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 icyumweru ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 icyumweru ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 icyumweru ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ezi 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ezi 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ezi 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ezi 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'aka 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'aka 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'aka 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'aka 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 vuna from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 vuna from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 vuna after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 vuna after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 vuna before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 vuna before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 vuna', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 vuna', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 vuna', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 vuna', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 vuna from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 -nzinya 1 vuna', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'aka 2 ezi 3 1 nsi 1 vuna', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'aka 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ezi 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'aka 2 ezi 3 1 nsi 1 vuna ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 icyumweru saha 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 icyumweru 6 nsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 icyumweru 6 nsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 icyumweru and 6 nsi from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 icyumweru saha 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saha 1 from now', // CarbonInterval::days(2)->forHumans() '2 nsi', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 nsi saha 3', ]; } ================================================ FILE: tests/Localization/RwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RwTest extends LocalizationTestCase { public const LOCALE = 'rw'; // Kinyarwanda public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa gatandatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ku cyumweru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa mbere at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuwa gatatu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kuwa kane at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa gatatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa kane at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa gatandatu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Ku cyumweru at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa kabiri at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa mbere at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ku cyumweru at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa gatandatu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Kuwa kane at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Kuwa gatatu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Kuwa gatanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 vuna ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 vuna ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 vuna ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 vuna ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 -nzinya ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 -nzinya ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 -nzinya ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 -nzinya ago', // Carbon::now()->subHours(1)->diffForHumans() 'saha 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'saha 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'saha 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'saha 2 ago', // Carbon::now()->subDays(1)->diffForHumans() '1 nsi ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 nsi ago', // Carbon::now()->subDays(2)->diffForHumans() '2 nsi ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 nsi ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 icyumweru ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 icyumweru ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 icyumweru ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 icyumweru ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ezi 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ezi 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ezi 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ezi 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'aka 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'aka 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'aka 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'aka 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 vuna from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 vuna from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 vuna after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 vuna after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 vuna before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 vuna before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 vuna', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 vuna', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 vuna', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 vuna', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 vuna from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 -nzinya 1 vuna', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'aka 2 ezi 3 1 nsi 1 vuna', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'aka 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ezi 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'aka 2 ezi 3 1 nsi 1 vuna ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 icyumweru saha 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 icyumweru 6 nsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 icyumweru 6 nsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 icyumweru and 6 nsi from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 icyumweru saha 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saha 1 from now', // CarbonInterval::days(2)->forHumans() '2 nsi', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 nsi saha 3', ]; } ================================================ FILE: tests/Localization/RwkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class RwkTest extends LocalizationTestCase { public const LOCALE = 'rwk'; // Rwa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapilyi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatanu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapilyi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapilyi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 utuko CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 utuko, 12:00 utuko', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 utuko, 1:30 utuko', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 utuko, 2:00 utuko', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 utuko, 6:00 utuko', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 utuko, 10:00 utuko', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kyiukonyi, 12:00 kyiukonyi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kyiukonyi, 5:00 kyiukonyi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kyiukonyi, 9:30 kyiukonyi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kyiukonyi, 11:00 kyiukonyi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/SaInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SaInTest extends LocalizationTestCase { public const LOCALE = 'sa_IN'; // Sanskrit public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतिवासरः at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतिवासरः at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवासर: at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवासर: at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतिवासरः at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 द्वितीयः ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 द्वितीयः ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 द्वितीयः ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 द्वितीयः ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 होरा ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 होरा ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 होरा ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 होरा ago', // Carbon::now()->subHours(1)->diffForHumans() '1 घण्टा ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिन ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 सप्ताहः saptahaĥ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 सप्ताहः saptahaĥ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 सप्ताहः saptahaĥ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 सप्ताहः saptahaĥ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 मास ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 मास ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 मास ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 मास ago', // Carbon::now()->subYears(1)->diffForHumans() '1 वर्ष ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष ago', // Carbon::now()->subYears(2)->diffForHumans() '2 वर्ष ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्ष ago', // Carbon::now()->addSecond()->diffForHumans() '1 द्वितीयः from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 द्वितीयः from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 द्वितीयः after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 द्वितीयः after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 द्वितीयः before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 द्वितीयः before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 द्वितीयः', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 द्वितीयः', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 द्वितीयः', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 द्वितीयः', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 द्वितीयः from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 होरा 1 द्वितीयः', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 मास 1 दिन 1 द्वितीयः', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वर्ष from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 मास ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 मास 1 दिन 1 द्वितीयः ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 सप्ताहः saptahaĥ 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताहः saptahaĥ 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताहः saptahaĥ 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 सप्ताहः saptahaĥ and 6 दिन from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 सप्ताहः saptahaĥ 1 घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 घण्टा from now', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/SaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SaTest extends LocalizationTestCase { public const LOCALE = 'sa'; // Sanskrit public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'रविवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बृहस्पतिवासरः at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बृहस्पतिवासरः at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिवासर: at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last रविवासर: at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last रविवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बृहस्पतिवासरः at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधवासर: at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रवासर at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 द्वितीयः ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 द्वितीयः ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 द्वितीयः ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 द्वितीयः ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 होरा ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 होरा ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 होरा ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 होरा ago', // Carbon::now()->subHours(1)->diffForHumans() '1 घण्टा ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans() '2 घण्टा ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 घण्टा ago', // Carbon::now()->subDays(1)->diffForHumans() '1 दिन ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 दिन ago', // Carbon::now()->subDays(2)->diffForHumans() '2 दिन ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 दिन ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 सप्ताहः saptahaĥ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 सप्ताहः saptahaĥ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 सप्ताहः saptahaĥ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 सप्ताहः saptahaĥ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 मास ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 मास ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 मास ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 मास ago', // Carbon::now()->subYears(1)->diffForHumans() '1 वर्ष ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 वर्ष ago', // Carbon::now()->subYears(2)->diffForHumans() '2 वर्ष ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 वर्ष ago', // Carbon::now()->addSecond()->diffForHumans() '1 द्वितीयः from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 द्वितीयः from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 द्वितीयः after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 द्वितीयः after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 द्वितीयः before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 द्वितीयः before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 द्वितीयः', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 द्वितीयः', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 द्वितीयः', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 द्वितीयः', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 द्वितीयः from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 होरा 1 द्वितीयः', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 वर्ष 3 मास 1 दिन 1 द्वितीयः', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 वर्ष from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 मास ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 वर्ष 3 मास 1 दिन 1 द्वितीयः ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 सप्ताहः saptahaĥ 10 घण्टा', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताहः saptahaĥ 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 सप्ताहः saptahaĥ 6 दिन', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 सप्ताहः saptahaĥ and 6 दिन from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 सप्ताहः saptahaĥ 1 घण्टा', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 घण्टा from now', // CarbonInterval::days(2)->forHumans() '2 दिन', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 दिन 3 घण्टा', ]; } ================================================ FILE: tests/Localization/SahRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SahRuTest extends LocalizationTestCase { public const LOCALE = 'sah_RU'; // Sakha public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субуота, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В баскыһыанньа, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую сэрэдэ, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую бээтинсэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую сэрэдэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую бээтинсэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субуота, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В бэнидиэнньик, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субуота, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую бээтинсэ, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую сэрэдэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В бээтинсэ, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунду назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуту назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 час назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 день назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 неделю назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяц назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 год назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 год', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 час', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 день', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 день', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 день', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 неделя 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 день', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SahTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SahTest extends LocalizationTestCase { public const LOCALE = 'sah'; // Sakha public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В субуота, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В баскыһыанньа, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий понедельник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В следующую сэрэдэ, в 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'В следующую бээтинсэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую сэрэдэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий четверг, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую бээтинсэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующую субуота, в 0:00', // Carbon::now()->subDays(2)->calendar() 'В прошлое воскресенье, в 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сегодня, в 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сегодня, в 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра, в 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В следующий вторник, в 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчера, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Во вторник, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В бэнидиэнньик, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлое воскресенье, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую субуота, в 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'В прошлую бээтинсэ, в 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'В прошлый четверг, в 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'В прошлую сэрэдэ, в 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'В бээтинсэ, в 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-я 1-я', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-я', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-я', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-я', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-я', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-я', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-я', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-я', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночи CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночи, 12:00 ночи', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночи, 1:30 ночи', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночи, 2:00 ночи', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 утра, 6:00 утра', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 утра, 10:00 утра', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечера, 5:00 вечера', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечера, 9:30 вечера', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечера, 11:00 вечера', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду назад', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 сек. назад', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунду назад', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сек. назад', // Carbon::now()->subMinutes(1)->diffForHumans() '1 минуту назад', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 мин. назад', // Carbon::now()->subMinutes(2)->diffForHumans() '2 минуту назад', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 мин. назад', // Carbon::now()->subHours(1)->diffForHumans() '1 час назад', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ч. назад', // Carbon::now()->subHours(2)->diffForHumans() '2 час назад', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ч. назад', // Carbon::now()->subDays(1)->diffForHumans() '1 день назад', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 д. назад', // Carbon::now()->subDays(2)->diffForHumans() '2 день назад', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 д. назад', // Carbon::now()->subWeeks(1)->diffForHumans() '1 неделю назад', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 нед. назад', // Carbon::now()->subWeeks(2)->diffForHumans() '2 неделю назад', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 нед. назад', // Carbon::now()->subMonths(1)->diffForHumans() '1 месяц назад', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 мес. назад', // Carbon::now()->subMonths(2)->diffForHumans() '2 месяц назад', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 мес. назад', // Carbon::now()->subYears(1)->diffForHumans() '1 год назад', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 г. назад', // Carbon::now()->subYears(2)->diffForHumans() '2 год назад', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 г. назад', // Carbon::now()->addSecond()->diffForHumans() 'через 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'через 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду после', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 сек. после', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 сек. до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунда', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'через 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минута 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 г. 3 мес. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'через 3 год', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 мес. назад', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 г. 3 мес. 1 д. 1 сек. назад', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 неделя 10 час', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 день', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 неделя 6 день', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'через 1 неделю и 6 день', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 неделя 1 час', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'через час', // CarbonInterval::days(2)->forHumans() '2 день', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SaqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SaqTest extends LocalizationTestCase { public const LOCALE = 'saq'; // Samburu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mderot ee kwe at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mderot ee are at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mderot ee kuni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mderot ee ong’wan at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mderot ee inet at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Mderot ee ile at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Mderot ee sapa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mderot ee ong’wan at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mderot ee inet at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mderot ee ile at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mderot ee sapa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mderot ee kwe at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Mderot ee are at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mderot ee ong’wan at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mderot ee ong’wan at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mderot ee kuni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mderot ee are at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mderot ee kwe at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mderot ee sapa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Mderot ee ile at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mderot ee inet at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Mderot ee sapa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 tesiran CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Tesiran, 12:00 tesiran', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Tesiran, 1:30 tesiran', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Tesiran, 2:00 tesiran', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Tesiran, 6:00 tesiran', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Tesiran, 10:00 tesiran', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Teipa, 12:00 teipa', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Teipa, 5:00 teipa', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Teipa, 9:30 teipa', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Teipa, 11:00 teipa', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/SatInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SatInTest extends LocalizationTestCase { public const LOCALE = 'sat_IN'; // Santali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ञुहुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सिंगेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ओतेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सागुनमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'सारदीमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सागुनमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सारदीमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ञुहुममाँहाँ at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last सिंगेमाँहाँ at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ओतेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सिंगेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ञुहुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last सारदीमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last सागुनमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ar ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ar ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ar ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ar ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ᱥᱳᱱᱚ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ᱥᱳᱱᱚ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ᱥᱳᱱᱚ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ᱥᱳᱱᱚ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ᱫᱤᱱ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ᱫᱤᱱ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ᱫᱤᱱ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ᱫᱤᱱ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 mãhã ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 mãhã ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 mãhã ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 mãhã ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ńindạ cando ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ńindạ cando ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ńindạ cando ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ńindạ cando ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ne̲s ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ne̲s ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ne̲s ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ne̲s ago', // Carbon::now()->addSecond()->diffForHumans() '1 ar from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ar from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ar after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ar after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ar before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ar before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ar', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ar', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ar', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ar', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ar from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ᱯᱤᱞᱪᱩ 1 ar', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ne̲s 3 ńindạ cando 1 ᱫᱤᱱ 1 ar', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ne̲s from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ńindạ cando ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ne̲s 3 ńindạ cando 1 ᱫᱤᱱ 1 ar ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 mãhã 10 ᱥᱳᱱᱚ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mãhã 6 ᱫᱤᱱ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mãhã 6 ᱫᱤᱱ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 mãhã and 6 ᱫᱤᱱ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 mãhã 1 ᱥᱳᱱᱚ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ᱥᱳᱱᱚ from now', // CarbonInterval::days(2)->forHumans() '2 ᱫᱤᱱ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ᱫᱤᱱ 3 ᱥᱳᱱᱚ', ]; } ================================================ FILE: tests/Localization/SatTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SatTest extends LocalizationTestCase { public const LOCALE = 'sat'; // Santali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ञुहुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सिंगेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ओतेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सागुनमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'सारदीमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सागुनमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'सारदीमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ञुहुममाँहाँ at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last सिंगेमाँहाँ at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last बालेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ओतेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सिंगेमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ञुहुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last सारदीमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last सागुनमाँहाँ at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last जारुममाँहाँ at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ar ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ar ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ar ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ar ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ᱯᱤᱞᱪᱩ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ᱥᱳᱱᱚ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ᱥᱳᱱᱚ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ᱥᱳᱱᱚ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ᱥᱳᱱᱚ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ᱫᱤᱱ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ᱫᱤᱱ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ᱫᱤᱱ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ᱫᱤᱱ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 mãhã ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 mãhã ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 mãhã ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 mãhã ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ńindạ cando ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ńindạ cando ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ńindạ cando ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ńindạ cando ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ne̲s ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ne̲s ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ne̲s ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ne̲s ago', // Carbon::now()->addSecond()->diffForHumans() '1 ar from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ar from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ar after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ar after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ar before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ar before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ar', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ar', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ar', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ar', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ar from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ᱯᱤᱞᱪᱩ 1 ar', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ne̲s 3 ńindạ cando 1 ᱫᱤᱱ 1 ar', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ne̲s from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ńindạ cando ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ne̲s 3 ńindạ cando 1 ᱫᱤᱱ 1 ar ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 mãhã 10 ᱥᱳᱱᱚ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mãhã 6 ᱫᱤᱱ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 mãhã 6 ᱫᱤᱱ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 mãhã and 6 ᱫᱤᱱ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 mãhã 1 ᱥᱳᱱᱚ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ᱥᱳᱱᱚ from now', // CarbonInterval::days(2)->forHumans() '2 ᱫᱤᱱ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ᱫᱤᱱ 3 ᱥᱳᱱᱚ', ]; } ================================================ FILE: tests/Localization/SbpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SbpTest extends LocalizationTestCase { public const LOCALE = 'sbp'; // Sangu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mulungu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alahamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alahamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Mulungu at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mulungu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alahamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatano at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 lwamilawu CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Lwamilawu, 12:00 lwamilawu', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Lwamilawu, 1:30 lwamilawu', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Lwamilawu, 2:00 lwamilawu', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Lwamilawu, 6:00 lwamilawu', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Lwamilawu, 10:00 lwamilawu', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Pashamihe, 12:00 pashamihe', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Pashamihe, 5:00 pashamihe', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Pashamihe, 9:30 pashamihe', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Pashamihe, 11:00 pashamihe', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/ScItTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ScItTest extends LocalizationTestCase { public const LOCALE = 'sc_IT'; // Sardinian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sàbadu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domìnigu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mèrcuris at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Giòbia at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Chenàbura at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mèrcuris at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Giòbia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chenàbura at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sàbadu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Domìnigu at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martis at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Domìnigu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sàbadu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chenàbura at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Giòbia at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mèrcuris at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Chenàbura at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secundu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 secundu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secundu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 secundu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mementu ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mementu ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mementu ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mementu ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ora ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ora ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ora ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ora ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dí ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dí ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dí ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dí ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 chida ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 chida ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 chida ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 chida ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mese ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mese ago', // Carbon::now()->subYears(1)->diffForHumans() '1 annu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 annu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 annu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 annu ago', // Carbon::now()->addSecond()->diffForHumans() '1 secundu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 secundu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secundu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 secundu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secundu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 secundu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 secundu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mementu 1 secundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 annu 3 mese 1 dí 1 secundu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 annu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mese ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 annu 3 mese 1 dí 1 secundu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 chida 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 chida 6 dí', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 chida 6 dí', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 chida and 6 dí from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 chida 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ora from now', // CarbonInterval::days(2)->forHumans() '2 dí', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dí 3 ora', ]; } ================================================ FILE: tests/Localization/ScTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ScTest extends LocalizationTestCase { public const LOCALE = 'sc'; // Sardinian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sàbadu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domìnigu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mèrcuris at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Giòbia at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Chenàbura at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martis at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mèrcuris at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Giòbia at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chenàbura at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sàbadu at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Domìnigu at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Martis at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Martis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lunis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Domìnigu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sàbadu at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chenàbura at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Giòbia at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mèrcuris at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Chenàbura at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 secundu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 secundu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 secundu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 secundu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mementu ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mementu ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mementu ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mementu ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ora ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ora ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ora ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ora ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dí ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dí ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dí ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dí ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 chida ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 chida ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 chida ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 chida ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mese ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mese ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mese ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mese ago', // Carbon::now()->subYears(1)->diffForHumans() '1 annu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 annu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 annu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 annu ago', // Carbon::now()->addSecond()->diffForHumans() '1 secundu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 secundu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 secundu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 secundu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 secundu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 secundu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 secundu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mementu 1 secundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 annu 3 mese 1 dí 1 secundu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 annu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mese ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 annu 3 mese 1 dí 1 secundu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 chida 10 ora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 chida 6 dí', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 chida 6 dí', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 chida and 6 dí from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 chida 1 ora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ora from now', // CarbonInterval::days(2)->forHumans() '2 dí', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dí 3 ora', ]; } ================================================ FILE: tests/Localization/ScrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ScrTest extends LocalizationTestCase { public const LOCALE = 'scr'; // Serbo Croatian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Subota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Nedelja at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Ponedeljak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Utorak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Sreda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Četvrtak at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Petak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Utorak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Sreda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Četvrtak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Petak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Subota at 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Nedelja at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Utorak at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Utorak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Ponedeljak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Nedelja at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Subota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Petak at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Četvrtak at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Sreda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Petak at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 pre podne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 pre podne, 12:00 pre podne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 pre podne, 1:30 pre podne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 pre podne, 2:00 pre podne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 pre podne, 6:00 pre podne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 pre podne, 10:00 pre podne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 po podne, 12:00 po podne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 po podne, 5:00 po podne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 po podne, 9:30 po podne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 po podne, 11:00 po podne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 s.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 s.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelja', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 n.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 n.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 m.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 m.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godina', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund raniјe', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 s. raniјe', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 m. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 m.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 m. 1 d. 1 s.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelja i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SdInDevanagariTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SdInDevanagariTest extends LocalizationTestCase { public const LOCALE = 'sd_IN@devanagari'; // Sindhi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سڀاڻي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'छंछस اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आर्तवारू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सूमरू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ॿुधरू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'विस्पति اڳين هفتي تي 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'जुमो اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ॿुधरू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'विस्पति اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'जुमो اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'छंछस اڳين هفتي تي 00:00', // Carbon::now()->subDays(2)->calendar() 'گزريل هفتي आर्तवारू تي 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڪالهه 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اڄ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اڄ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'سڀاڻي 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलू اڳين هفتي تي 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ڪالهه 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڪالهه 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي मंगलू تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي सूमरू تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي आर्तवारू تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي छंछस تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي जुमो تي 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'گزريل هفتي विस्पति تي 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'گزريل هفتي ॿुधरू تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'گزريل هفتي जुमो تي 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 म.पू. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 म.पू., 12:00 म.पू.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 म.पू., 1:30 म.पू.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 म.पू., 2:00 म.पू.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 म.पू., 6:00 म.पू.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 म.पू., 10:00 म.पू.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 म.नं., 12:00 म.नं.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 म.नं., 5:00 म.नं.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 म.नं., 9:30 म.नं.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 म.नं., 11:00 म.नं.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 سيڪنڊ اڳ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 سيڪنڊ اڳ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سيڪنڊ اڳ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سيڪنڊ اڳ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 منٽ اڳ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 منٽ اڳ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 منٽ اڳ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 منٽ اڳ', // Carbon::now()->subHours(1)->diffForHumans() '1 ڪلاڪ اڳ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ڪلاڪ اڳ', // Carbon::now()->subHours(2)->diffForHumans() '2 ڪلاڪ اڳ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ڪلاڪ اڳ', // Carbon::now()->subDays(1)->diffForHumans() '1 ڏينهن اڳ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ڏينهن اڳ', // Carbon::now()->subDays(2)->diffForHumans() '2 ڏينهن اڳ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ڏينهن اڳ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 هفتا اڳ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 هفتا اڳ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 هفتا اڳ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 هفتا اڳ', // Carbon::now()->subMonths(1)->diffForHumans() '1 مهينا اڳ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 مهينا اڳ', // Carbon::now()->subMonths(2)->diffForHumans() '2 مهينا اڳ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 مهينا اڳ', // Carbon::now()->subYears(1)->diffForHumans() '1 سال اڳ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 سال اڳ', // Carbon::now()->subYears(2)->diffForHumans() '2 سال اڳ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 سال اڳ', // Carbon::now()->addSecond()->diffForHumans() '1 سيڪنڊ پوء', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 سيڪنڊ پوء', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 سيڪنڊ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 سيڪنڊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سيڪنڊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سيڪنڊ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 سيڪنڊ پوء', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 منٽ 1 سيڪنڊ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 سال 3 مهينا 1 ڏينهن 1 سيڪنڊ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سال پوء', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 مهينا اڳ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 سال 3 مهينا 1 ڏينهن 1 سيڪنڊ اڳ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 هفتا 10 ڪلاڪ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 هفتا 6 ڏينهن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 هفتا 6 ڏينهن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 هفتا ۽ 6 ڏينهن پوء', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 هفتا 1 ڪلاڪ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'هڪ ڪلاڪ پوء', // CarbonInterval::days(2)->forHumans() '2 ڏينهن', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ڏينهن 3 ڪلاڪ', ]; } ================================================ FILE: tests/Localization/SdInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SdInTest extends LocalizationTestCase { public const LOCALE = 'sd_IN'; // Sindhi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سڀاڻي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڇنڇر اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آرتوارُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سومرُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'منگلُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ٻُڌرُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'وسپت اڳين هفتي تي 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جُمو اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگلُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ٻُڌرُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'وسپت اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جُمو اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ڇنڇر اڳين هفتي تي 00:00', // Carbon::now()->subDays(2)->calendar() 'گزريل هفتي آرتوارُ تي 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڪالهه 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اڄ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اڄ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'سڀاڻي 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگلُ اڳين هفتي تي 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ڪالهه 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڪالهه 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي منگلُ تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي سومرُ تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي آرتوارُ تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي ڇنڇر تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي جُمو تي 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'گزريل هفتي وسپت تي 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'گزريل هفتي ٻُڌرُ تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'گزريل هفتي جُمو تي 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 صبح CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 صبح, 12:00 صبح', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 صبح, 1:30 صبح', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 صبح, 2:00 صبح', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 صبح, 6:00 صبح', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 صبح, 10:00 صبح', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 شام, 12:00 شام', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 شام, 5:00 شام', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 شام, 9:30 شام', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 شام, 11:00 شام', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 سيڪنڊ اڳ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 سيڪنڊ اڳ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سيڪنڊ اڳ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سيڪنڊ اڳ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 منٽ اڳ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 منٽ اڳ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 منٽ اڳ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 منٽ اڳ', // Carbon::now()->subHours(1)->diffForHumans() '1 ڪلاڪ اڳ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ڪلاڪ اڳ', // Carbon::now()->subHours(2)->diffForHumans() '2 ڪلاڪ اڳ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ڪلاڪ اڳ', // Carbon::now()->subDays(1)->diffForHumans() '1 ڏينهن اڳ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ڏينهن اڳ', // Carbon::now()->subDays(2)->diffForHumans() '2 ڏينهن اڳ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ڏينهن اڳ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 هفتا اڳ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 هفتا اڳ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 هفتا اڳ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 هفتا اڳ', // Carbon::now()->subMonths(1)->diffForHumans() '1 مهينا اڳ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 مهينا اڳ', // Carbon::now()->subMonths(2)->diffForHumans() '2 مهينا اڳ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 مهينا اڳ', // Carbon::now()->subYears(1)->diffForHumans() '1 سال اڳ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 سال اڳ', // Carbon::now()->subYears(2)->diffForHumans() '2 سال اڳ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 سال اڳ', // Carbon::now()->addSecond()->diffForHumans() '1 سيڪنڊ پوء', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 سيڪنڊ پوء', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 سيڪنڊ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 سيڪنڊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سيڪنڊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سيڪنڊ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 سيڪنڊ پوء', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 منٽ 1 سيڪنڊ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 سال 3 مهينا 1 ڏينهن 1 سيڪنڊ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سال پوء', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 مهينا اڳ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 سال 3 مهينا 1 ڏينهن 1 سيڪنڊ اڳ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 هفتا 10 ڪلاڪ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 هفتا 6 ڏينهن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 هفتا 6 ڏينهن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 هفتا ۽ 6 ڏينهن پوء', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 هفتا 1 ڪلاڪ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'هڪ ڪلاڪ پوء', // CarbonInterval::days(2)->forHumans() '2 ڏينهن', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ڏينهن 3 ڪلاڪ', ]; } ================================================ FILE: tests/Localization/SdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SdTest extends LocalizationTestCase { public const LOCALE = 'sd'; // Sindhi public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سڀاڻي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڇنڇر اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آچر اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سومر اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اڱارو اڳين هفتي تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اربع اڳين هفتي تي 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'خميس اڳين هفتي تي 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمع اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'اڱارو اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'اربع اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'خميس اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمع اڳين هفتي تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ڇنڇر اڳين هفتي تي 00:00', // Carbon::now()->subDays(2)->calendar() 'گزريل هفتي آچر تي 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڪالهه 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'اڄ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اڄ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'سڀاڻي 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'اڱارو اڳين هفتي تي 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ڪالهه 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ڪالهه 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي اڱارو تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي سومر تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي آچر تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي ڇنڇر تي 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گزريل هفتي جمع تي 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'گزريل هفتي خميس تي 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'گزريل هفتي اربع تي 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'گزريل هفتي جمع تي 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 صبح CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 صبح, 12:00 صبح', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 صبح, 1:30 صبح', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 صبح, 2:00 صبح', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 صبح, 6:00 صبح', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 صبح, 10:00 صبح', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 شام, 12:00 شام', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 شام, 5:00 شام', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 شام, 9:30 شام', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 شام, 11:00 شام', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 سيڪنڊ اڳ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 سيڪنڊ اڳ', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سيڪنڊ اڳ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سيڪنڊ اڳ', // Carbon::now()->subMinutes(1)->diffForHumans() '1 منٽ اڳ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 منٽ اڳ', // Carbon::now()->subMinutes(2)->diffForHumans() '2 منٽ اڳ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 منٽ اڳ', // Carbon::now()->subHours(1)->diffForHumans() '1 ڪلاڪ اڳ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ڪلاڪ اڳ', // Carbon::now()->subHours(2)->diffForHumans() '2 ڪلاڪ اڳ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ڪلاڪ اڳ', // Carbon::now()->subDays(1)->diffForHumans() '1 ڏينهن اڳ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ڏينهن اڳ', // Carbon::now()->subDays(2)->diffForHumans() '2 ڏينهن اڳ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ڏينهن اڳ', // Carbon::now()->subWeeks(1)->diffForHumans() '1 هفتا اڳ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 هفتا اڳ', // Carbon::now()->subWeeks(2)->diffForHumans() '2 هفتا اڳ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 هفتا اڳ', // Carbon::now()->subMonths(1)->diffForHumans() '1 مهينا اڳ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 مهينا اڳ', // Carbon::now()->subMonths(2)->diffForHumans() '2 مهينا اڳ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 مهينا اڳ', // Carbon::now()->subYears(1)->diffForHumans() '1 سال اڳ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 سال اڳ', // Carbon::now()->subYears(2)->diffForHumans() '2 سال اڳ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 سال اڳ', // Carbon::now()->addSecond()->diffForHumans() '1 سيڪنڊ پوء', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 سيڪنڊ پوء', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 سيڪنڊ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 سيڪنڊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سيڪنڊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سيڪنڊ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 سيڪنڊ پوء', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 منٽ 1 سيڪنڊ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 سال 3 مهينا 1 ڏينهن 1 سيڪنڊ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سال پوء', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 مهينا اڳ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 سال 3 مهينا 1 ڏينهن 1 سيڪنڊ اڳ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 هفتا 10 ڪلاڪ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 هفتا 6 ڏينهن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 هفتا 6 ڏينهن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 هفتا ۽ 6 ڏينهن پوء', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 هفتا 1 ڪلاڪ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'هڪ ڪلاڪ پوء', // CarbonInterval::days(2)->forHumans() '2 ڏينهن', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ڏينهن 3 ڪلاڪ', ]; } ================================================ FILE: tests/Localization/SeFiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SeFiTest extends LocalizationTestCase { public const LOCALE = 'se_FI'; // NorthernSami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ihttin ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lávvordat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mánnodat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'disdat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'disdat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lávvordat ti 00:00', // Carbon::now()->subDays(2)->calendar() 'ovddit sotnabeaivi ti 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'otne ti 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'otne ti 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ihttin ti 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'disdat ti 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit disdat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit mánnodat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit lávvordat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ovddit duorastat ti 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ovddit gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 i CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 i, 12:00 i', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 i, 1:30 i', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 i, 2:00 i', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 i, 6:00 i', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 i, 10:00 i', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 e, 12:00 e', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 e, 5:00 e', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 e, 9:30 e', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 e, 11:00 e', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'maŋit 1 sekunddat', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'maŋit 1 s.', // Carbon::now()->subSeconds(2)->diffForHumans() 'maŋit 2 sekunddat', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'maŋit 2 s.', // Carbon::now()->subMinutes(1)->diffForHumans() 'maŋit 1 minuhta', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'maŋit 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'maŋit 2 minuhtat', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'maŋit 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'maŋit 1 diimmu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'maŋit 1 d.', // Carbon::now()->subHours(2)->diffForHumans() 'maŋit 2 diimmut', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'maŋit 2 d.', // Carbon::now()->subDays(1)->diffForHumans() 'maŋit 1 beaivi', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'maŋit 1 b.', // Carbon::now()->subDays(2)->diffForHumans() 'maŋit 2 beaivvit', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'maŋit 2 b.', // Carbon::now()->subWeeks(1)->diffForHumans() 'maŋit 1 vahkku', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'maŋit 1 v.', // Carbon::now()->subWeeks(2)->diffForHumans() 'maŋit 2 vahkku', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'maŋit 2 v.', // Carbon::now()->subMonths(1)->diffForHumans() 'maŋit 1 mánnu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'maŋit 1 mán.', // Carbon::now()->subMonths(2)->diffForHumans() 'maŋit 2 mánut', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'maŋit 2 mán.', // Carbon::now()->subYears(1)->diffForHumans() 'maŋit 1 jahki', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'maŋit 1 j.', // Carbon::now()->subYears(2)->diffForHumans() 'maŋit 2 jagit', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'maŋit 2 j.', // Carbon::now()->addSecond()->diffForHumans() '1 sekunddat geažes', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s. geažes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunddat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunddat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s. geažes', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuhta 1 sekunddat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jagit geažes', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'maŋit 5 mán.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'maŋit 2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vahkku 10 diimmut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vahkku ja 6 beaivvit geažes', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vahkku 1 diimmu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'okta diimmu geažes', // CarbonInterval::days(2)->forHumans() '2 beaivvit', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 b. 3 d.', ]; } ================================================ FILE: tests/Localization/SeNoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SeNoTest extends LocalizationTestCase { public const LOCALE = 'se_NO'; // NorthernSami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ihttin ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lávvardat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vuossárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lávvardat ti 00:00', // Carbon::now()->subDays(2)->calendar() 'ovddit sotnabeaivi ti 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'otne ti 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'otne ti 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ihttin ti 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit maŋŋebárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit vuossárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit lávvardat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ovddit duorastat ti 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ovddit gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 i.b. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 i.b., 12:00 i.b.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 i.b., 1:30 i.b.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 i.b., 2:00 i.b.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 i.b., 6:00 i.b.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 i.b., 10:00 i.b.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 e.b., 12:00 e.b.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 e.b., 5:00 e.b.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 e.b., 9:30 e.b.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 e.b., 11:00 e.b.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'maŋit 1 sekunddat', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'maŋit 1 s.', // Carbon::now()->subSeconds(2)->diffForHumans() 'maŋit 2 sekunddat', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'maŋit 2 s.', // Carbon::now()->subMinutes(1)->diffForHumans() 'maŋit 1 minuhta', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'maŋit 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'maŋit 2 minuhtat', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'maŋit 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'maŋit 1 diimmu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'maŋit 1 d.', // Carbon::now()->subHours(2)->diffForHumans() 'maŋit 2 diimmut', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'maŋit 2 d.', // Carbon::now()->subDays(1)->diffForHumans() 'maŋit 1 beaivi', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'maŋit 1 b.', // Carbon::now()->subDays(2)->diffForHumans() 'maŋit 2 beaivvit', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'maŋit 2 b.', // Carbon::now()->subWeeks(1)->diffForHumans() 'maŋit 1 vahkku', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'maŋit 1 v.', // Carbon::now()->subWeeks(2)->diffForHumans() 'maŋit 2 vahkku', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'maŋit 2 v.', // Carbon::now()->subMonths(1)->diffForHumans() 'maŋit 1 mánnu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'maŋit 1 mán.', // Carbon::now()->subMonths(2)->diffForHumans() 'maŋit 2 mánut', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'maŋit 2 mán.', // Carbon::now()->subYears(1)->diffForHumans() 'maŋit 1 jahki', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'maŋit 1 j.', // Carbon::now()->subYears(2)->diffForHumans() 'maŋit 2 jagit', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'maŋit 2 j.', // Carbon::now()->addSecond()->diffForHumans() '1 sekunddat geažes', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s. geažes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunddat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunddat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s. geažes', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuhta 1 sekunddat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jagit geažes', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'maŋit 5 mán.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'maŋit 2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vahkku 10 diimmut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vahkku ja 6 beaivvit geažes', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vahkku 1 diimmu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'okta diimmu geažes', // CarbonInterval::days(2)->forHumans() '2 beaivvit', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 b. 3 d.', ]; } ================================================ FILE: tests/Localization/SeSeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SeSeTest extends LocalizationTestCase { public const LOCALE = 'se_SE'; // NorthernSami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ihttin ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lávvardat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vuossárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lávvardat ti 00:00', // Carbon::now()->subDays(2)->calendar() 'ovddit sotnabeaivi ti 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'otne ti 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'otne ti 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ihttin ti 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit maŋŋebárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit vuossárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit lávvardat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ovddit duorastat ti 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ovddit gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 i.b. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 i.b., 12:00 i.b.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 i.b., 1:30 i.b.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 i.b., 2:00 i.b.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 i.b., 6:00 i.b.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 i.b., 10:00 i.b.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 e.b., 12:00 e.b.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 e.b., 5:00 e.b.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 e.b., 9:30 e.b.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 e.b., 11:00 e.b.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'maŋit 1 sekunddat', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'maŋit 1 s.', // Carbon::now()->subSeconds(2)->diffForHumans() 'maŋit 2 sekunddat', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'maŋit 2 s.', // Carbon::now()->subMinutes(1)->diffForHumans() 'maŋit 1 minuhta', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'maŋit 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'maŋit 2 minuhtat', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'maŋit 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'maŋit 1 diimmu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'maŋit 1 d.', // Carbon::now()->subHours(2)->diffForHumans() 'maŋit 2 diimmut', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'maŋit 2 d.', // Carbon::now()->subDays(1)->diffForHumans() 'maŋit 1 beaivi', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'maŋit 1 b.', // Carbon::now()->subDays(2)->diffForHumans() 'maŋit 2 beaivvit', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'maŋit 2 b.', // Carbon::now()->subWeeks(1)->diffForHumans() 'maŋit 1 vahkku', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'maŋit 1 v.', // Carbon::now()->subWeeks(2)->diffForHumans() 'maŋit 2 vahkku', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'maŋit 2 v.', // Carbon::now()->subMonths(1)->diffForHumans() 'maŋit 1 mánnu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'maŋit 1 mán.', // Carbon::now()->subMonths(2)->diffForHumans() 'maŋit 2 mánut', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'maŋit 2 mán.', // Carbon::now()->subYears(1)->diffForHumans() 'maŋit 1 jahki', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'maŋit 1 j.', // Carbon::now()->subYears(2)->diffForHumans() 'maŋit 2 jagit', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'maŋit 2 j.', // Carbon::now()->addSecond()->diffForHumans() '1 sekunddat geažes', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s. geažes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunddat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunddat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s. geažes', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuhta 1 sekunddat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jagit geažes', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'maŋit 5 mán.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'maŋit 2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vahkku 10 diimmut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vahkku ja 6 beaivvit geažes', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vahkku 1 diimmu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'okta diimmu geažes', // CarbonInterval::days(2)->forHumans() '2 beaivvit', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 b. 3 d.', ]; } ================================================ FILE: tests/Localization/SeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SeTest extends LocalizationTestCase { public const LOCALE = 'se'; // NorthernSami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ihttin ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lávvardat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vuossárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'duorastat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'bearjadat ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lávvardat ti 00:00', // Carbon::now()->subDays(2)->calendar() 'ovddit sotnabeaivi ti 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'otne ti 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'otne ti 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ihttin ti 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'maŋŋebárga ti 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ikte ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit maŋŋebárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit vuossárga ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit sotnabeaivi ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit lávvardat ti 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ovddit duorastat ti 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ovddit gaskavahkku ti 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ovddit bearjadat ti 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 i.b. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 i.b., 12:00 i.b.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 i.b., 1:30 i.b.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 i.b., 2:00 i.b.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 i.b., 6:00 i.b.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 i.b., 10:00 i.b.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 e.b., 12:00 e.b.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 e.b., 5:00 e.b.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 e.b., 9:30 e.b.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 e.b., 11:00 e.b.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'maŋit 1 sekunddat', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'maŋit 1 s.', // Carbon::now()->subSeconds(2)->diffForHumans() 'maŋit 2 sekunddat', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'maŋit 2 s.', // Carbon::now()->subMinutes(1)->diffForHumans() 'maŋit 1 minuhta', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'maŋit 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() 'maŋit 2 minuhtat', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'maŋit 2 min.', // Carbon::now()->subHours(1)->diffForHumans() 'maŋit 1 diimmu', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'maŋit 1 d.', // Carbon::now()->subHours(2)->diffForHumans() 'maŋit 2 diimmut', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'maŋit 2 d.', // Carbon::now()->subDays(1)->diffForHumans() 'maŋit 1 beaivi', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'maŋit 1 b.', // Carbon::now()->subDays(2)->diffForHumans() 'maŋit 2 beaivvit', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'maŋit 2 b.', // Carbon::now()->subWeeks(1)->diffForHumans() 'maŋit 1 vahkku', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'maŋit 1 v.', // Carbon::now()->subWeeks(2)->diffForHumans() 'maŋit 2 vahkku', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'maŋit 2 v.', // Carbon::now()->subMonths(1)->diffForHumans() 'maŋit 1 mánnu', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'maŋit 1 mán.', // Carbon::now()->subMonths(2)->diffForHumans() 'maŋit 2 mánut', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'maŋit 2 mán.', // Carbon::now()->subYears(1)->diffForHumans() 'maŋit 1 jahki', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'maŋit 1 j.', // Carbon::now()->subYears(2)->diffForHumans() 'maŋit 2 jagit', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'maŋit 2 j.', // Carbon::now()->addSecond()->diffForHumans() '1 sekunddat geažes', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 s. geažes', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunddat', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunddat', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 s. geažes', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuhta 1 sekunddat', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jagit geažes', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'maŋit 5 mán.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'maŋit 2 j. 3 mán. 1 b. 1 s.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vahkku 10 diimmut', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vahkku 6 beaivvit', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vahkku ja 6 beaivvit geažes', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vahkku 1 diimmu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'okta diimmu geažes', // CarbonInterval::days(2)->forHumans() '2 beaivvit', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 b. 3 d.', ]; } ================================================ FILE: tests/Localization/SehTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SehTest extends LocalizationTestCase { public const LOCALE = 'seh'; // Sena public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabudu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dimingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chiposi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chipiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chitatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Chinai at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Chishanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chipiri at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chitatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chinai at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chishanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabudu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Dimingu at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chipiri at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chipiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chiposi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Dimingu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabudu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chishanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Chinai at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Chitatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Chishanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/SesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SesTest extends LocalizationTestCase { public const LOCALE = 'ses'; // Koyraboro Senni public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asibti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atinni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamiisa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Alzuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamiisa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alzuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asibti at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Alhadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atalaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atinni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asibti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alzuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamiisa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Alzuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 adduha CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Adduha, 12:00 adduha', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Adduha, 1:30 adduha', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Adduha, 2:00 adduha', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Adduha, 6:00 adduha', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Adduha, 10:00 adduha', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Aluula, 12:00 aluula', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Aluula, 5:00 aluula', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Aluula, 9:30 aluula', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Aluula, 11:00 aluula', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ihinkante ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ihinkante ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ihinkante ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ihinkante ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 zarbu ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 zarbu ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 zarbu ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 zarbu ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ɲaajin ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ɲaajin ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ɲaajin ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ɲaajin ago', // Carbon::now()->subDays(1)->diffForHumans() '1 zaari ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 zaari ago', // Carbon::now()->subDays(2)->diffForHumans() '2 zaari ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 zaari ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 jirbiiyye ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 jirbiiyye ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 jirbiiyye ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 jirbiiyye ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 alaada ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 alaada ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 alaada ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 alaada ago', // Carbon::now()->subYears(1)->diffForHumans() '1 jiiri ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 jiiri ago', // Carbon::now()->subYears(2)->diffForHumans() '2 jiiri ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 jiiri ago', // Carbon::now()->addSecond()->diffForHumans() '1 ihinkante from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ihinkante from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ihinkante after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ihinkante after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ihinkante before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ihinkante before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ihinkante', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ihinkante', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ihinkante', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ihinkante', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ihinkante from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 zarbu 1 ihinkante', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 jiiri 3 alaada 1 zaari 1 ihinkante', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jiiri from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 alaada ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 jiiri 3 alaada 1 zaari 1 ihinkante ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 jirbiiyye 10 ɲaajin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 jirbiiyye 6 zaari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 jirbiiyye 6 zaari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 jirbiiyye and 6 zaari from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 jirbiiyye 1 ɲaajin', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ɲaajin from now', // CarbonInterval::days(2)->forHumans() '2 zaari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 zaari 3 ɲaajin', ]; } ================================================ FILE: tests/Localization/SgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SgTest extends LocalizationTestCase { public const LOCALE = 'sg'; // Sango public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lâyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bikua-ôko at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bïkua-ûse at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bïkua-ptâ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bïkua-usïö at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Bïkua-okü at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Lâpôsö at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bïkua-ptâ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bïkua-usïö at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bïkua-okü at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lâpôsö at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lâyenga at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Bikua-ôko at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Bïkua-ptâ at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bïkua-ptâ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bïkua-ûse at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Bikua-ôko at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lâyenga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lâpôsö at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Bïkua-okü at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Bïkua-usïö at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Lâpôsö at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 nd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ND, 12:00 nd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ND, 1:30 nd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ND, 2:00 nd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ND, 6:00 nd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ND, 10:00 nd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 LK, 12:00 lk', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 LK, 5:00 lk', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 LK, 9:30 lk', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 LK, 11:00 lk', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 bïkua-ôko ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 bïkua-ôko ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 bïkua-ôko ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 bïkua-ôko ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 yângâködörö ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 yângâködörö ago', // Carbon::now()->subHours(2)->diffForHumans() '2 yângâködörö ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 yângâködörö ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ziggawâ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ziggawâ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ziggawâ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ziggawâ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 bïkua-okü ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 bïkua-okü ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 bïkua-okü ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 bïkua-okü ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Nze tî ngu ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Nze tî ngu ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Nze tî ngu ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Nze tî ngu ago', // Carbon::now()->subYears(1)->diffForHumans() '1 dā ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 dā ago', // Carbon::now()->subYears(2)->diffForHumans() '2 dā ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 dā ago', // Carbon::now()->addSecond()->diffForHumans() '1 bïkua-ôko from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 bïkua-ôko from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 bïkua-ôko after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 bïkua-ôko after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 bïkua-ôko before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 bïkua-ôko before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 bïkua-ôko', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 bïkua-ôko', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 bïkua-ôko', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 bïkua-ôko', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 bïkua-ôko from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 bïkua-ôko', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 dā 3 Nze tî ngu 1 ziggawâ 1 bïkua-ôko', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 dā from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Nze tî ngu ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 dā 3 Nze tî ngu 1 ziggawâ 1 bïkua-ôko ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 bïkua-okü 10 yângâködörö', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 bïkua-okü 6 ziggawâ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 bïkua-okü 6 ziggawâ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 bïkua-okü and 6 ziggawâ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 bïkua-okü 1 yângâködörö', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 yângâködörö from now', // CarbonInterval::days(2)->forHumans() '2 ziggawâ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ziggawâ 3 yângâködörö', ]; } ================================================ FILE: tests/Localization/SgsLtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SgsLtTest extends LocalizationTestCase { public const LOCALE = 'sgs_LT'; // Samogitian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'nedielės dëna at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'panedielis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'oterninks at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sereda at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'četvergs at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'petnīčė at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'oterninks at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sereda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'četvergs at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'petnīčė at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobata at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last nedielės dëna at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'oterninks at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last oterninks at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last panedielis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last nedielės dëna at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last petnīčė at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last četvergs at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last sereda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last petnīčė at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Sekondė ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Sekondė ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Sekondė ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Sekondė ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mažos ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mažos ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mažos ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mažos ago', // Carbon::now()->subHours(1)->diffForHumans() '1 adīna ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 adīna ago', // Carbon::now()->subHours(2)->diffForHumans() '2 adīna ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 adīna ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dīna ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dīna ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dīna ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dīna ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 nedielė ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 nedielė ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 nedielė ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 nedielė ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mienou ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mienou ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mienou ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mienou ago', // Carbon::now()->subYears(1)->diffForHumans() '1 metā ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 metā ago', // Carbon::now()->subYears(2)->diffForHumans() '2 metā ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 metā ago', // Carbon::now()->addSecond()->diffForHumans() '1 Sekondė from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Sekondė from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekondė after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sekondė after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekondė before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sekondė before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekondė', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekondė', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekondė', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekondė', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Sekondė from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mažos 1 Sekondė', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 metā 3 mienou 1 dīna 1 Sekondė', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 metā from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mienou ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 metā 3 mienou 1 dīna 1 Sekondė ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 nedielė 10 adīna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nedielė 6 dīna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nedielė 6 dīna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 nedielė and 6 dīna from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 nedielė 1 adīna', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 adīna from now', // CarbonInterval::days(2)->forHumans() '2 dīna', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dīna 3 adīna', ]; } ================================================ FILE: tests/Localization/SgsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SgsTest extends LocalizationTestCase { public const LOCALE = 'sgs'; // Samogitian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'nedielės dëna at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'panedielis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'oterninks at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sereda at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'četvergs at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'petnīčė at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'oterninks at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sereda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'četvergs at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'petnīčė at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobata at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last nedielės dëna at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'oterninks at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last oterninks at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last panedielis at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last nedielės dëna at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobata at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last petnīčė at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last četvergs at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last sereda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last petnīčė at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Sekondė ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Sekondė ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Sekondė ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Sekondė ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 mažos ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 mažos ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 mažos ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 mažos ago', // Carbon::now()->subHours(1)->diffForHumans() '1 adīna ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 adīna ago', // Carbon::now()->subHours(2)->diffForHumans() '2 adīna ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 adīna ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dīna ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dīna ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dīna ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dīna ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 nedielė ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 nedielė ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 nedielė ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 nedielė ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mienou ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mienou ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mienou ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mienou ago', // Carbon::now()->subYears(1)->diffForHumans() '1 metā ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 metā ago', // Carbon::now()->subYears(2)->diffForHumans() '2 metā ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 metā ago', // Carbon::now()->addSecond()->diffForHumans() '1 Sekondė from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Sekondė from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sekondė after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sekondė after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sekondė before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sekondė before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sekondė', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sekondė', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sekondė', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sekondė', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Sekondė from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 mažos 1 Sekondė', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 metā 3 mienou 1 dīna 1 Sekondė', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 metā from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mienou ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 metā 3 mienou 1 dīna 1 Sekondė ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 nedielė 10 adīna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nedielė 6 dīna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 nedielė 6 dīna', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 nedielė and 6 dīna from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 nedielė 1 adīna', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 adīna from now', // CarbonInterval::days(2)->forHumans() '2 dīna', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dīna 3 adīna', ]; } ================================================ FILE: tests/Localization/ShTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShTest extends LocalizationTestCase { public const LOCALE = 'sh'; // Serbo Croatian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Subota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Nedelja at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Ponedeljak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Utorak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Sreda at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Četvrtak at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Petak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Utorak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Sreda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Četvrtak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Petak at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Subota at 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Nedelja at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Utorak at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Utorak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Ponedeljak at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Nedelja at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Subota at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Petak at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Četvrtak at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Sreda at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Petak at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 pre podne CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 pre podne, 12:00 pre podne', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 pre podne, 1:30 pre podne', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 pre podne, 2:00 pre podne', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 pre podne, 6:00 pre podne', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 pre podne, 10:00 pre podne', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 po podne, 12:00 po podne', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 po podne, 5:00 po podne', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 po podne, 9:30 po podne', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 po podne, 11:00 po podne', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 s.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 s.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelja', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 n.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 n.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 m.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 m.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godina', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund raniјe', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 s. raniјe', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 m. 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 m.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 m. 1 d. 1 s.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelja i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/ShiLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShiLatnTest extends LocalizationTestCase { public const LOCALE = 'shi_Latn'; // Tachelhit public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asiḍyas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asamas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aynas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asinas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'akṛas at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'akwas at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'asimwas at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asinas at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'akṛas at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'akwas at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asimwas at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asiḍyas at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last asamas at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asinas at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last asinas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aynas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last asamas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last asiḍyas at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last asimwas at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last akwas at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last akṛas at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last asimwas at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 tifawt CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 tifawt, 12:00 tifawt', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 tifawt, 1:30 tifawt', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 tifawt, 2:00 tifawt', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 tifawt, 6:00 tifawt', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 tifawt, 10:00 tifawt', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 tadggʷat, 12:00 tadggʷat', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 tadggʷat, 5:00 tadggʷat', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 tadggʷat, 9:30 tadggʷat', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 tadggʷat, 11:00 tadggʷat', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sin ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sin ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sin ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sin ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 agur ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 agur ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 agur ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 agur ago', // Carbon::now()->subHours(1)->diffForHumans() '1 urɣ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 urɣ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 urɣ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 urɣ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ass ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ass ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ass ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ass ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 imalass ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 imalass ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 imalass ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 imalass ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ayyur ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ayyur ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ayyur ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ayyur ago', // Carbon::now()->subYears(1)->diffForHumans() '1 aseggwas ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 aseggwas ago', // Carbon::now()->subYears(2)->diffForHumans() '2 aseggwas ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 aseggwas ago', // Carbon::now()->addSecond()->diffForHumans() '1 sin from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sin from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sin after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sin after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sin before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sin before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sin', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sin from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 agur 1 sin', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 aseggwas 3 ayyur 1 ass 1 sin', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 aseggwas from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ayyur ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 aseggwas 3 ayyur 1 ass 1 sin ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 imalass 10 urɣ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ass', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ass', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 imalass and 6 ass from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 imalass 1 urɣ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 urɣ from now', // CarbonInterval::days(2)->forHumans() '2 ass', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ass 3 urɣ', ]; } ================================================ FILE: tests/Localization/ShiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShiTest extends LocalizationTestCase { public const LOCALE = 'shi'; // Tachelhit public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴰⵎⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵢⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⴽⵕⴰⵙ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ⴰⴽⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⴽⵕⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⴽⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last ⴰⵙⴰⵎⴰⵙ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵢⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵙⴰⵎⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵙⵉⴹⵢⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ⴰⴽⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ⴰⴽⵕⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ⵜⵉⴼⴰⵡⵜ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ⵜⵉⴼⴰⵡⵜ, 12:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ⵜⵉⴼⴰⵡⵜ, 1:30 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ⵜⵉⴼⴰⵡⵜ, 2:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ⵜⵉⴼⴰⵡⵜ, 6:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ⵜⵉⴼⴰⵡⵜ, 10:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 12:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 5:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ⵜⴰⴷⴳⴳⵯⴰⵜ, 9:30 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 11:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sin ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sin ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sin ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sin ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ⴰⵎⵥⵉ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ⴰⵎⵥⵉ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ⴰⵎⵥⵉ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ⴰⵎⵥⵉ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 urɣ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 urɣ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 urɣ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 urɣ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ass ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ass ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ass ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ass ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 imalass ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 imalass ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 imalass ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 imalass ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ayyur ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ayyur ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ayyur ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ayyur ago', // Carbon::now()->subYears(1)->diffForHumans() '1 aseggwas ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 aseggwas ago', // Carbon::now()->subYears(2)->diffForHumans() '2 aseggwas ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 aseggwas ago', // Carbon::now()->addSecond()->diffForHumans() '1 sin from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sin from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sin after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sin after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sin before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sin before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sin', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sin from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ⴰⵎⵥⵉ 1 sin', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 aseggwas 3 ayyur 1 ass 1 sin', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 aseggwas from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ayyur ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 aseggwas 3 ayyur 1 ass 1 sin ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 imalass 10 urɣ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ass', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ass', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 imalass and 6 ass from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 imalass 1 urɣ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 urɣ from now', // CarbonInterval::days(2)->forHumans() '2 ass', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ass 3 urɣ', ]; } ================================================ FILE: tests/Localization/ShiTfngTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShiTfngTest extends LocalizationTestCase { public const LOCALE = 'shi_Tfng'; // Tachelhit public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴰⵎⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵢⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⴽⵕⴰⵙ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ⴰⴽⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⴽⵕⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⴽⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last ⴰⵙⴰⵎⴰⵙ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵙⵉⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵢⵏⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵙⴰⵎⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⴰⵙⵉⴹⵢⴰⵙ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ⴰⴽⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ⴰⴽⵕⴰⵙ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ⵙⵉⵎⵡⴰⵙ at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ⵜⵉⴼⴰⵡⵜ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ⵜⵉⴼⴰⵡⵜ, 12:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ⵜⵉⴼⴰⵡⵜ, 1:30 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ⵜⵉⴼⴰⵡⵜ, 2:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ⵜⵉⴼⴰⵡⵜ, 6:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ⵜⵉⴼⴰⵡⵜ, 10:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 12:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 5:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ⵜⴰⴷⴳⴳⵯⴰⵜ, 9:30 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 11:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sin ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sin ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sin ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sin ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ⴰⵎⵥⵉ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ⴰⵎⵥⵉ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ⴰⵎⵥⵉ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ⴰⵎⵥⵉ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 urɣ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 urɣ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 urɣ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 urɣ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ass ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ass ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ass ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ass ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 imalass ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 imalass ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 imalass ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 imalass ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ayyur ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ayyur ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ayyur ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ayyur ago', // Carbon::now()->subYears(1)->diffForHumans() '1 aseggwas ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 aseggwas ago', // Carbon::now()->subYears(2)->diffForHumans() '2 aseggwas ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 aseggwas ago', // Carbon::now()->addSecond()->diffForHumans() '1 sin from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sin from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sin after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sin after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sin before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sin before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sin', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sin from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ⴰⵎⵥⵉ 1 sin', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 aseggwas 3 ayyur 1 ass 1 sin', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 aseggwas from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ayyur ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 aseggwas 3 ayyur 1 ass 1 sin ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 imalass 10 urɣ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ass', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ass', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 imalass and 6 ass from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 imalass 1 urɣ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 urɣ from now', // CarbonInterval::days(2)->forHumans() '2 ass', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ass 3 urɣ', ]; } ================================================ FILE: tests/Localization/ShnMmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShnMmTest extends LocalizationTestCase { public const LOCALE = 'shn_MM'; // Shan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းသဝ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းဢႃးတိတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းၸၼ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းပူတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ဝၼ်းၽတ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းပူတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းၽတ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းသဝ် at 12:00 ၵၢင်ၼႂ်', // Carbon::now()->subDays(2)->calendar() 'Last ဝၼ်းဢႃးတိတ်ႉ at 8:49 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းၸၼ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းဢႃးတိတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းသဝ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ဝၼ်းၽတ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ဝၼ်းပူတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ၵၢင်ၼႂ် CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ၵၢင်ၼႂ်, 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ၵၢင်ၼႂ်, 1:30 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ၵၢင်ၼႂ်, 2:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ၵၢင်ၼႂ်, 6:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ၵၢင်ၼႂ်, 10:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 တၢမ်းၶမ်ႈ, 12:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 တၢမ်းၶမ်ႈ, 5:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 တၢမ်းၶမ်ႈ, 9:30 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 တၢမ်းၶမ်ႈ, 11:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ဢိုၼ်ႇ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ဢိုၼ်ႇ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ဢိုၼ်ႇ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ဢိုၼ်ႇ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ເດັກ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ເດັກ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ເດັກ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ເດັກ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ຕີ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ຕີ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ຕີ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ຕີ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ກາງວັນ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ກາງວັນ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ກາງວັນ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ກາງວັນ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ဝၼ်း ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ဝၼ်း ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ဝၼ်း ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ဝၼ်း ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 လိူၼ် ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 လိူၼ် ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 လိူၼ် ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 လိူၼ် ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ပီ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ပီ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ပီ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ပီ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ဢိုၼ်ႇ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ဢိုၼ်ႇ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ဢိုၼ်ႇ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ဢိုၼ်ႇ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ဢိုၼ်ႇ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ဢိုၼ်ႇ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ဢိုၼ်ႇ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ဢိုၼ်ႇ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ဢိုၼ်ႇ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ဢိုၼ်ႇ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ဢိုၼ်ႇ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ເດັກ 1 ဢိုၼ်ႇ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ပီ 3 လိူၼ် 1 ກາງວັນ 1 ဢိုၼ်ႇ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ပီ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 လိူၼ် ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ပီ 3 လိူၼ် 1 ກາງວັນ 1 ဢိုၼ်ႇ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ဝၼ်း 10 ຕີ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ဝၼ်း 6 ກາງວັນ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ဝၼ်း 6 ກາງວັນ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ဝၼ်း and 6 ກາງວັນ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ဝၼ်း 1 ຕີ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ຕີ from now', // CarbonInterval::days(2)->forHumans() '2 ກາງວັນ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ກາງວັນ 3 ຕີ', ]; } ================================================ FILE: tests/Localization/ShnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShnTest extends LocalizationTestCase { public const LOCALE = 'shn'; // Shan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းသဝ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းဢႃးတိတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းၸၼ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ဝၼ်းပူတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ဝၼ်းၽတ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းပူတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းၽတ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်းသဝ် at 12:00 ၵၢင်ၼႂ်', // Carbon::now()->subDays(2)->calendar() 'Last ဝၼ်းဢႃးတိတ်ႉ at 8:49 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်း​ဢၢင်း​ၵၢၼ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းၸၼ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းဢႃးတိတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းသဝ် at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ဝၼ်းၽတ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ဝၼ်းပူတ်ႉ at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ဝၼ်းသုၵ်း at 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ၵၢင်ၼႂ် CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ၵၢင်ၼႂ်, 12:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ၵၢင်ၼႂ်, 1:30 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ၵၢင်ၼႂ်, 2:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ၵၢင်ၼႂ်, 6:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ၵၢင်ၼႂ်, 10:00 ၵၢင်ၼႂ်', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 တၢမ်းၶမ်ႈ, 12:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 တၢမ်းၶမ်ႈ, 5:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 တၢမ်းၶမ်ႈ, 9:30 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 တၢမ်းၶမ်ႈ, 11:00 တၢမ်းၶမ်ႈ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ဢိုၼ်ႇ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ဢိုၼ်ႇ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ဢိုၼ်ႇ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ဢိုၼ်ႇ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ເດັກ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ເດັກ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ເດັກ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ເດັກ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ຕີ ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ຕີ ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ຕີ ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ຕີ ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ກາງວັນ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ກາງວັນ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ກາງວັນ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ກາງວັນ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ဝၼ်း ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ဝၼ်း ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ဝၼ်း ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ဝၼ်း ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 လိူၼ် ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 လိူၼ် ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 လိူၼ် ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 လိူၼ် ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ပီ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ပီ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ပီ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ပီ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ဢိုၼ်ႇ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ဢိုၼ်ႇ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ဢိုၼ်ႇ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ဢိုၼ်ႇ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ဢိုၼ်ႇ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ဢိုၼ်ႇ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ဢိုၼ်ႇ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ဢိုၼ်ႇ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ဢိုၼ်ႇ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ဢိုၼ်ႇ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ဢိုၼ်ႇ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ເດັກ 1 ဢိုၼ်ႇ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ပီ 3 လိူၼ် 1 ກາງວັນ 1 ဢိုၼ်ႇ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ပီ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 လိူၼ် ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ပီ 3 လိူၼ် 1 ກາງວັນ 1 ဢိုၼ်ႇ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ဝၼ်း 10 ຕີ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ဝၼ်း 6 ກາງວັນ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ဝၼ်း 6 ກາງວັນ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ဝၼ်း and 6 ກາງວັນ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ဝၼ်း 1 ຕີ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ຕີ from now', // CarbonInterval::days(2)->forHumans() '2 ກາງວັນ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ກາງວັນ 3 ຕີ', ]; } ================================================ FILE: tests/Localization/ShsCaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShsCaTest extends LocalizationTestCase { public const LOCALE = 'shs_CA'; // Shuswap public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Stqmekstesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sxetspesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Spetkesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Skellesq̓t at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Smesesq̓t at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Skellesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Smesesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Stqmekstesq̓t at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sxetspesq̓t at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Spetkesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sxetspesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Stqmekstesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Smesesq̓t at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Skellesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 seqwlút ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 seqwlút ago', // Carbon::now()->subHours(2)->diffForHumans() '2 seqwlút ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 seqwlút ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 swewll ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 swewll ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 swewll ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 swewll ago', // Carbon::now()->subYears(1)->diffForHumans() '1 sqlélten ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 sqlélten ago', // Carbon::now()->subYears(2)->diffForHumans() '2 sqlélten ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 sqlélten ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 sqlélten 3 swewll 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 sqlélten from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 swewll ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 sqlélten 3 swewll 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 seqwlút', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 seqwlút', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 seqwlút from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3 seqwlút', ]; } ================================================ FILE: tests/Localization/ShsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ShsTest extends LocalizationTestCase { public const LOCALE = 'shs'; // Shuswap public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Stqmekstesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sxetspesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Spetkesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Skellesq̓t at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Smesesq̓t at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Skellesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Smesesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Stqmekstesq̓t at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sxetspesq̓t at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Selesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Spetkesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sxetspesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Stqmekstesq̓t at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Smesesq̓t at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Skellesq̓t at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Stselkstesq̓t at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 seqwlút ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 seqwlút ago', // Carbon::now()->subHours(2)->diffForHumans() '2 seqwlút ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 seqwlút ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 swewll ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 swewll ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 swewll ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 swewll ago', // Carbon::now()->subYears(1)->diffForHumans() '1 sqlélten ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 sqlélten ago', // Carbon::now()->subYears(2)->diffForHumans() '2 sqlélten ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 sqlélten ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 sqlélten 3 swewll 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 sqlélten from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 swewll ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 sqlélten 3 swewll 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 seqwlút', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 seqwlút', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 seqwlút from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3 seqwlút', ]; } ================================================ FILE: tests/Localization/SiLkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SiLkTest extends LocalizationTestCase { public const LOCALE = 'si_LK'; // Sinhala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'හෙට පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'සෙනසුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ඉරිදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'සඳුදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'බදාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'බ්‍රහස්පතින්දා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'බදාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'බ්‍රහස්පතින්දා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'සෙනසුරාදා පෙ.ව. 12:00ට', // Carbon::now()->subDays(2)->calendar() 'පසුගිය ඉරිදා ප.ව. 8:49ට', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ඊයේ ප.ව. 10:00ට', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'අද පෙ.ව. 10:00ට', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'අද පෙ.ව. 2:00ට', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'හෙට පෙ.ව. 1:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ඊයේ පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ඊයේ පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය සඳුදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය ඉරිදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය සෙනසුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'පසුගිය බ්‍රහස්පතින්දා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'පසුගිය බදාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'පසුගිය සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 වැනි 1 වැනි 1 වැනි 1 වැනි 1 වැනි', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 වැනි 1 වැනි', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 වැනි 1 වැනි', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 වැනි 1 වැනි', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 වැනි 1 වැනි', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 වැනි 1 වැනි', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 වැනි 1 වැනි', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 වැනි 2 වැනි', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40 වැනි', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41 වැනි', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100 වැනි', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 පෙ.ව. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 පෙර වරු, 12:00 පෙ.ව.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 පෙර වරු, 1:30 පෙ.ව.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 පෙර වරු, 2:00 පෙ.ව.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 පෙර වරු, 6:00 පෙ.ව.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 පෙර වරු, 10:00 පෙ.ව.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 පස් වරු, 12:00 ප.ව.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 පස් වරු, 5:00 ප.ව.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 පස් වරු, 9:30 ප.ව.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 පස් වරු, 11:00 ප.ව.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0 වැනි', // Carbon::now()->subSeconds(1)->diffForHumans() 'තත්පර 1 කට පෙර', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'තත්පර 1 කට පෙර', // Carbon::now()->subSeconds(2)->diffForHumans() 'තත්පර 2 කට පෙර', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'තත්පර 2 කට පෙර', // Carbon::now()->subMinutes(1)->diffForHumans() 'මිනිත්තු 1 කට පෙර', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'මිනිත්තු 1 කට පෙර', // Carbon::now()->subMinutes(2)->diffForHumans() 'මිනිත්තු 2 කට පෙර', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'මිනිත්තු 2 කට පෙර', // Carbon::now()->subHours(1)->diffForHumans() 'පැය 1 කට පෙර', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'පැය 1 කට පෙර', // Carbon::now()->subHours(2)->diffForHumans() 'පැය 2 කට පෙර', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'පැය 2 කට පෙර', // Carbon::now()->subDays(1)->diffForHumans() 'දින 1 කට පෙර', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'දින 1 කට පෙර', // Carbon::now()->subDays(2)->diffForHumans() 'දින 2 කට පෙර', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'දින 2 කට පෙර', // Carbon::now()->subWeeks(1)->diffForHumans() 'සති 1 කට පෙර', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'සති 1 කට පෙර', // Carbon::now()->subWeeks(2)->diffForHumans() 'සති 2 කට පෙර', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'සති 2 කට පෙර', // Carbon::now()->subMonths(1)->diffForHumans() 'මාස 1 කට පෙර', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'මාස 1 කට පෙර', // Carbon::now()->subMonths(2)->diffForHumans() 'මාස 2 කට පෙර', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'මාස 2 කට පෙර', // Carbon::now()->subYears(1)->diffForHumans() 'වසර 1 කට පෙර', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'වසර 1 කට පෙර', // Carbon::now()->subYears(2)->diffForHumans() 'වසර 2 කට පෙර', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'වසර 2 කට පෙර', // Carbon::now()->addSecond()->diffForHumans() 'තත්පර 1 කින්', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'තත්පර 1 කින්', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'තත්පර 1 කින්', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'තත්පර 1 කින්', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'තත්පර 1 කට පෙර', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'තත්පර 1 කට පෙර', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'තත්පර 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'තත්පර 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'තත්පර 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'තත්පර 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'තත්පර 1 කින්', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'මිනිත්තු 1 තත්පර 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'වසර 2 මාස 3 දින 1 තත්පර 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'වසර 3 කින්', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'මාස 5 කට පෙර', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'වසර 2 මාස 3 දින 1 තත්පර 1 කට පෙර', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'සති 1 පැය 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'සති 1 දින 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'සති 1 දින 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'සති 1 දින 6 න්', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'සති 2 පැය 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'පැයක් කින්', // CarbonInterval::days(2)->forHumans() 'දින 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'දින 1 පැය 3', ]; } ================================================ FILE: tests/Localization/SiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SiTest extends LocalizationTestCase { public const LOCALE = 'si'; // Sinhala public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'හෙට පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'සෙනසුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ඉරිදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'සඳුදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'බදාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'බ්‍රහස්පතින්දා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'බදාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'බ්‍රහස්පතින්දා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'සෙනසුරාදා පෙ.ව. 12:00ට', // Carbon::now()->subDays(2)->calendar() 'පසුගිය ඉරිදා ප.ව. 8:49ට', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ඊයේ ප.ව. 10:00ට', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'අද පෙ.ව. 10:00ට', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'අද පෙ.ව. 2:00ට', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'හෙට පෙ.ව. 1:00ට', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ඊයේ පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ඊයේ පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය අඟහරුවාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය සඳුදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය ඉරිදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය සෙනසුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'පසුගිය සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'පසුගිය බ්‍රහස්පතින්දා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'පසුගිය බදාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'පසුගිය සිකුරාදා පෙ.ව. 12:00ට', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 වැනි 1 වැනි 1 වැනි 1 වැනි 1 වැනි', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 වැනි 1 වැනි', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 වැනි 1 වැනි', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 වැනි 1 වැනි', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 වැනි 1 වැනි', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 වැනි 1 වැනි', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 වැනි 1 වැනි', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 වැනි 2 වැනි', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40 වැනි', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41 වැනි', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100 වැනි', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 පෙ.ව. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 පෙර වරු, 12:00 පෙ.ව.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 පෙර වරු, 1:30 පෙ.ව.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 පෙර වරු, 2:00 පෙ.ව.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 පෙර වරු, 6:00 පෙ.ව.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 පෙර වරු, 10:00 පෙ.ව.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 පස් වරු, 12:00 ප.ව.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 පස් වරු, 5:00 ප.ව.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 පස් වරු, 9:30 ප.ව.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 පස් වරු, 11:00 ප.ව.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0 වැනි', // Carbon::now()->subSeconds(1)->diffForHumans() 'තත්පර 1 කට පෙර', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'තත්පර 1 කට පෙර', // Carbon::now()->subSeconds(2)->diffForHumans() 'තත්පර 2 කට පෙර', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'තත්පර 2 කට පෙර', // Carbon::now()->subMinutes(1)->diffForHumans() 'මිනිත්තු 1 කට පෙර', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'මිනිත්තු 1 කට පෙර', // Carbon::now()->subMinutes(2)->diffForHumans() 'මිනිත්තු 2 කට පෙර', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'මිනිත්තු 2 කට පෙර', // Carbon::now()->subHours(1)->diffForHumans() 'පැය 1 කට පෙර', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'පැය 1 කට පෙර', // Carbon::now()->subHours(2)->diffForHumans() 'පැය 2 කට පෙර', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'පැය 2 කට පෙර', // Carbon::now()->subDays(1)->diffForHumans() 'දින 1 කට පෙර', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'දින 1 කට පෙර', // Carbon::now()->subDays(2)->diffForHumans() 'දින 2 කට පෙර', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'දින 2 කට පෙර', // Carbon::now()->subWeeks(1)->diffForHumans() 'සති 1 කට පෙර', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'සති 1 කට පෙර', // Carbon::now()->subWeeks(2)->diffForHumans() 'සති 2 කට පෙර', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'සති 2 කට පෙර', // Carbon::now()->subMonths(1)->diffForHumans() 'මාස 1 කට පෙර', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'මාස 1 කට පෙර', // Carbon::now()->subMonths(2)->diffForHumans() 'මාස 2 කට පෙර', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'මාස 2 කට පෙර', // Carbon::now()->subYears(1)->diffForHumans() 'වසර 1 කට පෙර', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'වසර 1 කට පෙර', // Carbon::now()->subYears(2)->diffForHumans() 'වසර 2 කට පෙර', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'වසර 2 කට පෙර', // Carbon::now()->addSecond()->diffForHumans() 'තත්පර 1 කින්', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'තත්පර 1 කින්', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'තත්පර 1 කින්', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'තත්පර 1 කින්', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'තත්පර 1 කට පෙර', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'තත්පර 1 කට පෙර', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'තත්පර 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'තත්පර 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'තත්පර 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'තත්පර 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'තත්පර 1 කින්', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'මිනිත්තු 1 තත්පර 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'වසර 2 මාස 3 දින 1 තත්පර 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'වසර 3 කින්', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'මාස 5 කට පෙර', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'වසර 2 මාස 3 දින 1 තත්පර 1 කට පෙර', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'සති 1 පැය 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'සති 1 දින 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'සති 1 දින 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'සති 1 දින 6 න්', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'සති 2 පැය 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'පැයක් කින්', // CarbonInterval::days(2)->forHumans() 'දින 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'දින 1 පැය 3', ]; } ================================================ FILE: tests/Localization/SidEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SidEtTest extends LocalizationTestCase { public const LOCALE = 'sid_ET'; // Sidamo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qidaame at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sambata at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Roowe at 12:00 soodo', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Hamuse at 12:00 soodo', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Arbe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Roowe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Hamuse at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arbe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qidaame at 12:00 soodo', // Carbon::now()->subDays(2)->calendar() 'Last Sambata at 8:49 hawwaro', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 hawwaro', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 soodo', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sambata at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Qidaame at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Arbe at 12:00 soodo', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Hamuse at 12:00 soodo', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Roowe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Arbe at 12:00 soodo', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 soodo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 soodo, 12:00 soodo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 soodo, 1:30 soodo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 soodo, 2:00 soodo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 soodo, 6:00 soodo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 soodo, 10:00 soodo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 hawwaro, 12:00 hawwaro', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 hawwaro, 5:00 hawwaro', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 hawwaro, 9:30 hawwaro', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 hawwaro, 11:00 hawwaro', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/SidTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SidTest extends LocalizationTestCase { public const LOCALE = 'sid'; // Sidamo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Qidaame at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sambata at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Roowe at 12:00 soodo', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Hamuse at 12:00 soodo', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Arbe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Roowe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Hamuse at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Arbe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Qidaame at 12:00 soodo', // Carbon::now()->subDays(2)->calendar() 'Last Sambata at 8:49 hawwaro', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 hawwaro', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 soodo', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Maakisanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sanyo at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sambata at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Qidaame at 12:00 soodo', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Arbe at 12:00 soodo', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Hamuse at 12:00 soodo', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Roowe at 12:00 soodo', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Arbe at 12:00 soodo', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 soodo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 soodo, 12:00 soodo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 soodo, 1:30 soodo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 soodo, 2:00 soodo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 soodo, 6:00 soodo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 soodo, 10:00 soodo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 hawwaro, 12:00 hawwaro', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 hawwaro, 5:00 hawwaro', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 hawwaro, 9:30 hawwaro', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 hawwaro, 11:00 hawwaro', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/SkSkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SkSkTest extends LocalizationTestCase { public const LOCALE = 'sk_SK'; // Slovak public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zajtra o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobota o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'nedeľa o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pondelok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'utorok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'streda o 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'štvrtok o 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'piatok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'utorok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'streda o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'štvrtok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'piatok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobota o 00:00', // Carbon::now()->subDays(2)->calendar() 'minulá nedeľa o 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'včera o 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'dnes o 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dnes o 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'zajtra o 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'utorok o 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'včera o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'včera o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulý utorok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulý pondelok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulá nedeľa o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulá sobota o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulý piatok o 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'minulý štvrtok o 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'minulá streda o 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'minulý piatok o 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 dopoludnia CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 dopoludnia, 12:00 dopoludnia', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 dopoludnia, 1:30 dopoludnia', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 dopoludnia, 2:00 dopoludnia', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 dopoludnia, 6:00 dopoludnia', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 dopoludnia, 10:00 dopoludnia', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 popoludní, 12:00 popoludní', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 popoludní, 5:00 popoludní', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 popoludní, 9:30 popoludní', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 popoludní, 11:00 popoludní', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'pred 1 sekundou', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'pred 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'pred 2 sekundami', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'pred 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'pred 1 minútou', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'pred 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'pred 2 minútami', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'pred 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'pred 1 hodinou', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'pred 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'pred 2 hodinami', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'pred 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'pred 1 dňom', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'pred 1 d', // Carbon::now()->subDays(2)->diffForHumans() 'pred 2 dňami', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'pred 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() 'pred 1 týždňom', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'pred 1 t', // Carbon::now()->subWeeks(2)->diffForHumans() 'pred 2 týždňami', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'pred 2 t', // Carbon::now()->subMonths(1)->diffForHumans() 'pred 1 mesiacom', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'pred 1 m', // Carbon::now()->subMonths(2)->diffForHumans() 'pred 2 mesiacmi', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'pred 2 m', // Carbon::now()->subYears(1)->diffForHumans() 'pred 1 rokom', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'pred 1 r', // Carbon::now()->subYears(2)->diffForHumans() 'pred 2 rokmi', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'pred 2 r', // Carbon::now()->addSecond()->diffForHumans() 'o 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'o 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekundu po', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s po', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekundu pred', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s pred', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundy', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'o 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minúta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 r 3 m 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'o 3 roky', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'pred 5 m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'pred 2 r 3 m 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 týždeň 10 hodín', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týždeň 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týždeň 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'o 1 týždeň a 6 dní', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 týždne 1 hodina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'o hodinu', // CarbonInterval::days(2)->forHumans() '2 dni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d 3 h', ]; } ================================================ FILE: tests/Localization/SkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SkTest extends LocalizationTestCase { public const LOCALE = 'sk'; // Slovak public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'zajtra o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobota o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'nedeľa o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pondelok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'utorok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'streda o 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'štvrtok o 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'piatok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'utorok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'streda o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'štvrtok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'piatok o 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobota o 00:00', // Carbon::now()->subDays(2)->calendar() 'minulá nedeľa o 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'včera o 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'dnes o 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dnes o 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'zajtra o 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'utorok o 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'včera o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'včera o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulý utorok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulý pondelok o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulá nedeľa o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulá sobota o 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'minulý piatok o 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'minulý štvrtok o 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'minulá streda o 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'minulý piatok o 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 dopoludnia CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 dopoludnia, 12:00 dopoludnia', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 dopoludnia, 1:30 dopoludnia', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 dopoludnia, 2:00 dopoludnia', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 dopoludnia, 6:00 dopoludnia', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 dopoludnia, 10:00 dopoludnia', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 popoludní, 12:00 popoludní', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 popoludní, 5:00 popoludní', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 popoludní, 9:30 popoludní', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 popoludní, 11:00 popoludní', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'pred 1 sekundou', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'pred 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() 'pred 2 sekundami', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'pred 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() 'pred 1 minútou', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'pred 1 min', // Carbon::now()->subMinutes(2)->diffForHumans() 'pred 2 minútami', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'pred 2 min', // Carbon::now()->subHours(1)->diffForHumans() 'pred 1 hodinou', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'pred 1 h', // Carbon::now()->subHours(2)->diffForHumans() 'pred 2 hodinami', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'pred 2 h', // Carbon::now()->subDays(1)->diffForHumans() 'pred 1 dňom', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'pred 1 d', // Carbon::now()->subDays(2)->diffForHumans() 'pred 2 dňami', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'pred 2 d', // Carbon::now()->subWeeks(1)->diffForHumans() 'pred 1 týždňom', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'pred 1 t', // Carbon::now()->subWeeks(2)->diffForHumans() 'pred 2 týždňami', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'pred 2 t', // Carbon::now()->subMonths(1)->diffForHumans() 'pred 1 mesiacom', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'pred 1 m', // Carbon::now()->subMonths(2)->diffForHumans() 'pred 2 mesiacmi', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'pred 2 m', // Carbon::now()->subYears(1)->diffForHumans() 'pred 1 rokom', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'pred 1 r', // Carbon::now()->subYears(2)->diffForHumans() 'pred 2 rokmi', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'pred 2 r', // Carbon::now()->addSecond()->diffForHumans() 'o 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'o 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekundu po', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s po', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekundu pred', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s pred', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekundy', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'o 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minúta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 r 3 m 1 d 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'o 3 roky', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'pred 5 m', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'pred 2 r 3 m 1 d 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 týždeň 10 hodín', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týždeň 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 týždeň 6 dní', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'o 1 týždeň a 6 dní', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 týždne 1 hodina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'o hodinu', // CarbonInterval::days(2)->forHumans() '2 dni', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d 3 h', ]; } ================================================ FILE: tests/Localization/SlSiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SlSiTest extends LocalizationTestCase { public const LOCALE = 'sl_SI'; // Slovenian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'jutri ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'sobota ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'nedelja ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'ponedeljek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'torek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'sreda ob 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'četrtek ob 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'petek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'torek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'sreda ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'četrtek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'petek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'sobota ob 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'preteklo nedeljo ob 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'včeraj ob 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danes ob 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danes ob 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'jutri ob 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'torek ob 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'včeraj ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'včeraj ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'pretekli torek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'pretekli ponedeljek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'preteklo nedeljo ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'preteklo soboto ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'pretekli petek ob 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'pretekli četrtek ob 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'preteklo sredo ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'pretekli petek ob 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 dopoldan CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 dopoldan, 12:00 dopoldan', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 dopoldan, 1:30 dopoldan', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 dopoldan, 2:00 dopoldan', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 dopoldan, 6:00 dopoldan', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 dopoldan, 10:00 dopoldan', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 popoldan, 12:00 popoldan', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 popoldan, 5:00 popoldan', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 popoldan, 9:30 popoldan', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 popoldan, 11:00 popoldan', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pred 1 sekundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pred 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pred 2 sekundama', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pred 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pred 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pred 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pred 2 minutama', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pred 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pred 1 uro', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pred 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pred 2 urama', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pred 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pred 1 dnem', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pred 1 dnem', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pred 2 dnevoma', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pred 2 dnevoma', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pred 1 tednom', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pred 1 ted.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pred 2 tednoma', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pred 2 ted.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pred 1 mesecem', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pred 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pred 2 mesecema', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pred 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pred 1 letom', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pred 1 letom', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pred 2 letoma', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pred 2 letoma', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'čez 1 sekundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'čez 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekunda kasneje', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 s kasneje', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekunda prej', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 s prej', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekundi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'čez 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 leti 3 mes. 1 dan 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'čez 3 leta', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pred 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pred 2 letoma 3 mes. 1 dnem 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 teden 10 ur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 teden 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 teden 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'čez 1 teden in 6 dni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 tedna 1 ura', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'čez 1 uro', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dni', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 dan 3 h', ]; } ================================================ FILE: tests/Localization/SlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SlTest extends LocalizationTestCase { public const LOCALE = 'sl'; // Slovene public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'jutri ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'sobota ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'nedelja ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'ponedeljek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'torek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'sreda ob 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'četrtek ob 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'petek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'torek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'sreda ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'četrtek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'petek ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'sobota ob 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'preteklo nedeljo ob 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'včeraj ob 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danes ob 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danes ob 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'jutri ob 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'torek ob 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'včeraj ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'včeraj ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'pretekli torek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'pretekli ponedeljek ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'preteklo nedeljo ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'preteklo soboto ob 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'pretekli petek ob 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'pretekli četrtek ob 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'preteklo sredo ob 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'pretekli petek ob 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 dopoldan CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 dopoldan, 12:00 dopoldan', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 dopoldan, 1:30 dopoldan', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 dopoldan, 2:00 dopoldan', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 dopoldan, 6:00 dopoldan', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 dopoldan, 10:00 dopoldan', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 popoldan, 12:00 popoldan', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 popoldan, 5:00 popoldan', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 popoldan, 9:30 popoldan', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 popoldan, 11:00 popoldan', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pred 1 sekundo', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pred 1 s', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pred 2 sekundama', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pred 2 s', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pred 1 minuto', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pred 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pred 2 minutama', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pred 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pred 1 uro', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pred 1 h', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pred 2 urama', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pred 2 h', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pred 1 dnem', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pred 1 dnem', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pred 2 dnevoma', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pred 2 dnevoma', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pred 1 tednom', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pred 1 ted.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pred 2 tednoma', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pred 2 ted.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pred 1 mesecem', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pred 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pred 2 mesecema', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pred 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pred 1 letom', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pred 1 letom', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pred 2 letoma', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pred 2 letoma', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'čez 1 sekundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'čez 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekunda kasneje', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 s kasneje', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekunda prej', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 s prej', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekunda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekundi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'čez 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minuta 1 sekunda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 leti 3 mes. 1 dan 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'čez 3 leta', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pred 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pred 2 letoma 3 mes. 1 dnem 1 s', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 teden 10 ur', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 teden 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 teden 6 dni', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'čez 1 teden in 6 dni', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 tedna 1 ura', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'čez 1 uro', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dni', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 dan 3 h', ]; } ================================================ FILE: tests/Localization/SmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SmTest extends LocalizationTestCase { public const LOCALE = 'sm'; // Samoan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso To\'ana\'i at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Sa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Gafua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Lua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Lulu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aso Tofi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Aso Farail at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Lua at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Lulu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Tofi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Farail at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso To\'ana\'i at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Aso Sa at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Lua at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Lua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Gafua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Sa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso To\'ana\'i at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Farail at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aso Tofi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Aso Lulu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Aso Farail at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 lua ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 lua ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 lua ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 lua ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 itiiti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 itiiti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 itiiti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 itiiti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 uati ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 uati ago', // Carbon::now()->subHours(2)->diffForHumans() '2 uati ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 uati ago', // Carbon::now()->subDays(1)->diffForHumans() '1 aso ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 aso ago', // Carbon::now()->subDays(2)->diffForHumans() '2 aso ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 aso ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vaiaso ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vaiaso ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vaiaso ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vaiaso ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 māsina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 māsina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 māsina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 māsina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 tausaga ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tausaga ago', // Carbon::now()->subYears(2)->diffForHumans() '2 tausaga ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tausaga ago', // Carbon::now()->addSecond()->diffForHumans() '1 lua from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 lua from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 lua after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 lua after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 lua before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 lua before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 lua', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 lua', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 lua', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 lua', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 lua from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 itiiti 1 lua', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tausaga 3 māsina 1 aso 1 lua', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tausaga from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 māsina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tausaga 3 māsina 1 aso 1 lua ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vaiaso 10 uati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vaiaso 6 aso', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vaiaso 6 aso', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vaiaso and 6 aso from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vaiaso 1 uati', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 uati from now', // CarbonInterval::days(2)->forHumans() '2 aso', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 aso 3 uati', ]; } ================================================ FILE: tests/Localization/SmWsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SmWsTest extends LocalizationTestCase { public const LOCALE = 'sm_WS'; // Samoan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso To\'ana\'i at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Sa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Gafua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Lua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aso Lulu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Aso Tofi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Aso Farail at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Lua at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Lulu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Tofi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Farail at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso To\'ana\'i at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Aso Sa at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Aso Lua at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Lua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Gafua at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Sa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso To\'ana\'i at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Aso Farail at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Aso Tofi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Aso Lulu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Aso Farail at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 lua ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 lua ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 lua ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 lua ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 itiiti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 itiiti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 itiiti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 itiiti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 uati ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 uati ago', // Carbon::now()->subHours(2)->diffForHumans() '2 uati ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 uati ago', // Carbon::now()->subDays(1)->diffForHumans() '1 aso ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 aso ago', // Carbon::now()->subDays(2)->diffForHumans() '2 aso ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 aso ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vaiaso ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vaiaso ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vaiaso ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vaiaso ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 māsina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 māsina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 māsina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 māsina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 tausaga ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 tausaga ago', // Carbon::now()->subYears(2)->diffForHumans() '2 tausaga ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 tausaga ago', // Carbon::now()->addSecond()->diffForHumans() '1 lua from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 lua from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 lua after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 lua after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 lua before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 lua before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 lua', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 lua', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 lua', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 lua', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 lua from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 itiiti 1 lua', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 tausaga 3 māsina 1 aso 1 lua', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 tausaga from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 māsina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 tausaga 3 māsina 1 aso 1 lua ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vaiaso 10 uati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vaiaso 6 aso', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vaiaso 6 aso', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vaiaso and 6 aso from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vaiaso 1 uati', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 uati from now', // CarbonInterval::days(2)->forHumans() '2 aso', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 aso 3 uati', ]; } ================================================ FILE: tests/Localization/SmnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SmnTest extends LocalizationTestCase { public const LOCALE = 'smn'; // Inari Sami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 0.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lávurduv at 0.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pasepeeivi at 0.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'vuossaargâ at 0.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'majebaargâ at 0.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'koskoho at 0.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tuorâstuv at 0.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vástuppeeivi at 0.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'majebaargâ at 0.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'koskoho at 0.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tuorâstuv at 0.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vástuppeeivi at 0.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lávurduv at 0.00', // Carbon::now()->subDays(2)->calendar() 'Last pasepeeivi at 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'majebaargâ at 0.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 0.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 0.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last majebaargâ at 0.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vuossaargâ at 0.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pasepeeivi at 0.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lávurduv at 0.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vástuppeeivi at 0.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tuorâstuv at 0.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last koskoho at 0.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vástuppeeivi at 0.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ip. CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ip., 12:00 ip.', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ip., 1:30 ip.', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ip., 2:00 ip.', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ip., 6:00 ip.', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ip., 10:00 ip.', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ep., 12:00 ep.', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ep., 5:00 ep.', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ep., 9:30 ep.', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ep., 11:00 ep.', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 nubbe ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 nubbe ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 nubbe ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 nubbe ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 miinut ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 miinut ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 miinut ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 miinut ago', // Carbon::now()->subHours(1)->diffForHumans() '1 äigi ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 äigi ago', // Carbon::now()->subHours(2)->diffForHumans() '2 äigi ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 äigi ago', // Carbon::now()->subDays(1)->diffForHumans() '1 peivi ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 peivi ago', // Carbon::now()->subDays(2)->diffForHumans() '2 peivi ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 peivi ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 okko ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 okko ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 okko ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 okko ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mánuppaje ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mánuppaje ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mánuppaje ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mánuppaje ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ihe ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ihe ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ihe ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ihe ago', // Carbon::now()->addSecond()->diffForHumans() '1 nubbe from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 nubbe from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 nubbe after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 nubbe after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 nubbe before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 nubbe before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 nubbe', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 nubbe', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 nubbe', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 nubbe', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 nubbe from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 miinut 1 nubbe', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ihe 3 mánuppaje 1 peivi 1 nubbe', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ihe from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mánuppaje ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ihe 3 mánuppaje 1 peivi 1 nubbe ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 okko 10 äigi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 okko 6 peivi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 okko 6 peivi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 okko and 6 peivi from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 okko 1 äigi', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 äigi from now', // CarbonInterval::days(2)->forHumans() '2 peivi', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 peivi 3 äigi', ]; } ================================================ FILE: tests/Localization/SnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SnTest extends LocalizationTestCase { public const LOCALE = 'sn'; // Shona public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mugovera at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Svondo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Muvhuro at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chipiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Chitatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'China at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Chishanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chipiri at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chitatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'China at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chishanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mugovera at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Svondo at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Chipiri at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chipiri at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Muvhuro at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Svondo at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mugovera at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Chishanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last China at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Chitatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Chishanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 a CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 a, 12:00 a', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 a, 1:30 a', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 a, 2:00 a', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 a, 6:00 a', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 a, 10:00 a', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 p, 12:00 p', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 p, 5:00 p', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 p, 9:30 p', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 p, 11:00 p', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'sekonzi 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'sekonzi 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'sekonzi 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'sekonzi 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'minitsi 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minitsi 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'minitsi 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minitsi 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'maawa 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'maawa 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'maawa 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'maawa 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'mazuva 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'mazuva 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'mazuva 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'mazuva 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'vhiki 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'vhiki 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'vhiki 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'vhiki 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'mwedzi 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'mwedzi 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'mwedzi 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'mwedzi 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'makore 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'makore 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'makore 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'makore 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'sekonzi 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sekonzi 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekonzi 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'sekonzi 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekonzi 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'sekonzi 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekonzi 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'sekonzi 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekonzi 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'sekonzi 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sekonzi 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minitsi 1 sekonzi 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'makore 2 mwedzi 3 mazuva 1 sekonzi 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'makore 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'mwedzi 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'makore 2 mwedzi 3 mazuva 1 sekonzi 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'vhiki 1 maawa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'vhiki 1 mazuva 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'vhiki 1 mazuva 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'vhiki 1 and mazuva 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'vhiki 2 maawa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'maawa 1 from now', // CarbonInterval::days(2)->forHumans() 'mazuva 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'mazuva 1 maawa 3', ]; } ================================================ FILE: tests/Localization/SoDjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SoDjTest extends LocalizationTestCase { public const LOCALE = 'so_DJ'; // Somali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Beri markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Axad markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Isniin markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Hore Axad Markay ahayd 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Shalay markay ahayd 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Maanta markay tahay 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Maanta markay tahay 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Beri markay tahay 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Hore Talaada Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Hore Isniin Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Hore Axad Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Hore Sabti Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Hore Khamiis Markay ahayd 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Hore Arbaca Markay ahayd 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 ilbidhiqsi kahor', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1il kahor', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ilbidhiqsi kahor', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2il kahor', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiiqo kahor', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1dq kahor', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiiqo kahor', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2dq kahor', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saac kahor', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1sc kahor', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saac kahor', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2sc kahor', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 maalin kahor', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1ml kahor', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 maalmood kahor', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2ml kahor', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 isbuuc kahor', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1is kahor', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 isbuuc kahor', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2is kahor', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 bil kahor', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1bil kahor', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 bilood kahor', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2bil kahor', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 sanad kahor', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1sn kahor', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 sanadood kahor', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2sn kahor', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 ilbidhiqsi gudahood', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1il gudahood', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 ilbidhiqsi kedib', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1il kedib', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 ilbidhiqsi kahor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1il kahor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 ilbidhiqsi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1il', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ilbidhiqsi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2il', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1il gudahood', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiiqo 1 ilbidhiqsi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2sn 3bil 1ml 1il', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 sanadood gudahood', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5bil kahor', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2sn 3bil 1ml 1il kahor', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 isbuuc 10 saac', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 isbuuc and 6 maalmood gudahood', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 isbuuc 1 saac', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'saacad gudahood', // CarbonInterval::days(2)->forHumans() // '2 days' '2 maalmood', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1ml 3sc', ]; } ================================================ FILE: tests/Localization/SoEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SoEtTest extends LocalizationTestCase { public const LOCALE = 'so_ET'; // Somali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Beri markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Axad markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Isniin markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Hore Axad Markay ahayd 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Shalay markay ahayd 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Maanta markay tahay 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Maanta markay tahay 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Beri markay tahay 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Hore Talaada Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Hore Isniin Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Hore Axad Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Hore Sabti Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Hore Khamiis Markay ahayd 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Hore Arbaca Markay ahayd 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 ilbidhiqsi kahor', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1il kahor', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ilbidhiqsi kahor', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2il kahor', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiiqo kahor', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1dq kahor', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiiqo kahor', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2dq kahor', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saac kahor', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1sc kahor', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saac kahor', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2sc kahor', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 maalin kahor', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1ml kahor', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 maalmood kahor', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2ml kahor', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 isbuuc kahor', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1is kahor', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 isbuuc kahor', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2is kahor', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 bil kahor', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1bil kahor', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 bilood kahor', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2bil kahor', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 sanad kahor', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1sn kahor', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 sanadood kahor', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2sn kahor', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 ilbidhiqsi gudahood', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1il gudahood', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 ilbidhiqsi kedib', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1il kedib', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 ilbidhiqsi kahor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1il kahor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 ilbidhiqsi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1il', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ilbidhiqsi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2il', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1il gudahood', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiiqo 1 ilbidhiqsi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2sn 3bil 1ml 1il', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 sanadood gudahood', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5bil kahor', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2sn 3bil 1ml 1il kahor', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 isbuuc 10 saac', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 isbuuc and 6 maalmood gudahood', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 isbuuc 1 saac', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'saacad gudahood', // CarbonInterval::days(2)->forHumans() // '2 days' '2 maalmood', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1ml 3sc', ]; } ================================================ FILE: tests/Localization/SoKeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SoKeTest extends LocalizationTestCase { public const LOCALE = 'so_KE'; // Somali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Beri markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Axad markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Isniin markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Hore Axad Markay ahayd 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Shalay markay ahayd 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Maanta markay tahay 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Maanta markay tahay 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Beri markay tahay 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Hore Talaada Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Hore Isniin Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Hore Axad Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Hore Sabti Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Hore Khamiis Markay ahayd 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Hore Arbaca Markay ahayd 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 ilbidhiqsi kahor', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1il kahor', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ilbidhiqsi kahor', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2il kahor', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiiqo kahor', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1dq kahor', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiiqo kahor', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2dq kahor', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saac kahor', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1sc kahor', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saac kahor', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2sc kahor', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 maalin kahor', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1ml kahor', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 maalmood kahor', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2ml kahor', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 isbuuc kahor', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1is kahor', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 isbuuc kahor', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2is kahor', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 bil kahor', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1bil kahor', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 bilood kahor', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2bil kahor', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 sanad kahor', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1sn kahor', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 sanadood kahor', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2sn kahor', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 ilbidhiqsi gudahood', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1il gudahood', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 ilbidhiqsi kedib', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1il kedib', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 ilbidhiqsi kahor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1il kahor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 ilbidhiqsi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1il', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ilbidhiqsi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2il', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1il gudahood', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiiqo 1 ilbidhiqsi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2sn 3bil 1ml 1il', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 sanadood gudahood', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5bil kahor', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2sn 3bil 1ml 1il kahor', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 isbuuc 10 saac', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 isbuuc and 6 maalmood gudahood', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 isbuuc 1 saac', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'saacad gudahood', // CarbonInterval::days(2)->forHumans() // '2 days' '2 maalmood', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1ml 3sc', ]; } ================================================ FILE: tests/Localization/SoSoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SoSoTest extends LocalizationTestCase { public const LOCALE = 'so_SO'; // Somali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Beri markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Axad markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Isniin markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Hore Axad Markay ahayd 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Shalay markay ahayd 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Maanta markay tahay 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Maanta markay tahay 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Beri markay tahay 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Hore Talaada Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Hore Isniin Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Hore Axad Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Hore Sabti Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Hore Khamiis Markay ahayd 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Hore Arbaca Markay ahayd 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 ilbidhiqsi kahor', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1il kahor', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ilbidhiqsi kahor', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2il kahor', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiiqo kahor', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1dq kahor', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiiqo kahor', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2dq kahor', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saac kahor', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1sc kahor', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saac kahor', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2sc kahor', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 maalin kahor', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1ml kahor', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 maalmood kahor', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2ml kahor', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 isbuuc kahor', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1is kahor', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 isbuuc kahor', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2is kahor', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 bil kahor', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1bil kahor', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 bilood kahor', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2bil kahor', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 sanad kahor', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1sn kahor', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 sanadood kahor', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2sn kahor', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 ilbidhiqsi gudahood', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1il gudahood', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 ilbidhiqsi kedib', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1il kedib', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 ilbidhiqsi kahor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1il kahor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 ilbidhiqsi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1il', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ilbidhiqsi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2il', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1il gudahood', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiiqo 1 ilbidhiqsi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2sn 3bil 1ml 1il', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 sanadood gudahood', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5bil kahor', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2sn 3bil 1ml 1il kahor', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 isbuuc 10 saac', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 isbuuc and 6 maalmood gudahood', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 isbuuc 1 saac', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'saacad gudahood', // CarbonInterval::days(2)->forHumans() // '2 days' '2 maalmood', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1ml 3sc', ]; } ================================================ FILE: tests/Localization/SoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SoTest extends LocalizationTestCase { public const LOCALE = 'so'; // Somali public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Beri markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Axad markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Isniin markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Arbaca markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Khamiis markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Jimce markay tahay 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Sabti markay tahay 12:00 AM', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Hore Axad Markay ahayd 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Shalay markay ahayd 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Maanta markay tahay 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Maanta markay tahay 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Beri markay tahay 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Talaada markay tahay 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Shalay markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Hore Talaada Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Hore Isniin Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Hore Axad Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Hore Sabti Markay ahayd 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Hore Khamiis Markay ahayd 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Hore Arbaca Markay ahayd 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Hore Jimce Markay ahayd 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 2nd', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 ilbidhiqsi kahor', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1il kahor', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ilbidhiqsi kahor', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2il kahor', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiiqo kahor', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1dq kahor', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiiqo kahor', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2dq kahor', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 saac kahor', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1sc kahor', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 saac kahor', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2sc kahor', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 maalin kahor', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1ml kahor', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 maalmood kahor', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2ml kahor', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 isbuuc kahor', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1is kahor', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 isbuuc kahor', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2is kahor', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 bil kahor', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1bil kahor', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 bilood kahor', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2bil kahor', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 sanad kahor', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1sn kahor', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 sanadood kahor', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2sn kahor', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 ilbidhiqsi gudahood', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1il gudahood', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 ilbidhiqsi kedib', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1il kedib', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 ilbidhiqsi kahor', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1il kahor', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 ilbidhiqsi', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1il', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ilbidhiqsi', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2il', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1il gudahood', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiiqo 1 ilbidhiqsi', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2sn 3bil 1ml 1il', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 sanadood gudahood', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5bil kahor', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2sn 3bil 1ml 1il kahor', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 isbuuc 10 saac', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 isbuuc 6 maalmood', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 isbuuc and 6 maalmood gudahood', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 isbuuc 1 saac', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'saacad gudahood', // CarbonInterval::days(2)->forHumans() // '2 days' '2 maalmood', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1ml 3sc', ]; } ================================================ FILE: tests/Localization/SqAlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SqAlTest extends LocalizationTestCase { public const LOCALE = 'sq_AL'; // Albanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nesër në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e shtunë në 00:00', // Carbon::now()->subDays(2)->calendar() 'e diel e kaluar në 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Sot në 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sot në 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Nesër në 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'e enjte e kaluar në 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'e mërkurë e kaluar në 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PD, 12:00 pd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 PD, 1:30 pd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 PD, 2:00 pd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 PD, 6:00 pd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 PD, 10:00 pd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MD, 12:00 md', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MD, 5:00 md', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MD, 9:30 md', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MD, 11:00 md', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekondë më parë', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. më parë', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekonda më parë', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. më parë', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutë më parë', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. më parë', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta më parë', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. më parë', // Carbon::now()->subHours(1)->diffForHumans() '1 orë më parë', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. më parë', // Carbon::now()->subHours(2)->diffForHumans() '2 orë më parë', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. më parë', // Carbon::now()->subDays(1)->diffForHumans() '1 ditë më parë', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. më parë', // Carbon::now()->subDays(2)->diffForHumans() '2 ditë më parë', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. më parë', // Carbon::now()->subWeeks(1)->diffForHumans() '1 javë më parë', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 j. më parë', // Carbon::now()->subWeeks(2)->diffForHumans() '2 javë më parë', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 j. më parë', // Carbon::now()->subMonths(1)->diffForHumans() '1 muaj më parë', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans() '2 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 muaj më parë', // Carbon::now()->subYears(1)->diffForHumans() '1 vit më parë', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 v. më parë', // Carbon::now()->subYears(2)->diffForHumans() '2 vjet më parë', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 v. më parë', // Carbon::now()->addSecond()->diffForHumans() 'në 1 sekondë', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'në 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekondë pas', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. pas', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekondë para', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. para', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekondë', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekonda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'në 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutë 1 sekondë', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 v. 3 muaj 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'në 3 vjet', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 muaj më parë', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 v. 3 muaj 1 d. 1 s. më parë', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 javë 10 orë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'në 1 javë dhe 6 ditë', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 javë 1 orë', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'në një orë', // CarbonInterval::days(2)->forHumans() '2 ditë', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/SqMkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SqMkTest extends LocalizationTestCase { public const LOCALE = 'sq_MK'; // Albanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nesër në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e shtunë në 00:00', // Carbon::now()->subDays(2)->calendar() 'e diel e kaluar në 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Sot në 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sot në 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Nesër në 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'e enjte e kaluar në 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'e mërkurë e kaluar në 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PD, 12:00 pd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 PD, 1:30 pd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 PD, 2:00 pd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 PD, 6:00 pd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 PD, 10:00 pd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MD, 12:00 md', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MD, 5:00 md', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MD, 9:30 md', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MD, 11:00 md', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekondë më parë', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. më parë', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekonda më parë', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. më parë', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutë më parë', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. më parë', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta më parë', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. më parë', // Carbon::now()->subHours(1)->diffForHumans() '1 orë më parë', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. më parë', // Carbon::now()->subHours(2)->diffForHumans() '2 orë më parë', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. më parë', // Carbon::now()->subDays(1)->diffForHumans() '1 ditë më parë', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. më parë', // Carbon::now()->subDays(2)->diffForHumans() '2 ditë më parë', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. më parë', // Carbon::now()->subWeeks(1)->diffForHumans() '1 javë më parë', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 j. më parë', // Carbon::now()->subWeeks(2)->diffForHumans() '2 javë më parë', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 j. më parë', // Carbon::now()->subMonths(1)->diffForHumans() '1 muaj më parë', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans() '2 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 muaj më parë', // Carbon::now()->subYears(1)->diffForHumans() '1 vit më parë', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 v. më parë', // Carbon::now()->subYears(2)->diffForHumans() '2 vjet më parë', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 v. më parë', // Carbon::now()->addSecond()->diffForHumans() 'në 1 sekondë', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'në 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekondë pas', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. pas', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekondë para', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. para', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekondë', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekonda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'në 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutë 1 sekondë', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 v. 3 muaj 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'në 3 vjet', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 muaj më parë', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 v. 3 muaj 1 d. 1 s. më parë', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 javë 10 orë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'në 1 javë dhe 6 ditë', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 javë 1 orë', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'në një orë', // CarbonInterval::days(2)->forHumans() '2 ditë', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/SqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SqTest extends LocalizationTestCase { public const LOCALE = 'sq'; // Albanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nesër në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e shtunë në 00:00', // Carbon::now()->subDays(2)->calendar() 'e diel e kaluar në 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Sot në 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sot në 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Nesër në 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'e enjte e kaluar në 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'e mërkurë e kaluar në 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PD, 12:00 pd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 PD, 1:30 pd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 PD, 2:00 pd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 PD, 6:00 pd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 PD, 10:00 pd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MD, 12:00 md', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MD, 5:00 md', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MD, 9:30 md', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MD, 11:00 md', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekondë më parë', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. më parë', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekonda më parë', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. më parë', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutë më parë', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. më parë', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta më parë', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. më parë', // Carbon::now()->subHours(1)->diffForHumans() '1 orë më parë', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. më parë', // Carbon::now()->subHours(2)->diffForHumans() '2 orë më parë', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. më parë', // Carbon::now()->subDays(1)->diffForHumans() '1 ditë më parë', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. më parë', // Carbon::now()->subDays(2)->diffForHumans() '2 ditë më parë', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. më parë', // Carbon::now()->subWeeks(1)->diffForHumans() '1 javë më parë', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 j. më parë', // Carbon::now()->subWeeks(2)->diffForHumans() '2 javë më parë', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 j. më parë', // Carbon::now()->subMonths(1)->diffForHumans() '1 muaj më parë', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans() '2 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 muaj më parë', // Carbon::now()->subYears(1)->diffForHumans() '1 vit më parë', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 v. më parë', // Carbon::now()->subYears(2)->diffForHumans() '2 vjet më parë', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 v. më parë', // Carbon::now()->addSecond()->diffForHumans() 'në 1 sekondë', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'në 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekondë pas', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. pas', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekondë para', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. para', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekondë', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekonda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'në 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutë 1 sekondë', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 v. 3 muaj 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'në 3 vjet', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 muaj më parë', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 v. 3 muaj 1 d. 1 s. më parë', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 javë 10 orë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'në 1 javë dhe 6 ditë', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 javë 1 orë', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'në një orë', // CarbonInterval::days(2)->forHumans() '2 ditë', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/SqXkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SqXkTest extends LocalizationTestCase { public const LOCALE = 'sq_XK'; // Albanian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nesër në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e mërkurë në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e enjte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte në 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e shtunë në 00:00', // Carbon::now()->subDays(2)->calendar() 'e diel e kaluar në 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Sot në 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sot në 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Nesër në 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e martë në 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Dje në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e martë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e hënë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e diel e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e shtunë e kaluar në 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'e enjte e kaluar në 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'e mërkurë e kaluar në 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'e premte e kaluar në 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 pd CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PD, 12:00 pd', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 PD, 1:30 pd', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 PD, 2:00 pd', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 PD, 6:00 pd', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 PD, 10:00 pd', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 MD, 12:00 md', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 MD, 5:00 md', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 MD, 9:30 md', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 MD, 11:00 md', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekondë më parë', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 s. më parë', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekonda më parë', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 s. më parë', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minutë më parë', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. më parë', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta më parë', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. më parë', // Carbon::now()->subHours(1)->diffForHumans() '1 orë më parë', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 o. më parë', // Carbon::now()->subHours(2)->diffForHumans() '2 orë më parë', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 o. më parë', // Carbon::now()->subDays(1)->diffForHumans() '1 ditë më parë', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 d. më parë', // Carbon::now()->subDays(2)->diffForHumans() '2 ditë më parë', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 d. më parë', // Carbon::now()->subWeeks(1)->diffForHumans() '1 javë më parë', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 j. më parë', // Carbon::now()->subWeeks(2)->diffForHumans() '2 javë më parë', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 j. më parë', // Carbon::now()->subMonths(1)->diffForHumans() '1 muaj më parë', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans() '2 muaj më parë', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 muaj më parë', // Carbon::now()->subYears(1)->diffForHumans() '1 vit më parë', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 v. më parë', // Carbon::now()->subYears(2)->diffForHumans() '2 vjet më parë', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 v. më parë', // Carbon::now()->addSecond()->diffForHumans() 'në 1 sekondë', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'në 1 s.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekondë pas', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s. pas', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekondë para', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s. para', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekondë', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekonda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'në 1 s.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minutë 1 sekondë', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 v. 3 muaj 1 d. 1 s.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'në 3 vjet', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 muaj më parë', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 v. 3 muaj 1 d. 1 s. më parë', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 javë 10 orë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 javë 6 ditë', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'në 1 javë dhe 6 ditë', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 javë 1 orë', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'në një orë', // CarbonInterval::days(2)->forHumans() '2 ditë', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 d. 3 o.', ]; } ================================================ FILE: tests/Localization/SrCyrlBaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrCyrlBaTest extends LocalizationTestCase { public const LOCALE = 'sr_Cyrl_BA'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'сутра у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'у недељу у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'у понедељак у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'прошле недеље у 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'јуче у 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'данас у 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'данас у 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'сутра у 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'прошлог уторка у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'прошлог понедељка у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'прошле недеље у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'прошле суботе у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'прошлог четвртка у 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'прошле среде у 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'пре 1 секунд', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'пре 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'пре 2 секунде', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'пре 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'пре 1 минут', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'пре 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'пре 2 минута', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'пре 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'пре 1 сат', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'пре 1 ч.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'пре 2 сата', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'пре 2 ч.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'пре 1 дан', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'пре 1 д.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'пре 2 дана', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'пре 2 д.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'пре 1 недељу', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'пре 1 нед.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'пре 2 недеље', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'пре 2 нед.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'пре 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'пре 1 м.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'пре 2 месеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'пре 2 м.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'пре 1 годину', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'пре 1 г.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'пре 2 године', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'пре 2 г.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'за 1 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'за 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 секунд након', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сек. након', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 секунд пре', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 сек. пре', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунде', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'за 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'за 3 године', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'пре 5 м.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'пре 2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 недеља 10 сати', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'за 1 недељу и 6 дана', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 недеље 1 сат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'за 1 сат', // CarbonInterval::days(2)->forHumans() // '2 days' '2 дана', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SrCyrlMeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrCyrlMeTest extends LocalizationTestCase { public const LOCALE = 'sr_Cyrl_ME'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'сутра у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'у недељу у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'у понедељак у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'прошле недеље у 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'јуче у 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'данас у 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'данас у 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'сутра у 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'прошлог уторка у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'прошлог понедељка у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'прошле недеље у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'прошле суботе у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'прошлог четвртка у 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'прошле среде у 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'прије 1 секунд', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'прије 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'прије 2 секунде', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'прије 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'прије 1 минут', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'прије 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'прије 2 минута', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'прије 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'прије 1 сат', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'прије 1 ч.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'прије 2 сата', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'прије 2 ч.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'прије 1 дан', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'прије 1 д.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'прије 2 дана', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'прије 2 д.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'прије 1 недјељу', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'прије 1 нед.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'прије 2 недјеље', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'прије 2 нед.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'прије 1 мјесец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'прије 1 мј.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'прије 2 мјесеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'прије 2 мј.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'прије 1 годину', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'прије 1 г.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'прије 2 године', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'прије 2 г.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'за 1 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'за 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 секунд након', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сек. након', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 секунд прије', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 сек. прије', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунде', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'за 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 г. 3 мј. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'за 3 године', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'прије 5 мј.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'прије 2 г. 3 мј. 1 д. 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 недјеља 10 сати', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недјеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недјеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'за 1 недјељу и 6 дана', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 недјеље 1 сат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'за 1 сат', // CarbonInterval::days(2)->forHumans() // '2 days' '2 дана', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SrCyrlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrCyrlTest extends LocalizationTestCase { public const LOCALE = 'sr_Cyrl'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'сутра у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'у недељу у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'у понедељак у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'прошле недеље у 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'јуче у 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'данас у 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'данас у 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'сутра у 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'прошлог уторка у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'прошлог понедељка у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'прошле недеље у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'прошле суботе у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'прошлог четвртка у 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'прошле среде у 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'пре 1 секунд', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'пре 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'пре 2 секунде', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'пре 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'пре 1 минут', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'пре 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'пре 2 минута', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'пре 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'пре 1 сат', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'пре 1 ч.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'пре 2 сата', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'пре 2 ч.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'пре 1 дан', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'пре 1 д.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'пре 2 дана', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'пре 2 д.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'пре 1 недељу', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'пре 1 нед.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'пре 2 недеље', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'пре 2 нед.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'пре 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'пре 1 м.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'пре 2 месеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'пре 2 м.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'пре 1 годину', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'пре 1 г.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'пре 2 године', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'пре 2 г.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'за 1 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'за 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 секунд након', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сек. након', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 секунд пре', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 сек. пре', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунде', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'за 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'за 3 године', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'пре 5 м.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'пре 2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 недеља 10 сати', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'за 1 недељу и 6 дана', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 недеље 1 сат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'за 1 сат', // CarbonInterval::days(2)->forHumans() // '2 days' '2 дана', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SrCyrlXkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrCyrlXkTest extends LocalizationTestCase { public const LOCALE = 'sr_Cyrl_XK'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'сутра у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'у недељу у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'у понедељак у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'прошле недеље у 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'јуче у 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'данас у 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'данас у 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'сутра у 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'прошлог уторка у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'прошлог понедељка у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'прошле недеље у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'прошле суботе у 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'прошлог четвртка у 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'прошле среде у 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'пре 1 секунд', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'пре 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'пре 2 секунде', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'пре 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'пре 1 минут', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'пре 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'пре 2 минута', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'пре 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'пре 1 сат', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'пре 1 ч.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'пре 2 сата', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'пре 2 ч.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'пре 1 дан', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'пре 1 д.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'пре 2 дана', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'пре 2 д.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'пре 1 недељу', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'пре 1 нед.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'пре 2 недеље', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'пре 2 нед.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'пре 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'пре 1 м.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'пре 2 месеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'пре 2 м.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'пре 1 годину', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'пре 1 г.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'пре 2 године', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'пре 2 г.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'за 1 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'за 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 секунд након', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сек. након', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 секунд пре', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 сек. пре', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунде', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'за 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'за 3 године', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'пре 5 м.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'пре 2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 недеља 10 сати', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'за 1 недељу и 6 дана', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 недеље 1 сат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'за 1 сат', // CarbonInterval::days(2)->forHumans() // '2 days' '2 дана', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SrLatnBaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrLatnBaTest extends LocalizationTestCase { public const LOCALE = 'sr_Latn_BA'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sutra u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedelju u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedeljak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sutra u 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošlog ponedeljka u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedelje u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srede u 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'pre 1 sekundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'pre 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SrLatnMeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrLatnMeTest extends LocalizationTestCase { public const LOCALE = 'sr_Latn_ME'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sjutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedjelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sjutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošle nedjelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedjelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srijede u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'prije 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'prije 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'prije 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'prije 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'prije 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'prije 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'prije 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'prije 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'prije 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'prije 1 nedjelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'prije 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'prije 2 nedjelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'prije 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'prije 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'prije 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'prije 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'prije 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekund nakon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 sek. nakon', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund prije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 sek. prije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'prije 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'prije 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedjelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedjelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedjelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedjelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedjelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SrLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrLatnTest extends LocalizationTestCase { public const LOCALE = 'sr_Latn'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošlog ponedeljka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srede u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'pre 1 sekundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'pre 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SrLatnXkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrLatnXkTest extends LocalizationTestCase { public const LOCALE = 'sr_Latn_XK'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sutra u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedelju u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedeljak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sutra u 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošlog ponedeljka u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedelje u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srede u 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'pre 1 sekundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'pre 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SrMeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrMeTest extends LocalizationTestCase { public const LOCALE = 'sr_ME'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sjutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedjelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedjeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u srijedu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u srijedu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedjelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sjutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošle nedjelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedjelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srijede u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'prije 1 sekund', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'prije 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'prije 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'prije 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'prije 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'prije 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'prije 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'prije 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'prije 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'prije 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'prije 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'prije 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'prije 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'prije 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'prije 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'prije 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'prije 1 nedjelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'prije 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'prije 2 nedjelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'prije 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'prije 1 mjesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'prije 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'prije 2 mjeseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'prije 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'prije 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'prije 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'prije 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'prije 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 sekund nakon', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 sek. nakon', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 sekund prije', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 sek. prije', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'prije 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'prije 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedjelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedjelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedjelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedjelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedjelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SrRsLatinTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrRsLatinTest extends LocalizationTestCase { public const LOCALE = 'sr_RS@latin'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošlog ponedeljka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srede u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'pre 1 sekundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'pre 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SrRsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrRsTest extends LocalizationTestCase { public const LOCALE = 'sr_RS'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'сутра у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'у недељу у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'у понедељак у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'у среду у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'у четвртак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'у петак у 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'у суботу у 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'прошле недеље у 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'јуче у 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'данас у 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'данас у 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'сутра у 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'у уторак у 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'јуче у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'прошлог уторка у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'прошлог понедељка у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'прошле недеље у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'прошле суботе у 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'прошлог четвртка у 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'прошле среде у 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'прошлог петка у 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 ам CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 АМ, 12:00 ам', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 АМ, 1:30 ам', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 АМ, 2:00 ам', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 АМ, 6:00 ам', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 АМ, 10:00 ам', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ПМ, 12:00 пм', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ПМ, 5:00 пм', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ПМ, 9:30 пм', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ПМ, 11:00 пм', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'пре 1 секунд', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'пре 1 сек.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'пре 2 секунде', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'пре 2 сек.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'пре 1 минут', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'пре 1 мин.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'пре 2 минута', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'пре 2 мин.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'пре 1 сат', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'пре 1 ч.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'пре 2 сата', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'пре 2 ч.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'пре 1 дан', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'пре 1 д.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'пре 2 дана', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'пре 2 д.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'пре 1 недељу', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'пре 1 нед.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'пре 2 недеље', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'пре 2 нед.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'пре 1 месец', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'пре 1 м.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'пре 2 месеца', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'пре 2 м.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'пре 1 годину', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'пре 1 г.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'пре 2 године', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'пре 2 г.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'за 1 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'за 1 сек.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 секунд након', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сек. након', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 секунд пре', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 сек. пре', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 сек.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунде', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 сек.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'за 1 сек.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'за 3 године', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'пре 5 м.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'пре 2 г. 3 м. 1 д. 1 сек.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 недеља 10 сати', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 недеља 6 дана', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'за 1 недељу и 6 дана', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 недеље 1 сат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'за 1 сат', // CarbonInterval::days(2)->forHumans() // '2 days' '2 дана', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 д. 3 ч.', ]; } ================================================ FILE: tests/Localization/SrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SrTest extends LocalizationTestCase { public const LOCALE = 'sr'; // Serbian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'sutra u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'u nedelju u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'u ponedeljak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'u sredu u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'u četvrtak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'u petak u 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'u subotu u 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'prošle nedelje u 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'juče u 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'danas u 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'danas u 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'sutra u 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'u utorak u 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'juče u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'prošlog utorka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'prošlog ponedeljka u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'prošle nedelje u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'prošle subote u 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'prošlog četvrtka u 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'prošle srede u 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'prošlog petka u 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0.', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'pre 1 sekundu', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'pre 1 sek.', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'pre 2 sekunde', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'pre 2 sek.', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'pre 1 minut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'pre 1 min.', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'pre 2 minuta', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'pre 2 min.', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'pre 1 sat', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'pre 1 č.', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'pre 2 sata', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'pre 2 č.', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'pre 1 dan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'pre 1 d.', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'pre 2 dana', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'pre 2 d.', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'pre 1 nedelju', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'pre 1 ned.', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'pre 2 nedelje', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'pre 2 ned.', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'pre 1 mesec', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'pre 1 mes.', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'pre 2 meseca', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'pre 2 mes.', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'pre 1 godinu', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'pre 1 g.', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'pre 2 godine', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'pre 2 g.', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'za 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'za 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'nakon 1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'nakon 1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'pre 1 sekundu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'pre 1 sek.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 sekundu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 sek.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 sekunde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 sek.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'za 1 sek.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minut 1 sekundu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'za 3 godine', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'pre 5 mes.', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'pre 2 g. 3 mes. 1 d. 1 sek.', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 nedelja 10 sati', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 nedelja 6 dana', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'za 1 nedelju i 6 dana', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 nedelje 1 sat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'za 1 sat', // CarbonInterval::days(2)->forHumans() // '2 days' '2 dana', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 d. 3 č.', ]; } ================================================ FILE: tests/Localization/SsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SsTest extends LocalizationTestCase { public const LOCALE = 'ss'; // Swati public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kusasa nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umgcibelo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lisontfo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umsombuluko nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesibili nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesitsatfu nga 12:00 ekuseni', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Lesine nga 12:00 ekuseni', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Lesihlanu nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesibili nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesitsatfu nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesine nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesihlanu nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Umgcibelo nga 12:00 ekuseni', // Carbon::now()->subDays(2)->calendar() 'Lisontfo leliphelile nga 8:49 ebusuku', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Itolo nga 10:00 ebusuku', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Namuhla nga 10:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Namuhla nga 2:00 ekuseni', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Kusasa nga 1:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesibili nga 12:00 ekuseni', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Itolo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Itolo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesibili leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umsombuluko leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lisontfo leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umgcibelo leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesihlanu leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Lesine leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Lesitsatfu leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesihlanu leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3e 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4e 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5e 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6e 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7e 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11e 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ekuseni CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ekuseni, 12:00 ekuseni', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ekuseni, 1:30 ekuseni', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ekuseni, 2:00 ekuseni', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ekuseni, 6:00 ekuseni', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ekuseni, 10:00 ekuseni', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 emini, 12:00 emini', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 entsambama, 5:00 entsambama', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ebusuku, 9:30 ebusuku', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ebusuku, 11:00 ebusuku', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'wenteka nga emizuzwana lomcane', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'wenteka nga emizuzwana lomcane', // Carbon::now()->subSeconds(2)->diffForHumans() 'wenteka nga 2 mzuzwana', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'wenteka nga 2 mzuzwana', // Carbon::now()->subMinutes(1)->diffForHumans() 'wenteka nga umzuzu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'wenteka nga umzuzu', // Carbon::now()->subMinutes(2)->diffForHumans() 'wenteka nga 2 emizuzu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'wenteka nga 2 emizuzu', // Carbon::now()->subHours(1)->diffForHumans() 'wenteka nga lihora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'wenteka nga lihora', // Carbon::now()->subHours(2)->diffForHumans() 'wenteka nga 2 emahora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'wenteka nga 2 emahora', // Carbon::now()->subDays(1)->diffForHumans() 'wenteka nga lilanga', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'wenteka nga lilanga', // Carbon::now()->subDays(2)->diffForHumans() 'wenteka nga 2 emalanga', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'wenteka nga 2 emalanga', // Carbon::now()->subWeeks(1)->diffForHumans() 'wenteka nga 1 liviki', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'wenteka nga 1 liviki', // Carbon::now()->subWeeks(2)->diffForHumans() 'wenteka nga 2 emaviki', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'wenteka nga 2 emaviki', // Carbon::now()->subMonths(1)->diffForHumans() 'wenteka nga inyanga', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'wenteka nga inyanga', // Carbon::now()->subMonths(2)->diffForHumans() 'wenteka nga 2 tinyanga', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'wenteka nga 2 tinyanga', // Carbon::now()->subYears(1)->diffForHumans() 'wenteka nga umnyaka', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'wenteka nga umnyaka', // Carbon::now()->subYears(2)->diffForHumans() 'wenteka nga 2 iminyaka', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'wenteka nga 2 iminyaka', // Carbon::now()->addSecond()->diffForHumans() 'nga emizuzwana lomcane', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'nga emizuzwana lomcane', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'emizuzwana lomcane', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'emizuzwana lomcane', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 mzuzwana', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 mzuzwana', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'nga emizuzwana lomcane', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'umzuzu emizuzwana lomcane', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 iminyaka 3 tinyanga lilanga emizuzwana lomcane', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'nga 3 iminyaka', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'wenteka nga 5 tinyanga', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'wenteka nga 2 iminyaka 3 tinyanga lilanga emizuzwana lomcane', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 liviki 10 emahora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 liviki 6 emalanga', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 liviki 6 emalanga', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'nga 1 liviki 6 emalanga', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 emaviki lihora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'nga lihora', // CarbonInterval::days(2)->forHumans() '2 emalanga', // CarbonInterval::create('P1DT3H')->forHumans(true) 'lilanga 3 emahora', ]; } ================================================ FILE: tests/Localization/SsZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SsZaTest extends LocalizationTestCase { public const LOCALE = 'ss_ZA'; // Swati public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kusasa nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umgcibelo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lisontfo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umsombuluko nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesibili nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesitsatfu nga 12:00 ekuseni', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Lesine nga 12:00 ekuseni', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Lesihlanu nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesibili nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesitsatfu nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesine nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesihlanu nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Umgcibelo nga 12:00 ekuseni', // Carbon::now()->subDays(2)->calendar() 'Lisontfo leliphelile nga 8:49 ebusuku', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Itolo nga 10:00 ebusuku', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Namuhla nga 10:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Namuhla nga 2:00 ekuseni', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Kusasa nga 1:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesibili nga 12:00 ekuseni', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Itolo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Itolo nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesibili leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umsombuluko leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lisontfo leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Umgcibelo leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lesihlanu leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Lesine leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Lesitsatfu leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lesihlanu leliphelile nga 12:00 ekuseni', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3e 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4e 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5e 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6e 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7e 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11e 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ekuseni CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ekuseni, 12:00 ekuseni', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ekuseni, 1:30 ekuseni', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ekuseni, 2:00 ekuseni', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ekuseni, 6:00 ekuseni', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ekuseni, 10:00 ekuseni', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 emini, 12:00 emini', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 entsambama, 5:00 entsambama', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ebusuku, 9:30 ebusuku', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ebusuku, 11:00 ebusuku', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'wenteka nga emizuzwana lomcane', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'wenteka nga emizuzwana lomcane', // Carbon::now()->subSeconds(2)->diffForHumans() 'wenteka nga 2 mzuzwana', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'wenteka nga 2 mzuzwana', // Carbon::now()->subMinutes(1)->diffForHumans() 'wenteka nga umzuzu', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'wenteka nga umzuzu', // Carbon::now()->subMinutes(2)->diffForHumans() 'wenteka nga 2 emizuzu', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'wenteka nga 2 emizuzu', // Carbon::now()->subHours(1)->diffForHumans() 'wenteka nga lihora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'wenteka nga lihora', // Carbon::now()->subHours(2)->diffForHumans() 'wenteka nga 2 emahora', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'wenteka nga 2 emahora', // Carbon::now()->subDays(1)->diffForHumans() 'wenteka nga lilanga', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'wenteka nga lilanga', // Carbon::now()->subDays(2)->diffForHumans() 'wenteka nga 2 emalanga', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'wenteka nga 2 emalanga', // Carbon::now()->subWeeks(1)->diffForHumans() 'wenteka nga 1 liviki', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'wenteka nga 1 liviki', // Carbon::now()->subWeeks(2)->diffForHumans() 'wenteka nga 2 emaviki', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'wenteka nga 2 emaviki', // Carbon::now()->subMonths(1)->diffForHumans() 'wenteka nga inyanga', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'wenteka nga inyanga', // Carbon::now()->subMonths(2)->diffForHumans() 'wenteka nga 2 tinyanga', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'wenteka nga 2 tinyanga', // Carbon::now()->subYears(1)->diffForHumans() 'wenteka nga umnyaka', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'wenteka nga umnyaka', // Carbon::now()->subYears(2)->diffForHumans() 'wenteka nga 2 iminyaka', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'wenteka nga 2 iminyaka', // Carbon::now()->addSecond()->diffForHumans() 'nga emizuzwana lomcane', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'nga emizuzwana lomcane', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'emizuzwana lomcane', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'emizuzwana lomcane', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 mzuzwana', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 mzuzwana', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'nga emizuzwana lomcane', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'umzuzu emizuzwana lomcane', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 iminyaka 3 tinyanga lilanga emizuzwana lomcane', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'nga 3 iminyaka', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'wenteka nga 5 tinyanga', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'wenteka nga 2 iminyaka 3 tinyanga lilanga emizuzwana lomcane', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 liviki 10 emahora', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 liviki 6 emalanga', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 liviki 6 emalanga', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'nga 1 liviki 6 emalanga', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 emaviki lihora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'nga lihora', // CarbonInterval::days(2)->forHumans() '2 emalanga', // CarbonInterval::create('P1DT3H')->forHumans(true) 'lilanga 3 emahora', ]; } ================================================ FILE: tests/Localization/StTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class StTest extends LocalizationTestCase { public const LOCALE = 'st'; // Sotho public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Moqebelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sontaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mantaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Moqebelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sontaha at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mantaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sontaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Moqebelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Labone at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 thusa ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 thusa ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 thusa ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 thusa ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menyane ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 menyane ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menyane ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 menyane ago', // Carbon::now()->subHours(1)->diffForHumans() '1 sešupanako ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 sešupanako ago', // Carbon::now()->subHours(2)->diffForHumans() '2 sešupanako ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sešupanako ago', // Carbon::now()->subDays(1)->diffForHumans() '1 letsatsi ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 letsatsi ago', // Carbon::now()->subDays(2)->diffForHumans() '2 letsatsi ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 letsatsi ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Sontaha ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Sontaha ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Sontaha ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Sontaha ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 kgwedi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 kgwedi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 selemo ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 selemo ago', // Carbon::now()->subYears(2)->diffForHumans() '2 selemo ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 selemo ago', // Carbon::now()->addSecond()->diffForHumans() '1 thusa from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 thusa from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 thusa after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 thusa after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 thusa before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 thusa before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 thusa', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 thusa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 thusa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 thusa', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 thusa from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menyane 1 thusa', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 selemo 3 kgwedi 1 letsatsi 1 thusa', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 selemo from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 kgwedi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 selemo 3 kgwedi 1 letsatsi 1 thusa ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Sontaha 10 sešupanako', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sontaha 6 letsatsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sontaha 6 letsatsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Sontaha and 6 letsatsi from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Sontaha 1 sešupanako', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 sešupanako from now', // CarbonInterval::days(2)->forHumans() '2 letsatsi', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 letsatsi 3 sešupanako', ]; } ================================================ FILE: tests/Localization/StZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class StZaTest extends LocalizationTestCase { public const LOCALE = 'st_ZA'; // Sotho public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Moqebelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sontaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mantaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labohlano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Moqebelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sontaha at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mantaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sontaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Moqebelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Labone at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Labohlano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 thusa ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 thusa ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 thusa ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 thusa ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 menyane ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 menyane ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 menyane ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 menyane ago', // Carbon::now()->subHours(1)->diffForHumans() '1 sešupanako ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 sešupanako ago', // Carbon::now()->subHours(2)->diffForHumans() '2 sešupanako ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sešupanako ago', // Carbon::now()->subDays(1)->diffForHumans() '1 letsatsi ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 letsatsi ago', // Carbon::now()->subDays(2)->diffForHumans() '2 letsatsi ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 letsatsi ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Sontaha ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Sontaha ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Sontaha ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Sontaha ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 kgwedi ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 kgwedi ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 kgwedi ago', // Carbon::now()->subYears(1)->diffForHumans() '1 selemo ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 selemo ago', // Carbon::now()->subYears(2)->diffForHumans() '2 selemo ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 selemo ago', // Carbon::now()->addSecond()->diffForHumans() '1 thusa from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 thusa from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 thusa after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 thusa after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 thusa before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 thusa before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 thusa', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 thusa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 thusa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 thusa', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 thusa from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 menyane 1 thusa', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 selemo 3 kgwedi 1 letsatsi 1 thusa', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 selemo from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 kgwedi ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 selemo 3 kgwedi 1 letsatsi 1 thusa ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Sontaha 10 sešupanako', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sontaha 6 letsatsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sontaha 6 letsatsi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Sontaha and 6 letsatsi from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Sontaha 1 sešupanako', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 sešupanako from now', // CarbonInterval::days(2)->forHumans() '2 letsatsi', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 letsatsi 3 sešupanako', ]; } ================================================ FILE: tests/Localization/SvAxTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SvAxTest extends LocalizationTestCase { public const LOCALE = 'sv_AX'; // Swedish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I morgon 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På lördag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På söndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På måndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På lördag 00:00', // Carbon::now()->subDays(2)->calendar() 'I söndags 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'I dag 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I dag 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'I morgon 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I tisdags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I måndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I söndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I lördags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'I torsdags 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'I onsdags 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3e 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4e 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5e 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6e 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7e 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11e 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 fm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 fm, 12:00 fm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 fm, 1:30 fm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 fm, 2:00 fm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 fm, 6:00 fm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 fm, 10:00 fm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 em, 12:00 em', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 em, 5:00 em', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 em, 9:30 em', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 em, 11:00 em', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'för 1 sekund sedan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'för 1 s sedan', // Carbon::now()->subSeconds(2)->diffForHumans() 'för 2 sekunder sedan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'för 2 s sedan', // Carbon::now()->subMinutes(1)->diffForHumans() 'för 1 minut sedan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'för 1 min sedan', // Carbon::now()->subMinutes(2)->diffForHumans() 'för 2 minuter sedan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'för 2 min sedan', // Carbon::now()->subHours(1)->diffForHumans() 'för 1 timme sedan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'för 1 tim sedan', // Carbon::now()->subHours(2)->diffForHumans() 'för 2 timmar sedan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'för 2 tim sedan', // Carbon::now()->subDays(1)->diffForHumans() 'för 1 dag sedan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'för 1 dgr sedan', // Carbon::now()->subDays(2)->diffForHumans() 'för 2 dagar sedan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'för 2 dgr sedan', // Carbon::now()->subWeeks(1)->diffForHumans() 'för 1 vecka sedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'för 1 v sedan', // Carbon::now()->subWeeks(2)->diffForHumans() 'för 2 veckor sedan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'för 2 v sedan', // Carbon::now()->subMonths(1)->diffForHumans() 'för 1 månad sedan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'för 1 mån sedan', // Carbon::now()->subMonths(2)->diffForHumans() 'för 2 månader sedan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'för 2 mån sedan', // Carbon::now()->subYears(1)->diffForHumans() 'för 1 år sedan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'för 1 år sedan', // Carbon::now()->subYears(2)->diffForHumans() 'för 2 år sedan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'för 2 år sedan', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund före', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s före', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mån 1 dgr 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'för 5 mån sedan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'för 2 år 3 mån 1 dgr 1 s sedan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vecka 10 timmar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 vecka och 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 veckor 1 timme', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en timme', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dgr 3 tim', ]; } ================================================ FILE: tests/Localization/SvFiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SvFiTest extends LocalizationTestCase { public const LOCALE = 'sv_FI'; // Swedish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I morgon 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På lördag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På söndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På måndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På lördag 00:00', // Carbon::now()->subDays(2)->calendar() 'I söndags 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'I dag 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I dag 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'I morgon 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I tisdags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I måndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I söndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I lördags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'I torsdags 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'I onsdags 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3e 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4e 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5e 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6e 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7e 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11e 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 fm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 fm, 12:00 fm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 fm, 1:30 fm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 fm, 2:00 fm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 fm, 6:00 fm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 fm, 10:00 fm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 em, 12:00 em', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 em, 5:00 em', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 em, 9:30 em', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 em, 11:00 em', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'för 1 sekund sedan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'för 1 s sedan', // Carbon::now()->subSeconds(2)->diffForHumans() 'för 2 sekunder sedan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'för 2 s sedan', // Carbon::now()->subMinutes(1)->diffForHumans() 'för 1 minut sedan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'för 1 min sedan', // Carbon::now()->subMinutes(2)->diffForHumans() 'för 2 minuter sedan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'för 2 min sedan', // Carbon::now()->subHours(1)->diffForHumans() 'för 1 timme sedan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'för 1 tim sedan', // Carbon::now()->subHours(2)->diffForHumans() 'för 2 timmar sedan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'för 2 tim sedan', // Carbon::now()->subDays(1)->diffForHumans() 'för 1 dag sedan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'för 1 dgr sedan', // Carbon::now()->subDays(2)->diffForHumans() 'för 2 dagar sedan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'för 2 dgr sedan', // Carbon::now()->subWeeks(1)->diffForHumans() 'för 1 vecka sedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'för 1 v sedan', // Carbon::now()->subWeeks(2)->diffForHumans() 'för 2 veckor sedan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'för 2 v sedan', // Carbon::now()->subMonths(1)->diffForHumans() 'för 1 månad sedan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'för 1 mån sedan', // Carbon::now()->subMonths(2)->diffForHumans() 'för 2 månader sedan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'för 2 mån sedan', // Carbon::now()->subYears(1)->diffForHumans() 'för 1 år sedan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'för 1 år sedan', // Carbon::now()->subYears(2)->diffForHumans() 'för 2 år sedan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'för 2 år sedan', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund före', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s före', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mån 1 dgr 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'för 5 mån sedan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'för 2 år 3 mån 1 dgr 1 s sedan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vecka 10 timmar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 vecka och 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 veckor 1 timme', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en timme', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dgr 3 tim', ]; } ================================================ FILE: tests/Localization/SvSeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SvSeTest extends LocalizationTestCase { public const LOCALE = 'sv_SE'; // Swedish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I morgon 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På lördag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På söndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På måndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På lördag 00:00', // Carbon::now()->subDays(2)->calendar() 'I söndags 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'I dag 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I dag 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'I morgon 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I tisdags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I måndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I söndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I lördags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'I torsdags 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'I onsdags 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3e 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4e 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5e 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6e 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7e 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11e 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 fm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 fm, 12:00 fm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 fm, 1:30 fm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 fm, 2:00 fm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 fm, 6:00 fm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 fm, 10:00 fm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 em, 12:00 em', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 em, 5:00 em', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 em, 9:30 em', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 em, 11:00 em', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'för 1 sekund sedan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'för 1 s sedan', // Carbon::now()->subSeconds(2)->diffForHumans() 'för 2 sekunder sedan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'för 2 s sedan', // Carbon::now()->subMinutes(1)->diffForHumans() 'för 1 minut sedan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'för 1 min sedan', // Carbon::now()->subMinutes(2)->diffForHumans() 'för 2 minuter sedan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'för 2 min sedan', // Carbon::now()->subHours(1)->diffForHumans() 'för 1 timme sedan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'för 1 tim sedan', // Carbon::now()->subHours(2)->diffForHumans() 'för 2 timmar sedan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'för 2 tim sedan', // Carbon::now()->subDays(1)->diffForHumans() 'för 1 dag sedan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'för 1 dgr sedan', // Carbon::now()->subDays(2)->diffForHumans() 'för 2 dagar sedan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'för 2 dgr sedan', // Carbon::now()->subWeeks(1)->diffForHumans() 'för 1 vecka sedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'för 1 v sedan', // Carbon::now()->subWeeks(2)->diffForHumans() 'för 2 veckor sedan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'för 2 v sedan', // Carbon::now()->subMonths(1)->diffForHumans() 'för 1 månad sedan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'för 1 mån sedan', // Carbon::now()->subMonths(2)->diffForHumans() 'för 2 månader sedan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'för 2 mån sedan', // Carbon::now()->subYears(1)->diffForHumans() 'för 1 år sedan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'för 1 år sedan', // Carbon::now()->subYears(2)->diffForHumans() 'för 2 år sedan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'för 2 år sedan', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund före', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s före', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mån 1 dgr 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'för 5 mån sedan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'för 2 år 3 mån 1 dgr 1 s sedan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vecka 10 timmar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 vecka och 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 veckor 1 timme', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en timme', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dgr 3 tim', ]; } ================================================ FILE: tests/Localization/SvTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SvTest extends LocalizationTestCase { public const LOCALE = 'sv'; // Swedish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I morgon 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På lördag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På söndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På måndag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På onsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På torsdag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På fredag 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På lördag 00:00', // Carbon::now()->subDays(2)->calendar() 'I söndags 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'I dag 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I dag 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'I morgon 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'På tisdag 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I går 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I tisdags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I måndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I söndags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I lördags 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'I torsdags 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'I onsdags 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'I fredags 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1a 1a 1a 1a 1a', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2a 1a', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3e 1a', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4e 1a', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5e 1a', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6e 1a', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7e 1a', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11e 2a', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40e', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41a', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100e', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 fm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 fm, 12:00 fm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 fm, 1:30 fm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 fm, 2:00 fm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 fm, 6:00 fm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 fm, 10:00 fm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 em, 12:00 em', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 em, 5:00 em', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 em, 9:30 em', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 em, 11:00 em', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0e', // Carbon::now()->subSeconds(1)->diffForHumans() 'för 1 sekund sedan', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'för 1 s sedan', // Carbon::now()->subSeconds(2)->diffForHumans() 'för 2 sekunder sedan', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'för 2 s sedan', // Carbon::now()->subMinutes(1)->diffForHumans() 'för 1 minut sedan', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'för 1 min sedan', // Carbon::now()->subMinutes(2)->diffForHumans() 'för 2 minuter sedan', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'för 2 min sedan', // Carbon::now()->subHours(1)->diffForHumans() 'för 1 timme sedan', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'för 1 tim sedan', // Carbon::now()->subHours(2)->diffForHumans() 'för 2 timmar sedan', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'för 2 tim sedan', // Carbon::now()->subDays(1)->diffForHumans() 'för 1 dag sedan', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'för 1 dgr sedan', // Carbon::now()->subDays(2)->diffForHumans() 'för 2 dagar sedan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'för 2 dgr sedan', // Carbon::now()->subWeeks(1)->diffForHumans() 'för 1 vecka sedan', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'för 1 v sedan', // Carbon::now()->subWeeks(2)->diffForHumans() 'för 2 veckor sedan', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'för 2 v sedan', // Carbon::now()->subMonths(1)->diffForHumans() 'för 1 månad sedan', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'för 1 mån sedan', // Carbon::now()->subMonths(2)->diffForHumans() 'för 2 månader sedan', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'för 2 mån sedan', // Carbon::now()->subYears(1)->diffForHumans() 'för 1 år sedan', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'för 1 år sedan', // Carbon::now()->subYears(2)->diffForHumans() 'för 2 år sedan', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'för 2 år sedan', // Carbon::now()->addSecond()->diffForHumans() 'om 1 sekund', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'om 1 s', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekund efter', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 s efter', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekund före', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 s före', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekund', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunder', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'om 1 s', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekund', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 år 3 mån 1 dgr 1 s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'om 3 år', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'för 5 mån sedan', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'för 2 år 3 mån 1 dgr 1 s sedan', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vecka 10 timmar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vecka 6 dagar', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'om 1 vecka och 6 dagar', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 veckor 1 timme', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'om en timme', // CarbonInterval::days(2)->forHumans() '2 dagar', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dgr 3 tim', ]; } ================================================ FILE: tests/Localization/SwCdTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SwCdTest extends LocalizationTestCase { public const LOCALE = 'sw_CD'; // Swahili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kesho saa 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::now()->subDays(2)->calendar() 'wiki iliyopita Jumapili saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'leo saa 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leo saa 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'kesho saa 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'wiki iliyopita Alhamisi saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'wiki iliyopita Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'tokea sekunde 1', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tokea se. 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'tokea sekunde 2', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tokea se. 2', // Carbon::now()->subMinutes(1)->diffForHumans() 'tokea dakika 1', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'tokea d. 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'tokea dakika 2', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'tokea d. 2', // Carbon::now()->subHours(1)->diffForHumans() 'tokea saa 1', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tokea saa 1', // Carbon::now()->subHours(2)->diffForHumans() 'tokea masaa 2', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tokea masaa 2', // Carbon::now()->subDays(1)->diffForHumans() 'tokea siku 1', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'tokea si. 1', // Carbon::now()->subDays(2)->diffForHumans() 'tokea siku 2', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'tokea si. 2', // Carbon::now()->subWeeks(1)->diffForHumans() 'tokea wiki 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'tokea w. 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'tokea wiki 2', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'tokea w. 2', // Carbon::now()->subMonths(1)->diffForHumans() 'tokea mwezi 1', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tokea mwezi 1', // Carbon::now()->subMonths(2)->diffForHumans() 'tokea miezi 2', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tokea miezi 2', // Carbon::now()->subYears(1)->diffForHumans() 'tokea mwaka 1', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'tokea mwaka 1', // Carbon::now()->subYears(2)->diffForHumans() 'tokea miaka 2', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'tokea miaka 2', // Carbon::now()->addSecond()->diffForHumans() 'sekunde 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'se. 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekunde 1 baada', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'se. 1 baada', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekunde 1 kabla', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'se. 1 kabla', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekunde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'se. 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekunde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'se. 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'se. 1 baadaye', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'dakika 1 sekunde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'miaka 3 baadaye', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tokea miezi 5', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'tokea miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'wiki 1 masaa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wiki 1 na siku 6 baadaye', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'wiki 2 saa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saa limoja baadaye', // CarbonInterval::days(2)->forHumans() 'siku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'si. 1 masaa 3', ]; } ================================================ FILE: tests/Localization/SwKeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SwKeTest extends LocalizationTestCase { public const LOCALE = 'sw_KE'; // Swahili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kesho saa 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::now()->subDays(2)->calendar() 'wiki iliyopita Jumapili saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'leo saa 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leo saa 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'kesho saa 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'wiki iliyopita Alhamisi saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'wiki iliyopita Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 asubuhi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 asubuhi, 12:00 asubuhi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 asubuhi, 1:30 asubuhi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 asubuhi, 2:00 asubuhi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 asubuhi, 6:00 asubuhi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 asubuhi, 10:00 asubuhi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 alasiri, 12:00 alasiri', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 alasiri, 5:00 alasiri', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 alasiri, 9:30 alasiri', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 alasiri, 11:00 alasiri', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'tokea sekunde 1', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tokea se. 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'tokea sekunde 2', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tokea se. 2', // Carbon::now()->subMinutes(1)->diffForHumans() 'tokea dakika 1', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'tokea d. 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'tokea dakika 2', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'tokea d. 2', // Carbon::now()->subHours(1)->diffForHumans() 'tokea saa 1', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tokea saa 1', // Carbon::now()->subHours(2)->diffForHumans() 'tokea masaa 2', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tokea masaa 2', // Carbon::now()->subDays(1)->diffForHumans() 'tokea siku 1', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'tokea si. 1', // Carbon::now()->subDays(2)->diffForHumans() 'tokea siku 2', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'tokea si. 2', // Carbon::now()->subWeeks(1)->diffForHumans() 'tokea wiki 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'tokea w. 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'tokea wiki 2', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'tokea w. 2', // Carbon::now()->subMonths(1)->diffForHumans() 'tokea mwezi 1', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tokea mwezi 1', // Carbon::now()->subMonths(2)->diffForHumans() 'tokea miezi 2', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tokea miezi 2', // Carbon::now()->subYears(1)->diffForHumans() 'tokea mwaka 1', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'tokea mwaka 1', // Carbon::now()->subYears(2)->diffForHumans() 'tokea miaka 2', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'tokea miaka 2', // Carbon::now()->addSecond()->diffForHumans() 'sekunde 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'se. 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekunde 1 baada', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'se. 1 baada', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekunde 1 kabla', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'se. 1 kabla', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekunde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'se. 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekunde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'se. 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'se. 1 baadaye', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'dakika 1 sekunde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'miaka 3 baadaye', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tokea miezi 5', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'tokea miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'wiki 1 masaa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wiki 1 na siku 6 baadaye', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'wiki 2 saa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saa limoja baadaye', // CarbonInterval::days(2)->forHumans() 'siku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'si. 1 masaa 3', ]; } ================================================ FILE: tests/Localization/SwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SwTest extends LocalizationTestCase { public const LOCALE = 'sw'; // Swahili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kesho saa 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::now()->subDays(2)->calendar() 'wiki iliyopita Jumapili saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'leo saa 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leo saa 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'kesho saa 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'wiki iliyopita Alhamisi saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'wiki iliyopita Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'tokea sekunde 1', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tokea se. 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'tokea sekunde 2', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tokea se. 2', // Carbon::now()->subMinutes(1)->diffForHumans() 'tokea dakika 1', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'tokea d. 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'tokea dakika 2', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'tokea d. 2', // Carbon::now()->subHours(1)->diffForHumans() 'tokea saa 1', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tokea saa 1', // Carbon::now()->subHours(2)->diffForHumans() 'tokea masaa 2', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tokea masaa 2', // Carbon::now()->subDays(1)->diffForHumans() 'tokea siku 1', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'tokea si. 1', // Carbon::now()->subDays(2)->diffForHumans() 'tokea siku 2', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'tokea si. 2', // Carbon::now()->subWeeks(1)->diffForHumans() 'tokea wiki 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'tokea w. 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'tokea wiki 2', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'tokea w. 2', // Carbon::now()->subMonths(1)->diffForHumans() 'tokea mwezi 1', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tokea mwezi 1', // Carbon::now()->subMonths(2)->diffForHumans() 'tokea miezi 2', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tokea miezi 2', // Carbon::now()->subYears(1)->diffForHumans() 'tokea mwaka 1', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'tokea mwaka 1', // Carbon::now()->subYears(2)->diffForHumans() 'tokea miaka 2', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'tokea miaka 2', // Carbon::now()->addSecond()->diffForHumans() 'sekunde 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'se. 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekunde 1 baada', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'se. 1 baada', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekunde 1 kabla', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'se. 1 kabla', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekunde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'se. 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekunde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'se. 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'se. 1 baadaye', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'dakika 1 sekunde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'miaka 3 baadaye', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tokea miezi 5', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'tokea miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'wiki 1 masaa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wiki 1 na siku 6 baadaye', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'wiki 2 saa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saa limoja baadaye', // CarbonInterval::days(2)->forHumans() 'siku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'si. 1 masaa 3', ]; } ================================================ FILE: tests/Localization/SwTzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SwTzTest extends LocalizationTestCase { public const LOCALE = 'sw_TZ'; // Swahili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kesho saa 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::now()->subDays(2)->calendar() 'wiki iliyopita Jumapili saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'leo saa 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leo saa 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'kesho saa 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'wiki iliyopita Alhamisi saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'wiki iliyopita Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 asubuhi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 asubuhi, 12:00 asubuhi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 asubuhi, 1:30 asubuhi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 asubuhi, 2:00 asubuhi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 asubuhi, 6:00 asubuhi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 asubuhi, 10:00 asubuhi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 alasiri, 12:00 alasiri', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 alasiri, 5:00 alasiri', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 alasiri, 9:30 alasiri', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 alasiri, 11:00 alasiri', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'tokea sekunde 1', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tokea se. 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'tokea sekunde 2', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tokea se. 2', // Carbon::now()->subMinutes(1)->diffForHumans() 'tokea dakika 1', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'tokea d. 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'tokea dakika 2', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'tokea d. 2', // Carbon::now()->subHours(1)->diffForHumans() 'tokea saa 1', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tokea saa 1', // Carbon::now()->subHours(2)->diffForHumans() 'tokea masaa 2', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tokea masaa 2', // Carbon::now()->subDays(1)->diffForHumans() 'tokea siku 1', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'tokea si. 1', // Carbon::now()->subDays(2)->diffForHumans() 'tokea siku 2', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'tokea si. 2', // Carbon::now()->subWeeks(1)->diffForHumans() 'tokea wiki 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'tokea w. 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'tokea wiki 2', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'tokea w. 2', // Carbon::now()->subMonths(1)->diffForHumans() 'tokea mwezi 1', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tokea mwezi 1', // Carbon::now()->subMonths(2)->diffForHumans() 'tokea miezi 2', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tokea miezi 2', // Carbon::now()->subYears(1)->diffForHumans() 'tokea mwaka 1', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'tokea mwaka 1', // Carbon::now()->subYears(2)->diffForHumans() 'tokea miaka 2', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'tokea miaka 2', // Carbon::now()->addSecond()->diffForHumans() 'sekunde 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'se. 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekunde 1 baada', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'se. 1 baada', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekunde 1 kabla', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'se. 1 kabla', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekunde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'se. 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekunde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'se. 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'se. 1 baadaye', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'dakika 1 sekunde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'miaka 3 baadaye', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tokea miezi 5', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'tokea miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'wiki 1 masaa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wiki 1 na siku 6 baadaye', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'wiki 2 saa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saa limoja baadaye', // CarbonInterval::days(2)->forHumans() 'siku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'si. 1 masaa 3', ]; } ================================================ FILE: tests/Localization/SwUgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SwUgTest extends LocalizationTestCase { public const LOCALE = 'sw_UG'; // Swahili public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kesho saa 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Alhamisi saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Ijumaa saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumamosi saat 00:00', // Carbon::now()->subDays(2)->calendar() 'wiki iliyopita Jumapili saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'leo saa 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'leo saa 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'kesho saa 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki ijayo Jumanne saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'jana 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumanne saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumatatu saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumapili saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Jumamosi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'wiki iliyopita Alhamisi saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'wiki iliyopita Jumatano saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wiki iliyopita Ijumaa saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'tokea sekunde 1', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tokea se. 1', // Carbon::now()->subSeconds(2)->diffForHumans() 'tokea sekunde 2', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tokea se. 2', // Carbon::now()->subMinutes(1)->diffForHumans() 'tokea dakika 1', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'tokea d. 1', // Carbon::now()->subMinutes(2)->diffForHumans() 'tokea dakika 2', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'tokea d. 2', // Carbon::now()->subHours(1)->diffForHumans() 'tokea saa 1', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tokea saa 1', // Carbon::now()->subHours(2)->diffForHumans() 'tokea masaa 2', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tokea masaa 2', // Carbon::now()->subDays(1)->diffForHumans() 'tokea siku 1', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'tokea si. 1', // Carbon::now()->subDays(2)->diffForHumans() 'tokea siku 2', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'tokea si. 2', // Carbon::now()->subWeeks(1)->diffForHumans() 'tokea wiki 1', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'tokea w. 1', // Carbon::now()->subWeeks(2)->diffForHumans() 'tokea wiki 2', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'tokea w. 2', // Carbon::now()->subMonths(1)->diffForHumans() 'tokea mwezi 1', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tokea mwezi 1', // Carbon::now()->subMonths(2)->diffForHumans() 'tokea miezi 2', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tokea miezi 2', // Carbon::now()->subYears(1)->diffForHumans() 'tokea mwaka 1', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'tokea mwaka 1', // Carbon::now()->subYears(2)->diffForHumans() 'tokea miaka 2', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'tokea miaka 2', // Carbon::now()->addSecond()->diffForHumans() 'sekunde 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'se. 1 baadaye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'sekunde 1 baada', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'se. 1 baada', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'sekunde 1 kabla', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'se. 1 kabla', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'sekunde 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'se. 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'sekunde 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'se. 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'se. 1 baadaye', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'dakika 1 sekunde 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'miaka 3 baadaye', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tokea miezi 5', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'tokea miaka 2 miezi 3 si. 1 se. 1', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'wiki 1 masaa 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wiki 1 siku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wiki 1 na siku 6 baadaye', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'wiki 2 saa 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'saa limoja baadaye', // CarbonInterval::days(2)->forHumans() 'siku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'si. 1 masaa 3', ]; } ================================================ FILE: tests/Localization/SzlPlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SzlPlTest extends LocalizationTestCase { public const LOCALE = 'szl_PL'; // Silesian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobŏta at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'niydziela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pyńdziŏek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wtŏrek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'strzŏda at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sztwortek at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pjōntek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtŏrek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'strzŏda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sztwortek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pjōntek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobŏta at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last niydziela at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtŏrek at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wtŏrek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pyńdziŏek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last niydziela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobŏta at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pjōntek at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sztwortek at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last strzŏda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pjōntek at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekůnda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekůnda ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekůnda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekůnda ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuta ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuta ago', // Carbon::now()->subHours(1)->diffForHumans() '1 godzina ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 godzina ago', // Carbon::now()->subHours(2)->diffForHumans() '2 godzina ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 godzina ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dźyń ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dźyń ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dźyń ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dźyń ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tydźyń ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tydźyń ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tydźyń ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tydźyń ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mjeśůnc ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mjeśůnc ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mjeśůnc ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mjeśůnc ago', // Carbon::now()->subYears(1)->diffForHumans() '1 rok ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 rok ago', // Carbon::now()->subYears(2)->diffForHumans() '2 rok ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 rok ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekůnda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekůnda from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekůnda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekůnda after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekůnda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekůnda before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekůnda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekůnda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekůnda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekůnda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekůnda from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 sekůnda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 rok 3 mjeśůnc 1 dźyń 1 sekůnda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 rok from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mjeśůnc ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 rok 3 mjeśůnc 1 dźyń 1 sekůnda ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tydźyń 10 godzina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźyń 6 dźyń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźyń 6 dźyń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tydźyń and 6 dźyń from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tydźyń 1 godzina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 godzina from now', // CarbonInterval::days(2)->forHumans() '2 dźyń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dźyń 3 godzina', ]; } ================================================ FILE: tests/Localization/SzlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class SzlTest extends LocalizationTestCase { public const LOCALE = 'szl'; // Silesian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sobŏta at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'niydziela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'pyńdziŏek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wtŏrek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'strzŏda at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sztwortek at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pjōntek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtŏrek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'strzŏda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sztwortek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pjōntek at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sobŏta at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last niydziela at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'wtŏrek at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last wtŏrek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pyńdziŏek at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last niydziela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sobŏta at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pjōntek at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sztwortek at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last strzŏda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pjōntek at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekůnda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekůnda ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekůnda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekůnda ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuta ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuta ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minuta ago', // Carbon::now()->subHours(1)->diffForHumans() '1 godzina ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 godzina ago', // Carbon::now()->subHours(2)->diffForHumans() '2 godzina ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 godzina ago', // Carbon::now()->subDays(1)->diffForHumans() '1 dźyń ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 dźyń ago', // Carbon::now()->subDays(2)->diffForHumans() '2 dźyń ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 dźyń ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tydźyń ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tydźyń ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tydźyń ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tydźyń ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mjeśůnc ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mjeśůnc ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mjeśůnc ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mjeśůnc ago', // Carbon::now()->subYears(1)->diffForHumans() '1 rok ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 rok ago', // Carbon::now()->subYears(2)->diffForHumans() '2 rok ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 rok ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekůnda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekůnda from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekůnda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekůnda after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekůnda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekůnda before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekůnda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekůnda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekůnda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekůnda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekůnda from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuta 1 sekůnda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 rok 3 mjeśůnc 1 dźyń 1 sekůnda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 rok from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mjeśůnc ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 rok 3 mjeśůnc 1 dźyń 1 sekůnda ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tydźyń 10 godzina', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźyń 6 dźyń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tydźyń 6 dźyń', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tydźyń and 6 dźyń from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tydźyń 1 godzina', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 godzina from now', // CarbonInterval::days(2)->forHumans() '2 dźyń', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 dźyń 3 godzina', ]; } ================================================ FILE: tests/Localization/TaInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TaInTest extends LocalizationTestCase { public const LOCALE = 'ta_IN'; // Tamil public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'சனி, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ஞாயிறு, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'திங்கள், 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'செவ்வாய், 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'புதன், 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'வியாழன், 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'வெள்ளி, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'புதன், 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வியாழன், 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வெள்ளி, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'சனி, 00:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் ஞாயிறு, 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் செவ்வாய், 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் திங்கள், 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் ஞாயிறு, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் சனி, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் வெள்ளி, 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் வியாழன், 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் புதன், 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் வெள்ளி, 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 2வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 காலை CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 காலை, 12:00 காலை', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 காலை, 1:30 காலை', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 காலை, 2:00 காலை', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 காலை, 6:00 காலை', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 காலை, 10:00 காலை', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 மாலை, 12:00 மாலை', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 மாலை, 5:00 மாலை', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 மாலை, 9:30 மாலை', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 மாலை, 11:00 மாலை', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடங்கள் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாட்கள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாட். முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரங்கள் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதங்கள் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 ஆண்டுகள் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ஆண். முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ஆண்டுகள் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாட்கள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரங்கள் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாட்கள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TaLkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TaLkTest extends LocalizationTestCase { public const LOCALE = 'ta_LK'; // Tamil public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'சனி, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ஞாயிறு, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'திங்கள், 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'செவ்வாய், 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'புதன், 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'வியாழன், 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'வெள்ளி, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'புதன், 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வியாழன், 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வெள்ளி, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'சனி, 00:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் ஞாயிறு, 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் செவ்வாய், 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் திங்கள், 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் ஞாயிறு, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் சனி, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் வெள்ளி, 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் வியாழன், 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் புதன், 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் வெள்ளி, 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 1வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 காலை CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 காலை, 12:00 காலை', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 காலை, 1:30 காலை', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 காலை, 2:00 காலை', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 காலை, 6:00 காலை', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 காலை, 10:00 காலை', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 மாலை, 12:00 மாலை', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 மாலை, 5:00 மாலை', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 மாலை, 9:30 மாலை', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 மாலை, 11:00 மாலை', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடங்கள் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாட்கள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாட். முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரங்கள் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதங்கள் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 ஆண்டுகள் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ஆண். முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ஆண்டுகள் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாட்கள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரங்கள் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாட்கள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TaMyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TaMyTest extends LocalizationTestCase { public const LOCALE = 'ta_MY'; // Tamil public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'சனி, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ஞாயிறு, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'திங்கள், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'புதன், மு.ப 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'வியாழன், மு.ப 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'புதன், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வியாழன், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'சனி, மு.ப 12:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் ஞாயிறு, பி.ப 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று பி.ப 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று மு.ப 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று மு.ப 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை மு.ப 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் திங்கள், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் ஞாயிறு, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் சனி, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் வியாழன், மு.ப 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் புதன், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 1வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 மு.ப CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 மு.ப, 12:00 மு.ப', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 மு.ப, 1:30 மு.ப', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 மு.ப, 2:00 மு.ப', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 மு.ப, 6:00 மு.ப', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 மு.ப, 10:00 மு.ப', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 பி.ப, 12:00 பி.ப', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 பி.ப, 5:00 பி.ப', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 பி.ப, 9:30 பி.ப', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 பி.ப, 11:00 பி.ப', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடங்கள் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாட்கள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாட். முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரங்கள் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதங்கள் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 ஆண்டுகள் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ஆண். முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ஆண்டுகள் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாட்கள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரங்கள் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாட்கள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TaSgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TaSgTest extends LocalizationTestCase { public const LOCALE = 'ta_SG'; // Tamil public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'சனி, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ஞாயிறு, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'திங்கள், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'புதன், மு.ப 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'வியாழன், மு.ப 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'புதன், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வியாழன், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'சனி, மு.ப 12:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் ஞாயிறு, பி.ப 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று பி.ப 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று மு.ப 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று மு.ப 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை மு.ப 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் செவ்வாய், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் திங்கள், மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் ஞாயிறு, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் சனி, மு.ப 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் வியாழன், மு.ப 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் புதன், மு.ப 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் வெள்ளி, மு.ப 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 2வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 மு.ப CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 மு.ப, 12:00 மு.ப', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 மு.ப, 1:30 மு.ப', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 மு.ப, 2:00 மு.ப', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 மு.ப, 6:00 மு.ப', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 மு.ப, 10:00 மு.ப', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 பி.ப, 12:00 பி.ப', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 பி.ப, 5:00 பி.ப', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 பி.ப, 9:30 பி.ப', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 பி.ப, 11:00 பி.ப', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடங்கள் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாட்கள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாட். முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரங்கள் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதங்கள் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 ஆண்டுகள் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ஆண். முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ஆண்டுகள் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாட்கள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரங்கள் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாட்கள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TaTest extends LocalizationTestCase { public const LOCALE = 'ta'; // Tamil public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'சனிக்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ஞாயிற்றுக்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'திங்கட்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'செவ்வாய்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'புதன்கிழமை, 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'வியாழக்கிழமை, 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'வெள்ளிக்கிழமை, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய்கிழமை, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'புதன்கிழமை, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வியாழக்கிழமை, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'வெள்ளிக்கிழமை, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'சனிக்கிழமை, 00:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் ஞாயிற்றுக்கிழமை, 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'செவ்வாய்கிழமை, 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் செவ்வாய்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் திங்கட்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் ஞாயிற்றுக்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் சனிக்கிழமை, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் வெள்ளிக்கிழமை, 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் வியாழக்கிழமை, 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் புதன்கிழமை, 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் வெள்ளிக்கிழமை, 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 2வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 யாமம் CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 யாமம், 12:00 யாமம்', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 யாமம், 1:30 யாமம்', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 வைகறை, 2:00 வைகறை', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 காலை, 6:00 காலை', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 நண்பகல், 10:00 நண்பகல்', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 நண்பகல், 12:00 நண்பகல்', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 எற்பாடு, 5:00 எற்பாடு', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 மாலை, 9:30 மாலை', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 யாமம், 11:00 யாமம்', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடங்கள் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாட்கள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாட். முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரங்கள் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதங்கள் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 ஆண்டுகள் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ஆண். முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ஆண்டுகள் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ஆண். 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாட்கள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாட்கள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரங்கள் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாட்கள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TcyInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TcyInTest extends LocalizationTestCase { public const LOCALE = 'tcy_IN'; // Tulu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಶನಿವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಐಥಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಸೋಮಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಬುಧಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ಗುರುವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಬುಧಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಗುರುವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶನಿವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::now()->subDays(2)->calendar() 'Last ಐಥಾರ at 8:49 ಬಯ್ಯ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ಬಯ್ಯ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಸೋಮಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಐಥಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಶನಿವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ಗುರುವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ಬುಧಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ಕಾಂಡೆ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ಕಾಂಡೆ, 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ಕಾಂಡೆ, 1:30 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ಕಾಂಡೆ, 2:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ಕಾಂಡೆ, 6:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ಕಾಂಡೆ, 10:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ಬಯ್ಯ, 12:00 ಬಯ್ಯ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ಬಯ್ಯ, 5:00 ಬಯ್ಯ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ಬಯ್ಯ, 9:30 ಬಯ್ಯ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ಬಯ್ಯ, 11:00 ಬಯ್ಯ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ಸುಗ್ಗಿ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ಸುಗ್ಗಿ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ಸುಗ್ಗಿ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ಸುಗ್ಗಿ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ಮೀನ್ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ಮೀನ್ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ಮೀನ್ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ಮೀನ್ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ನೀರ್ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ನೀರ್ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ನೀರ್ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ನೀರ್ ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ನೀರ್ 3 ಮೀನ್ 1 ಸುಗ್ಗಿ 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ನೀರ್ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ಮೀನ್ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ನೀರ್ 3 ಮೀನ್ 1 ಸುಗ್ಗಿ 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ಸುಗ್ಗಿ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ಸುಗ್ಗಿ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ಸುಗ್ಗಿ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ಸುಗ್ಗಿ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ಸುಗ್ಗಿ 3h', ]; } ================================================ FILE: tests/Localization/TcyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TcyTest extends LocalizationTestCase { public const LOCALE = 'tcy'; // Tulu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಶನಿವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಐಥಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಸೋಮಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ಬುಧಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ಗುರುವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಬುಧಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಗುರುವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಶನಿವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::now()->subDays(2)->calendar() 'Last ಐಥಾರ at 8:49 ಬಯ್ಯ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ಬಯ್ಯ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಅಂಗರೆ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಸೋಮಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಐಥಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಶನಿವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ಗುರುವಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ಬುಧಾರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ಶುಕ್ರರ at 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ಕಾಂಡೆ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ಕಾಂಡೆ, 12:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ಕಾಂಡೆ, 1:30 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ಕಾಂಡೆ, 2:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ಕಾಂಡೆ, 6:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ಕಾಂಡೆ, 10:00 ಕಾಂಡೆ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ಬಯ್ಯ, 12:00 ಬಯ್ಯ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ಬಯ್ಯ, 5:00 ಬಯ್ಯ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ಬಯ್ಯ, 9:30 ಬಯ್ಯ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ಬಯ್ಯ, 11:00 ಬಯ್ಯ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ಸುಗ್ಗಿ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ಸುಗ್ಗಿ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ಸುಗ್ಗಿ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ಸುಗ್ಗಿ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ಮೀನ್ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ಮೀನ್ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ಮೀನ್ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ಮೀನ್ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ನೀರ್ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ನೀರ್ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ನೀರ್ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ನೀರ್ ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ನೀರ್ 3 ಮೀನ್ 1 ಸುಗ್ಗಿ 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ನೀರ್ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ಮೀನ್ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ನೀರ್ 3 ಮೀನ್ 1 ಸುಗ್ಗಿ 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ಸುಗ್ಗಿ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 ಸುಗ್ಗಿ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 ಸುಗ್ಗಿ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 ಸುಗ್ಗಿ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ಸುಗ್ಗಿ 3h', ]; } ================================================ FILE: tests/Localization/TeInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TeInTest extends LocalizationTestCase { public const LOCALE = 'te_IN'; // Telugu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'రేపు రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'శనివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ఆదివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'సోమవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'బుధవారం, రాత్రి 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'గురువారం, రాత్రి 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'బుధవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'గురువారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'శనివారం, రాత్రి 12:00', // Carbon::now()->subDays(2)->calendar() 'గత ఆదివారం, రాత్రి 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'నిన్న రాత్రి 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'నేడు మధ్యాహ్నం 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'నేడు రాత్రి 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'రేపు రాత్రి 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'నిన్న రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'నిన్న రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత సోమవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత ఆదివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత శనివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'గత గురువారం, రాత్రి 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'గత బుధవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'గత శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1వ 1వ 1వ 1వ 1వ', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2వ 1వ', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3వ 1వ', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4వ 1వ', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5వ 1వ', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6వ 1వ', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7వ 2వ', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11వ 2వ', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40వ', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41వ', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100వ', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 రాత్రి CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 రాత్రి, 12:00 రాత్రి', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 రాత్రి, 1:30 రాత్రి', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 రాత్రి, 2:00 రాత్రి', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ఉదయం, 6:00 ఉదయం', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 మధ్యాహ్నం, 10:00 మధ్యాహ్నం', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 మధ్యాహ్నం, 12:00 మధ్యాహ్నం', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 సాయంత్రం, 5:00 సాయంత్రం', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 రాత్రి, 9:30 రాత్రి', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 రాత్రి, 11:00 రాత్రి', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0వ', // Carbon::now()->subSeconds(1)->diffForHumans() '1 సెకను క్రితం', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 సెక. క్రితం', // Carbon::now()->subSeconds(2)->diffForHumans() '2 సెకన్లు క్రితం', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 సెక. క్రితం', // Carbon::now()->subMinutes(1)->diffForHumans() '1 నిమిషం క్రితం', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 నిమి. క్రితం', // Carbon::now()->subMinutes(2)->diffForHumans() '2 నిమిషాలు క్రితం', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 నిమి. క్రితం', // Carbon::now()->subHours(1)->diffForHumans() '1 గంట క్రితం', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 గం. క్రితం', // Carbon::now()->subHours(2)->diffForHumans() '2 గంటలు క్రితం', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 గం. క్రితం', // Carbon::now()->subDays(1)->diffForHumans() '1 రోజు క్రితం', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 రోజు క్రితం', // Carbon::now()->subDays(2)->diffForHumans() '2 రోజులు క్రితం', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 రోజు. క్రితం', // Carbon::now()->subWeeks(1)->diffForHumans() '1 వారం క్రితం', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 వార. క్రితం', // Carbon::now()->subWeeks(2)->diffForHumans() '2 వారాలు క్రితం', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 వారా. క్రితం', // Carbon::now()->subMonths(1)->diffForHumans() '1 నెల క్రితం', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 నెల క్రితం', // Carbon::now()->subMonths(2)->diffForHumans() '2 నెలలు క్రితం', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 నెల. క్రితం', // Carbon::now()->subYears(1)->diffForHumans() '1 సంవత్సరం క్రితం', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 సం. క్రితం', // Carbon::now()->subYears(2)->diffForHumans() '2 సంవత్సరాలు క్రితం', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 సం. క్రితం', // Carbon::now()->addSecond()->diffForHumans() '1 సెకను లో', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 సెక. లో', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 సెకను', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 సెక.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 సెకన్లు', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 సెక.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 సెక. లో', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 నిమిషం 1 సెకను', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 సం. 3 నెల. 1 రోజు 1 సెక.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 సంవత్సరాలు లో', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 నెల. క్రితం', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 సం. 3 నెల. 1 రోజు 1 సెక. క్రితం', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 వారం 10 గంటలు', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 వారం 6 రోజులు', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 వారం 6 రోజులు', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 వారం, 6 రోజులు లో', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 వారాలు 1 గంట', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ఒక గంట లో', // CarbonInterval::days(2)->forHumans() '2 రోజులు', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 రోజు 3 గం.', ]; } ================================================ FILE: tests/Localization/TeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TeTest extends LocalizationTestCase { public const LOCALE = 'te'; // Telugu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'రేపు రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'శనివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ఆదివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'సోమవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'బుధవారం, రాత్రి 12:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'గురువారం, రాత్రి 12:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'బుధవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'గురువారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'శనివారం, రాత్రి 12:00', // Carbon::now()->subDays(2)->calendar() 'గత ఆదివారం, రాత్రి 8:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'నిన్న రాత్రి 10:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'నేడు మధ్యాహ్నం 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'నేడు రాత్రి 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'రేపు రాత్రి 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'నిన్న రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'నిన్న రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత మంగళవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత సోమవారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత ఆదివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత శనివారం, రాత్రి 12:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'గత శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'గత గురువారం, రాత్రి 12:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'గత బుధవారం, రాత్రి 12:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'గత శుక్రవారం, రాత్రి 12:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1వ 1వ 1వ 1వ 1వ', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2వ 1వ', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3వ 1వ', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4వ 1వ', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5వ 1వ', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6వ 1వ', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7వ 2వ', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11వ 2వ', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40వ', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41వ', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100వ', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 రాత్రి CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 రాత్రి, 12:00 రాత్రి', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 రాత్రి, 1:30 రాత్రి', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 రాత్రి, 2:00 రాత్రి', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ఉదయం, 6:00 ఉదయం', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 మధ్యాహ్నం, 10:00 మధ్యాహ్నం', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 మధ్యాహ్నం, 12:00 మధ్యాహ్నం', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 సాయంత్రం, 5:00 సాయంత్రం', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 రాత్రి, 9:30 రాత్రి', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 రాత్రి, 11:00 రాత్రి', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0వ', // Carbon::now()->subSeconds(1)->diffForHumans() '1 సెకను క్రితం', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 సెక. క్రితం', // Carbon::now()->subSeconds(2)->diffForHumans() '2 సెకన్లు క్రితం', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 సెక. క్రితం', // Carbon::now()->subMinutes(1)->diffForHumans() '1 నిమిషం క్రితం', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 నిమి. క్రితం', // Carbon::now()->subMinutes(2)->diffForHumans() '2 నిమిషాలు క్రితం', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 నిమి. క్రితం', // Carbon::now()->subHours(1)->diffForHumans() '1 గంట క్రితం', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 గం. క్రితం', // Carbon::now()->subHours(2)->diffForHumans() '2 గంటలు క్రితం', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 గం. క్రితం', // Carbon::now()->subDays(1)->diffForHumans() '1 రోజు క్రితం', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 రోజు క్రితం', // Carbon::now()->subDays(2)->diffForHumans() '2 రోజులు క్రితం', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 రోజు. క్రితం', // Carbon::now()->subWeeks(1)->diffForHumans() '1 వారం క్రితం', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 వార. క్రితం', // Carbon::now()->subWeeks(2)->diffForHumans() '2 వారాలు క్రితం', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 వారా. క్రితం', // Carbon::now()->subMonths(1)->diffForHumans() '1 నెల క్రితం', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 నెల క్రితం', // Carbon::now()->subMonths(2)->diffForHumans() '2 నెలలు క్రితం', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 నెల. క్రితం', // Carbon::now()->subYears(1)->diffForHumans() '1 సంవత్సరం క్రితం', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 సం. క్రితం', // Carbon::now()->subYears(2)->diffForHumans() '2 సంవత్సరాలు క్రితం', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 సం. క్రితం', // Carbon::now()->addSecond()->diffForHumans() '1 సెకను లో', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 సెక. లో', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 సెకను', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 సెక.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 సెకన్లు', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 సెక.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 సెక. లో', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 నిమిషం 1 సెకను', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 సం. 3 నెల. 1 రోజు 1 సెక.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 సంవత్సరాలు లో', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 నెల. క్రితం', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 సం. 3 నెల. 1 రోజు 1 సెక. క్రితం', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 వారం 10 గంటలు', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 వారం 6 రోజులు', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 వారం 6 రోజులు', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 వారం, 6 రోజులు లో', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 వారాలు 1 గంట', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ఒక గంట లో', // CarbonInterval::days(2)->forHumans() '2 రోజులు', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 రోజు 3 గం.', ]; } ================================================ FILE: tests/Localization/TeoKeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TeoKeTest extends LocalizationTestCase { public const LOCALE = 'teo_KE'; // Teso public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakasabiti, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakaejuma, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakaebarasa, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakaare, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakauni, 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Nakaung’on, 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Nakakany, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakaare, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakauni, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakaung’on, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakakany, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakasabiti, 00:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் Nakaejuma, 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakaare, 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakaare, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakaebarasa, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakaejuma, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakasabiti, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakakany, 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் Nakaung’on, 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் Nakauni, 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் Nakakany, 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 2வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 taparachu CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Taparachu, 12:00 taparachu', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Taparachu, 1:30 taparachu', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Taparachu, 2:00 taparachu', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Taparachu, 6:00 taparachu', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Taparachu, 10:00 taparachu', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ebongi, 12:00 ebongi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ebongi, 5:00 ebongi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ebongi, 9:30 ebongi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ebongi, 11:00 ebongi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடம் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாள் முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரம் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதம் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 வருடம் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 வருட. முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 சில விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 வருட. 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 வருடம் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 வருட. 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரம் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TeoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TeoTest extends LocalizationTestCase { public const LOCALE = 'teo'; // Teso public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நாளை 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakasabiti, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakaejuma, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakaebarasa, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakaare, 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Nakauni, 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Nakaung’on, 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Nakakany, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakaare, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakauni, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakaung’on, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakakany, 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakasabiti, 00:00', // Carbon::now()->subDays(2)->calendar() 'கடந்த வாரம் Nakaejuma, 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'இன்று 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'இன்று 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'நாளை 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Nakaare, 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'நேற்று 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakaare, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakaebarasa, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakaejuma, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakasabiti, 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'கடந்த வாரம் Nakakany, 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'கடந்த வாரம் Nakaung’on, 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'கடந்த வாரம் Nakauni, 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'கடந்த வாரம் Nakakany, 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1வது 1வது 1வது 1வது 1வது', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2வது 1வது', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3வது 1வது', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4வது 1வது', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5வது 1வது', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6வது 1வது', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7வது 1வது', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11வது 2வது', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40வது', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41வது', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100வது', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 taparachu CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Taparachu, 12:00 taparachu', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Taparachu, 1:30 taparachu', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Taparachu, 2:00 taparachu', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Taparachu, 6:00 taparachu', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Taparachu, 10:00 taparachu', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ebongi, 12:00 ebongi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ebongi, 5:00 ebongi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ebongi, 9:30 ebongi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ebongi, 11:00 ebongi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0வது', // Carbon::now()->subSeconds(1)->diffForHumans() '1 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 விநா. முன்', // Carbon::now()->subSeconds(2)->diffForHumans() '2 சில விநாடிகள் முன்', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 விநா. முன்', // Carbon::now()->subMinutes(1)->diffForHumans() '1 நிமிடம் முன்', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 நிமி. முன்', // Carbon::now()->subMinutes(2)->diffForHumans() '2 நிமிடம் முன்', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 நிமி. முன்', // Carbon::now()->subHours(1)->diffForHumans() '1 மணி நேரம் முன்', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 மணி. முன்', // Carbon::now()->subHours(2)->diffForHumans() '2 மணி நேரம் முன்', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 மணி. முன்', // Carbon::now()->subDays(1)->diffForHumans() '1 நாள் முன்', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans() '2 நாள் முன்', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 நாள் முன்', // Carbon::now()->subWeeks(1)->diffForHumans() '1 வாரம் முன்', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 வார. முன்', // Carbon::now()->subWeeks(2)->diffForHumans() '2 வாரம் முன்', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 வார. முன்', // Carbon::now()->subMonths(1)->diffForHumans() '1 மாதம் முன்', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 மாத. முன்', // Carbon::now()->subMonths(2)->diffForHumans() '2 மாதம் முன்', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 மாத. முன்', // Carbon::now()->subYears(1)->diffForHumans() '1 வருடம் முன்', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 வருட. முன்', // Carbon::now()->subYears(2)->diffForHumans() '2 வருடம் முன்', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 வருட. முன்', // Carbon::now()->addSecond()->diffForHumans() '1 சில விநாடிகள் இல்', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 விநா. இல்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 சில விநாடிகள் பின்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 விநா. பின்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 சில விநாடிகள் முன்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 விநா. முன்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 சில விநாடிகள்', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 விநா.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 சில விநாடிகள்', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 விநா.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 விநா. இல்', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 நிமிடம் 1 சில விநாடிகள்', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 வருட. 3 மாத. 1 நாள் 1 விநா.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 வருடம் இல்', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 மாத. முன்', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 வருட. 3 மாத. 1 நாள் 1 விநா. முன்', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 வாரம் 10 மணி நேரம்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 வாரம் 6 நாள்', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 வாரம் மற்றும் 6 நாள் இல்', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 வாரம் 1 மணி நேரம்', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ஒரு மணி நேரம் இல்', // CarbonInterval::days(2)->forHumans() '2 நாள்', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 நாள் 3 மணி.', ]; } ================================================ FILE: tests/Localization/TetTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TetTest extends LocalizationTestCase { public const LOCALE = 'tet'; // Tetum public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Aban iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabadu iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domingu iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Segunda iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tersa iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Kuarta iha 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Kinta iha 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Sesta iha 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tersa iha 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kuarta iha 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Kinta iha 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sesta iha 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sabadu iha 00:00', // Carbon::now()->subDays(2)->calendar() 'Domingu semana kotuk iha 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Horiseik iha 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Ohin iha 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ohin iha 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Aban iha 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tersa iha 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Horiseik iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Horiseik iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tersa semana kotuk iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Segunda semana kotuk iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Domingu semana kotuk iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabadu semana kotuk iha 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sesta semana kotuk iha 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Kinta semana kotuk iha 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Kuarta semana kotuk iha 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sesta semana kotuk iha 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1º 1º 1º 1º 1º', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2º 1º', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3º 1º', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4º 1º', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5º 1º', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6º 1º', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7º 1º', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11º 2º', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40º', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41º', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100º', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0º', // Carbon::now()->subSeconds(1)->diffForHumans() 'segundu 1 liuba', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'segundu 1 liuba', // Carbon::now()->subSeconds(2)->diffForHumans() 'segundu 2 liuba', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'segundu 2 liuba', // Carbon::now()->subMinutes(1)->diffForHumans() 'minutu 1 liuba', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'minutu 1 liuba', // Carbon::now()->subMinutes(2)->diffForHumans() 'minutu 2 liuba', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'minutu 2 liuba', // Carbon::now()->subHours(1)->diffForHumans() 'oras 1 liuba', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'oras 1 liuba', // Carbon::now()->subHours(2)->diffForHumans() 'oras 2 liuba', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'oras 2 liuba', // Carbon::now()->subDays(1)->diffForHumans() 'loron 1 liuba', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'loron 1 liuba', // Carbon::now()->subDays(2)->diffForHumans() 'loron 2 liuba', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'loron 2 liuba', // Carbon::now()->subWeeks(1)->diffForHumans() 'semana 1 liuba', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'semana 1 liuba', // Carbon::now()->subWeeks(2)->diffForHumans() 'semana 2 liuba', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'semana 2 liuba', // Carbon::now()->subMonths(1)->diffForHumans() 'fulan 1 liuba', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'fulan 1 liuba', // Carbon::now()->subMonths(2)->diffForHumans() 'fulan 2 liuba', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'fulan 2 liuba', // Carbon::now()->subYears(1)->diffForHumans() 'tinan 1 liuba', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'tinan 1 liuba', // Carbon::now()->subYears(2)->diffForHumans() 'tinan 2 liuba', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'tinan 2 liuba', // Carbon::now()->addSecond()->diffForHumans() 'iha segundu 1', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'iha segundu 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'segundu 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'segundu 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'segundu 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'segundu 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'iha segundu 1', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'minutu 1 segundu 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'tinan 2 fulan 3 loron 1 segundu 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'iha tinan 3', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'fulan 5 liuba', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'tinan 2 fulan 3 loron 1 segundu 1 liuba', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'semana 1 oras 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'semana 1 loron 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'semana 1 loron 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'iha semana 1 loron 6', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'semana 2 oras 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'iha oras ida', // CarbonInterval::days(2)->forHumans() 'loron 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'loron 1 oras 3', ]; } ================================================ FILE: tests/Localization/TgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TgTest extends LocalizationTestCase { public const LOCALE = 'tg'; // Tajik public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Пагоҳ соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'шанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'якшанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'душанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сешанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'чоршанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'панҷшанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ҷумъаи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сешанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'чоршанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'панҷшанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ҷумъаи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'шанбеи ҳафтаи оянда соати 00:00', // Carbon::now()->subDays(2)->calendar() 'якшанбеи ҳафтаи гузашта соати 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дирӯз соати 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Имрӯз соати 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Имрӯз соати 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Пагоҳ соати 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сешанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Дирӯз соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дирӯз соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сешанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'душанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'якшанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'шанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ҷумъаи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'панҷшанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'чоршанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ҷумъаи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ум 1-ум 1-ум 1-ум 1-ум', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-юм 1-ум', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-юм 1-ум', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ум 1-ум', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ум 1-ум', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ум 1-ум', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ум 1-ум', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ум 2-юм', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ум', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ум', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ум', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 шаб CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 шаб, 12:00 шаб', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 шаб, 1:30 шаб', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 шаб, 2:00 шаб', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 субҳ, 6:00 субҳ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 субҳ, 10:00 субҳ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 рӯз, 12:00 рӯз', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 бегоҳ, 5:00 бегоҳ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 шаб, 9:30 шаб', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 шаб, 11:00 шаб', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() 'якчанд сония пеш', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'якчанд сония пеш', // Carbon::now()->subSeconds(2)->diffForHumans() '2 сония пеш', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сония пеш', // Carbon::now()->subMinutes(1)->diffForHumans() 'як дақиқа пеш', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'як дақиқа пеш', // Carbon::now()->subMinutes(2)->diffForHumans() '2 дақиқа пеш', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 дақиқа пеш', // Carbon::now()->subHours(1)->diffForHumans() 'як соат пеш', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'як соат пеш', // Carbon::now()->subHours(2)->diffForHumans() '2 соат пеш', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 соат пеш', // Carbon::now()->subDays(1)->diffForHumans() 'як рӯз пеш', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'як рӯз пеш', // Carbon::now()->subDays(2)->diffForHumans() '2 рӯз пеш', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 рӯз пеш', // Carbon::now()->subWeeks(1)->diffForHumans() 'як ҳафта пеш', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'як ҳафта пеш', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ҳафта пеш', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ҳафта пеш', // Carbon::now()->subMonths(1)->diffForHumans() 'як моҳ пеш', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'як моҳ пеш', // Carbon::now()->subMonths(2)->diffForHumans() '2 моҳ пеш', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 моҳ пеш', // Carbon::now()->subYears(1)->diffForHumans() 'як сол пеш', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'як сол пеш', // Carbon::now()->subYears(2)->diffForHumans() '2 сол пеш', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 сол пеш', // Carbon::now()->addSecond()->diffForHumans() 'баъди якчанд сония', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'баъди якчанд сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'якчанд сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'якчанд сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сония', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'баъди якчанд сония', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'як дақиқа якчанд сония', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 сол 3 моҳ як рӯз якчанд сония', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'баъди 3 сол', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 моҳ пеш', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 сол 3 моҳ як рӯз якчанд сония пеш', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'як ҳафта 10 соат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'як ҳафта 6 рӯз', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'як ҳафта 6 рӯз', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'баъди як ҳафта ва 6 рӯз', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ҳафта як соат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'баъди як соат', // CarbonInterval::days(2)->forHumans() '2 рӯз', // CarbonInterval::create('P1DT3H')->forHumans(true) 'як рӯз 3 соат', ]; } ================================================ FILE: tests/Localization/TgTjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TgTjTest extends LocalizationTestCase { public const LOCALE = 'tg_TJ'; // Tajik public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Пагоҳ соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'шанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'якшанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'душанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сешанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'чоршанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'панҷшанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ҷумъаи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сешанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'чоршанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'панҷшанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ҷумъаи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'шанбеи ҳафтаи оянда соати 00:00', // Carbon::now()->subDays(2)->calendar() 'якшанбеи ҳафтаи гузашта соати 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дирӯз соати 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Имрӯз соати 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Имрӯз соати 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Пагоҳ соати 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сешанбеи ҳафтаи оянда соати 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Дирӯз соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Дирӯз соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сешанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'душанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'якшанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'шанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ҷумъаи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'панҷшанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'чоршанбеи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ҷумъаи ҳафтаи гузашта соати 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-ум 1-ум 1-ум 1-ум 1-ум', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-юм 1-ум', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-юм 1-ум', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-ум 1-ум', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-ум 1-ум', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-ум 1-ум', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-ум 1-ум', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-ум 2-юм', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-ум', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-ум', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-ум', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 шаб CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 шаб, 12:00 шаб', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 шаб, 1:30 шаб', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 шаб, 2:00 шаб', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 субҳ, 6:00 субҳ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 субҳ, 10:00 субҳ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 рӯз, 12:00 рӯз', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 бегоҳ, 5:00 бегоҳ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 шаб, 9:30 шаб', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 шаб, 11:00 шаб', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0-ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() 'якчанд сония пеш', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'якчанд сония пеш', // Carbon::now()->subSeconds(2)->diffForHumans() '2 сония пеш', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 сония пеш', // Carbon::now()->subMinutes(1)->diffForHumans() 'як дақиқа пеш', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'як дақиқа пеш', // Carbon::now()->subMinutes(2)->diffForHumans() '2 дақиқа пеш', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 дақиқа пеш', // Carbon::now()->subHours(1)->diffForHumans() 'як соат пеш', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'як соат пеш', // Carbon::now()->subHours(2)->diffForHumans() '2 соат пеш', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 соат пеш', // Carbon::now()->subDays(1)->diffForHumans() 'як рӯз пеш', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'як рӯз пеш', // Carbon::now()->subDays(2)->diffForHumans() '2 рӯз пеш', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 рӯз пеш', // Carbon::now()->subWeeks(1)->diffForHumans() 'як ҳафта пеш', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'як ҳафта пеш', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ҳафта пеш', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ҳафта пеш', // Carbon::now()->subMonths(1)->diffForHumans() 'як моҳ пеш', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'як моҳ пеш', // Carbon::now()->subMonths(2)->diffForHumans() '2 моҳ пеш', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 моҳ пеш', // Carbon::now()->subYears(1)->diffForHumans() 'як сол пеш', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'як сол пеш', // Carbon::now()->subYears(2)->diffForHumans() '2 сол пеш', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 сол пеш', // Carbon::now()->addSecond()->diffForHumans() 'баъди якчанд сония', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'баъди якчанд сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'якчанд сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'якчанд сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 сония', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'баъди якчанд сония', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'як дақиқа якчанд сония', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 сол 3 моҳ як рӯз якчанд сония', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'баъди 3 сол', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 моҳ пеш', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 сол 3 моҳ як рӯз якчанд сония пеш', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'як ҳафта 10 соат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'як ҳафта 6 рӯз', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'як ҳафта 6 рӯз', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'баъди як ҳафта ва 6 рӯз', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ҳафта як соат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'баъди як соат', // CarbonInterval::days(2)->forHumans() '2 рӯз', // CarbonInterval::create('P1DT3H')->forHumans(true) 'як рӯз 3 соат', ]; } ================================================ FILE: tests/Localization/ThTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ThTest extends LocalizationTestCase { public const LOCALE = 'th'; // Thai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'พรุ่งนี้ เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'เสาร์หน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'อาทิตย์หน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'จันทร์หน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'อังคารหน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'พุธหน้า เวลา 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'พฤหัสบดีหน้า เวลา 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'ศุกร์หน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'อังคารหน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'พุธหน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'พฤหัสบดีหน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'ศุกร์หน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'เสาร์หน้า เวลา 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'วันอาทิตย์ที่แล้ว เวลา 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'เมื่อวานนี้ เวลา 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'วันนี้ เวลา 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'วันนี้ เวลา 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'พรุ่งนี้ เวลา 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'อังคารหน้า เวลา 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'เมื่อวานนี้ เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'เมื่อวานนี้ เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'วันอังคารที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'วันจันทร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'วันอาทิตย์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'วันเสาร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'วันศุกร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'วันพฤหัสบดีที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'วันพุธที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'วันศุกร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 ก่อนเที่ยง CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ก่อนเที่ยง, 12:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ก่อนเที่ยง, 1:30 ก่อนเที่ยง', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ก่อนเที่ยง, 2:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 ก่อนเที่ยง, 6:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 ก่อนเที่ยง, 10:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 หลังเที่ยง, 12:00 หลังเที่ยง', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 หลังเที่ยง, 5:00 หลังเที่ยง', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 หลังเที่ยง, 9:30 หลังเที่ยง', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 หลังเที่ยง, 11:00 หลังเที่ยง', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 วินาทีที่แล้ว', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 วินาทีที่แล้ว', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 วินาทีที่แล้ว', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 วินาทีที่แล้ว', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 นาทีที่แล้ว', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 นาทีที่แล้ว', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 นาทีที่แล้ว', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 นาทีที่แล้ว', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ชั่วโมงที่แล้ว', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ชั่วโมงที่แล้ว', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ชั่วโมงที่แล้ว', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ชั่วโมงที่แล้ว', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 วันที่แล้ว', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 วันที่แล้ว', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 วันที่แล้ว', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 วันที่แล้ว', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 สัปดาห์ที่แล้ว', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 สัปดาห์ที่แล้ว', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 สัปดาห์ที่แล้ว', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 สัปดาห์ที่แล้ว', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 เดือนที่แล้ว', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 เดือนที่แล้ว', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 เดือนที่แล้ว', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 เดือนที่แล้ว', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 ปีที่แล้ว', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 ปีที่แล้ว', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 ปีที่แล้ว', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 ปีที่แล้ว', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'อีก 1 วินาที', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'อีก 1 วินาที', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 วินาทีหลังจากนี้', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 วินาทีหลังจากนี้', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 วินาทีก่อน', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 วินาทีก่อน', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 วินาที', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 วินาที', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 วินาที', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 วินาที', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'อีก 1 วินาที', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 นาที 1 วินาที', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 ปี 3 เดือน 1 วัน 1 วินาที', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'อีก 3 ปี', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 เดือนที่แล้ว', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 ปี 3 เดือน 1 วัน 1 วินาทีที่แล้ว', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 สัปดาห์ 10 ชั่วโมง', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 สัปดาห์ 6 วัน', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 สัปดาห์ 6 วัน', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'อีก 1 สัปดาห์ และ 6 วัน', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 สัปดาห์ 1 ชั่วโมง', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'อีก 1 ชั่วโมง', // CarbonInterval::days(2)->forHumans() // '2 days', '2 วัน', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 วัน 3 ชั่วโมง', ]; } ================================================ FILE: tests/Localization/ThThTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ThThTest extends LocalizationTestCase { public const LOCALE = 'th_TH'; // Thai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'พรุ่งนี้ เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'เสาร์หน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'อาทิตย์หน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'จันทร์หน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'อังคารหน้า เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'พุธหน้า เวลา 0:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'พฤหัสบดีหน้า เวลา 0:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'ศุกร์หน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'อังคารหน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'พุธหน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'พฤหัสบดีหน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'ศุกร์หน้า เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'เสาร์หน้า เวลา 0:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'วันอาทิตย์ที่แล้ว เวลา 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'เมื่อวานนี้ เวลา 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'วันนี้ เวลา 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'วันนี้ เวลา 2:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'พรุ่งนี้ เวลา 1:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'อังคารหน้า เวลา 0:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'เมื่อวานนี้ เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'เมื่อวานนี้ เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'วันอังคารที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'วันจันทร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'วันอาทิตย์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'วันเสาร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'วันศุกร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'วันพฤหัสบดีที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'วันพุธที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'วันศุกร์ที่แล้ว เวลา 0:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 ก่อนเที่ยง CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ก่อนเที่ยง, 12:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ก่อนเที่ยง, 1:30 ก่อนเที่ยง', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ก่อนเที่ยง, 2:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 ก่อนเที่ยง, 6:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 ก่อนเที่ยง, 10:00 ก่อนเที่ยง', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 หลังเที่ยง, 12:00 หลังเที่ยง', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 หลังเที่ยง, 5:00 หลังเที่ยง', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 หลังเที่ยง, 9:30 หลังเที่ยง', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 หลังเที่ยง, 11:00 หลังเที่ยง', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 วินาทีที่แล้ว', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1 วินาทีที่แล้ว', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 วินาทีที่แล้ว', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2 วินาทีที่แล้ว', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 นาทีที่แล้ว', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1 นาทีที่แล้ว', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 นาทีที่แล้ว', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2 นาทีที่แล้ว', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 ชั่วโมงที่แล้ว', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1 ชั่วโมงที่แล้ว', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 ชั่วโมงที่แล้ว', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2 ชั่วโมงที่แล้ว', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 วันที่แล้ว', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1 วันที่แล้ว', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 วันที่แล้ว', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2 วันที่แล้ว', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 สัปดาห์ที่แล้ว', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1 สัปดาห์ที่แล้ว', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 สัปดาห์ที่แล้ว', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2 สัปดาห์ที่แล้ว', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 เดือนที่แล้ว', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1 เดือนที่แล้ว', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 เดือนที่แล้ว', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2 เดือนที่แล้ว', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 ปีที่แล้ว', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1 ปีที่แล้ว', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 ปีที่แล้ว', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2 ปีที่แล้ว', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', 'อีก 1 วินาที', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', 'อีก 1 วินาที', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 วินาทีหลังจากนี้', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1 วินาทีหลังจากนี้', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 วินาทีก่อน', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1 วินาทีก่อน', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 วินาที', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1 วินาที', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 วินาที', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2 วินาที', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', 'อีก 1 วินาที', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 นาที 1 วินาที', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2 ปี 3 เดือน 1 วัน 1 วินาที', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', 'อีก 3 ปี', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5 เดือนที่แล้ว', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2 ปี 3 เดือน 1 วัน 1 วินาทีที่แล้ว', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 สัปดาห์ 10 ชั่วโมง', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 สัปดาห์ 6 วัน', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 สัปดาห์ 6 วัน', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', 'อีก 1 สัปดาห์ และ 6 วัน', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 สัปดาห์ 1 ชั่วโมง', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'อีก 1 ชั่วโมง', // CarbonInterval::days(2)->forHumans() // '2 days', '2 วัน', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1 วัน 3 ชั่วโมง', ]; } ================================================ FILE: tests/Localization/TheNpTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TheNpTest extends LocalizationTestCase { public const LOCALE = 'the_NP'; // Chitwania Tharu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आइतबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिहिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिहिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिबार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last आइतबार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last आइतबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिहिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/TheTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TheTest extends LocalizationTestCase { public const LOCALE = 'the'; // Chitwania Tharu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'शनिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'आइतबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'सोमबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'बुधबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'बिहिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बुधबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'बिहिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'शनिबार at 12:00 पूर्वाह्न', // Carbon::now()->subDays(2)->calendar() 'Last आइतबार at 8:49 अपराह्न', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 अपराह्न', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 पूर्वाह्न', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last मंगलबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last सोमबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last आइतबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शनिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last बिहिबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last बुधबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last शुक्रबार at 12:00 पूर्वाह्न', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 पूर्वाह्न CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 पूर्वाह्न, 12:00 पूर्वाह्न', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 पूर्वाह्न, 1:30 पूर्वाह्न', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 पूर्वाह्न, 2:00 पूर्वाह्न', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 पूर्वाह्न, 6:00 पूर्वाह्न', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 पूर्वाह्न, 10:00 पूर्वाह्न', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 अपराह्न, 12:00 अपराह्न', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 अपराह्न, 5:00 अपराह्न', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 अपराह्न, 9:30 अपराह्न', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 अपराह्न, 11:00 अपराह्न', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/TiErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TiErTest extends LocalizationTestCase { public const LOCALE = 'ti_ER'; // Tigrinya public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑይ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበት at 8:49 ድሕር ሰዓት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ድሕር ሰዓት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑይ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ንጉሆ ሰዓተ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ንጉሆ ሰዓተ, 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ንጉሆ ሰዓተ, 1:30 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ንጉሆ ሰዓተ, 2:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ንጉሆ ሰዓተ, 6:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ንጉሆ ሰዓተ, 10:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ድሕር ሰዓት, 12:00 ድሕር ሰዓት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ድሕር ሰዓት, 5:00 ድሕር ሰዓት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ድሕር ሰዓት, 9:30 ድሕር ሰዓት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ድሕር ሰዓት, 11:00 ድሕር ሰዓት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ሰከንድ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ሰከንድ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ሰከንድ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ሰከንድ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ደቒቕ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ደቒቕ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ደቒቕ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ደቒቕ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ሰዓት ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ሰዓት ago', // Carbon::now()->subDays(1)->diffForHumans() '1 መዓልቲ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 መዓልቲ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 መዓልቲ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 መዓልቲ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ሰሙን ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ሰሙን ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ሰሙን ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ሰሙን ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ወርሒ 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ወርሒ 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ወርሒ 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ወርሒ 2 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ዓመት ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ዓመት ago', // Carbon::now()->addSecond()->diffForHumans() '1 ሰከንድ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ሰከንድ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ሰከንድ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ሰከንድ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ሰከንድ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ሰከንድ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ሰከንድ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ሰከንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ሰከንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ሰከንድ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ሰከንድ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ደቒቕ 1 ሰከንድ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ዓመት ወርሒ 3 1 መዓልቲ 1 ሰከንድ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ዓመት from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ወርሒ 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ዓመት ወርሒ 3 1 መዓልቲ 1 ሰከንድ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሰሙን 10 ሰዓት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰሙን 6 መዓልቲ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰሙን 6 መዓልቲ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ሰሙን and 6 መዓልቲ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሰሙን 1 ሰዓት', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ሰዓት from now', // CarbonInterval::days(2)->forHumans() '2 መዓልቲ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 መዓልቲ 3 ሰዓት', ]; } ================================================ FILE: tests/Localization/TiEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TiEtTest extends LocalizationTestCase { public const LOCALE = 'ti_ET'; // Tigrinya public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑይ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበት at 8:49 ድሕር ሰዓት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ድሕር ሰዓት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑይ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ንጉሆ ሰዓተ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ንጉሆ ሰዓተ, 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ንጉሆ ሰዓተ, 1:30 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ንጉሆ ሰዓተ, 2:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ንጉሆ ሰዓተ, 6:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ንጉሆ ሰዓተ, 10:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ድሕር ሰዓት, 12:00 ድሕር ሰዓት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ድሕር ሰዓት, 5:00 ድሕር ሰዓት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ድሕር ሰዓት, 9:30 ድሕር ሰዓት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ድሕር ሰዓት, 11:00 ድሕር ሰዓት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/TiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TiTest extends LocalizationTestCase { public const LOCALE = 'ti'; // Tigrinya public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኑይ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበት at 8:49 ድሕር ሰዓት', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ድሕር ሰዓት', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰሉስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኑይ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቀዳም at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሓሙስ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ረቡዕ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ዓርቢ at 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ንጉሆ ሰዓተ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ንጉሆ ሰዓተ, 12:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ንጉሆ ሰዓተ, 1:30 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ንጉሆ ሰዓተ, 2:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ንጉሆ ሰዓተ, 6:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ንጉሆ ሰዓተ, 10:00 ንጉሆ ሰዓተ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ድሕር ሰዓት, 12:00 ድሕር ሰዓት', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ድሕር ሰዓት, 5:00 ድሕር ሰዓት', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ድሕር ሰዓት, 9:30 ድሕር ሰዓት', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ድሕር ሰዓት, 11:00 ድሕር ሰዓት', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ሰከንድ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ሰከንድ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ሰከንድ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ሰከንድ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ደቒቕ ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ደቒቕ ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ደቒቕ ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ደቒቕ ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ሰዓት ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ሰዓት ago', // Carbon::now()->subDays(1)->diffForHumans() '1 መዓልቲ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 መዓልቲ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 መዓልቲ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 መዓልቲ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ሰሙን ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ሰሙን ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ሰሙን ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ሰሙን ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ወርሒ 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ወርሒ 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ወርሒ 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ወርሒ 2 ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ዓመት ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ዓመት ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ዓመት ago', // Carbon::now()->addSecond()->diffForHumans() '1 ሰከንድ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ሰከንድ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ሰከንድ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ሰከንድ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ሰከንድ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ሰከንድ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ሰከንድ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ሰከንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ሰከንድ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ሰከንድ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ሰከንድ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ደቒቕ 1 ሰከንድ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ዓመት ወርሒ 3 1 መዓልቲ 1 ሰከንድ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ዓመት from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ወርሒ 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ዓመት ወርሒ 3 1 መዓልቲ 1 ሰከንድ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሰሙን 10 ሰዓት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰሙን 6 መዓልቲ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰሙን 6 መዓልቲ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ሰሙን and 6 መዓልቲ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሰሙን 1 ሰዓት', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ሰዓት from now', // CarbonInterval::days(2)->forHumans() '2 መዓልቲ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 መዓልቲ 3 ሰዓት', ]; } ================================================ FILE: tests/Localization/TigErTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TigErTest extends LocalizationTestCase { public const LOCALE = 'tig_ER'; // Tigre public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት ንኢሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት ዓባይ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ኣረርባዓ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ከሚሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ኣረርባዓ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ከሚሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰንበት ንኢሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበት ዓባይ at 8:49 ሓቆ ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት ዓባይ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት ንኢሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ከሚሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ኣረርባዓ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ቀደም ሰር ምዕል CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ቀደም ሰር ምዕል, 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ቀደም ሰር ምዕል, 1:30 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ቀደም ሰር ምዕል, 2:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ቀደም ሰር ምዕል, 6:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ቀደም ሰር ምዕል, 10:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ሓቆ ሰር ምዕል, 12:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ሓቆ ሰር ምዕል, 5:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ሓቆ ሰር ምዕል, 9:30 ሓቆ ሰር ምዕል', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ሓቆ ሰር ምዕል, 11:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ካልኣይ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ካልኣይ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ካልኣይ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ካልኣይ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ካልኣይት ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ካልኣይት ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ካልኣይት ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ካልኣይት ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ሰዓት ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ሰዓት ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ዎሮ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ዎሮ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ዎሮ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ዎሮ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ሰቡዕ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ሰቡዕ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ሰቡዕ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ሰቡዕ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ሸምሽ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ሸምሽ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ሸምሽ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ሸምሽ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ማይ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ማይ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ማይ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ማይ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ካልኣይ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ካልኣይ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ካልኣይ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ካልኣይ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ካልኣይ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ካልኣይ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ካልኣይ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ካልኣይ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ካልኣይ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ካልኣይ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ካልኣይ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ካልኣይት 1 ካልኣይ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ማይ 3 ሸምሽ 1 ዎሮ 1 ካልኣይ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ማይ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ሸምሽ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ማይ 3 ሸምሽ 1 ዎሮ 1 ካልኣይ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሰቡዕ 10 ሰዓት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰቡዕ 6 ዎሮ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰቡዕ 6 ዎሮ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ሰቡዕ and 6 ዎሮ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሰቡዕ 1 ሰዓት', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ሰዓት from now', // CarbonInterval::days(2)->forHumans() '2 ዎሮ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ዎሮ 3 ሰዓት', ]; } ================================================ FILE: tests/Localization/TigTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TigTest extends LocalizationTestCase { public const LOCALE = 'tig'; // Tigre public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት ንኢሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰንበት ዓባይ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሰኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ኣረርባዓ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ከሚሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ኣረርባዓ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ከሚሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሰንበት ንኢሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::now()->subDays(2)->calendar() 'Last ሰንበት ዓባይ at 8:49 ሓቆ ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ታላሸኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰኖ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት ዓባይ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሰንበት ንኢሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ከሚሽ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ኣረርባዓ at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ጅምዓት at 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ቀደም ሰር ምዕል CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ቀደም ሰር ምዕል, 12:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ቀደም ሰር ምዕል, 1:30 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ቀደም ሰር ምዕል, 2:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ቀደም ሰር ምዕል, 6:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ቀደም ሰር ምዕል, 10:00 ቀደም ሰር ምዕል', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ሓቆ ሰር ምዕል, 12:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ሓቆ ሰር ምዕል, 5:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ሓቆ ሰር ምዕል, 9:30 ሓቆ ሰር ምዕል', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ሓቆ ሰር ምዕል, 11:00 ሓቆ ሰር ምዕል', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ካልኣይ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ካልኣይ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ካልኣይ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ካልኣይ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ካልኣይት ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ካልኣይት ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ካልኣይት ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ካልኣይት ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ሰዓት ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ሰዓት ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ሰዓት ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ዎሮ ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ዎሮ ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ዎሮ ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ዎሮ ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ሰቡዕ ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ሰቡዕ ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ሰቡዕ ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ሰቡዕ ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 ሸምሽ ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ሸምሽ ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 ሸምሽ ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ሸምሽ ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ማይ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ማይ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ማይ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ማይ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ካልኣይ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ካልኣይ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ካልኣይ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ካልኣይ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ካልኣይ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ካልኣይ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ካልኣይ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ካልኣይ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ካልኣይ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ካልኣይ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ካልኣይ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ካልኣይት 1 ካልኣይ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ማይ 3 ሸምሽ 1 ዎሮ 1 ካልኣይ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ማይ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ሸምሽ ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ማይ 3 ሸምሽ 1 ዎሮ 1 ካልኣይ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ሰቡዕ 10 ሰዓት', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰቡዕ 6 ዎሮ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ሰቡዕ 6 ዎሮ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ሰቡዕ and 6 ዎሮ from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ሰቡዕ 1 ሰዓት', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ሰዓት from now', // CarbonInterval::days(2)->forHumans() '2 ዎሮ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ዎሮ 3 ሰዓት', ]; } ================================================ FILE: tests/Localization/TkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TkTest extends LocalizationTestCase { public const LOCALE = 'tk'; // Turkmen public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Şenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ýekşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Duşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sişenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Çarşenbe at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Penşenbe at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Anna at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sişenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Çarşenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Penşenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Anna at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Şenbe at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Ýekşenbe at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sişenbe at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sişenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Duşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ýekşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Şenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Anna at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Penşenbe at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Çarşenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Anna at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekunt ozal', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekunt ozal', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekunt ozal', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekunt ozal', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut ozal', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minut ozal', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minut ozal', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minut ozal', // Carbon::now()->subHours(1)->diffForHumans() '1 sagat ozal', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 sagat ozal', // Carbon::now()->subHours(2)->diffForHumans() '2 sagat ozal', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sagat ozal', // Carbon::now()->subDays(1)->diffForHumans() '1 gün ozal', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 gün ozal', // Carbon::now()->subDays(2)->diffForHumans() '2 gün ozal', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gün ozal', // Carbon::now()->subWeeks(1)->diffForHumans() '1 hepde ozal', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 hepde ozal', // Carbon::now()->subWeeks(2)->diffForHumans() '2 hepde ozal', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 hepde ozal', // Carbon::now()->subMonths(1)->diffForHumans() '1 aý ozal', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 aý ozal', // Carbon::now()->subMonths(2)->diffForHumans() '2 aý ozal', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 aý ozal', // Carbon::now()->subYears(1)->diffForHumans() '1 ýyl ozal', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ýyl ozal', // Carbon::now()->subYears(2)->diffForHumans() '2 ýyl ozal', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ýyl ozal', // Carbon::now()->addSecond()->diffForHumans() '1 sekunt soňra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekunt soňra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekunt soň', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekunt soň', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekunt öň', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekunt öň', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunt', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekunt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekunt soňra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekunt', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ýyl 3 aý 1 gün 1 sekunt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ýyl soňra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 aý ozal', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ýyl 3 aý 1 gün 1 sekunt ozal', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 hepde 10 sagat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hepde 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hepde 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 hepde and 6 gün soňra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 hepde 1 sagat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 sagat soňra', // CarbonInterval::days(2)->forHumans() '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 gün 3 sagat', ]; } ================================================ FILE: tests/Localization/TkTmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TkTmTest extends LocalizationTestCase { public const LOCALE = 'tk_TM'; // Turkmen public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Şenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ýekşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Duşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sişenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Çarşenbe at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Penşenbe at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Anna at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sişenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Çarşenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Penşenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Anna at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Şenbe at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Ýekşenbe at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sişenbe at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sişenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Duşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ýekşenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Şenbe at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Anna at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Penşenbe at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Çarşenbe at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Anna at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekunt ozal', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekunt ozal', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekunt ozal', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekunt ozal', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut ozal', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minut ozal', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minut ozal', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minut ozal', // Carbon::now()->subHours(1)->diffForHumans() '1 sagat ozal', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 sagat ozal', // Carbon::now()->subHours(2)->diffForHumans() '2 sagat ozal', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 sagat ozal', // Carbon::now()->subDays(1)->diffForHumans() '1 gün ozal', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 gün ozal', // Carbon::now()->subDays(2)->diffForHumans() '2 gün ozal', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 gün ozal', // Carbon::now()->subWeeks(1)->diffForHumans() '1 hepde ozal', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 hepde ozal', // Carbon::now()->subWeeks(2)->diffForHumans() '2 hepde ozal', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 hepde ozal', // Carbon::now()->subMonths(1)->diffForHumans() '1 aý ozal', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 aý ozal', // Carbon::now()->subMonths(2)->diffForHumans() '2 aý ozal', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 aý ozal', // Carbon::now()->subYears(1)->diffForHumans() '1 ýyl ozal', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ýyl ozal', // Carbon::now()->subYears(2)->diffForHumans() '2 ýyl ozal', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ýyl ozal', // Carbon::now()->addSecond()->diffForHumans() '1 sekunt soňra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekunt soňra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekunt soň', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekunt soň', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekunt öň', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekunt öň', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekunt', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekunt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekunt', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekunt', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekunt soňra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekunt', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ýyl 3 aý 1 gün 1 sekunt', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ýyl soňra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 aý ozal', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ýyl 3 aý 1 gün 1 sekunt ozal', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 hepde 10 sagat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hepde 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 hepde 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 hepde and 6 gün soňra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 hepde 1 sagat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 sagat soňra', // CarbonInterval::days(2)->forHumans() '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 gün 3 sagat', ]; } ================================================ FILE: tests/Localization/TlPhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TlPhTest extends LocalizationTestCase { public const LOCALE = 'tl_PH'; // Tagalog public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bukas ng 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Sabado', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Linggo', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Lunes', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Martes', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Miyerkules', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '00:00 sa susunod na Huwebes', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '00:00 sa susunod na Biyernes', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Martes', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Miyerkules', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Huwebes', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Biyernes', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Sabado', // Carbon::now()->subDays(2)->calendar() '20:49 noong nakaraang Linggo', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '22:00 kahapon', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '10:00 ngayong araw', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '02:00 ngayong araw', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Bukas ng 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Martes', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '00:00 kahapon', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 kahapon', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Martes', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Lunes', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Linggo', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Sabado', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Biyernes', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '00:00 noong nakaraang Huwebes', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '00:00 noong nakaraang Miyerkules', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 noong nakaraang Biyernes', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segundo ang nakalipas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 seg. ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segundo ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 seg. ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuto ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans() '1 oras ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans() '2 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oras ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans() '1 araw ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans() '2 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 araw ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 linggo ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 linggo ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans() '1 buwan ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans() '2 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 buwan ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans() '1 taon ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans() '2 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taon ang nakalipas', // Carbon::now()->addSecond()->diffForHumans() 'sa loob ng 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sa loob ng 1 seg.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 seg.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 seg.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sa loob ng 1 seg.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taon 3 buwan 1 araw 1 seg.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'sa loob ng 3 taon', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 buwan ang nakalipas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taon 3 buwan 1 araw 1 seg. ang nakalipas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 linggo 10 oras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'sa loob ng 1 linggo at 6 araw', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 linggo 1 oras', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sa loob ng isang oras', // CarbonInterval::days(2)->forHumans() '2 araw', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 araw 3 oras', ]; } ================================================ FILE: tests/Localization/TlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TlTest extends LocalizationTestCase { public const LOCALE = 'tl'; // Tagalog public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Bukas ng 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Sabado', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Linggo', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Lunes', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Martes', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 sa susunod na Miyerkules', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '00:00 sa susunod na Huwebes', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '00:00 sa susunod na Biyernes', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Martes', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Miyerkules', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Huwebes', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Biyernes', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Sabado', // Carbon::now()->subDays(2)->calendar() '20:49 noong nakaraang Linggo', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '22:00 kahapon', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) '10:00 ngayong araw', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '02:00 ngayong araw', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Bukas ng 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 sa susunod na Martes', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) '00:00 kahapon', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 kahapon', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Martes', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Lunes', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Linggo', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Sabado', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '00:00 noong nakaraang Biyernes', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '00:00 noong nakaraang Huwebes', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '00:00 noong nakaraang Miyerkules', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '00:00 noong nakaraang Biyernes', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 segundo ang nakalipas', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 seg. ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans() '2 segundo ang nakalipas', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 seg. ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minuto ang nakalipas', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 min. ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minuto ang nakalipas', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 min. ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans() '1 oras ang nakalipas', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans() '2 oras ang nakalipas', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 oras ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans() '1 araw ang nakalipas', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans() '2 araw ang nakalipas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 araw ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans() '1 linggo ang nakalipas', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans() '2 linggo ang nakalipas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 linggo ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans() '1 buwan ang nakalipas', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans() '2 buwan ang nakalipas', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 buwan ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans() '1 taon ang nakalipas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans() '2 taon ang nakalipas', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 taon ang nakalipas', // Carbon::now()->addSecond()->diffForHumans() 'sa loob ng 1 segundo', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'sa loob ng 1 seg.', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 segundo', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 seg.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 segundo', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 seg.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'sa loob ng 1 seg.', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuto 1 segundo', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 taon 3 buwan 1 araw 1 seg.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'sa loob ng 3 taon', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 buwan ang nakalipas', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 taon 3 buwan 1 araw 1 seg. ang nakalipas', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 linggo 10 oras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 linggo 6 araw', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'sa loob ng 1 linggo at 6 araw', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 linggo 1 oras', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'sa loob ng isang oras', // CarbonInterval::days(2)->forHumans() '2 araw', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 araw 3 oras', ]; } ================================================ FILE: tests/Localization/TlhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TlhTest extends LocalizationTestCase { public const LOCALE = 'tlh'; // Klingon public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wa’leS 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '6 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '7 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '8 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '9 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '10 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) '11 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) '12 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '9 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) '10 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) '11 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) '12 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) '13 tera’ jar wa’ 2018 00:00', // Carbon::now()->subDays(2)->calendar() '13 tera’ jar vagh 2018 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wa’Hu’ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'DaHjaj 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'DaHjaj 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'wa’leS 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '9 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'wa’Hu’ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'wa’Hu’ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) '2 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) '1 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) '31 tera’ jar wa’maH cha’ 2017 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) '30 tera’ jar wa’maH cha’ 2017 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) '29 tera’ jar wa’maH cha’ 2017 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) '28 tera’ jar wa’maH cha’ 2017 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) '27 tera’ jar wa’maH cha’ 2017 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) '5 tera’ jar wa’ 2018 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'puS lup ret', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'puS lup ret', // Carbon::now()->subSeconds(2)->diffForHumans() '2 lup ret', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 lup ret', // Carbon::now()->subMinutes(1)->diffForHumans() 'wa’ tup ret', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'wa’ tup ret', // Carbon::now()->subMinutes(2)->diffForHumans() '2 tup ret', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 tup ret', // Carbon::now()->subHours(1)->diffForHumans() 'wa’ rep ret', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'wa’ rep ret', // Carbon::now()->subHours(2)->diffForHumans() '2 rep ret', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 rep ret', // Carbon::now()->subDays(1)->diffForHumans() 'wa’ Hu’', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'wa’ Hu’', // Carbon::now()->subDays(2)->diffForHumans() '2 Hu’', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 Hu’', // Carbon::now()->subWeeks(1)->diffForHumans() 'wa’ hogh ret', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'wa’ hogh ret', // Carbon::now()->subWeeks(2)->diffForHumans() '2 hogh ret', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 hogh ret', // Carbon::now()->subMonths(1)->diffForHumans() 'wa’ wen', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'wa’ wen', // Carbon::now()->subMonths(2)->diffForHumans() '2 wen', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 wen', // Carbon::now()->subYears(1)->diffForHumans() 'wa’ ben', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'wa’ ben', // Carbon::now()->subYears(2)->diffForHumans() '2 ben', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ben', // Carbon::now()->addSecond()->diffForHumans() 'puS lup pIq', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'puS lup pIq', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'puS lup', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'puS lup', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 lup', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 lup', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'puS lup pIq', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'wa’ tup puS lup', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 DIS 3 jar wa’ jaj puS lup', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 nem', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 wen', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ben 3 wen wa’ Hu’ puS lup', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'wa’ hogh 10 rep', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wa’ hogh 6 jaj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'wa’ hogh 6 jaj', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'wa’ hogh ’ej 6 leS', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 hogh wa’ rep', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'wa’ rep pIq', // CarbonInterval::days(2)->forHumans() '2 jaj', // CarbonInterval::create('P1DT3H')->forHumans(true) 'wa’ jaj 3 rep', ]; } ================================================ FILE: tests/Localization/TnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TnTest extends LocalizationTestCase { public const LOCALE = 'tn'; // Tswana public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lamatlhatso at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'laTshipi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mosupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Labotlhano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labotlhano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lamatlhatso at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last laTshipi at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mosupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last laTshipi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lamatlhatso at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labotlhano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Labone at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Labotlhano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'metsotswana e le 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'metsotswana e le 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'metsotswana e le 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'metsotswana e le 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'metsotso e le 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'metsotso e le 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'metsotso e le 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'metsotso e le 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'diura di le 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'diura di le 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'diura di le 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'diura di le 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'malatsi 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'malatsi 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'malatsi 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'malatsi 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'dibeke di le 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'dibeke di le 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'dibeke di le 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'dibeke di le 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'dikgwedi di le 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'dikgwedi di le 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'dikgwedi di le 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'dikgwedi di le 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'dingwaga di le 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'dingwaga di le 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'dingwaga di le 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'dingwaga di le 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'metsotswana e le 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'metsotswana e le 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'metsotswana e le 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'metsotswana e le 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'metsotswana e le 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'metsotswana e le 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'metsotswana e le 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'metsotswana e le 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'metsotswana e le 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'metsotswana e le 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'metsotswana e le 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'metsotso e le 1 metsotswana e le 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'dingwaga di le 2 dikgwedi di le 3 malatsi 1 metsotswana e le 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dingwaga di le 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'dikgwedi di le 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'dingwaga di le 2 dikgwedi di le 3 malatsi 1 metsotswana e le 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'dibeke di le 1 diura di le 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'dibeke di le 1 malatsi 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'dibeke di le 1 malatsi 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dibeke di le 1 and malatsi 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'dibeke di le 2 diura di le 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'diura di le 1 from now', // CarbonInterval::days(2)->forHumans() 'malatsi 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'malatsi 1 diura di le 3', ]; } ================================================ FILE: tests/Localization/TnZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TnZaTest extends LocalizationTestCase { public const LOCALE = 'tn_ZA'; // Tswana public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lamatlhatso at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'laTshipi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mosupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Labotlhano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labone at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labotlhano at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Lamatlhatso at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last laTshipi at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Labobedi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labobedi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mosupologo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last laTshipi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Lamatlhatso at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Labotlhano at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Labone at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Laboraro at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Labotlhano at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'metsotswana e le 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'metsotswana e le 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'metsotswana e le 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'metsotswana e le 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'metsotso e le 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'metsotso e le 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'metsotso e le 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'metsotso e le 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'diura di le 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'diura di le 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'diura di le 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'diura di le 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'malatsi 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'malatsi 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'malatsi 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'malatsi 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'dibeke di le 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'dibeke di le 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'dibeke di le 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'dibeke di le 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'dikgwedi di le 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'dikgwedi di le 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'dikgwedi di le 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'dikgwedi di le 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'dingwaga di le 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'dingwaga di le 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'dingwaga di le 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'dingwaga di le 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'metsotswana e le 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'metsotswana e le 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'metsotswana e le 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'metsotswana e le 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'metsotswana e le 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'metsotswana e le 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'metsotswana e le 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'metsotswana e le 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'metsotswana e le 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'metsotswana e le 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'metsotswana e le 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'metsotso e le 1 metsotswana e le 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'dingwaga di le 2 dikgwedi di le 3 malatsi 1 metsotswana e le 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dingwaga di le 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'dikgwedi di le 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'dingwaga di le 2 dikgwedi di le 3 malatsi 1 metsotswana e le 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'dibeke di le 1 diura di le 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'dibeke di le 1 malatsi 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'dibeke di le 1 malatsi 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dibeke di le 1 and malatsi 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'dibeke di le 2 diura di le 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'diura di le 1 from now', // CarbonInterval::days(2)->forHumans() 'malatsi 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'malatsi 1 diura di le 3', ]; } ================================================ FILE: tests/Localization/ToTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ToTest extends LocalizationTestCase { public const LOCALE = 'to'; // Tonga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tokonaki at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sāpate at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mōnite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Pulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Tuʻapulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Pulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuʻapulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tokonaki at 12:00 hengihengi', // Carbon::now()->subDays(2)->calendar() 'Last Sāpate at 8:49 efiafi', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 efiafi', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 hengihengi', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mōnite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sāpate at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tokonaki at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Tuʻapulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Pulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 hengihengi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 hengihengi, 12:00 hengihengi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 hengihengi, 1:30 hengihengi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 hengihengi, 2:00 hengihengi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 hengihengi, 6:00 hengihengi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 hengihengi, 10:00 hengihengi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 efiafi, 12:00 efiafi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 efiafi, 5:00 efiafi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 efiafi, 9:30 efiafi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 efiafi, 11:00 efiafi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekoni ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekoni ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekoni ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekoni ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 miniti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 miniti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 miniti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 miniti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 houa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 houa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 houa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 houa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ʻaho ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ʻaho ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ʻaho ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ʻaho ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Sapate ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Sapate ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Sapate ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Sapate ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 fitu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 fitu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 fitu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 fitu ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekoni from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekoni from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekoni after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekoni after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekoni before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekoni before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekoni', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekoni', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekoni', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekoni', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekoni from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 miniti 1 sekoni', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 fitu 3 mahina 1 ʻaho 1 sekoni', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 fitu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 fitu 3 mahina 1 ʻaho 1 sekoni ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Sapate 10 houa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sapate 6 ʻaho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sapate 6 ʻaho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Sapate and 6 ʻaho from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Sapate 1 houa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 houa from now', // CarbonInterval::days(2)->forHumans() '2 ʻaho', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ʻaho 3 houa', ]; } ================================================ FILE: tests/Localization/ToToTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ToToTest extends LocalizationTestCase { public const LOCALE = 'to_TO'; // Tonga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tokonaki at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sāpate at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mōnite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Pulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Tuʻapulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Pulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuʻapulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tokonaki at 12:00 hengihengi', // Carbon::now()->subDays(2)->calendar() 'Last Sāpate at 8:49 efiafi', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 efiafi', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 hengihengi', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tūsite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mōnite at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sāpate at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tokonaki at 12:00 hengihengi', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Tuʻapulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Pulelulu at 12:00 hengihengi', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Falaite at 12:00 hengihengi', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 hengihengi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 hengihengi, 12:00 hengihengi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 hengihengi, 1:30 hengihengi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 hengihengi, 2:00 hengihengi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 hengihengi, 6:00 hengihengi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 hengihengi, 10:00 hengihengi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 efiafi, 12:00 efiafi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 efiafi, 5:00 efiafi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 efiafi, 9:30 efiafi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 efiafi, 11:00 efiafi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekoni ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekoni ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekoni ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekoni ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 miniti ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 miniti ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 miniti ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 miniti ago', // Carbon::now()->subHours(1)->diffForHumans() '1 houa ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 houa ago', // Carbon::now()->subHours(2)->diffForHumans() '2 houa ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 houa ago', // Carbon::now()->subDays(1)->diffForHumans() '1 ʻaho ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ʻaho ago', // Carbon::now()->subDays(2)->diffForHumans() '2 ʻaho ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ʻaho ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 Sapate ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 Sapate ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 Sapate ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 Sapate ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mahina ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mahina ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mahina ago', // Carbon::now()->subYears(1)->diffForHumans() '1 fitu ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 fitu ago', // Carbon::now()->subYears(2)->diffForHumans() '2 fitu ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 fitu ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekoni from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekoni from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekoni after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekoni after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekoni before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekoni before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekoni', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekoni', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekoni', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekoni', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekoni from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 miniti 1 sekoni', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 fitu 3 mahina 1 ʻaho 1 sekoni', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 fitu from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mahina ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 fitu 3 mahina 1 ʻaho 1 sekoni ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 Sapate 10 houa', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sapate 6 ʻaho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 Sapate 6 ʻaho', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 Sapate and 6 ʻaho from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 Sapate 1 houa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 houa from now', // CarbonInterval::days(2)->forHumans() '2 ʻaho', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ʻaho 3 houa', ]; } ================================================ FILE: tests/Localization/TpiPgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TpiPgTest extends LocalizationTestCase { public const LOCALE = 'tpi_PG'; // Tok Pisin public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sarere at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tunde at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Trinde at 12:00 biknait', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Fonde at 12:00 biknait', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fraide at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tunde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Trinde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fonde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fraide at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sarere at 12:00 biknait', // Carbon::now()->subDays(2)->calendar() 'Last Sande at 8:49 apinun', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 apinun', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 biknait', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tunde at 12:00 biknait', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tunde at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sarere at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fraide at 12:00 biknait', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Fonde at 12:00 biknait', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Trinde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fraide at 12:00 biknait', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 biknait CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 biknait, 12:00 biknait', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 biknait, 1:30 biknait', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 biknait, 2:00 biknait', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 biknait, 6:00 biknait', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 biknait, 10:00 biknait', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 apinun, 12:00 apinun', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 apinun, 5:00 apinun', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 apinun, 9:30 apinun', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 apinun, 11:00 apinun', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 namba tu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 namba tu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 namba tu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 namba tu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit ago', // Carbon::now()->subHours(1)->diffForHumans() '1 aua ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 aua ago', // Carbon::now()->subHours(2)->diffForHumans() '2 aua ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 aua ago', // Carbon::now()->subDays(1)->diffForHumans() '1 de ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 de ago', // Carbon::now()->subDays(2)->diffForHumans() '2 de ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 de ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wik ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 wik ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wik ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 wik ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mun ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mun ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mun ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mun ago', // Carbon::now()->subYears(1)->diffForHumans() 'yia 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'yia 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'yia 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'yia 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 namba tu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 namba tu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 namba tu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 namba tu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 namba tu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 namba tu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 namba tu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 namba tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 namba tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 namba tu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 namba tu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 namba tu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'yia 2 3 mun 1 de 1 namba tu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'yia 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mun ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'yia 2 3 mun 1 de 1 namba tu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wik 10 aua', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wik 6 de', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wik 6 de', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 wik and 6 de from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wik 1 aua', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 aua from now', // CarbonInterval::days(2)->forHumans() '2 de', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 de 3 aua', ]; } ================================================ FILE: tests/Localization/TpiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TpiTest extends LocalizationTestCase { public const LOCALE = 'tpi'; // Tok Pisin public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sarere at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tunde at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Trinde at 12:00 biknait', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Fonde at 12:00 biknait', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fraide at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tunde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Trinde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fonde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fraide at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sarere at 12:00 biknait', // Carbon::now()->subDays(2)->calendar() 'Last Sande at 8:49 apinun', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 apinun', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 biknait', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tunde at 12:00 biknait', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tunde at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sande at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sarere at 12:00 biknait', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fraide at 12:00 biknait', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Fonde at 12:00 biknait', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Trinde at 12:00 biknait', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fraide at 12:00 biknait', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 biknait CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 biknait, 12:00 biknait', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 biknait, 1:30 biknait', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 biknait, 2:00 biknait', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 biknait, 6:00 biknait', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 biknait, 10:00 biknait', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 apinun, 12:00 apinun', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 apinun, 5:00 apinun', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 apinun, 9:30 apinun', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 apinun, 11:00 apinun', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 namba tu ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 namba tu ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 namba tu ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 namba tu ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minit ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minit ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minit ago', // Carbon::now()->subHours(1)->diffForHumans() '1 aua ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 aua ago', // Carbon::now()->subHours(2)->diffForHumans() '2 aua ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 aua ago', // Carbon::now()->subDays(1)->diffForHumans() '1 de ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 de ago', // Carbon::now()->subDays(2)->diffForHumans() '2 de ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 de ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 wik ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 wik ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 wik ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 wik ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mun ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mun ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mun ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mun ago', // Carbon::now()->subYears(1)->diffForHumans() 'yia 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'yia 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'yia 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'yia 2 ago', // Carbon::now()->addSecond()->diffForHumans() '1 namba tu from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 namba tu from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 namba tu after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 namba tu after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 namba tu before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 namba tu before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 namba tu', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 namba tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 namba tu', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 namba tu', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 namba tu from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minit 1 namba tu', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'yia 2 3 mun 1 de 1 namba tu', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'yia 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mun ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'yia 2 3 mun 1 de 1 namba tu ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 wik 10 aua', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wik 6 de', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 wik 6 de', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 wik and 6 de from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 wik 1 aua', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 aua from now', // CarbonInterval::days(2)->forHumans() '2 de', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 de 3 aua', ]; } ================================================ FILE: tests/Localization/TrCyTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TrCyTest extends LocalizationTestCase { public const LOCALE = 'tr_CY'; // Turkish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'yarın saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'gelecek Cumartesi saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'gelecek Pazar saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'gelecek Pazartesi saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'gelecek Çarşamba saat 12:00 öö', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'gelecek Perşembe saat 12:00 öö', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'gelecek Cuma saat 12:00 öö', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 12:00 öö', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'gelecek Çarşamba saat 12:00 öö', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'gelecek Perşembe saat 12:00 öö', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'gelecek Cuma saat 12:00 öö', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'gelecek Cumartesi saat 12:00 öö', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'geçen Pazar saat 8:49 ös', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'dün 10:00 ös', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'bugün saat 10:00 öö', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'bugün saat 2:00 öö', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'yarın saat 1:00 öö', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 12:00 öö', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'dün 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'dün 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'geçen Salı saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'geçen Pazartesi saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'geçen Pazar saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'geçen Cumartesi saat 12:00 öö', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'geçen Cuma saat 12:00 öö', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'geçen Perşembe saat 12:00 öö', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'geçen Çarşamba saat 12:00 öö', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'geçen Cuma saat 12:00 öö', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1\'inci 1\'inci 1 1\'inci 1\'inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1\'inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1\'inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1\'inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1\'inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1\'inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 1\'inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2\'nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41\'inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100\'üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 öö CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ÖÖ, 12:00 öö', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ÖÖ, 1:30 öö', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ÖÖ, 2:00 öö', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 ÖÖ, 6:00 öö', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 ÖÖ, 10:00 öö', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 ÖS, 12:00 ös', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 ÖS, 5:00 ös', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 ÖS, 9:30 ös', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ÖS, 11:00 ös', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0\'ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 saniye önce', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1sn önce', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 saniye önce', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2sn önce', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 dakika önce', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1dk önce', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 dakika önce', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2dk önce', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 saat önce', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1sa önce', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 saat önce', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2sa önce', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 gün önce', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1g önce', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 gün önce', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2g önce', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 hafta önce', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1h önce', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 hafta önce', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2h önce', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ay önce', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1ay önce', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ay önce', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2ay önce', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 yıl önce', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1y önce', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 yıl önce', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2y önce', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 saniye sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1sn sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 saniye sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1sn sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 saniye önce', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1sn önce', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 saniye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1sn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2sn', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1sn sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 dakika 1 saniye', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2y 3ay 1g 1sn', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 yıl sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5ay önce', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2y 3ay 1g 1sn önce', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 hafta 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 hafta 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 hafta 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 hafta ve 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 hafta 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'bir saat sonra', // CarbonInterval::days(2)->forHumans() // '2 days', '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1g 3sa', ]; } ================================================ FILE: tests/Localization/TrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TrTest extends LocalizationTestCase { public const LOCALE = 'tr'; // Turkish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'yarın saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'gelecek Cumartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'gelecek Pazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'gelecek Pazartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'gelecek Çarşamba saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'gelecek Perşembe saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'gelecek Cuma saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'gelecek Çarşamba saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'gelecek Perşembe saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'gelecek Cuma saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'gelecek Cumartesi saat 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'geçen Pazar saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'dün 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'bugün saat 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'bugün saat 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'yarın saat 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'dün 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'dün 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'geçen Salı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'geçen Pazartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'geçen Pazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'geçen Cumartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'geçen Cuma saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'geçen Perşembe saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'geçen Çarşamba saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'geçen Cuma saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1\'inci 1\'inci 1 1\'inci 1\'inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1\'inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1\'inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1\'inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1\'inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1\'inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 1\'inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2\'nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41\'inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100\'üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 öö CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ÖÖ, 12:00 öö', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ÖÖ, 1:30 öö', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ÖÖ, 2:00 öö', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 ÖÖ, 6:00 öö', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 ÖÖ, 10:00 öö', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 ÖS, 12:00 ös', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 ÖS, 5:00 ös', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 ÖS, 9:30 ös', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ÖS, 11:00 ös', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0\'ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 saniye önce', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1sn önce', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 saniye önce', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2sn önce', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 dakika önce', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1dk önce', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 dakika önce', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2dk önce', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 saat önce', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1sa önce', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 saat önce', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2sa önce', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 gün önce', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1g önce', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 gün önce', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2g önce', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 hafta önce', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1h önce', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 hafta önce', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2h önce', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ay önce', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1ay önce', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ay önce', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2ay önce', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 yıl önce', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1y önce', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 yıl önce', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2y önce', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 saniye sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1sn sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 saniye sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1sn sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 saniye önce', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1sn önce', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 saniye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1sn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2sn', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1sn sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 dakika 1 saniye', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2y 3ay 1g 1sn', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 yıl sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5ay önce', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2y 3ay 1g 1sn önce', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 hafta 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 hafta 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 hafta 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 hafta ve 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 hafta 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'bir saat sonra', // CarbonInterval::days(2)->forHumans() // '2 days', '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1g 3sa', ]; } ================================================ FILE: tests/Localization/TrTrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TrTrTest extends LocalizationTestCase { public const LOCALE = 'tr_TR'; // Turkish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM', 'yarın saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM', 'gelecek Cumartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM', 'gelecek Pazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM', 'gelecek Pazartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM', 'gelecek Çarşamba saat 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM', 'gelecek Perşembe saat 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM', 'gelecek Cuma saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM', 'gelecek Çarşamba saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM', 'gelecek Perşembe saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM', 'gelecek Cuma saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM', 'gelecek Cumartesi saat 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM', 'geçen Pazar saat 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM', 'dün 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM', 'bugün saat 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM', 'bugün saat 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM', 'yarın saat 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM', 'gelecek Salı saat 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM', 'dün 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM', 'dün 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM', 'geçen Salı saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM', 'geçen Pazartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM', 'geçen Pazar saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM', 'geçen Cumartesi saat 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM', 'geçen Cuma saat 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM', 'geçen Perşembe saat 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM', 'geçen Çarşamba saat 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM', 'geçen Cuma saat 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st', '1\'inci 1\'inci 1 1\'inci 1\'inci', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st', '2 1\'inci', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st', '3 1\'inci', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st', '4 1\'inci', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st', '5 1\'inci', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st', '6 1\'inci', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd', '7 1\'inci', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd', '11 2\'nci', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th', '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st', '41\'inci', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th', '100\'üncü', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET', '12:00 öö CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am', '12:00 ÖÖ, 12:00 öö', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am', '1:30 ÖÖ, 1:30 öö', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am', '2:00 ÖÖ, 2:00 öö', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am', '6:00 ÖÖ, 6:00 öö', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am', '10:00 ÖÖ, 10:00 öö', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm', '12:00 ÖS, 12:00 ös', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm', '5:00 ÖS, 5:00 ös', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm', '9:30 ÖS, 9:30 ös', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm', '11:00 ÖS, 11:00 ös', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th', '0\'ıncı', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago', '1 saniye önce', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago', '1sn önce', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago', '2 saniye önce', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago', '2sn önce', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago', '1 dakika önce', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago', '1dk önce', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago', '2 dakika önce', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago', '2dk önce', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago', '1 saat önce', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago', '1sa önce', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago', '2 saat önce', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago', '2sa önce', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago', '1 gün önce', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago', '1g önce', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago', '2 gün önce', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago', '2g önce', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago', '1 hafta önce', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago', '1h önce', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago', '2 hafta önce', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago', '2h önce', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago', '1 ay önce', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago', '1ay önce', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago', '2 ay önce', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago', '2ay önce', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago', '1 yıl önce', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago', '1y önce', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago', '2 yıl önce', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago', '2y önce', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now', '1 saniye sonra', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now', '1sn sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after', '1 saniye sonra', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after', '1sn sonra', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before', '1 saniye önce', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before', '1sn önce', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second', '1 saniye', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s', '1sn', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds', '2 saniye', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s', '2sn', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now', '1sn sonra', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second', '1 dakika 1 saniye', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s', '2y 3ay 1g 1sn', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now', '3 yıl sonra', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago', '5ay önce', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago', '2y 3ay 1g 1sn önce', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours', '1 hafta 10 saat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 hafta 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days', '1 hafta 6 gün', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now', '1 hafta ve 6 gün sonra', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour', '2 hafta 1 saat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now', 'bir saat sonra', // CarbonInterval::days(2)->forHumans() // '2 days', '2 gün', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h', '1g 3sa', ]; } ================================================ FILE: tests/Localization/TsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TsTest extends LocalizationTestCase { public const LOCALE = 'ts'; // Tsonga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mugqivela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Musumbhunuku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ravunharhu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ravumune at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravunharhu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravumune at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mugqivela at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sonto at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Musumbhunuku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mugqivela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Ravumune at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ravunharhu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'tisekoni ta 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tisekoni ta 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'tisekoni ta 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tisekoni ta 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'timinete ta 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'timinete ta 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'timinete ta 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'timinete ta 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'tiawara ta 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tiawara ta 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'tiawara ta 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tiawara ta 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'masiku 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'masiku 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'masiku 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'masiku 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mavhiki ya 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mavhiki ya 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mavhiki ya 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mavhiki ya 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'tin’hweti ta 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tin’hweti ta 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'tin’hweti ta 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tin’hweti ta 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'malembe ya 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'malembe ya 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'malembe ya 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'malembe ya 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'tisekoni ta 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tisekoni ta 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'tisekoni ta 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'tisekoni ta 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'tisekoni ta 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'tisekoni ta 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'tisekoni ta 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'tisekoni ta 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'tisekoni ta 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'tisekoni ta 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tisekoni ta 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'timinete ta 1 tisekoni ta 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'malembe ya 2 tin’hweti ta 3 masiku 1 tisekoni ta 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'malembe ya 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tin’hweti ta 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'malembe ya 2 tin’hweti ta 3 masiku 1 tisekoni ta 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mavhiki ya 1 tiawara ta 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mavhiki ya 1 masiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mavhiki ya 1 masiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mavhiki ya 1 and masiku 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mavhiki ya 2 tiawara ta 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'tiawara ta 1 from now', // CarbonInterval::days(2)->forHumans() 'masiku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'masiku 1 tiawara ta 3', ]; } ================================================ FILE: tests/Localization/TsZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TsZaTest extends LocalizationTestCase { public const LOCALE = 'ts_ZA'; // Tsonga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mugqivela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Musumbhunuku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ravunharhu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ravumune at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravunharhu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravumune at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mugqivela at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Sonto at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ravumbirhi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Musumbhunuku at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mugqivela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Ravumune at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ravunharhu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ravuntlhanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'tisekoni ta 1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'tisekoni ta 1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'tisekoni ta 2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'tisekoni ta 2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'timinete ta 1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'timinete ta 1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'timinete ta 2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'timinete ta 2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'tiawara ta 1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'tiawara ta 1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'tiawara ta 2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'tiawara ta 2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'masiku 1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'masiku 1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'masiku 2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'masiku 2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'mavhiki ya 1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'mavhiki ya 1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'mavhiki ya 2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'mavhiki ya 2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'tin’hweti ta 1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'tin’hweti ta 1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'tin’hweti ta 2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'tin’hweti ta 2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'malembe ya 1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'malembe ya 1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'malembe ya 2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'malembe ya 2 ago', // Carbon::now()->addSecond()->diffForHumans() 'tisekoni ta 1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'tisekoni ta 1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'tisekoni ta 1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'tisekoni ta 1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'tisekoni ta 1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'tisekoni ta 1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'tisekoni ta 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'tisekoni ta 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'tisekoni ta 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'tisekoni ta 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'tisekoni ta 1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'timinete ta 1 tisekoni ta 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'malembe ya 2 tin’hweti ta 3 masiku 1 tisekoni ta 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'malembe ya 3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'tin’hweti ta 5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'malembe ya 2 tin’hweti ta 3 masiku 1 tisekoni ta 1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'mavhiki ya 1 tiawara ta 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mavhiki ya 1 masiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'mavhiki ya 1 masiku 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'mavhiki ya 1 and masiku 6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'mavhiki ya 2 tiawara ta 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'tiawara ta 1 from now', // CarbonInterval::days(2)->forHumans() 'masiku 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'masiku 1 tiawara ta 3', ]; } ================================================ FILE: tests/Localization/TtRuIqtelifTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TtRuIqtelifTest extends LocalizationTestCase { public const LOCALE = 'tt_RU@iqtelif'; // Tatar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Şimbe at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Yekşembí at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Düşembí at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Sişembí at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Çerşembí at 12:00 ÖA', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Pencíşembí at 12:00 ÖA', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Comğa at 12:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Sişembí at 12:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Çerşembí at 12:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Pencíşembí at 12:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Comğa at 12:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Şimbe at 12:00 ÖA', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last Yekşembí at 8:49 ÖS', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 10:00 ÖS', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 2:00 ÖA', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 1:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Sişembí at 12:00 ÖA', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last Sişembí at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last Düşembí at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last Yekşembí at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last Şimbe at 12:00 ÖA', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Comğa at 12:00 ÖA', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last Pencíşembí at 12:00 ÖA', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last Çerşembí at 12:00 ÖA', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last Comğa at 12:00 ÖA', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 öa CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 ÖA, 12:00 öa', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 ÖA, 1:30 öa', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 ÖA, 2:00 öa', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 ÖA, 6:00 öa', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 ÖA, 10:00 öa', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ÖS, 12:00 ös', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ÖS, 5:00 ös', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ÖS, 9:30 ös', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ÖS, 11:00 ös', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0th', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2m ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1h ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2h ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1d ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'an hour from now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1d 3h', ]; } ================================================ FILE: tests/Localization/TtRuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TtRuTest extends LocalizationTestCase { public const LOCALE = 'tt_RU'; // Tatar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'шимбә at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'якшәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'дышәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'сишәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'чәршәәмбе at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'пәнҗешмбе at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'җомга at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'сишәмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'чәршәәмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'пәнҗешмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'җомга at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'шимбә at 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Last якшәмбе at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'сишәмбе at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Last сишәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Last дышәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Last якшәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Last шимбә at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Last җомга at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Last пәнҗешмбе at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Last чәршәәмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Last җомга at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 1st' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' 'ago', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 ел 3 ай 1 көн 1 секунд', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 атна 10 сәгать', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 атна 6 көн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 атна 6 көн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 атна 1 сәгать', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'from_now', // CarbonInterval::days(2)->forHumans() // '2 days' '2 көн', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 көн 3 сәгать', ]; } ================================================ FILE: tests/Localization/TtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TtTest extends LocalizationTestCase { public const LOCALE = 'tt'; // Tatar public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'шимбә at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'якшәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'дышәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'сишәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'чәршәәмбе at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'пәнҗешмбе at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'җомга at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сишәмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'чәршәәмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'пәнҗешмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'җомга at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'шимбә at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last якшәмбе at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'сишәмбе at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last сишәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last дышәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last якшәмбе at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last шимбә at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last җомга at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last пәнҗешмбе at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last чәршәәмбе at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last җомга at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунд', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунд', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 секунд', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 минут 1 секунд', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ел 3 ай 1 көн 1 секунд', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 атна 10 сәгать', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 атна 6 көн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 атна 6 көн', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 атна 1 сәгать', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 көн', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 көн 3 сәгать', ]; } ================================================ FILE: tests/Localization/TwqTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TwqTest extends LocalizationTestCase { public const LOCALE = 'twq'; // Tasawaq public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Asibti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atinni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamiisa at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Alzuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamiisa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alzuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Asibti at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Alhadi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Atalaata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atalaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Atinni at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alhadi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Asibti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Alzuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamiisa at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Alarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Alzuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 subbaahi CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Subbaahi, 12:00 subbaahi', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Subbaahi, 1:30 subbaahi', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Subbaahi, 2:00 subbaahi', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Subbaahi, 6:00 subbaahi', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Subbaahi, 10:00 subbaahi', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Zaarikay b, 12:00 zaarikay b', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Zaarikay b, 5:00 zaarikay b', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Zaarikay b, 9:30 zaarikay b', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Zaarikay b, 11:00 zaarikay b', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ihinkante ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ihinkante ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ihinkante ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ihinkante ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 zarbu ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 zarbu ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 zarbu ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 zarbu ago', // Carbon::now()->subHours(1)->diffForHumans() '1 ɲaajin ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 ɲaajin ago', // Carbon::now()->subHours(2)->diffForHumans() '2 ɲaajin ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 ɲaajin ago', // Carbon::now()->subDays(1)->diffForHumans() '1 zaari ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 zaari ago', // Carbon::now()->subDays(2)->diffForHumans() '2 zaari ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 zaari ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 jirbiiyye ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 jirbiiyye ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 jirbiiyye ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 jirbiiyye ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 alaada ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 alaada ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 alaada ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 alaada ago', // Carbon::now()->subYears(1)->diffForHumans() '1 jiiri ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 jiiri ago', // Carbon::now()->subYears(2)->diffForHumans() '2 jiiri ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 jiiri ago', // Carbon::now()->addSecond()->diffForHumans() '1 ihinkante from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ihinkante from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ihinkante after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ihinkante after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ihinkante before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ihinkante before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ihinkante', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ihinkante', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ihinkante', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ihinkante', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ihinkante from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 zarbu 1 ihinkante', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 jiiri 3 alaada 1 zaari 1 ihinkante', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 jiiri from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 alaada ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 jiiri 3 alaada 1 zaari 1 ihinkante ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 jirbiiyye 10 ɲaajin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 jirbiiyye 6 zaari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 jirbiiyye 6 zaari', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 jirbiiyye and 6 zaari from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 jirbiiyye 1 ɲaajin', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 ɲaajin from now', // CarbonInterval::days(2)->forHumans() '2 zaari', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 zaari 3 ɲaajin', ]; } ================================================ FILE: tests/Localization/TzlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TzlTest extends LocalizationTestCase { public const LOCALE = 'tzl'; // Talossan public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'demà à 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sáturi à 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Súladi à 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Lúneçi à 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Maitzi à 00.00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Márcuri à 00.00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Xhúadi à 00.00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Viénerçi à 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maitzi à 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Márcuri à 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Xhúadi à 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Viénerçi à 00.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Sáturi à 00.00', // Carbon::now()->subDays(2)->calendar() 'sür el Súladi lasteu à 20.49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieiri à 22.00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'oxhi à 10.00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'oxhi à 02.00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'demà à 01.00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Maitzi à 00.00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ieiri à 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ieiri à 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sür el Maitzi lasteu à 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sür el Lúneçi lasteu à 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sür el Súladi lasteu à 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sür el Sáturi lasteu à 00.00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sür el Viénerçi lasteu à 00.00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'sür el Xhúadi lasteu à 00.00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'sür el Márcuri lasteu à 00.00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sür el Viénerçi lasteu à 00.00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1. 1. 1. 1. 1.', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2. 1.', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3. 1.', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4. 1.', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5. 1.', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6. 1.', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7. 1.', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11. 2.', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40.', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41.', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100.', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 d\'a CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 D\'A, 12:00 d\'a', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 D\'A, 1:30 d\'a', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 D\'A, 2:00 d\'a', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 D\'A, 6:00 d\'a', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 D\'A, 10:00 d\'a', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 D\'O, 12:00 d\'o', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 D\'O, 5:00 d\'o', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 D\'O, 9:30 d\'o', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 D\'O, 11:00 d\'o', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0.', // Carbon::now()->subSeconds(1)->diffForHumans() 'ja 1 secunds', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ja 1 secunds', // Carbon::now()->subSeconds(2)->diffForHumans() 'ja 2 secunds', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ja 2 secunds', // Carbon::now()->subMinutes(1)->diffForHumans() 'ja 1 míut', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ja 1 míut', // Carbon::now()->subMinutes(2)->diffForHumans() 'ja 2 míuts', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ja 2 míuts', // Carbon::now()->subHours(1)->diffForHumans() 'ja 1 þora', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ja 1 þora', // Carbon::now()->subHours(2)->diffForHumans() 'ja 2 þoras', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ja 2 þoras', // Carbon::now()->subDays(1)->diffForHumans() 'ja 1 ziua', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ja 1 ziua', // Carbon::now()->subDays(2)->diffForHumans() 'ja 2 ziuas', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ja 2 ziuas', // Carbon::now()->subWeeks(1)->diffForHumans() 'ja 1 seifetziua', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ja 1 seifetziua', // Carbon::now()->subWeeks(2)->diffForHumans() 'ja 2 seifetziuas', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ja 2 seifetziuas', // Carbon::now()->subMonths(1)->diffForHumans() 'ja 1 mes', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ja 1 mes', // Carbon::now()->subMonths(2)->diffForHumans() 'ja 2 mesen', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ja 2 mesen', // Carbon::now()->subYears(1)->diffForHumans() 'ja 1 ar', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ja 1 ar', // Carbon::now()->subYears(2)->diffForHumans() 'ja 2 ars', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ja 2 ars', // Carbon::now()->addSecond()->diffForHumans() 'osprei 1 secunds', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'osprei 1 secunds', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 secunds', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 secunds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 secunds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 secunds', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'osprei 1 secunds', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 míut 1 secunds', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ars 3 mesen 1 ziua 1 secunds', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'osprei 3 ars', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ja 5 mesen', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ja 2 ars 3 mesen 1 ziua 1 secunds', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 seifetziua 10 þoras', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seifetziua 6 ziuas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 seifetziua 6 ziuas', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'osprei 1 seifetziua 6 ziuas', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 seifetziuas 1 þora', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'osprei 1 þora', // CarbonInterval::days(2)->forHumans() '2 ziuas', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ziua 3 þoras', ]; } ================================================ FILE: tests/Localization/TzmLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TzmLatnTest extends LocalizationTestCase { public const LOCALE = 'tzm_Latn'; // Tamazight public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aska g 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asiḍyas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asamas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aynas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asinas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'akras g 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'akwas g 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'asimwas g 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asinas g 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'akras g 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'akwas g 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asimwas g 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asiḍyas g 00:00', // Carbon::now()->subDays(2)->calendar() 'asamas g 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'assant g 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'asdkh g 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asdkh g 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'aska g 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asinas g 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'assant g 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'assant g 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asinas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'aynas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asamas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asiḍyas g 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'asimwas g 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'akwas g 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'akras g 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'asimwas g 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 zdat azal CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Zdat azal, 12:00 zdat azal', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Zdat azal, 1:30 zdat azal', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Zdat azal, 2:00 zdat azal', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Zdat azal, 6:00 zdat azal', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Zdat azal, 10:00 zdat azal', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ḍeffir aza, 12:00 ḍeffir aza', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ḍeffir aza, 5:00 ḍeffir aza', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ḍeffir aza, 9:30 ḍeffir aza', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ḍeffir aza, 11:00 ḍeffir aza', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'yan 1 imik', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'yan 1 imik', // Carbon::now()->subSeconds(2)->diffForHumans() 'yan 2 imik', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'yan 2 imik', // Carbon::now()->subMinutes(1)->diffForHumans() 'yan 1 minuḍ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'yan 1 minuḍ', // Carbon::now()->subMinutes(2)->diffForHumans() 'yan 2 minuḍ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'yan 2 minuḍ', // Carbon::now()->subHours(1)->diffForHumans() 'yan 1 saɛa', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'yan 1 saɛa', // Carbon::now()->subHours(2)->diffForHumans() 'yan 2 tassaɛin', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'yan 2 tassaɛin', // Carbon::now()->subDays(1)->diffForHumans() 'yan 1 ass', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'yan 1 ass', // Carbon::now()->subDays(2)->diffForHumans() 'yan 2 ossan', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'yan 2 ossan', // Carbon::now()->subWeeks(1)->diffForHumans() 'yan 1 imalass', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'yan 1 imalass', // Carbon::now()->subWeeks(2)->diffForHumans() 'yan 2 imalass', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'yan 2 imalass', // Carbon::now()->subMonths(1)->diffForHumans() 'yan 1 ayowr', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'yan 1 ayowr', // Carbon::now()->subMonths(2)->diffForHumans() 'yan 2 iyyirn', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'yan 2 iyyirn', // Carbon::now()->subYears(1)->diffForHumans() 'yan 1 asgas', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'yan 1 asgas', // Carbon::now()->subYears(2)->diffForHumans() 'yan 2 isgasn', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'yan 2 isgasn', // Carbon::now()->addSecond()->diffForHumans() 'dadkh s yan 1 imik', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'dadkh s yan 1 imik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 imik', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 imik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 imik', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 imik', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'dadkh s yan 1 imik', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minuḍ 1 imik', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 isgasn 3 iyyirn 1 ass 1 imik', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'dadkh s yan 3 isgasn', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'yan 5 iyyirn', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'yan 2 isgasn 3 iyyirn 1 ass 1 imik', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 imalass 10 tassaɛin', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ossan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 imalass 6 ossan', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'dadkh s yan 1 imalass 6 ossan', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 imalass 1 saɛa', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'dadkh s yan saɛa', // CarbonInterval::days(2)->forHumans() '2 ossan', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ass 3 tassaɛin', ]; } ================================================ FILE: tests/Localization/TzmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class TzmTest extends LocalizationTestCase { public const LOCALE = 'tzm'; // Tamazight public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴽⴰ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴰⵎⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵢⵏⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⴽⵔⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ⴰⴽⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ⴰⵙⵉⵎⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⴽⵔⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⴽⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵎⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ ⴴ 00:00', // Carbon::now()->subDays(2)->calendar() 'ⴰⵙⴰⵎⴰⵙ ⴴ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵚⴰⵏⵜ ⴴ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ⴰⵙⴷⵅ ⴴ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴷⵅ ⴴ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ⴰⵙⴽⴰ ⴴ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ⴰⵚⴰⵏⵜ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵚⴰⵏⵜ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⵏⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵢⵏⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴰⵎⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⴹⵢⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵉⵎⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ⴰⴽⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ⴰⴽⵔⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⴰⵙⵉⵎⵡⴰⵙ ⴴ 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 2', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 2', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ⵢⴰⵏ ⵉⵎⵉⴽ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ ⵉⵎⵉⴽ', // Carbon::now()->subSeconds(2)->diffForHumans() 'ⵢⴰⵏ 2 ⵉⵎⵉⴽ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 ⵉⵎⵉⴽ', // Carbon::now()->subMinutes(1)->diffForHumans() 'ⵢⴰⵏ ⵎⵉⵏⵓⴺ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ ⵎⵉⵏⵓⴺ', // Carbon::now()->subMinutes(2)->diffForHumans() 'ⵢⴰⵏ 2 ⵎⵉⵏⵓⴺ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 ⵎⵉⵏⵓⴺ', // Carbon::now()->subHours(1)->diffForHumans() 'ⵢⴰⵏ ⵙⴰⵄⴰ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ ⵙⴰⵄⴰ', // Carbon::now()->subHours(2)->diffForHumans() 'ⵢⴰⵏ 2 ⵜⴰⵙⵙⴰⵄⵉⵏ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 ⵜⴰⵙⵙⴰⵄⵉⵏ', // Carbon::now()->subDays(1)->diffForHumans() 'ⵢⴰⵏ ⴰⵙⵙ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ ⴰⵙⵙ', // Carbon::now()->subDays(2)->diffForHumans() 'ⵢⴰⵏ 2 oⵙⵙⴰⵏ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 oⵙⵙⴰⵏ', // Carbon::now()->subWeeks(1)->diffForHumans() 'ⵢⴰⵏ 1 ⵉⵎⴰⵍⴰⵙⵙ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ 1 ⵉⵎⴰⵍⴰⵙⵙ', // Carbon::now()->subWeeks(2)->diffForHumans() 'ⵢⴰⵏ 2 ⵉⵎⴰⵍⴰⵙⵙ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 ⵉⵎⴰⵍⴰⵙⵙ', // Carbon::now()->subMonths(1)->diffForHumans() 'ⵢⴰⵏ ⴰⵢoⵓⵔ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ ⴰⵢoⵓⵔ', // Carbon::now()->subMonths(2)->diffForHumans() 'ⵢⴰⵏ 2 ⵉⵢⵢⵉⵔⵏ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 ⵉⵢⵢⵉⵔⵏ', // Carbon::now()->subYears(1)->diffForHumans() 'ⵢⴰⵏ ⴰⵙⴳⴰⵙ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ⵢⴰⵏ ⴰⵙⴳⴰⵙ', // Carbon::now()->subYears(2)->diffForHumans() 'ⵢⴰⵏ 2 ⵉⵙⴳⴰⵙⵏ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ⵢⴰⵏ 2 ⵉⵙⴳⴰⵙⵏ', // Carbon::now()->addSecond()->diffForHumans() 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'ⵉⵎⵉⴽ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'ⵉⵎⵉⴽ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ⵉⵎⵉⴽ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ⵉⵎⵉⴽ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵉⵎⵉⴽ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ⵎⵉⵏⵓⴺ ⵉⵎⵉⴽ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ⵉⵙⴳⴰⵙⵏ 3 ⵉⵢⵢⵉⵔⵏ ⴰⵙⵙ ⵉⵎⵉⴽ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ 3 ⵉⵙⴳⴰⵙⵏ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ⵢⴰⵏ 5 ⵉⵢⵢⵉⵔⵏ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ⵢⴰⵏ 2 ⵉⵙⴳⴰⵙⵏ 3 ⵉⵢⵢⵉⵔⵏ ⴰⵙⵙ ⵉⵎⵉⴽ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ⵉⵎⴰⵍⴰⵙⵙ 10 ⵜⴰⵙⵙⴰⵄⵉⵏ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ⵉⵎⴰⵍⴰⵙⵙ 6 oⵙⵙⴰⵏ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ⵉⵎⴰⵍⴰⵙⵙ 6 oⵙⵙⴰⵏ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ 1 ⵉⵎⴰⵍⴰⵙⵙ 6 oⵙⵙⴰⵏ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ⵉⵎⴰⵍⴰⵙⵙ ⵙⴰⵄⴰ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ ⵙⴰⵄⴰ', // CarbonInterval::days(2)->forHumans() '2 oⵙⵙⴰⵏ', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ⴰⵙⵙ 3 ⵜⴰⵙⵙⴰⵄⵉⵏ', ]; } ================================================ FILE: tests/Localization/UgCnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UgCnTest extends LocalizationTestCase { public const LOCALE = 'ug_CN'; // Uighur public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئەتە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى شەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى يەكشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى دۈشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى چارشەنبە سائەت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'كېلەركى پەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'كېلەركى جۈمە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى چارشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى پەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى جۈمە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى شەنبە سائەت 00:00', // Carbon::now()->subDays(2)->calendar() 'ئالدىنقى يەكشەنبە سائەت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'تۆنۈگۈن 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'بۈگۈن سائەت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بۈگۈن سائەت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ئەتە سائەت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'تۆنۈگۈن 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'تۆنۈگۈن 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى دۈشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى يەكشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى شەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى جۈمە سائەت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ئالدىنقى پەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ئالدىنقى چارشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ئالدىنقى جۈمە سائەت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1-كۈنى 1-ھەپتە 1-ھەپتە', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-كۈنى 2-ھەپتە', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-كۈنى', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-كۈنى', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-كۈنى', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 يېرىم كېچە CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 يېرىم كېچە, 12:00 يېرىم كېچە', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 يېرىم كېچە, 1:30 يېرىم كېچە', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 يېرىم كېچە, 2:00 يېرىم كېچە', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 سەھەر, 6:00 سەھەر', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 چۈشتىن بۇرۇن, 10:00 چۈشتىن بۇرۇن', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 چۈش, 12:00 چۈش', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 چۈشتىن كېيىن, 5:00 چۈشتىن كېيىن', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 كەچ, 9:30 كەچ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 كەچ, 11:00 كەچ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'نەچچە سېكونت بۇرۇن', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'نەچچە سېكونت بۇرۇن', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سېكونت بۇرۇن', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سېكونت بۇرۇن', // Carbon::now()->subMinutes(1)->diffForHumans() 'بىر مىنۇت بۇرۇن', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'بىر مىنۇت بۇرۇن', // Carbon::now()->subMinutes(2)->diffForHumans() '2 مىنۇت بۇرۇن', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 مىنۇت بۇرۇن', // Carbon::now()->subHours(1)->diffForHumans() 'بىر سائەت بۇرۇن', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'بىر سائەت بۇرۇن', // Carbon::now()->subHours(2)->diffForHumans() '2 سائەت بۇرۇن', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 سائەت بۇرۇن', // Carbon::now()->subDays(1)->diffForHumans() 'بىر كۈن بۇرۇن', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'بىر كۈن بۇرۇن', // Carbon::now()->subDays(2)->diffForHumans() '2 كۈن بۇرۇن', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 كۈن بۇرۇن', // Carbon::now()->subWeeks(1)->diffForHumans() 'بىر ھەپتە بۇرۇن', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'بىر ھەپتە بۇرۇن', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ھەپتە بۇرۇن', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ھەپتە بۇرۇن', // Carbon::now()->subMonths(1)->diffForHumans() 'بىر ئاي بۇرۇن', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'بىر ئاي بۇرۇن', // Carbon::now()->subMonths(2)->diffForHumans() '2 ئاي بۇرۇن', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ئاي بۇرۇن', // Carbon::now()->subYears(1)->diffForHumans() 'بىر يىل بۇرۇن', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'بىر يىل بۇرۇن', // Carbon::now()->subYears(2)->diffForHumans() '2 يىل بۇرۇن', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 يىل بۇرۇن', // Carbon::now()->addSecond()->diffForHumans() 'نەچچە سېكونت كېيىن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'نەچچە سېكونت كېيىن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'نەچچە سېكونت', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'نەچچە سېكونت', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سېكونت', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سېكونت', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'نەچچە سېكونت كېيىن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'بىر مىنۇت نەچچە سېكونت', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 يىل 3 ئاي بىر كۈن نەچچە سېكونت', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 يىل كېيىن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ئاي بۇرۇن', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 يىل 3 ئاي بىر كۈن نەچچە سېكونت بۇرۇن', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'بىر ھەپتە 10 سائەت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'بىر ھەپتە 6 كۈن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'بىر ھەپتە 6 كۈن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'بىر ھەپتە ۋە 6 كۈن كېيىن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ھەپتە بىر سائەت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'بىر سائەت كېيىن', // CarbonInterval::days(2)->forHumans() '2 كۈن', // CarbonInterval::create('P1DT3H')->forHumans(true) 'بىر كۈن 3 سائەت', ]; } ================================================ FILE: tests/Localization/UgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UgTest extends LocalizationTestCase { public const LOCALE = 'ug'; // Uighur public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئەتە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى شەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى يەكشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى دۈشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'كېلەركى چارشەنبە سائەت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'كېلەركى پەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'كېلەركى جۈمە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى چارشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى پەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى جۈمە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى شەنبە سائەت 00:00', // Carbon::now()->subDays(2)->calendar() 'ئالدىنقى يەكشەنبە سائەت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'تۆنۈگۈن 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'بۈگۈن سائەت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بۈگۈن سائەت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ئەتە سائەت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'كېلەركى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'تۆنۈگۈن 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'تۆنۈگۈن 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى سەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى دۈشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى يەكشەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى شەنبە سائەت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ئالدىنقى جۈمە سائەت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ئالدىنقى پەيشەنبە سائەت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ئالدىنقى چارشەنبە سائەت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ئالدىنقى جۈمە سائەت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1-كۈنى 1-ھەپتە 1-ھەپتە', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-كۈنى 1-ھەپتە', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-كۈنى 2-ھەپتە', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-كۈنى', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-كۈنى', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-كۈنى', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 يېرىم كېچە CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 يېرىم كېچە, 12:00 يېرىم كېچە', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 يېرىم كېچە, 1:30 يېرىم كېچە', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 يېرىم كېچە, 2:00 يېرىم كېچە', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 سەھەر, 6:00 سەھەر', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 چۈشتىن بۇرۇن, 10:00 چۈشتىن بۇرۇن', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 چۈش, 12:00 چۈش', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 چۈشتىن كېيىن, 5:00 چۈشتىن كېيىن', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 كەچ, 9:30 كەچ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 كەچ, 11:00 كەچ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'نەچچە سېكونت بۇرۇن', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'نەچچە سېكونت بۇرۇن', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سېكونت بۇرۇن', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سېكونت بۇرۇن', // Carbon::now()->subMinutes(1)->diffForHumans() 'بىر مىنۇت بۇرۇن', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'بىر مىنۇت بۇرۇن', // Carbon::now()->subMinutes(2)->diffForHumans() '2 مىنۇت بۇرۇن', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 مىنۇت بۇرۇن', // Carbon::now()->subHours(1)->diffForHumans() 'بىر سائەت بۇرۇن', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'بىر سائەت بۇرۇن', // Carbon::now()->subHours(2)->diffForHumans() '2 سائەت بۇرۇن', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 سائەت بۇرۇن', // Carbon::now()->subDays(1)->diffForHumans() 'بىر كۈن بۇرۇن', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'بىر كۈن بۇرۇن', // Carbon::now()->subDays(2)->diffForHumans() '2 كۈن بۇرۇن', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 كۈن بۇرۇن', // Carbon::now()->subWeeks(1)->diffForHumans() 'بىر ھەپتە بۇرۇن', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'بىر ھەپتە بۇرۇن', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ھەپتە بۇرۇن', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ھەپتە بۇرۇن', // Carbon::now()->subMonths(1)->diffForHumans() 'بىر ئاي بۇرۇن', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'بىر ئاي بۇرۇن', // Carbon::now()->subMonths(2)->diffForHumans() '2 ئاي بۇرۇن', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ئاي بۇرۇن', // Carbon::now()->subYears(1)->diffForHumans() 'بىر يىل بۇرۇن', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'بىر يىل بۇرۇن', // Carbon::now()->subYears(2)->diffForHumans() '2 يىل بۇرۇن', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 يىل بۇرۇن', // Carbon::now()->addSecond()->diffForHumans() 'نەچچە سېكونت كېيىن', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'نەچچە سېكونت كېيىن', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'نەچچە سېكونت', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'نەچچە سېكونت', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سېكونت', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سېكونت', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'نەچچە سېكونت كېيىن', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'بىر مىنۇت نەچچە سېكونت', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 يىل 3 ئاي بىر كۈن نەچچە سېكونت', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 يىل كېيىن', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ئاي بۇرۇن', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 يىل 3 ئاي بىر كۈن نەچچە سېكونت بۇرۇن', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'بىر ھەپتە 10 سائەت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'بىر ھەپتە 6 كۈن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'بىر ھەپتە 6 كۈن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'بىر ھەپتە ۋە 6 كۈن كېيىن', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ھەپتە بىر سائەت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'بىر سائەت كېيىن', // CarbonInterval::days(2)->forHumans() '2 كۈن', // CarbonInterval::create('P1DT3H')->forHumans(true) 'بىر كۈن 3 سائەت', ]; } ================================================ FILE: tests/Localization/UkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UkTest extends LocalizationTestCase { public const LOCALE = 'uk'; // Ukrainian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У суботу о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У неділю о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У понеділок о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У вівторок о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У середу о 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'У четвер о 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'У п’ятницю о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У вівторок о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У середу о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У четвер о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У п’ятницю о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У суботу о 00:00', // Carbon::now()->subDays(2)->calendar() 'Минулої неділі о 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчора о 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сьогодні о 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сьогодні о 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра о 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У вівторок о 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчора о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчора о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулого вівторка о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулого понеділка о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулої неділі о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулої суботи о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулої п’ятниці о 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Минулого четверга о 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Минулої середи о 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Минулої п’ятниці о 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-й 1-й', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-й', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-й', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-й', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-й', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-й', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-й', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-й', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночі CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночі, 12:00 ночі', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночі, 1:30 ночі', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночі, 2:00 ночі', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ранку, 6:00 ранку', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ранку, 10:00 ранку', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечора, 5:00 вечора', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечора, 9:30 вечора', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечора, 11:00 вечора', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду тому', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1сек тому', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунди тому', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2сек тому', // Carbon::now()->subMinutes(1)->diffForHumans() '1 хвилину тому', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1хв тому', // Carbon::now()->subMinutes(2)->diffForHumans() '2 хвилини тому', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2хв тому', // Carbon::now()->subHours(1)->diffForHumans() '1 годину тому', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1г тому', // Carbon::now()->subHours(2)->diffForHumans() '2 години тому', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2г тому', // Carbon::now()->subDays(1)->diffForHumans() '1 день тому', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1д тому', // Carbon::now()->subDays(2)->diffForHumans() '2 дні тому', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2д тому', // Carbon::now()->subWeeks(1)->diffForHumans() '1 тиждень тому', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1т тому', // Carbon::now()->subWeeks(2)->diffForHumans() '2 тижні тому', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2т тому', // Carbon::now()->subMonths(1)->diffForHumans() '1 місяць тому', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1м тому', // Carbon::now()->subMonths(2)->diffForHumans() '2 місяці тому', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2м тому', // Carbon::now()->subYears(1)->diffForHumans() '1 рік тому', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1р тому', // Carbon::now()->subYears(2)->diffForHumans() '2 роки тому', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2рр тому', // Carbon::now()->addSecond()->diffForHumans() 'за 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'за 1сек', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду після', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1сек після', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1сек до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1сек', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунди', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2сек', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'за 1сек', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 хвилина 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2рр 3м 1д 1сек', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'за 3 роки', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5м тому', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2рр 3м 1д 1сек тому', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 тиждень 10 годин', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 тиждень 6 днів', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 тиждень 6 днів', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'за 1 тиждень i 6 днів', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 тижні 1 година', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'за годину', // CarbonInterval::days(2)->forHumans() '2 дні', // CarbonInterval::create('P1DT3H')->forHumans(true) '1д 3г', ]; } ================================================ FILE: tests/Localization/UkUaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UkUaTest extends LocalizationTestCase { public const LOCALE = 'uk_UA'; // Ukrainian public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Завтра о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У суботу о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У неділю о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У понеділок о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У вівторок о 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'У середу о 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'У четвер о 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'У п’ятницю о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У вівторок о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У середу о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У четвер о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У п’ятницю о 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У суботу о 00:00', // Carbon::now()->subDays(2)->calendar() 'Минулої неділі о 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчора о 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Сьогодні о 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Сьогодні о 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Завтра о 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'У вівторок о 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Вчора о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Вчора о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулого вівторка о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулого понеділка о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулої неділі о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулої суботи о 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Минулої п’ятниці о 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Минулого четверга о 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Минулої середи о 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Минулої п’ятниці о 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1-й 1-й 1-го 1-й 1-й', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2-го 1-й', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3-го 1-й', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4-го 1-й', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5-го 1-й', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6-го 1-й', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7-го 1-й', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11-го 2-й', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40-й', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41-й', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100-й', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ночі CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ночі, 12:00 ночі', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ночі, 1:30 ночі', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ночі, 2:00 ночі', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ранку, 6:00 ранку', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ранку, 10:00 ранку', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 дня, 12:00 дня', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 вечора, 5:00 вечора', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 вечора, 9:30 вечора', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 вечора, 11:00 вечора', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 секунду тому', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1сек тому', // Carbon::now()->subSeconds(2)->diffForHumans() '2 секунди тому', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2сек тому', // Carbon::now()->subMinutes(1)->diffForHumans() '1 хвилину тому', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1хв тому', // Carbon::now()->subMinutes(2)->diffForHumans() '2 хвилини тому', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2хв тому', // Carbon::now()->subHours(1)->diffForHumans() '1 годину тому', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1г тому', // Carbon::now()->subHours(2)->diffForHumans() '2 години тому', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2г тому', // Carbon::now()->subDays(1)->diffForHumans() '1 день тому', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1д тому', // Carbon::now()->subDays(2)->diffForHumans() '2 дні тому', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2д тому', // Carbon::now()->subWeeks(1)->diffForHumans() '1 тиждень тому', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1т тому', // Carbon::now()->subWeeks(2)->diffForHumans() '2 тижні тому', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2т тому', // Carbon::now()->subMonths(1)->diffForHumans() '1 місяць тому', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1м тому', // Carbon::now()->subMonths(2)->diffForHumans() '2 місяці тому', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2м тому', // Carbon::now()->subYears(1)->diffForHumans() '1 рік тому', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1р тому', // Carbon::now()->subYears(2)->diffForHumans() '2 роки тому', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2рр тому', // Carbon::now()->addSecond()->diffForHumans() 'за 1 секунду', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'за 1сек', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 секунду після', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1сек після', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 секунду до', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1сек до', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 секунда', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1сек', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 секунди', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2сек', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'за 1сек', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 хвилина 1 секунда', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2рр 3м 1д 1сек', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'за 3 роки', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5м тому', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2рр 3м 1д 1сек тому', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 тиждень 10 годин', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 тиждень 6 днів', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 тиждень 6 днів', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'за 1 тиждень i 6 днів', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 тижні 1 година', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'за годину', // CarbonInterval::days(2)->forHumans() '2 дні', // CarbonInterval::create('P1DT3H')->forHumans(true) '1д 3г', ]; } ================================================ FILE: tests/Localization/UnmTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UnmTest extends LocalizationTestCase { public const LOCALE = 'unm'; // Unami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sateteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kentuwei at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'manteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tusteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lelai at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tasteke at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pelaiteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tusteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lelai at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tasteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pelaiteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sateteke at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last kentuwei at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tusteke at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tusteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last manteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last kentuwei at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sateteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pelaiteke at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tasteke at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last lelai at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pelaiteke at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/UnmUsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UnmUsTest extends LocalizationTestCase { public const LOCALE = 'unm_US'; // Unami public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sateteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'kentuwei at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'manteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tusteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lelai at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'tasteke at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'pelaiteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tusteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lelai at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tasteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'pelaiteke at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sateteke at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last kentuwei at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'tusteke at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tusteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last manteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last kentuwei at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sateteke at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last pelaiteke at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last tasteke at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last lelai at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last pelaiteke at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/UrInTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UrInTest extends LocalizationTestCase { public const LOCALE = 'ur_IN'; // Urdu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'کل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'سنیچر بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اتوار بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'پیر بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بدھ بوقت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'جمعرات بوقت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمعہ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بدھ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعرات بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعہ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'سنیچر بوقت 00:00', // Carbon::now()->subDays(2)->calendar() 'گذشتہ اتوار بوقت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ روز بوقت 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'آج بوقت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آج بوقت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'کل بوقت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'گذشتہ روز بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ روز بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ منگل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ پیر بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ اتوار بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ سنیچر بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ جمعہ بوقت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'گذشتہ جمعرات بوقت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'گذشتہ بدھ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'گذشتہ جمعہ بوقت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 صبح CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 صبح, 12:00 صبح', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 صبح, 1:30 صبح', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 صبح, 2:00 صبح', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 صبح, 6:00 صبح', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 صبح, 10:00 صبح', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 شام, 12:00 شام', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 شام, 5:00 شام', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 شام, 9:30 شام', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 شام, 11:00 شام', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 سیکنڈ قبل', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سیکنڈ قبل', // Carbon::now()->subMinutes(1)->diffForHumans() '1 منٹ قبل', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans() '2 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 منٹ قبل', // Carbon::now()->subHours(1)->diffForHumans() '1 گھنٹے قبل', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans() '2 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 گھنٹے قبل', // Carbon::now()->subDays(1)->diffForHumans() '1 دن قبل', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 دن قبل', // Carbon::now()->subDays(2)->diffForHumans() '2 دن قبل', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 دن قبل', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ہفتے قبل', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ہفتے قبل', // Carbon::now()->subMonths(1)->diffForHumans() '1 ماہ قبل', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans() '2 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ماہ قبل', // Carbon::now()->subYears(1)->diffForHumans() '1 سال قبل', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 سال قبل', // Carbon::now()->subYears(2)->diffForHumans() '2 سال قبل', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 سال قبل', // Carbon::now()->addSecond()->diffForHumans() '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 سیکنڈ بعد', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 سیکنڈ پہلے', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 سیکنڈ پہلے', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 سیکنڈ بعد', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 منٹ 1 سیکنڈ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 سال 3 ماہ 1 دن 1 سیکنڈ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سال بعد', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ماہ قبل', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 سال 3 ماہ 1 دن 1 سیکنڈ قبل', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ہفتے 10 گھنٹے', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ہفتے اور 6 دن بعد', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ہفتے 1 گھنٹے', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ایک گھنٹہ بعد', // CarbonInterval::days(2)->forHumans() '2 دن', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 دن 3 گھنٹے', ]; } ================================================ FILE: tests/Localization/UrPkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UrPkTest extends LocalizationTestCase { public const LOCALE = 'ur_PK'; // Urdu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'کل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'هفته بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اتوار بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'پير بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بدھ بوقت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'جمعرات بوقت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمعه بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بدھ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعرات بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعه بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'هفته بوقت 00:00', // Carbon::now()->subDays(2)->calendar() 'گذشتہ اتوار بوقت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ روز بوقت 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'آج بوقت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آج بوقت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'کل بوقت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'گذشتہ روز بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ روز بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ منگل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ پير بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ اتوار بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ هفته بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ جمعه بوقت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'گذشتہ جمعرات بوقت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'گذشتہ بدھ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'گذشتہ جمعه بوقت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ص CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ص, 12:00 ص', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ص, 1:30 ص', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ص, 2:00 ص', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ص, 6:00 ص', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ص, 10:00 ص', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ش, 12:00 ش', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ش, 5:00 ش', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ش, 9:30 ش', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ش, 11:00 ش', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 سیکنڈ قبل', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سیکنڈ قبل', // Carbon::now()->subMinutes(1)->diffForHumans() '1 منٹ قبل', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans() '2 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 منٹ قبل', // Carbon::now()->subHours(1)->diffForHumans() '1 گھنٹے قبل', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans() '2 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 گھنٹے قبل', // Carbon::now()->subDays(1)->diffForHumans() '1 دن قبل', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 دن قبل', // Carbon::now()->subDays(2)->diffForHumans() '2 دن قبل', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 دن قبل', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ہفتے قبل', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ہفتے قبل', // Carbon::now()->subMonths(1)->diffForHumans() '1 ماہ قبل', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans() '2 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ماہ قبل', // Carbon::now()->subYears(1)->diffForHumans() '1 سال قبل', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 سال قبل', // Carbon::now()->subYears(2)->diffForHumans() '2 سال قبل', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 سال قبل', // Carbon::now()->addSecond()->diffForHumans() '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 سیکنڈ بعد', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 سیکنڈ پہلے', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 سیکنڈ پہلے', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 سیکنڈ بعد', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 منٹ 1 سیکنڈ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 سال 3 ماہ 1 دن 1 سیکنڈ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سال بعد', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ماہ قبل', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 سال 3 ماہ 1 دن 1 سیکنڈ قبل', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ہفتے 10 گھنٹے', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ہفتے اور 6 دن بعد', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ہفتے 1 گھنٹے', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ایک گھنٹہ بعد', // CarbonInterval::days(2)->forHumans() '2 دن', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 دن 3 گھنٹے', ]; } ================================================ FILE: tests/Localization/UrTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UrTest extends LocalizationTestCase { public const LOCALE = 'ur'; // Urdu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'کل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ہفتہ بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'اتوار بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'پیر بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'بدھ بوقت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'جمعرات بوقت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'جمعہ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'بدھ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعرات بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'جمعہ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ہفتہ بوقت 00:00', // Carbon::now()->subDays(2)->calendar() 'گذشتہ اتوار بوقت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ روز بوقت 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'آج بوقت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'آج بوقت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'کل بوقت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'منگل بوقت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'گذشتہ روز بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ روز بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ منگل بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ پیر بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ اتوار بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ ہفتہ بوقت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'گذشتہ جمعہ بوقت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'گذشتہ جمعرات بوقت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'گذشتہ بدھ بوقت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'گذشتہ جمعہ بوقت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 صبح CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 صبح, 12:00 صبح', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 صبح, 1:30 صبح', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 صبح, 2:00 صبح', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 صبح, 6:00 صبح', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 صبح, 10:00 صبح', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 شام, 12:00 شام', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 شام, 5:00 شام', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 شام, 9:30 شام', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 شام, 11:00 شام', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 سیکنڈ قبل', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans() '2 سیکنڈ قبل', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 سیکنڈ قبل', // Carbon::now()->subMinutes(1)->diffForHumans() '1 منٹ قبل', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans() '2 منٹ قبل', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 منٹ قبل', // Carbon::now()->subHours(1)->diffForHumans() '1 گھنٹے قبل', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans() '2 گھنٹے قبل', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 گھنٹے قبل', // Carbon::now()->subDays(1)->diffForHumans() '1 دن قبل', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 دن قبل', // Carbon::now()->subDays(2)->diffForHumans() '2 دن قبل', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 دن قبل', // Carbon::now()->subWeeks(1)->diffForHumans() '1 ہفتے قبل', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans() '2 ہفتے قبل', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 ہفتے قبل', // Carbon::now()->subMonths(1)->diffForHumans() '1 ماہ قبل', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans() '2 ماہ قبل', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 ماہ قبل', // Carbon::now()->subYears(1)->diffForHumans() '1 سال قبل', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 سال قبل', // Carbon::now()->subYears(2)->diffForHumans() '2 سال قبل', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 سال قبل', // Carbon::now()->addSecond()->diffForHumans() '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 سیکنڈ بعد', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 سیکنڈ بعد', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 سیکنڈ پہلے', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 سیکنڈ پہلے', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 سیکنڈ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 سیکنڈ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 سیکنڈ بعد', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 منٹ 1 سیکنڈ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 سال 3 ماہ 1 دن 1 سیکنڈ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 سال بعد', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 ماہ قبل', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 سال 3 ماہ 1 دن 1 سیکنڈ قبل', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ہفتے 10 گھنٹے', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ہفتے 6 دن', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 ہفتے اور 6 دن بعد', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ہفتے 1 گھنٹے', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ایک گھنٹہ بعد', // CarbonInterval::days(2)->forHumans() '2 دن', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 دن 3 گھنٹے', ]; } ================================================ FILE: tests/Localization/UzArabTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UzArabTest extends LocalizationTestCase { public const LOCALE = 'uz_Arab'; // Uzbek public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'فردا ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'شنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'یکشنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'دوشنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'سه‌شنبه ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'چهارشنبه ساعت 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'پنجشنبه ساعت 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'جمعه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'سه‌شنبه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'چهارشنبه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'پنجشنبه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'جمعه ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'شنبه ساعت 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'یکشنبه پیش ساعت 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'دیروز ساعت 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'امروز ساعت 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'امروز ساعت 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'فردا ساعت 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'سه‌شنبه ساعت 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'دیروز ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'دیروز ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'سه‌شنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'دوشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'یکشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'شنبه پیش ساعت 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'جمعه پیش ساعت 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'پنجشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'چهارشنبه پیش ساعت 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'جمعه پیش ساعت 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' ':timeم :timeم :timeم :timeم :timeم', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' ':timeم :timeم', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' ':timeم :timeم', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' ':timeم :timeم', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' ':timeم :timeم', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' ':timeم :timeم', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' ':timeم :timeم', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' ':timeم :timeم', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' ':timeم', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' ':timeم', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' ':timeم', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 قبل از ظهر CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 قبل از ظهر, 12:00 قبل از ظهر', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 قبل از ظهر, 1:30 قبل از ظهر', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 قبل از ظهر, 2:00 قبل از ظهر', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 قبل از ظهر, 6:00 قبل از ظهر', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 قبل از ظهر, 10:00 قبل از ظهر', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 بعد از ظهر, 12:00 بعد از ظهر', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 بعد از ظهر, 5:00 بعد از ظهر', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 بعد از ظهر, 9:30 بعد از ظهر', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 بعد از ظهر, 11:00 بعد از ظهر', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' ':timeم', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 ثانیه پیش', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 ثانیه پیش', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 ثانیه پیش', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 دقیقه پیش', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 دقیقه پیش', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 دقیقه پیش', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 ساعت پیش', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 ساعت پیش', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 ساعت پیش', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 روز پیش', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 روز پیش', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 روز پیش', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 روز پیش', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 هفته پیش', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 هفته پیش', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 هفته پیش', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ماه پیش', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ماه پیش', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 ماه پیش', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 سال پیش', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 سال پیش', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 سال پیش', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 سال پیش', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1 ثانیه دیگر', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 ثانیه پس از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 ثانیه پس از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 ثانیه پیش از', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 ثانیه پیش از', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 ثانیه', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 ثانیه', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 ثانیه', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1 ثانیه دیگر', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 دقیقه 1 ثانیه', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 سال 3 ماه 1 روز 1 ثانیه', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3 سال دیگر', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 ماه پیش', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 سال 3 ماه 1 روز 1 ثانیه پیش', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 هفته 10 ساعت', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 هفته 6 روز', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1 هفته و 6 روز دیگر', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 هفته 1 ساعت', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'یک ساعت دیگر', // CarbonInterval::days(2)->forHumans() // '2 days' '2 روز', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 روز 3 ساعت', ]; } ================================================ FILE: tests/Localization/UzCyrlTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UzCyrlTest extends LocalizationTestCase { public const LOCALE = 'uz_Cyrl'; // Uzbek public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Эртага 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'шанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'якшанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'душанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'сешанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'жума куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'сешанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'жума куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'шанба куни соат 00:00 да', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Утган якшанба куни соат 20:49 да', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Кеча соат 22:00 да', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Бугун соат 10:00 да', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Бугун соат 02:00 да', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Эртага 01:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'сешанба куни соат 00:00 да', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Кеча соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Кеча соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Утган сешанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Утган душанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Утган якшанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Утган шанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Утган жума куни соат 00:00 да', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Утган пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Утган чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Утган жума куни соат 00:00 да', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 то CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 ТО, 12:00 то', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 ТО, 1:30 то', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 ТО, 2:00 то', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 ТО, 6:00 то', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 ТО, 10:00 то', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 ТК, 12:00 тк', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 ТК, 5:00 тк', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 ТК, 9:30 тк', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 ТК, 11:00 тк', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 сония аввал', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 с аввал', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 сония аввал', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 с аввал', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 дақиқа аввал', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 д аввал', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 дақиқа аввал', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 д аввал', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 соат аввал', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 с аввал', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 соат аввал', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 с аввал', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 кун аввал', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 к аввал', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 кун аввал', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 к аввал', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 ҳафта аввал', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 ҳ аввал', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ҳафта аввал', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ҳ аввал', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ой аввал', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 о аввал', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ой аввал', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 о аввал', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 йил аввал', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 й аввал', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 йил аввал', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 й аввал', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'Якин 1 сония ичида', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'Якин 1 с ичида', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 сониядан кейин', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сдан кейин', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 сония олдин', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 с олдин', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 с', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 с', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'Якин 1 с ичида', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 дақиқа 1 сония', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 й 3 о 1 к 1 с', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'Якин 3 йил ичида', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 о аввал', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 й 3 о 1 к 1 с аввал', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 ҳафта 10 соат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ҳафта 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ҳафта 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'Якин 1 ҳафта ва 6 кун ичида', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ҳафта 1 соат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'Якин бир соат ичида', // CarbonInterваl::days(2)->forHumans() // '2 days' '2 кун', // CarbonInterваl::create('P1DT3H')->forHumans(true) // '1d 3h' '1 к 3 с', ]; } ================================================ FILE: tests/Localization/UzLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UzLatnTest extends LocalizationTestCase { public const LOCALE = 'uz_Latn'; // Uzbek public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Ertaga 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Shanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Yakshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Dushanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Chorshanba kuni soat 00:00 da', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Payshanba kuni soat 00:00 da', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Juma kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Chorshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Payshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Juma kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Shanba kuni soat 00:00 da', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'O\'tgan Yakshanba kuni soat 20:49 da', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Kecha soat 22:00 da', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Bugun soat 10:00 da', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Bugun soat 02:00 da', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Ertaga 01:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Kecha soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Kecha soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'O\'tgan Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'O\'tgan Dushanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'O\'tgan Yakshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'O\'tgan Shanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'O\'tgan Juma kuni soat 00:00 da', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'O\'tgan Payshanba kuni soat 00:00 da', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'O\'tgan Chorshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'O\'tgan Juma kuni soat 00:00 da', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 to CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 TO, 12:00 to', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 TO, 1:30 to', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 TO, 2:00 to', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 TO, 6:00 to', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 TO, 10:00 to', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 TK, 12:00 tk', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 TK, 5:00 tk', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 TK, 9:30 tk', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 TK, 11:00 tk', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 soniya avval', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 son. avval', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 soniya avval', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 son. avval', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiqa avval', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 d avval', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiqa avval', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 d avval', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 soat avval', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 soat avval', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 soat avval', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 soat avval', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 kun avval', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 k avval', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 kun avval', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 k avval', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 hafta avval', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 h avval', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 hafta avval', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 h avval', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 oy avval', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 o avval', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 oy avval', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 o avval', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 yil avval', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 y avval', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 yil avval', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 y avval', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'Yaqin 1 soniya ichida', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'Yaqin 1 son. ichida', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 soniyadan keyin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 son.dan keyin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 soniya oldin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 son. oldin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 soniya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 son.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 soniya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 son.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'Yaqin 1 son. ichida', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiqa 1 soniya', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 y 3 o 1 k 1 son.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'Yaqin 3 yil ichida', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 o avval', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 y 3 o 1 k 1 son. avval', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 hafta 10 soat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hafta 6 kun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hafta 6 kun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'Yaqin 1 hafta va 6 kun ichida', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 hafta 1 soat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'Yaqin bir soat ichida', // CarbonInterval::days(2)->forHumans() // '2 days' '2 kun', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 k 3 soat', ]; } ================================================ FILE: tests/Localization/UzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UzTest extends LocalizationTestCase { public const LOCALE = 'uz'; // Uzbek public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Эртага 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'шанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'якшанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'душанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'сешанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'жума куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'сешанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'жума куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'шанба куни соат 00:00 да', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Утган якшанба куни соат 20:49 да', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Кеча соат 22:00 да', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Бугун соат 10:00 да', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Бугун соат 02:00 да', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Эртага 01:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'сешанба куни соат 00:00 да', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Кеча соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Кеча соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Утган сешанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Утган душанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Утган якшанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Утган шанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Утган жума куни соат 00:00 да', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Утган пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Утган чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Утган жума куни соат 00:00 да', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 эрталаб CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 эрталаб, 12:00 эрталаб', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 эрталаб, 1:30 эрталаб', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 эрталаб, 2:00 эрталаб', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 эрталаб, 6:00 эрталаб', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 эрталаб, 10:00 эрталаб', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 кечаси, 12:00 кечаси', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 кечаси, 5:00 кечаси', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 кечаси, 9:30 кечаси', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 кечаси, 11:00 кечаси', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 сония аввал', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 с аввал', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 сония аввал', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 с аввал', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 дақиқа аввал', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 д аввал', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 дақиқа аввал', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 д аввал', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 соат аввал', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 с аввал', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 соат аввал', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 с аввал', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 кун аввал', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 к аввал', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 кун аввал', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 к аввал', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 ҳафта аввал', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 ҳ аввал', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ҳафта аввал', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ҳ аввал', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ой аввал', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 о аввал', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ой аввал', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 о аввал', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 йил аввал', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 й аввал', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 йил аввал', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 й аввал', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'Якин 1 сония ичида', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'Якин 1 с ичида', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 сониядан кейин', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сдан кейин', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 сония олдин', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 с олдин', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 с', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 с', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'Якин 1 с ичида', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 дақиқа 1 сония', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 й 3 о 1 к 1 с', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'Якин 3 йил ичида', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 о аввал', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 й 3 о 1 к 1 с аввал', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 ҳафта 10 соат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ҳафта 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ҳафта 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'Якин 1 ҳафта ва 6 кун ичида', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ҳафта 1 соат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'Якин бир соат ичида', // CarbonInterваl::days(2)->forHumans() // '2 days' '2 кун', // CarbonInterваl::create('P1DT3H')->forHumans(true) // '1d 3h' '1 к 3 с', ]; } ================================================ FILE: tests/Localization/UzUzCyrillicTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UzUzCyrillicTest extends LocalizationTestCase { public const LOCALE = 'uz_UZ@cyrillic'; // Uzbek public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Эртага 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Шанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Якшанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Душанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Сешанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Жума куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Сешанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Жума куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Шанба куни соат 00:00 да', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'Утган Якшанба куни соат 20:49 да', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Кеча соат 22:00 да', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Бугун соат 10:00 да', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Бугун соат 02:00 да', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Эртага 01:00 да', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Сешанба куни соат 00:00 да', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Кеча соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Кеча соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'Утган Сешанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'Утган Душанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'Утган Якшанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'Утган Шанба куни соат 00:00 да', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'Утган Жума куни соат 00:00 да', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'Утган Пайшанба куни соат 00:00 да', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'Утган Чоршанба куни соат 00:00 да', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'Утган Жума куни соат 00:00 да', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 эрталаб CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 эрталаб, 12:00 эрталаб', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 эрталаб, 1:30 эрталаб', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 эрталаб, 2:00 эрталаб', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 эрталаб, 6:00 эрталаб', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 эрталаб, 10:00 эрталаб', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 кечаси, 12:00 кечаси', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 кечаси, 5:00 кечаси', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 кечаси, 9:30 кечаси', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 кечаси, 11:00 кечаси', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 сония аввал', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 с аввал', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 сония аввал', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 с аввал', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 дақиқа аввал', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 д аввал', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 дақиқа аввал', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 д аввал', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 соат аввал', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 с аввал', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 соат аввал', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 с аввал', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 кун аввал', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 к аввал', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 кун аввал', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 к аввал', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 ҳафта аввал', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 ҳ аввал', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 ҳафта аввал', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 ҳ аввал', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 ой аввал', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 о аввал', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 ой аввал', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 о аввал', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 йил аввал', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 й аввал', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 йил аввал', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 й аввал', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'Якин 1 сония ичида', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'Якин 1 с ичида', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 сониядан кейин', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 сдан кейин', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 сония олдин', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 с олдин', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 сония', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 с', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 сония', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 с', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'Якин 1 с ичида', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 дақиқа 1 сония', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 й 3 о 1 к 1 с', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'Якин 3 йил ичида', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 о аввал', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 й 3 о 1 к 1 с аввал', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 ҳафта 10 соат', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ҳафта 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 ҳафта 6 кун', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'Якин 1 ҳафта ва 6 кун ичида', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 ҳафта 1 соат', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'Якин бир соат ичида', // CarbonInterваl::days(2)->forHumans() // '2 days' '2 кун', // CarbonInterваl::create('P1DT3H')->forHumans(true) // '1d 3h' '1 к 3 с', ]; } ================================================ FILE: tests/Localization/UzUzTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class UzUzTest extends LocalizationTestCase { public const LOCALE = 'uz_UZ'; // Uzbek public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' 'Ertaga 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' 'Shanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' 'Yakshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' 'Dushanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' 'Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' 'Chorshanba kuni soat 00:00 da', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' 'Payshanba kuni soat 00:00 da', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' 'Juma kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' 'Chorshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' 'Payshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' 'Juma kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' 'Shanba kuni soat 00:00 da', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' 'O\'tgan Yakshanba kuni soat 20:49 da', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' 'Kecha soat 22:00 da', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' 'Bugun soat 10:00 da', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' 'Bugun soat 02:00 da', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' 'Ertaga 01:00 da', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' 'Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' 'Kecha soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' 'Kecha soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' 'O\'tgan Seshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' 'O\'tgan Dushanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' 'O\'tgan Yakshanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' 'O\'tgan Shanba kuni soat 00:00 da', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' 'O\'tgan Juma kuni soat 00:00 da', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' 'O\'tgan Payshanba kuni soat 00:00 da', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' 'O\'tgan Chorshanba kuni soat 00:00 da', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' 'O\'tgan Juma kuni soat 00:00 da', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 to CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 TO, 12:00 to', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 TO, 1:30 to', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 TO, 2:00 to', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 TO, 6:00 to', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 TO, 10:00 to', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 TK, 12:00 tk', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 TK, 5:00 tk', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 TK, 9:30 tk', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 TK, 11:00 tk', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1 soniya avval', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1 son. avval', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2 soniya avval', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2 son. avval', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1 daqiqa avval', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1 d avval', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2 daqiqa avval', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2 d avval', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1 soat avval', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1 soat avval', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2 soat avval', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2 soat avval', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1 kun avval', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1 k avval', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2 kun avval', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2 k avval', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1 hafta avval', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1 h avval', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2 hafta avval', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2 h avval', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1 oy avval', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1 o avval', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2 oy avval', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2 o avval', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1 yil avval', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1 y avval', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2 yil avval', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2 y avval', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' 'Yaqin 1 soniya ichida', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' 'Yaqin 1 son. ichida', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1 soniyadan keyin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1 son.dan keyin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1 soniya oldin', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1 son. oldin', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1 soniya', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1 son.', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2 soniya', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2 son.', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' 'Yaqin 1 son. ichida', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1 daqiqa 1 soniya', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2 y 3 o 1 k 1 son.', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' 'Yaqin 3 yil ichida', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5 o avval', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2 y 3 o 1 k 1 son. avval', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1 hafta 10 soat', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hafta 6 kun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1 hafta 6 kun', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' 'Yaqin 1 hafta va 6 kun ichida', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2 hafta 1 soat', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' 'Yaqin bir soat ichida', // CarbonInterval::days(2)->forHumans() // '2 days' '2 kun', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1 k 3 soat', ]; } ================================================ FILE: tests/Localization/VaiLatnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VaiLatnTest extends LocalizationTestCase { public const LOCALE = 'vai_Latn'; // Vai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'siɓiti at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lahadi at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'tɛɛnɛɛ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'talata at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'alaba at 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'aimisa at 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'aijima at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talata at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alaba at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'aimisa at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'aijima at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'siɓiti at 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Last lahadi at 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talata at 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last talata at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last tɛɛnɛɛ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lahadi at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last siɓiti at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last aijima at 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last aimisa at 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last alaba at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last aijima at 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/VaiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VaiTest extends LocalizationTestCase { public const LOCALE = 'vai'; // Vai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꔻꔬꔳ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꕞꕌꔵ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꗳꗡꘉ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꕉꕞꕒ at 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ꕉꔤꕆꕢ at 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕉꕞꕒ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕉꔤꕆꕢ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꔻꔬꔳ at 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Last ꕞꕌꔵ at 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꗳꗡꘉ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꕞꕌꔵ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꔻꔬꔳ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ꕉꔤꕆꕢ at 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ꕉꕞꕒ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ꗱꕞꕯꕊ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ꗱꕞꕯꕊ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ꗱꕞꕯꕊ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ꗱꕞꕯꕊ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ꕀ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ꕀ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ꕀ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ꕀ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ꗱꕞꕯꕊ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ꗱꕞꕯꕊ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ꗱꕞꕯꕊ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ꗱꕞꕯꕊ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ꗱꕞꕯꕊ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ꗱꕞꕯꕊ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ꗱꕞꕯꕊ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ꗱꕞꕯꕊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ꗱꕞꕯꕊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ꗱꕞꕯꕊ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ꗱꕞꕯꕊ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ꗱꕞꕯꕊ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ꕀ 3mos 1d 1 ꗱꕞꕯꕊ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ꕀ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ꕀ 3mos 1d 1 ꗱꕞꕯꕊ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/VaiVaiiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VaiVaiiTest extends LocalizationTestCase { public const LOCALE = 'vai_Vaii'; // Vai public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꔻꔬꔳ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꕞꕌꔵ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꗳꗡꘉ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ꕉꕞꕒ at 12:00 am', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ꕉꔤꕆꕢ at 12:00 am', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕉꕞꕒ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕉꔤꕆꕢ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꔻꔬꔳ at 12:00 am', // Carbon::now()->subDays(2)->calendar() 'Last ꕞꕌꔵ at 8:49 pm', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 pm', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 am', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 am', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 am', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꕚꕞꕚ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꗳꗡꘉ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꕞꕌꔵ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꔻꔬꔳ at 12:00 am', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ꕉꔤꕆꕢ at 12:00 am', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last ꕉꕞꕒ at 12:00 am', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ꕉꔤꕀꕮ at 12:00 am', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 ꗱꕞꕯꕊ ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 ꗱꕞꕯꕊ ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 ꗱꕞꕯꕊ ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 ꗱꕞꕯꕊ ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ꕀ ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ꕀ ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ꕀ ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ꕀ ago', // Carbon::now()->addSecond()->diffForHumans() '1 ꗱꕞꕯꕊ from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 ꗱꕞꕯꕊ from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ꗱꕞꕯꕊ after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ꗱꕞꕯꕊ after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ꗱꕞꕯꕊ before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ꗱꕞꕯꕊ before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ꗱꕞꕯꕊ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ꗱꕞꕯꕊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ꗱꕞꕯꕊ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ꗱꕞꕯꕊ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 ꗱꕞꕯꕊ from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 ꗱꕞꕯꕊ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ꕀ 3mos 1d 1 ꗱꕞꕯꕊ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ꕀ from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ꕀ 3mos 1d 1 ꗱꕞꕯꕊ ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/VeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VeTest extends LocalizationTestCase { public const LOCALE = 've'; // Venda public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mugivhela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Swondaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Musumbuluwo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ḽavhuraru at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ḽavhuṋa at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuraru at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuṋa at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mugivhela at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Swondaha at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Musumbuluwo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Swondaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mugivhela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Ḽavhuṋa at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ḽavhuraru at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/VeZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VeZaTest extends LocalizationTestCase { public const LOCALE = 've_ZA'; // Venda public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mugivhela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Swondaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Musumbuluwo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ḽavhuraru at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ḽavhuṋa at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuraru at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuṋa at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mugivhela at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Swondaha at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ḽavhuvhili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Musumbuluwo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Swondaha at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mugivhela at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Ḽavhuṋa at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Ḽavhuraru at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ḽavhuṱanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/ViTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ViTest extends LocalizationTestCase { public const LOCALE = 'vi'; // Vietnamese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ngày mai lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ bảy tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'chủ nhật tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ hai tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ ba tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ tư tuần tới lúc 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'thứ năm tuần tới lúc 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'thứ sáu tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ ba tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ tư tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ năm tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ sáu tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ bảy tuần tới lúc 00:00', // Carbon::now()->subDays(2)->calendar() 'chủ nhật tuần trước lúc 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hôm qua lúc 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hôm nay lúc 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hôm nay lúc 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ngày mai lúc 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ ba tuần tới lúc 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hôm qua lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hôm qua lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ ba tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ hai tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'chủ nhật tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ bảy tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ sáu tuần trước lúc 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'thứ năm tuần trước lúc 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'thứ tư tuần trước lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ sáu tuần trước lúc 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 sa CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 SA, 12:00 sa', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 SA, 1:30 sa', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 SA, 2:00 sa', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 SA, 6:00 sa', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 SA, 10:00 sa', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 CH, 12:00 ch', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 CH, 5:00 ch', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 CH, 9:30 ch', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 CH, 11:00 ch', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 giây trước', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 giây trước', // Carbon::now()->subSeconds(2)->diffForHumans() '2 giây trước', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 giây trước', // Carbon::now()->subMinutes(1)->diffForHumans() '1 phút trước', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 phút trước', // Carbon::now()->subMinutes(2)->diffForHumans() '2 phút trước', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 phút trước', // Carbon::now()->subHours(1)->diffForHumans() '1 giờ trước', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 giờ trước', // Carbon::now()->subHours(2)->diffForHumans() '2 giờ trước', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 giờ trước', // Carbon::now()->subDays(1)->diffForHumans() '1 ngày trước', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ngày trước', // Carbon::now()->subDays(2)->diffForHumans() '2 ngày trước', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ngày trước', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tuần trước', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tuần trước', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tuần trước', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tuần trước', // Carbon::now()->subMonths(1)->diffForHumans() '1 tháng trước', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 tháng trước', // Carbon::now()->subMonths(2)->diffForHumans() '2 tháng trước', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 tháng trước', // Carbon::now()->subYears(1)->diffForHumans() '1 năm trước', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 năm trước', // Carbon::now()->subYears(2)->diffForHumans() '2 năm trước', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 năm trước', // Carbon::now()->addSecond()->diffForHumans() '1 giây tới', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 giây tới', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 giây sau', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 giây sau', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 giây trước', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 giây trước', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 giây', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 giây', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 giây', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 giây', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 giây tới', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 phút 1 giây', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 năm 3 tháng 1 ngày 1 giây', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 năm tới', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 tháng trước', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 năm 3 tháng 1 ngày 1 giây trước', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tuần 10 giờ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tuần 6 ngày', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tuần 6 ngày', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tuần và 6 ngày tới', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tuần 1 giờ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'một giờ tới', // CarbonInterval::days(2)->forHumans() '2 ngày', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ngày 3 giờ', ]; } ================================================ FILE: tests/Localization/ViVnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ViVnTest extends LocalizationTestCase { public const LOCALE = 'vi_VN'; // Vietnamese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ngày mai lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ bảy tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'chủ nhật tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ hai tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ ba tuần tới lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ tư tuần tới lúc 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'thứ năm tuần tới lúc 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'thứ sáu tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ ba tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ tư tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ năm tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ sáu tuần tới lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ bảy tuần tới lúc 00:00', // Carbon::now()->subDays(2)->calendar() 'chủ nhật tuần trước lúc 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hôm qua lúc 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Hôm nay lúc 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hôm nay lúc 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ngày mai lúc 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ ba tuần tới lúc 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Hôm qua lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Hôm qua lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ ba tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ hai tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'chủ nhật tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ bảy tuần trước lúc 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'thứ sáu tuần trước lúc 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'thứ năm tuần trước lúc 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'thứ tư tuần trước lúc 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'thứ sáu tuần trước lúc 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 sa CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 SA, 12:00 sa', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 SA, 1:30 sa', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 SA, 2:00 sa', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 SA, 6:00 sa', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 SA, 10:00 sa', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 CH, 12:00 ch', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 CH, 5:00 ch', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 CH, 9:30 ch', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 CH, 11:00 ch', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() '1 giây trước', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 giây trước', // Carbon::now()->subSeconds(2)->diffForHumans() '2 giây trước', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 giây trước', // Carbon::now()->subMinutes(1)->diffForHumans() '1 phút trước', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 phút trước', // Carbon::now()->subMinutes(2)->diffForHumans() '2 phút trước', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 phút trước', // Carbon::now()->subHours(1)->diffForHumans() '1 giờ trước', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 giờ trước', // Carbon::now()->subHours(2)->diffForHumans() '2 giờ trước', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 giờ trước', // Carbon::now()->subDays(1)->diffForHumans() '1 ngày trước', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 ngày trước', // Carbon::now()->subDays(2)->diffForHumans() '2 ngày trước', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 ngày trước', // Carbon::now()->subWeeks(1)->diffForHumans() '1 tuần trước', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 tuần trước', // Carbon::now()->subWeeks(2)->diffForHumans() '2 tuần trước', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 tuần trước', // Carbon::now()->subMonths(1)->diffForHumans() '1 tháng trước', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 tháng trước', // Carbon::now()->subMonths(2)->diffForHumans() '2 tháng trước', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 tháng trước', // Carbon::now()->subYears(1)->diffForHumans() '1 năm trước', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 năm trước', // Carbon::now()->subYears(2)->diffForHumans() '2 năm trước', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 năm trước', // Carbon::now()->addSecond()->diffForHumans() '1 giây tới', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 giây tới', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 giây sau', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 giây sau', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 giây trước', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 giây trước', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 giây', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 giây', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 giây', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 giây', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 giây tới', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 phút 1 giây', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 năm 3 tháng 1 ngày 1 giây', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 năm tới', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 tháng trước', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 năm 3 tháng 1 ngày 1 giây trước', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 tuần 10 giờ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tuần 6 ngày', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 tuần 6 ngày', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 tuần và 6 ngày tới', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 tuần 1 giờ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'một giờ tới', // CarbonInterval::days(2)->forHumans() '2 ngày', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ngày 3 giờ', ]; } ================================================ FILE: tests/Localization/VoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VoTest extends LocalizationTestCase { public const LOCALE = 'vo'; // Volapuk public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Thursday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Friday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Saturday at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sunday at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Tuesday at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Tuesday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Monday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sunday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Saturday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Thursday at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Wednesday at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Friday at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 sekun ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 sekun ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 sekun ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 sekun ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minut ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 minut ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minut ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 minut ago', // Carbon::now()->subHours(1)->diffForHumans() '1 düp ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 düp ago', // Carbon::now()->subHours(2)->diffForHumans() '2 düp ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 düp ago', // Carbon::now()->subDays(1)->diffForHumans() '1 del ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 del ago', // Carbon::now()->subDays(2)->diffForHumans() '2 del ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 del ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 vig ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 vig ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 vig ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 vig ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 mul ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 mul ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 mul ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 mul ago', // Carbon::now()->subYears(1)->diffForHumans() '1 yel ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 yel ago', // Carbon::now()->subYears(2)->diffForHumans() '2 yel ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 yel ago', // Carbon::now()->addSecond()->diffForHumans() '1 sekun from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 sekun from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 sekun after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 sekun after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 sekun before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 sekun before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 sekun', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 sekun', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 sekun', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 sekun', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 sekun from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minut 1 sekun', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 yel 3 mul 1 del 1 sekun', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 yel from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 mul ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 yel 3 mul 1 del 1 sekun ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 vig 10 düp', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vig 6 del', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 vig 6 del', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 vig and 6 del from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 vig 1 düp', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 düp from now', // CarbonInterval::days(2)->forHumans() '2 del', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 del 3 düp', ]; } ================================================ FILE: tests/Localization/VunTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class VunTest extends LocalizationTestCase { public const LOCALE = 'vun'; // Vunjo public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumapilyi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatatuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Jumatanu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Alhamisi at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ijumaa at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumamosi at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Jumapilyi at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Jumanne at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumanne at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumatatuu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumapilyi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Jumamosi at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Alhamisi at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Jumatanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Ijumaa at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 utuko CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 utuko, 12:00 utuko', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 utuko, 1:30 utuko', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 utuko, 2:00 utuko', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 utuko, 6:00 utuko', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 utuko, 10:00 utuko', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kyiukonyi, 12:00 kyiukonyi', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kyiukonyi, 5:00 kyiukonyi', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kyiukonyi, 9:30 kyiukonyi', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kyiukonyi, 11:00 kyiukonyi', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/WaBeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WaBeTest extends LocalizationTestCase { public const LOCALE = 'wa_BE'; // Walloon public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'semdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimegne at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'londi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mårdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mierkidi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'djudi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vénrdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mårdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mierkidi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'djudi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vénrdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'semdi at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dimegne at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mårdi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mårdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last londi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dimegne at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last semdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vénrdi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last djudi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mierkidi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vénrdi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Sigonde ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Sigonde ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Sigonde ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Sigonde ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 munute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 munute ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 munute ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 munute ago', // Carbon::now()->subHours(1)->diffForHumans() '1 eure ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 eure ago', // Carbon::now()->subHours(2)->diffForHumans() '2 eure ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 eure ago', // Carbon::now()->subDays(1)->diffForHumans() '1 djoû ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 djoû ago', // Carbon::now()->subDays(2)->diffForHumans() '2 djoû ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 djoû ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 samwinne ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 samwinne ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 samwinne ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 samwinne ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 meûs ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 meûs ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 meûs ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 meûs ago', // Carbon::now()->subYears(1)->diffForHumans() '1 anêye ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anêye ago', // Carbon::now()->subYears(2)->diffForHumans() '2 anêye ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anêye ago', // Carbon::now()->addSecond()->diffForHumans() '1 Sigonde from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Sigonde from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sigonde after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sigonde after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sigonde before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sigonde before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sigonde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sigonde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sigonde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sigonde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Sigonde from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 munute 1 Sigonde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anêye 3 meûs 1 djoû 1 Sigonde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 anêye from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 meûs ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anêye 3 meûs 1 djoû 1 Sigonde ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 samwinne 10 eure', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 samwinne 6 djoû', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 samwinne 6 djoû', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 samwinne and 6 djoû from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 samwinne 1 eure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 eure from now', // CarbonInterval::days(2)->forHumans() '2 djoû', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 djoû 3 eure', ]; } ================================================ FILE: tests/Localization/WaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WaTest extends LocalizationTestCase { public const LOCALE = 'wa'; // Walloon public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'semdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dimegne at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'londi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mårdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mierkidi at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'djudi at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'vénrdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mårdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mierkidi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'djudi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'vénrdi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'semdi at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last dimegne at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mårdi at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mårdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last londi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dimegne at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last semdi at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last vénrdi at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last djudi at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mierkidi at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last vénrdi at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 Sigonde ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 Sigonde ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 Sigonde ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 Sigonde ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 munute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 munute ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 munute ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 munute ago', // Carbon::now()->subHours(1)->diffForHumans() '1 eure ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 eure ago', // Carbon::now()->subHours(2)->diffForHumans() '2 eure ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 eure ago', // Carbon::now()->subDays(1)->diffForHumans() '1 djoû ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 djoû ago', // Carbon::now()->subDays(2)->diffForHumans() '2 djoû ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 djoû ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 samwinne ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 samwinne ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 samwinne ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 samwinne ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 meûs ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 meûs ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 meûs ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 meûs ago', // Carbon::now()->subYears(1)->diffForHumans() '1 anêye ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 anêye ago', // Carbon::now()->subYears(2)->diffForHumans() '2 anêye ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 anêye ago', // Carbon::now()->addSecond()->diffForHumans() '1 Sigonde from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 Sigonde from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 Sigonde after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 Sigonde after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 Sigonde before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 Sigonde before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 Sigonde', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 Sigonde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 Sigonde', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 Sigonde', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 Sigonde from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 munute 1 Sigonde', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 anêye 3 meûs 1 djoû 1 Sigonde', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 anêye from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 meûs ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 anêye 3 meûs 1 djoû 1 Sigonde ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 samwinne 10 eure', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 samwinne 6 djoû', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 samwinne 6 djoû', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 samwinne and 6 djoû from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 samwinne 1 eure', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 eure from now', // CarbonInterval::days(2)->forHumans() '2 djoû', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 djoû 3 eure', ]; } ================================================ FILE: tests/Localization/WaeChTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WaeChTest extends LocalizationTestCase { public const LOCALE = 'wae_CH'; // Walser public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Suntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mäntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Zischtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwuch at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Frontag at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fritag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Zischtag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwuch at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Frontag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fritag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschtag at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Suntag at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Zischtag at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Zischtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mäntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Suntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samschtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fritag at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Frontag at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mittwuch at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fritag at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Maano ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Maano ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Maano ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Maano ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3 Maano 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Maano ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3 Maano 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/WaeTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WaeTest extends LocalizationTestCase { public const LOCALE = 'wae'; // Walser public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Samschtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Suntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mäntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Zischtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Mittwuch at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Frontag at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Fritag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Zischtag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Mittwuch at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Frontag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Fritag at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Samschtag at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last Suntag at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Zischtag at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Zischtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Mäntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Suntag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Samschtag at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Fritag at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Frontag at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Mittwuch at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Fritag at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 Maano ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 Maano ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 Maano ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 Maano ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3 Maano 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 Maano ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3 Maano 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/WalEtTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WalEtTest extends LocalizationTestCase { public const LOCALE = 'wal_ET'; // Wolaytta public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቄራ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ወጋ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሳይኖ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'አሩዋ at 12:00 ማለዶ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሃሙሳ at 12:00 ማለዶ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'አሩዋ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሃሙሳ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቄራ at 12:00 ማለዶ', // Carbon::now()->subDays(2)->calendar() 'Last ወጋ at 8:49 ቃማ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ቃማ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ማለዶ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሳይኖ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ወጋ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቄራ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሃሙሳ at 12:00 ማለዶ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last አሩዋ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ማለዶ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ማለዶ, 12:00 ማለዶ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ማለዶ, 1:30 ማለዶ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ማለዶ, 2:00 ማለዶ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ማለዶ, 6:00 ማለዶ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ማለዶ, 10:00 ማለዶ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ቃማ, 12:00 ቃማ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ቃማ, 5:00 ቃማ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ቃማ, 9:30 ቃማ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ቃማ, 11:00 ቃማ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/WalTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WalTest extends LocalizationTestCase { public const LOCALE = 'wal'; // Wolaytta public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ቄራ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ወጋ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ሳይኖ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'አሩዋ at 12:00 ማለዶ', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ሃሙሳ at 12:00 ማለዶ', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'አሩዋ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ሃሙሳ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ቄራ at 12:00 ማለዶ', // Carbon::now()->subDays(2)->calendar() 'Last ወጋ at 8:49 ቃማ', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 ቃማ', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 ማለዶ', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ማቆሳኛ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ሳይኖ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ወጋ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ቄራ at 12:00 ማለዶ', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ሃሙሳ at 12:00 ማለዶ', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last አሩዋ at 12:00 ማለዶ', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last አርባ at 12:00 ማለዶ', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ማለዶ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ማለዶ, 12:00 ማለዶ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ማለዶ, 1:30 ማለዶ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ማለዶ, 2:00 ማለዶ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ማለዶ, 6:00 ማለዶ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ማለዶ, 10:00 ማለዶ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ቃማ, 12:00 ቃማ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ቃማ, 5:00 ቃማ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ቃማ, 9:30 ቃማ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ቃማ, 11:00 ቃማ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/WoSnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WoSnTest extends LocalizationTestCase { public const LOCALE = 'wo_SN'; // Wolof public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaawu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dib\'eer at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'altine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'talaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'allarba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'alxames at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ajjuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'allarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alxames at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ajjuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gaawu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dib\'eer at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talaata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last talaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last altine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dib\'eer at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last gaawu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ajjuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last alxames at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last allarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ajjuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saa', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 saa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 saa', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 simili 1 saa', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 at 3 wèr 1 bés 1 saa', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ayubés 10 waxtu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ayubés 6 bés', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ayubés 6 bés', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ayubés 1 waxtu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 bés', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 bés 3 waxtu', ]; } ================================================ FILE: tests/Localization/WoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class WoTest extends LocalizationTestCase { public const LOCALE = 'wo'; // Wolof public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'gaawu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'dib\'eer at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'altine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'talaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'allarba at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'alxames at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ajjuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talaata at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'allarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'alxames at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ajjuma at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'gaawu at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last dib\'eer at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'talaata at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last talaata at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last altine at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last dib\'eer at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last gaawu at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last ajjuma at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last alxames at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last allarba at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last ajjuma at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(1)->diffForHumans() 'ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subHours(2)->diffForHumans() 'ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(1)->diffForHumans() 'ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subDays(2)->diffForHumans() 'ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(1)->diffForHumans() 'ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subMonths(2)->diffForHumans() 'ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(1)->diffForHumans() 'ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ago', // Carbon::now()->subYears(2)->diffForHumans() 'ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ago', // Carbon::now()->addSecond()->diffForHumans() 'from_now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'from_now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 saa', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 saa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 saa', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 saa', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'from_now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 simili 1 saa', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 at 3 wèr 1 bés 1 saa', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'from_now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ayubés 10 waxtu', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ayubés 6 bés', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ayubés 6 bés', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'from_now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ayubés 1 waxtu', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'from_now', // CarbonInterval::days(2)->forHumans() '2 bés', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 bés 3 waxtu', ]; } ================================================ FILE: tests/Localization/XhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class XhTest extends LocalizationTestCase { public const LOCALE = 'xh'; // Xhosa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'iCawa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lwesiBini at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lwesiThathu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ulweSine at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiBini at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiThathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ulweSine at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last iCawa at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiBini at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lwesiBini at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last iCawa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ulweSine at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last lwesiThathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 nceda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 nceda ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 nceda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 nceda ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ingqalelo ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ingqalelo ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ingqalelo ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ingqalelo ago', // Carbon::now()->subHours(1)->diffForHumans() '1 iwotshi ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 iwotshi ago', // Carbon::now()->subHours(2)->diffForHumans() '2 iwotshi ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 iwotshi ago', // Carbon::now()->subDays(1)->diffForHumans() '1 imini ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 imini ago', // Carbon::now()->subDays(2)->diffForHumans() '2 imini ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 imini ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 veki ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 veki ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 veki ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 veki ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 inyanga ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 inyanga ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 inyanga ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 inyanga ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ihlobo ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ihlobo ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ihlobo ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ihlobo ago', // Carbon::now()->addSecond()->diffForHumans() '1 nceda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 nceda from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 nceda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 nceda after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 nceda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 nceda before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 nceda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 nceda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 nceda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 nceda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 nceda from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ingqalelo 1 nceda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ihlobo 3 inyanga 1 imini 1 nceda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ihlobo from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 inyanga ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ihlobo 3 inyanga 1 imini 1 nceda ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 veki 10 iwotshi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 veki 6 imini', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 veki 6 imini', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 veki and 6 imini from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 veki 1 iwotshi', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 iwotshi from now', // CarbonInterval::days(2)->forHumans() '2 imini', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 imini 3 iwotshi', ]; } ================================================ FILE: tests/Localization/XhZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class XhZaTest extends LocalizationTestCase { public const LOCALE = 'xh_ZA'; // Xhosa public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'iCawa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lwesiBini at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'lwesiThathu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ulweSine at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiBini at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiThathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ulweSine at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last iCawa at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'lwesiBini at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lwesiBini at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMvulo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last iCawa at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last ulweSine at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last lwesiThathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last lwesiHlanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 nceda ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 nceda ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 nceda ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 nceda ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 ingqalelo ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 ingqalelo ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 ingqalelo ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 ingqalelo ago', // Carbon::now()->subHours(1)->diffForHumans() '1 iwotshi ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 iwotshi ago', // Carbon::now()->subHours(2)->diffForHumans() '2 iwotshi ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 iwotshi ago', // Carbon::now()->subDays(1)->diffForHumans() '1 imini ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 imini ago', // Carbon::now()->subDays(2)->diffForHumans() '2 imini ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 imini ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 veki ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 veki ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 veki ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 veki ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 inyanga ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 inyanga ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 inyanga ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 inyanga ago', // Carbon::now()->subYears(1)->diffForHumans() '1 ihlobo ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 ihlobo ago', // Carbon::now()->subYears(2)->diffForHumans() '2 ihlobo ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 ihlobo ago', // Carbon::now()->addSecond()->diffForHumans() '1 nceda from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 nceda from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 nceda after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 nceda after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 nceda before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 nceda before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 nceda', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 nceda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 nceda', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 nceda', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 nceda from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ingqalelo 1 nceda', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ihlobo 3 inyanga 1 imini 1 nceda', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 ihlobo from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 inyanga ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 ihlobo 3 inyanga 1 imini 1 nceda ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 veki 10 iwotshi', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 veki 6 imini', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 veki 6 imini', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 veki and 6 imini from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 veki 1 iwotshi', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) '1 iwotshi from now', // CarbonInterval::days(2)->forHumans() '2 imini', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 imini 3 iwotshi', ]; } ================================================ FILE: tests/Localization/XogTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class XogTest extends LocalizationTestCase { public const LOCALE = 'xog'; // Soga public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Olomukaaga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Sabiiti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Balaza at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Owokubili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Owokusatu at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Olokuna at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Olokutaanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Owokubili at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Owokusatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Olokuna at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Olokutaanu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Olomukaaga at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last Sabiiti at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Owokubili at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Owokubili at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Balaza at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Sabiiti at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Olomukaaga at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last Olokutaanu at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last Olokuna at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last Owokusatu at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last Olokutaanu at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 munkyo CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Munkyo, 12:00 munkyo', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Munkyo, 1:30 munkyo', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Munkyo, 2:00 munkyo', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Munkyo, 6:00 munkyo', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Munkyo, 10:00 munkyo', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Eigulo, 12:00 eigulo', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Eigulo, 5:00 eigulo', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Eigulo, 9:30 eigulo', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Eigulo, 11:00 eigulo', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/YavTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YavTest extends LocalizationTestCase { public const LOCALE = 'yav'; // Yangben public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'séselé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sɔ́ndiɛ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'móndie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'muányáŋmóndie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'metúkpíápɛ at 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'kúpélimetúkpiapɛ at 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'feléte at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'muányáŋmóndie at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'metúkpíápɛ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'kúpélimetúkpiapɛ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'feléte at 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'séselé at 00:00', // Carbon::now()->subDays(2)->calendar() 'Last sɔ́ndiɛ at 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'muányáŋmóndie at 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last muányáŋmóndie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last móndie at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sɔ́ndiɛ at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last séselé at 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last feléte at 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last kúpélimetúkpiapɛ at 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last metúkpíápɛ at 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last feléte at 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 1st', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 kiɛmɛ́ɛm CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kiɛmɛ́ɛm, 12:00 kiɛmɛ́ɛm', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 kiɛmɛ́ɛm, 1:30 kiɛmɛ́ɛm', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 kiɛmɛ́ɛm, 2:00 kiɛmɛ́ɛm', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 kiɛmɛ́ɛm, 6:00 kiɛmɛ́ɛm', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 kiɛmɛ́ɛm, 10:00 kiɛmɛ́ɛm', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 kisɛ́ndɛ, 12:00 kisɛ́ndɛ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 kisɛ́ndɛ, 5:00 kisɛ́ndɛ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 kisɛ́ndɛ, 9:30 kisɛ́ndɛ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 kisɛ́ndɛ, 11:00 kisɛ́ndɛ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/YiTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YiTest extends LocalizationTestCase { public const LOCALE = 'yi'; // Yiddish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'שבת at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'זונטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'מאנטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'דינסטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'מיטוואך at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'דאנערשטאג at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'פרייטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'דינסטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'מיטוואך at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'דאנערשטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'פרייטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'שבת at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last זונטאג at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'דינסטאג at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last דינסטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last מאנטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last זונטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last שבת at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last פרייטאג at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last דאנערשטאג at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last מיטוואך at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last פרייטאג at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1טע 1טע 1טע 1טע 1טע', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2טע 1טע', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3טע 1טע', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4טע 1טע', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5טע 1טע', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6טע 1טע', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7טע 2טע', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11טע 2טע', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40טע', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41טע', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100טע', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0טע', // Carbon::now()->subSeconds(1)->diffForHumans() '1 סעקונדע פון יעצט', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 סעק פון יעצט', // Carbon::now()->subSeconds(2)->diffForHumans() '2 סעקונדעס פון יעצט', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 סעק פון יעצט', // Carbon::now()->subMinutes(1)->diffForHumans() '1 מינוט פון יעצט', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 מינוט פון יעצט', // Carbon::now()->subMinutes(2)->diffForHumans() '2 מינוט פון יעצט', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 מינוט פון יעצט', // Carbon::now()->subHours(1)->diffForHumans() '1 שעה פון יעצט', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 שעה פון יעצט', // Carbon::now()->subHours(2)->diffForHumans() '2 שעה פון יעצט', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 שעה פון יעצט', // Carbon::now()->subDays(1)->diffForHumans() '1 טאג פון יעצט', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 טאג פון יעצט', // Carbon::now()->subDays(2)->diffForHumans() '2 טעג פון יעצט', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 טאג פון יעצט', // Carbon::now()->subWeeks(1)->diffForHumans() '1 וואך פון יעצט', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 וואך פון יעצט', // Carbon::now()->subWeeks(2)->diffForHumans() '2 וואכן פון יעצט', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 וואך פון יעצט', // Carbon::now()->subMonths(1)->diffForHumans() '1 חודש פון יעצט', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 חודש פון יעצט', // Carbon::now()->subMonths(2)->diffForHumans() '2 חדשים פון יעצט', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 חדשים פון יעצט', // Carbon::now()->subYears(1)->diffForHumans() '1 יאר פון יעצט', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 יאר פון יעצט', // Carbon::now()->subYears(2)->diffForHumans() '2 יאר פון יעצט', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 יאר פון יעצט', // Carbon::now()->addSecond()->diffForHumans() '1 סעקונדע ארום', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 סעק ארום', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 סעקונדע נאך', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 סעק נאך', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 סעקונדע פאר', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 סעק פאר', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 סעקונדע', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 סעק', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 סעקונדעס', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 סעק', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 סעק ארום', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 מינוט 1 סעקונדע', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 יאר 3 חדשים 1 טאג 1 סעק', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 יאר ארום', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 חדשים פון יעצט', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 יאר 3 חדשים 1 טאג 1 סעק פון יעצט', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 וואך 10 שעה', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 וואך 6 טעג', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 וואך 6 טעג', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 וואך און 6 טעג ארום', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 וואכן 1 שעה', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'א שעה ארום', // CarbonInterval::days(2)->forHumans() '2 טעג', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 טאג 3 שעה', ]; } ================================================ FILE: tests/Localization/YiUsTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YiUsTest extends LocalizationTestCase { public const LOCALE = 'yi_US'; // Yiddish public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'שבת at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'זונטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'מאנטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'דינסטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'מיטוואך at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'דאנערשטאג at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'פרייטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'דינסטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'מיטוואך at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'דאנערשטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'פרייטאג at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'שבת at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last זונטאג at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'דינסטאג at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last דינסטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last מאנטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last זונטאג at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last שבת at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last פרייטאג at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last דאנערשטאג at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last מיטוואך at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last פרייטאג at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1טע 1טע 1טע 1טע 1טע', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2טע 1טע', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3טע 1טע', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4טע 1טע', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5טע 1טע', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6טע 1טע', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7טע 2טע', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11טע 2טע', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40טע', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41טע', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100טע', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0טע', // Carbon::now()->subSeconds(1)->diffForHumans() '1 סעקונדע פון יעצט', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1 סעק פון יעצט', // Carbon::now()->subSeconds(2)->diffForHumans() '2 סעקונדעס פון יעצט', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2 סעק פון יעצט', // Carbon::now()->subMinutes(1)->diffForHumans() '1 מינוט פון יעצט', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1 מינוט פון יעצט', // Carbon::now()->subMinutes(2)->diffForHumans() '2 מינוט פון יעצט', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2 מינוט פון יעצט', // Carbon::now()->subHours(1)->diffForHumans() '1 שעה פון יעצט', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1 שעה פון יעצט', // Carbon::now()->subHours(2)->diffForHumans() '2 שעה פון יעצט', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2 שעה פון יעצט', // Carbon::now()->subDays(1)->diffForHumans() '1 טאג פון יעצט', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1 טאג פון יעצט', // Carbon::now()->subDays(2)->diffForHumans() '2 טעג פון יעצט', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2 טאג פון יעצט', // Carbon::now()->subWeeks(1)->diffForHumans() '1 וואך פון יעצט', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1 וואך פון יעצט', // Carbon::now()->subWeeks(2)->diffForHumans() '2 וואכן פון יעצט', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2 וואך פון יעצט', // Carbon::now()->subMonths(1)->diffForHumans() '1 חודש פון יעצט', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1 חודש פון יעצט', // Carbon::now()->subMonths(2)->diffForHumans() '2 חדשים פון יעצט', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2 חדשים פון יעצט', // Carbon::now()->subYears(1)->diffForHumans() '1 יאר פון יעצט', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1 יאר פון יעצט', // Carbon::now()->subYears(2)->diffForHumans() '2 יאר פון יעצט', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2 יאר פון יעצט', // Carbon::now()->addSecond()->diffForHumans() '1 סעקונדע ארום', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1 סעק ארום', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 סעקונדע נאך', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 סעק נאך', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 סעקונדע פאר', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 סעק פאר', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 סעקונדע', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 סעק', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 סעקונדעס', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 סעק', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1 סעק ארום', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 מינוט 1 סעקונדע', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 יאר 3 חדשים 1 טאג 1 סעק', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 יאר ארום', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5 חדשים פון יעצט', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2 יאר 3 חדשים 1 טאג 1 סעק פון יעצט', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 וואך 10 שעה', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 וואך 6 טעג', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 וואך 6 טעג', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 וואך און 6 טעג ארום', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 וואכן 1 שעה', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'א שעה ארום', // CarbonInterval::days(2)->forHumans() '2 טעג', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 טאג 3 שעה', ]; } ================================================ FILE: tests/Localization/YoBjTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YoBjTest extends LocalizationTestCase { public const LOCALE = 'yo_BJ'; // Yoruba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ọ̀la ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Àbámɛ́ta Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Àìkú Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Ajé Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Ìsɛ́gun Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́rú Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ɔjɔ́bɔ Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ɔjɔ́ Ɛtì Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́ Ìsɛ́gun Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́rú Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́bɔ Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́ Ɛtì Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́ Àbámɛ́ta Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::now()->subDays(2)->calendar() 'Ɔjɔ́ Àìkú Ọsẹ̀ tólọ́ ni 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àna ni 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Ònì ni 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ònì ni 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ọ̀la ni 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́ Ìsɛ́gun Ọsẹ̀ tón\'bọ ni 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Àna ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àna ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Ìsɛ́gun Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Ajé Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Àìkú Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Àbámɛ́ta Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ɔjɔ́ Ɛtì Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Ɔjɔ́bɔ Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Ɔjɔ́rú Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ɔjɔ́ Ɛtì Ọsẹ̀ tólọ́ ni 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ọjọ́ 1 ọjọ́ 1 ọjọ́ 1 ọjọ́ 1 ọjọ́ 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ọjọ́ 2 ọjọ́ 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ọjọ́ 3 ọjọ́ 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ọjọ́ 4 ọjọ́ 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ọjọ́ 5 ọjọ́ 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ọjọ́ 6 ọjọ́ 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ọjọ́ 7 ọjọ́ 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ọjọ́ 11 ọjọ́ 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ọjọ́ 40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ọjọ́ 41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ọjọ́ 100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 àárɔ̀ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Àárɔ̀, 12:00 àárɔ̀', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Àárɔ̀, 1:30 àárɔ̀', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Àárɔ̀, 2:00 àárɔ̀', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Àárɔ̀, 6:00 àárɔ̀', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Àárɔ̀, 10:00 àárɔ̀', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ɔ̀sán, 12:00 ɔ̀sán', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ɔ̀sán, 5:00 ɔ̀sán', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ɔ̀sán, 9:30 ɔ̀sán', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ɔ̀sán, 11:00 ɔ̀sán', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ọjọ́ 0', // Carbon::now()->subSeconds(1)->diffForHumans() 'iaayá 1 kọjá', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'iaayá 1 kọjá', // Carbon::now()->subSeconds(2)->diffForHumans() 'iaayá 2 kọjá', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'iaayá 2 kọjá', // Carbon::now()->subMinutes(1)->diffForHumans() 'ìsẹjú 1 kọjá', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ìsẹjú 1 kọjá', // Carbon::now()->subMinutes(2)->diffForHumans() 'ìsẹjú 2 kọjá', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ìsẹjú 2 kọjá', // Carbon::now()->subHours(1)->diffForHumans() 'wákati 1 kọjá', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'wákati 1 kọjá', // Carbon::now()->subHours(2)->diffForHumans() 'wákati 2 kọjá', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'wákati 2 kọjá', // Carbon::now()->subDays(1)->diffForHumans() 'ọjọ́ 1 kọjá', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ọjọ́ 1 kọjá', // Carbon::now()->subDays(2)->diffForHumans() 'ọjọ́ 2 kọjá', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ọjọ́ 2 kọjá', // Carbon::now()->subWeeks(1)->diffForHumans() 'ọsẹ 1 kọjá', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ọsẹ 1 kọjá', // Carbon::now()->subWeeks(2)->diffForHumans() 'ọsẹ 2 kọjá', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ọsẹ 2 kọjá', // Carbon::now()->subMonths(1)->diffForHumans() 'osù 1 kọjá', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'osù 1 kọjá', // Carbon::now()->subMonths(2)->diffForHumans() 'osù 2 kọjá', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'osù 2 kọjá', // Carbon::now()->subYears(1)->diffForHumans() 'ọdún 1 kọjá', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ọdún 1 kọjá', // Carbon::now()->subYears(2)->diffForHumans() 'ọdún 2 kọjá', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ọdún 2 kọjá', // Carbon::now()->addSecond()->diffForHumans() 'ní iaayá 1', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ní iaayá 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'iaayá 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'iaayá 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'iaayá 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'iaayá 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ní iaayá 1', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ìsẹjú 1 iaayá 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ọdún 2 osù 3 ọjọ́ 1 iaayá 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ní ọdún 3', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'osù 5 kọjá', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ọdún 2 osù 3 ọjọ́ 1 iaayá 1 kọjá', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'ọsẹ 1 wákati 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ní ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'ọsẹ 2 wákati 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ní wákati kan', // CarbonInterval::days(2)->forHumans() 'ọjọ́ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ọjọ́ 1 wákati 3', ]; } ================================================ FILE: tests/Localization/YoNgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YoNgTest extends LocalizationTestCase { public const LOCALE = 'yo_NG'; // Yoruba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ọ̀la ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àbámẹ́ta Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àìkú Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ajé Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ọjọ́rú Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ọjọ́bọ Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ẹtì Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ọjọ́rú Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ọjọ́bọ Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ẹtì Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Àbámẹ́ta Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::now()->subDays(2)->calendar() 'Àìkú Ọsẹ̀ tólọ́ ni 8:49 Ọ̀sán', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àna ni 10:00 Ọ̀sán', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Ònì ni 10:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ònì ni 2:00 Àárọ̀', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ọ̀la ni 1:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Àna ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àna ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ajé Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àìkú Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àbámẹ́ta Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ẹtì Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Ọjọ́bọ Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Ọjọ́rú Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ẹtì Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ọjọ́ 1 ọjọ́ 1 ọjọ́ 1 ọjọ́ 1 ọjọ́ 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ọjọ́ 2 ọjọ́ 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ọjọ́ 3 ọjọ́ 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ọjọ́ 4 ọjọ́ 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ọjọ́ 5 ọjọ́ 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ọjọ́ 6 ọjọ́ 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ọjọ́ 7 ọjọ́ 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ọjọ́ 11 ọjọ́ 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ọjọ́ 40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ọjọ́ 41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ọjọ́ 100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 àárọ̀ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Àárọ̀, 12:00 àárọ̀', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Àárọ̀, 1:30 àárọ̀', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Àárọ̀, 2:00 àárọ̀', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Àárọ̀, 6:00 àárọ̀', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Àárọ̀, 10:00 àárọ̀', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ọ̀sán, 12:00 ọ̀sán', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ọ̀sán, 5:00 ọ̀sán', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ọ̀sán, 9:30 ọ̀sán', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ọ̀sán, 11:00 ọ̀sán', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ọjọ́ 0', // Carbon::now()->subSeconds(1)->diffForHumans() 'iaayá 1 kọjá', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'iaayá 1 kọjá', // Carbon::now()->subSeconds(2)->diffForHumans() 'iaayá 2 kọjá', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'iaayá 2 kọjá', // Carbon::now()->subMinutes(1)->diffForHumans() 'ìsẹjú 1 kọjá', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ìsẹjú 1 kọjá', // Carbon::now()->subMinutes(2)->diffForHumans() 'ìsẹjú 2 kọjá', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ìsẹjú 2 kọjá', // Carbon::now()->subHours(1)->diffForHumans() 'wákati 1 kọjá', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'wákati 1 kọjá', // Carbon::now()->subHours(2)->diffForHumans() 'wákati 2 kọjá', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'wákati 2 kọjá', // Carbon::now()->subDays(1)->diffForHumans() 'ọjọ́ 1 kọjá', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ọjọ́ 1 kọjá', // Carbon::now()->subDays(2)->diffForHumans() 'ọjọ́ 2 kọjá', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ọjọ́ 2 kọjá', // Carbon::now()->subWeeks(1)->diffForHumans() 'ọsẹ 1 kọjá', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ọsẹ 1 kọjá', // Carbon::now()->subWeeks(2)->diffForHumans() 'ọsẹ 2 kọjá', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ọsẹ 2 kọjá', // Carbon::now()->subMonths(1)->diffForHumans() 'osù 1 kọjá', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'osù 1 kọjá', // Carbon::now()->subMonths(2)->diffForHumans() 'osù 2 kọjá', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'osù 2 kọjá', // Carbon::now()->subYears(1)->diffForHumans() 'ọdún 1 kọjá', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ọdún 1 kọjá', // Carbon::now()->subYears(2)->diffForHumans() 'ọdún 2 kọjá', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ọdún 2 kọjá', // Carbon::now()->addSecond()->diffForHumans() 'ní iaayá 1', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ní iaayá 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'iaayá 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'iaayá 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'iaayá 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'iaayá 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ní iaayá 1', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ìsẹjú 1 iaayá 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ọdún 2 osù 3 ọjọ́ 1 iaayá 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ní ọdún 3', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'osù 5 kọjá', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ọdún 2 osù 3 ọjọ́ 1 iaayá 1 kọjá', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'ọsẹ 1 wákati 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ní ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'ọsẹ 2 wákati 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ní wákati kan', // CarbonInterval::days(2)->forHumans() 'ọjọ́ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ọjọ́ 1 wákati 3', ]; } ================================================ FILE: tests/Localization/YoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YoTest extends LocalizationTestCase { public const LOCALE = 'yo'; // Yoruba public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ọ̀la ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àbámẹ́ta Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àìkú Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ajé Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ọjọ́rú Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'Ọjọ́bọ Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'Ẹtì Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ọjọ́rú Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ọjọ́bọ Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ẹtì Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Àbámẹ́ta Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::now()->subDays(2)->calendar() 'Àìkú Ọsẹ̀ tólọ́ ni 8:49 Ọ̀sán', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àna ni 10:00 Ọ̀sán', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Ònì ni 10:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ònì ni 2:00 Àárọ̀', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Ọ̀la ni 1:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tón\'bọ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Àna ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àna ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ìsẹ́gun Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ajé Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àìkú Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Àbámẹ́ta Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Ẹtì Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Ọjọ́bọ Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Ọjọ́rú Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Ẹtì Ọsẹ̀ tólọ́ ni 12:00 Àárọ̀', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') 'ọjọ́ 1 ọjọ́ 1 ọjọ́ 1 ọjọ́ 1 ọjọ́ 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') 'ọjọ́ 2 ọjọ́ 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') 'ọjọ́ 3 ọjọ́ 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') 'ọjọ́ 4 ọjọ́ 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') 'ọjọ́ 5 ọjọ́ 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') 'ọjọ́ 6 ọjọ́ 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') 'ọjọ́ 7 ọjọ́ 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') 'ọjọ́ 11 ọjọ́ 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') 'ọjọ́ 40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') 'ọjọ́ 41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') 'ọjọ́ 100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 àárọ̀ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Àárọ̀, 12:00 àárọ̀', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 Àárọ̀, 1:30 àárọ̀', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 Àárọ̀, 2:00 àárọ̀', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 Àárọ̀, 6:00 àárọ̀', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 Àárọ̀, 10:00 àárọ̀', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 Ọ̀sán, 12:00 ọ̀sán', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 Ọ̀sán, 5:00 ọ̀sán', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 Ọ̀sán, 9:30 ọ̀sán', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 Ọ̀sán, 11:00 ọ̀sán', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') 'ọjọ́ 0', // Carbon::now()->subSeconds(1)->diffForHumans() 'iaayá 1 kọjá', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'iaayá 1 kọjá', // Carbon::now()->subSeconds(2)->diffForHumans() 'iaayá 2 kọjá', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'iaayá 2 kọjá', // Carbon::now()->subMinutes(1)->diffForHumans() 'ìsẹjú 1 kọjá', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ìsẹjú 1 kọjá', // Carbon::now()->subMinutes(2)->diffForHumans() 'ìsẹjú 2 kọjá', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ìsẹjú 2 kọjá', // Carbon::now()->subHours(1)->diffForHumans() 'wákati 1 kọjá', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'wákati 1 kọjá', // Carbon::now()->subHours(2)->diffForHumans() 'wákati 2 kọjá', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'wákati 2 kọjá', // Carbon::now()->subDays(1)->diffForHumans() 'ọjọ́ 1 kọjá', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ọjọ́ 1 kọjá', // Carbon::now()->subDays(2)->diffForHumans() 'ọjọ́ 2 kọjá', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ọjọ́ 2 kọjá', // Carbon::now()->subWeeks(1)->diffForHumans() 'ọsẹ 1 kọjá', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ọsẹ 1 kọjá', // Carbon::now()->subWeeks(2)->diffForHumans() 'ọsẹ 2 kọjá', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ọsẹ 2 kọjá', // Carbon::now()->subMonths(1)->diffForHumans() 'osù 1 kọjá', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'osù 1 kọjá', // Carbon::now()->subMonths(2)->diffForHumans() 'osù 2 kọjá', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'osù 2 kọjá', // Carbon::now()->subYears(1)->diffForHumans() 'ọdún 1 kọjá', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ọdún 1 kọjá', // Carbon::now()->subYears(2)->diffForHumans() 'ọdún 2 kọjá', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ọdún 2 kọjá', // Carbon::now()->addSecond()->diffForHumans() 'ní iaayá 1', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ní iaayá 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'iaayá 1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'iaayá 1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'iaayá 2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'iaayá 2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ní iaayá 1', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ìsẹjú 1 iaayá 1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'ọdún 2 osù 3 ọjọ́ 1 iaayá 1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ní ọdún 3', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'osù 5 kọjá', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ọdún 2 osù 3 ọjọ́ 1 iaayá 1 kọjá', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'ọsẹ 1 wákati 10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ní ọsẹ 1 ọjọ́ 6', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'ọsẹ 2 wákati 1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ní wákati kan', // CarbonInterval::days(2)->forHumans() 'ọjọ́ 2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ọjọ́ 1 wákati 3', ]; } ================================================ FILE: tests/Localization/YueHansTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YueHansTest extends LocalizationTestCase { public const LOCALE = 'yue_Hans'; // Cantonese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/YueHantTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YueHantTest extends LocalizationTestCase { public const LOCALE = 'yue_Hant'; // Cantonese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/YueHkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YueHkTest extends LocalizationTestCase { public const LOCALE = 'yue_HK'; // Cantonese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 2周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 上午 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 上午, 12:00 上午', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 上午, 1:30 上午', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 上午, 2:00 上午', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 上午, 6:00 上午', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 下午, 12:00 下午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 下午, 9:30 下午', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 下午, 11:00 下午', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/YueTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YueTest extends LocalizationTestCase { public const LOCALE = 'yue'; // Cantonese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 2周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 上午 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 上午, 12:00 上午', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 上午, 1:30 上午', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 上午, 2:00 上午', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 上午, 6:00 上午', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 下午, 12:00 下午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 下午, 9:30 下午', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 下午, 11:00 下午', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/YuwPgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YuwPgTest extends LocalizationTestCase { public const LOCALE = 'yuw_PG'; // Yau (Morobe Province) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'söndanggie at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sinda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mitiwö at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sogipbono at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'nenggo at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sinda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mitiwö at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sogipbono at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'nenggo at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'söndanggie at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last sönda at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sinda at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sinda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last söndanggie at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last nenggo at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sogipbono at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mitiwö at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last nenggo at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/YuwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class YuwTest extends LocalizationTestCase { public const LOCALE = 'yuw'; // Yau (Morobe Province) public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'söndanggie at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'sinda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'mitiwö at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'sogipbono at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'nenggo at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sinda at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'mitiwö at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sogipbono at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'nenggo at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'söndanggie at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last sönda at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'sinda at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sinda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last mönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last sönda at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last söndanggie at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last nenggo at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last sogipbono at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last mitiwö at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last nenggo at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() '1 second ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) '1s ago', // Carbon::now()->subSeconds(2)->diffForHumans() '2 seconds ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) '2s ago', // Carbon::now()->subMinutes(1)->diffForHumans() '1 minute ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) '1m ago', // Carbon::now()->subMinutes(2)->diffForHumans() '2 minutes ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) '2m ago', // Carbon::now()->subHours(1)->diffForHumans() '1 hour ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) '1h ago', // Carbon::now()->subHours(2)->diffForHumans() '2 hours ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) '2h ago', // Carbon::now()->subDays(1)->diffForHumans() '1 day ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) '1d ago', // Carbon::now()->subDays(2)->diffForHumans() '2 days ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) '2d ago', // Carbon::now()->subWeeks(1)->diffForHumans() '1 week ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) '1w ago', // Carbon::now()->subWeeks(2)->diffForHumans() '2 weeks ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) '2w ago', // Carbon::now()->subMonths(1)->diffForHumans() '1 month ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) '1mo ago', // Carbon::now()->subMonths(2)->diffForHumans() '2 months ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) '2mos ago', // Carbon::now()->subYears(1)->diffForHumans() '1 year ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) '1yr ago', // Carbon::now()->subYears(2)->diffForHumans() '2 years ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) '2yrs ago', // Carbon::now()->addSecond()->diffForHumans() '1 second from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) '1s from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 second after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1s after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 second before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1s before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 second', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1s', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 seconds', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2s', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) '1s from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 minute 1 second', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2yrs 3mos 1d 1s', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) '3 years from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) '5mos ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) '2yrs 3mos 1d 1s ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 week 10 hours', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 week 6 days', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) '1 week and 6 days from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 weeks 1 hour', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'an hour from now', // CarbonInterval::days(2)->forHumans() '2 days', // CarbonInterval::create('P1DT3H')->forHumans(true) '1d 3h', ]; } ================================================ FILE: tests/Localization/ZghTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZghTest extends LocalizationTestCase { public const LOCALE = 'zgh'; // Standard Moroccan Tamazight public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⴽⴽⴰ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⵉⴹⵢⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⴰⵎⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵡⴰⵢⵏⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⵉⵏⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵡⴰⴽⵕⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'ⵓⴽⵡⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'ⵓⵙⵉⵎⵡⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵓⵙⵉⵏⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵡⴰⴽⵕⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵓⴽⵡⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵓⵙⵉⵎⵡⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵓⵙⵉⴹⵢⴰⵙ ⴳ 00:00', // Carbon::now()->subDays(2)->calendar() 'ⵓⵙⴰⵎⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵙⵏⵏⴰⵟ ⴳ 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'ⴰⵙⵙ ⴰ/ⴰⴷ ⴳ 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵙ ⴰ/ⴰⴷ ⴳ 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'ⴰⵙⴽⴽⴰ ⴳ 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵓⵙⵉⵏⴰⵙ ⴳ 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'ⴰⵙⵙⵏⵏⴰⵟ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⴰⵙⵙⵏⵏⴰⵟ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⵉⵏⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵡⴰⵢⵏⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⴰⵎⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⵉⴹⵢⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'ⵓⵙⵉⵎⵡⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'ⵓⴽⵡⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'ⵡⴰⴽⵕⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'ⵓⵙⵉⵎⵡⴰⵙ ⴰⵎⴳⴳⴰⵔⵓ ⴳ 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1 1 1 1 1', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2 1', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3 1', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4 1', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5 1', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6 1', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7 1', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11 2', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 ⵜⵉⴼⴰⵡⵜ CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ⵜⵉⴼⴰⵡⵜ, 12:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 ⵜⵉⴼⴰⵡⵜ, 1:30 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 ⵜⵉⴼⴰⵡⵜ, 2:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 ⵜⵉⴼⴰⵡⵜ, 6:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 ⵜⵉⴼⴰⵡⵜ, 10:00 ⵜⵉⴼⴰⵡⵜ', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 12:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 5:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 ⵜⴰⴷⴳⴳⵯⴰⵜ, 9:30 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 ⵜⴰⴷⴳⴳⵯⴰⵜ, 11:00 ⵜⴰⴷⴳⴳⵯⴰⵜ', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0', // Carbon::now()->subSeconds(1)->diffForHumans() 'ⵣⴳ 1 ⵜⵙⵉⵏⵜ', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⵜ', // Carbon::now()->subSeconds(2)->diffForHumans() 'ⵣⴳ 2 ⵜⵙⵉⵏⵜ', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⵜ', // Carbon::now()->subMinutes(1)->diffForHumans() 'ⵣⴳ 1 ⵜⵓⵙⴷⵉⴷⵜ', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⵜⵓⵙ', // Carbon::now()->subMinutes(2)->diffForHumans() 'ⵣⴳ 2 ⵜⵓⵙⴷⵉⴷⵜ', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⵜⵓⵙ', // Carbon::now()->subHours(1)->diffForHumans() 'ⵣⴳ 1 ⵜⵙⵔⴰⴳⵜ', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⵜ', // Carbon::now()->subHours(2)->diffForHumans() 'ⵣⴳ 2 ⵜⵙⵔⴰⴳⵜ', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⵜ', // Carbon::now()->subDays(1)->diffForHumans() 'ⵣⴳ 1 ⵡⴰⵙⵙ', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⵓ', // Carbon::now()->subDays(2)->diffForHumans() 'ⵣⴳ 2 ⵡⴰⵙⵙ', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⵓ', // Carbon::now()->subWeeks(1)->diffForHumans() 'ⵣⴳ 1 ⵉⵎⴰⵍⴰⵙⵙ', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⵉⵎⴰⵍⴰⵙⵙ.', // Carbon::now()->subWeeks(2)->diffForHumans() 'ⵣⴳ 2 ⵉⵎⴰⵍⴰⵙⵙ', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⵉⵎⴰⵍⴰⵙⵙ.', // Carbon::now()->subMonths(1)->diffForHumans() 'ⵣⴳ 1 ⵡⴰⵢⵢⵓⵔ', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⴰⵢⵢⵓⵔⵏ', // Carbon::now()->subMonths(2)->diffForHumans() 'ⵣⴳ 2 ⵡⴰⵢⵢⵓⵔ', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⴰⵢⵢⵓⵔⵏ', // Carbon::now()->subYears(1)->diffForHumans() 'ⵣⴳ 1 ⵓⵙⴳⴳⵯⴰⵙ', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'ⵣⴳ 1 ⵓⵙⴳⴳⵯⴰⵙ', // Carbon::now()->subYears(2)->diffForHumans() 'ⵣⴳ 2 ⵓⵙⴳⴳⵯⴰⵙ', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'ⵣⴳ 2 ⵓⵙⴳⴳⵯⴰⵙ', // Carbon::now()->addSecond()->diffForHumans() 'ⴷⴳ 1 ⵜⵙⵉⵏⵜ', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'ⴷⴳ 1 ⵜ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) '1 ⵜⵙⵉⵏⵜ ⴰⵡⴰⵔ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) '1 ⵜ ⴰⵡⴰⵔ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) '1 ⵜⵙⵉⵏⵜ ⴷⴰⵜ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) '1 ⵜ ⴷⴰⵜ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) '1 ⵜⵙⵉⵏⵜ', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) '1 ⵜ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) '2 ⵜⵙⵉⵏⵜ', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) '2 ⵜ', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'ⴷⴳ 1 ⵜ', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) '1 ⵜⵓⵙⴷⵉⴷⵜ 1 ⵜⵙⵉⵏⵜ', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) '2 ⵓⵙⴳⴳⵯⴰⵙ 3 ⴰⵢⵢⵓⵔⵏ 1 ⵓ 1 ⵜ', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'ⴷⴳ 3 ⵓⵙⴳⴳⵯⴰⵙ', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'ⵣⴳ 5 ⴰⵢⵢⵓⵔⵏ', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'ⵣⴳ 2 ⵓⵙⴳⴳⵯⴰⵙ 3 ⴰⵢⵢⵓⵔⵏ 1 ⵓ 1 ⵜ', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) '1 ⵉⵎⴰⵍⴰⵙⵙ 10 ⵜⵙⵔⴰⴳⵜ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ⵉⵎⴰⵍⴰⵙⵙ 6 ⵡⴰⵙⵙ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) '1 ⵉⵎⴰⵍⴰⵙⵙ 6 ⵡⴰⵙⵙ', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'ⴷⴳ 1 ⵉⵎⴰⵍⴰⵙⵙ ⴷ 6 ⵡⴰⵙⵙ', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) '2 ⵉⵎⴰⵍⴰⵙⵙ 1 ⵜⵙⵔⴰⴳⵜ', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'ⴷⴳ ⵉⵛⵜ ⵜⵙⵔⴰⴳⵜ', // CarbonInterval::days(2)->forHumans() '2 ⵡⴰⵙⵙ', // CarbonInterval::create('P1DT3H')->forHumans(true) '1 ⵓ 3 ⵜ', ]; } ================================================ FILE: tests/Localization/ZhCnTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhCnTest extends LocalizationTestCase { public const LOCALE = 'zh_CN'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhHansHkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHansHkTest extends LocalizationTestCase { public const LOCALE = 'zh_Hans_HK'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhHansMoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHansMoTest extends LocalizationTestCase { public const LOCALE = 'zh_Hans_MO'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhHansSgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHansSgTest extends LocalizationTestCase { public const LOCALE = 'zh_Hans_SG'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhHansTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHansTest extends LocalizationTestCase { public const LOCALE = 'zh_Hans'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhHantHkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHantHkTest extends LocalizationTestCase { public const LOCALE = 'zh_Hant_HK'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhHantMoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHantMoTest extends LocalizationTestCase { public const LOCALE = 'zh_Hant_MO'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhHantTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHantTest extends LocalizationTestCase { public const LOCALE = 'zh_Hant'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhHantTwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHantTwTest extends LocalizationTestCase { public const LOCALE = 'zh_Hant_TW'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhHkTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhHkTest extends LocalizationTestCase { public const LOCALE = 'zh_HK'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhMoTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhMoTest extends LocalizationTestCase { public const LOCALE = 'zh_MO'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhSgTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhSgTest extends LocalizationTestCase { public const LOCALE = 'zh_SG'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhTest extends LocalizationTestCase { public const LOCALE = 'zh'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZhTwTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhTwTest extends LocalizationTestCase { public const LOCALE = 'zh_TW'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五 00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六 00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日 20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天 22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天 10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天 02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天 01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二 00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六 00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四 00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三 00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五 00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分鐘前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分鐘前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分鐘前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小時前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小時前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小時前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小時前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1週前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1週前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2週前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2週前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1個月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2個月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒後', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒後', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒後', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分鐘1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年後', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1週10小時', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1週6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1週6天後', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2週1小時', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小時後', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小時', ]; } ================================================ FILE: tests/Localization/ZhYueTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZhYueTest extends LocalizationTestCase { public const LOCALE = 'zh_YUE'; // Chinese public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tomorrow at 12:00 AM' '明天00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Sunday at 12:00 AM' '下星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Monday at 12:00 AM' '下星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Wednesday at 12:00 AM' '下星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Thursday at 12:00 AM' '下星期四00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Friday at 12:00 AM' '下星期五00:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Saturday at 12:00 AM' '下星期六00:00', // Carbon::now()->subDays(2)->calendar() // 'Last Sunday at 8:49 PM' '上星期日20:49', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 10:00 PM' '昨天22:00', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) // 'Today at 10:00 AM' '今天10:00', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Today at 2:00 AM' '今天02:00', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) // 'Tomorrow at 1:00 AM' '明天01:00', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Tuesday at 12:00 AM' '下星期二00:00', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Yesterday at 12:00 AM' '昨天00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Tuesday at 12:00 AM' '上星期二00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Monday at 12:00 AM' '上星期一00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Sunday at 12:00 AM' '上星期日00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Saturday at 12:00 AM' '上星期六00:00', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) // 'Last Thursday at 12:00 AM' '上星期四00:00', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) // 'Last Wednesday at 12:00 AM' '上星期三00:00', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) // 'Last Friday at 12:00 AM' '上星期五00:00', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') // '1st 1st 1st 1st 1st' '1月 1月 1日 1周 1周', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') // '2nd 1st' '2日 1周', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') // '3rd 1st' '3日 1周', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') // '4th 1st' '4日 1周', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') // '5th 1st' '5日 1周', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') // '6th 1st' '6日 1周', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') // '7th 2nd' '7日 1周', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') // '11th 2nd' '11日 2周', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') // '40th' '40日', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') // '41st' '41日', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') // '100th' '100日', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') // '12:00 am CET' '12:00 凌晨 CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 AM, 12:00 am' '12:00 凌晨, 12:00 凌晨', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') // '1:30 AM, 1:30 am' '1:30 凌晨, 1:30 凌晨', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') // '2:00 AM, 2:00 am' '2:00 凌晨, 2:00 凌晨', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') // '6:00 AM, 6:00 am' '6:00 早上, 6:00 早上', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') // '10:00 AM, 10:00 am' '10:00 上午, 10:00 上午', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') // '12:00 PM, 12:00 pm' '12:00 中午, 12:00 中午', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') // '5:00 PM, 5:00 pm' '5:00 下午, 5:00 下午', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') // '9:30 PM, 9:30 pm' '9:30 晚上, 9:30 晚上', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') // '11:00 PM, 11:00 pm' '11:00 晚上, 11:00 晚上', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') // '0th' '0', // Carbon::now()->subSeconds(1)->diffForHumans() // '1 second ago' '1秒前', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) // '1s ago' '1秒前', // Carbon::now()->subSeconds(2)->diffForHumans() // '2 seconds ago' '2秒前', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) // '2s ago' '2秒前', // Carbon::now()->subMinutes(1)->diffForHumans() // '1 minute ago' '1分钟前', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) // '1m ago' '1分钟前', // Carbon::now()->subMinutes(2)->diffForHumans() // '2 minutes ago' '2分钟前', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) // '2m ago' '2分钟前', // Carbon::now()->subHours(1)->diffForHumans() // '1 hour ago' '1小时前', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) // '1h ago' '1小时前', // Carbon::now()->subHours(2)->diffForHumans() // '2 hours ago' '2小时前', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) // '2h ago' '2小时前', // Carbon::now()->subDays(1)->diffForHumans() // '1 day ago' '1天前', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) // '1d ago' '1天前', // Carbon::now()->subDays(2)->diffForHumans() // '2 days ago' '2天前', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) // '2d ago' '2天前', // Carbon::now()->subWeeks(1)->diffForHumans() // '1 week ago' '1周前', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) // '1w ago' '1周前', // Carbon::now()->subWeeks(2)->diffForHumans() // '2 weeks ago' '2周前', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) // '2w ago' '2周前', // Carbon::now()->subMonths(1)->diffForHumans() // '1 month ago' '1个月前', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) // '1mo ago' '1个月前', // Carbon::now()->subMonths(2)->diffForHumans() // '2 months ago' '2个月前', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) // '2mos ago' '2个月前', // Carbon::now()->subYears(1)->diffForHumans() // '1 year ago' '1年前', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) // '1yr ago' '1年前', // Carbon::now()->subYears(2)->diffForHumans() // '2 years ago' '2年前', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) // '2yrs ago' '2年前', // Carbon::now()->addSecond()->diffForHumans() // '1 second from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(null, false, true) // '1s from now' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) // '1 second after' '1秒后', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) // '1s after' '1秒后', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) // '1 second before' '1秒前', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) // '1s before' '1秒前', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) // '1 second' '1秒', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) // '1s' '1秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) // '2 seconds' '2秒', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) // '2s' '2秒', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) // '1s from now' '1秒后', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) // '1 minute 1 second' '1分钟1秒', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) // '2yrs 3mos 1d 1s' '2年3个月1天1秒', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) // '3 years from now' '3年后', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) // '5mos ago' '5个月前', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) // '2yrs 3mos 1d 1s ago' '2年3个月1天1秒前', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) // '1 week 10 hours' '1周10小时', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) // '1 week 6 days' '1周6天', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) // '1 week and 6 days from now' '1周6天后', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) // '2 weeks 1 hour' '2周1小时', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) // 'an hour from now' '1小时后', // CarbonInterval::days(2)->forHumans() // '2 days' '2天', // CarbonInterval::create('P1DT3H')->forHumans(true) // '1d 3h' '1天3小时', ]; } ================================================ FILE: tests/Localization/ZuTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZuTest extends LocalizationTestCase { public const LOCALE = 'zu'; // Zulu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'iSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMsombuluko at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uLwesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uLwesithathu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'uLwesine at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesibili at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesine at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last iSonto at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesibili at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uLwesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMsombuluko at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last iSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last uLwesine at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last uLwesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'imizuzwana engu-1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'imizuzwana engu-1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'imizuzwana engu-2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'imizuzwana engu-2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ngemizuzu engu-1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ngemizuzu engu-1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ngemizuzu engu-2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ngemizuzu engu-2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'amahora angu-1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'amahora angu-1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'amahora angu-2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'amahora angu-2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ezingaba ngu-1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ezingaba ngu-1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ezingaba ngu-2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ezingaba ngu-2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'lwamasonto angu-1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'lwamasonto angu-1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'lwamasonto angu-2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'lwamasonto angu-2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'izinyanga ezingu-1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'izinyanga ezingu-1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'izinyanga ezingu-2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'izinyanga ezingu-2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'kweminyaka engu-1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'kweminyaka engu-1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'kweminyaka engu-2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'kweminyaka engu-2 ago', // Carbon::now()->addSecond()->diffForHumans() 'imizuzwana engu-1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'imizuzwana engu-1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'imizuzwana engu-1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'imizuzwana engu-1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'imizuzwana engu-1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'imizuzwana engu-1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'imizuzwana engu-1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'imizuzwana engu-1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'imizuzwana engu-2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'imizuzwana engu-2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'imizuzwana engu-1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ngemizuzu engu-1 imizuzwana engu-1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'kweminyaka engu-2 izinyanga ezingu-3 ezingaba ngu-1 imizuzwana engu-1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'kweminyaka engu-3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'izinyanga ezingu-5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'kweminyaka engu-2 izinyanga ezingu-3 ezingaba ngu-1 imizuzwana engu-1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'lwamasonto angu-1 amahora angu-10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'lwamasonto angu-1 ezingaba ngu-6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'lwamasonto angu-1 ezingaba ngu-6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'lwamasonto angu-1 and ezingaba ngu-6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'lwamasonto angu-2 amahora angu-1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'amahora angu-1 from now', // CarbonInterval::days(2)->forHumans() 'ezingaba ngu-2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ezingaba ngu-1 amahora angu-3', ]; } ================================================ FILE: tests/Localization/ZuZaTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Localization; use PHPUnit\Framework\Attributes\Group; #[Group('localization')] class ZuZaTest extends LocalizationTestCase { public const LOCALE = 'zu_ZA'; // Zulu public const CASES = [ // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Tomorrow at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'iSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uMsombuluko at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uLwesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'uLwesithathu at 12:00 AM', // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00')) 'uLwesine at 12:00 AM', // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00')) 'uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesibili at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesine at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uMgqibelo at 12:00 AM', // Carbon::now()->subDays(2)->calendar() 'Last iSonto at 8:49 PM', // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 10:00 PM', // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00')) 'Today at 10:00 AM', // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Today at 2:00 AM', // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00')) 'Tomorrow at 1:00 AM', // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'uLwesibili at 12:00 AM', // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Yesterday at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uLwesibili at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMsombuluko at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last iSonto at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uMgqibelo at 12:00 AM', // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00')) 'Last uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00')) 'Last uLwesine at 12:00 AM', // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00')) 'Last uLwesithathu at 12:00 AM', // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00')) 'Last uLwesihlanu at 12:00 AM', // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo') '1st 1st 1st 1st 1st', // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo') '2nd 1st', // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo') '3rd 1st', // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo') '4th 1st', // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo') '5th 1st', // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo') '6th 1st', // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo') '7th 2nd', // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo') '11th 2nd', // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo') '40th', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo') '41st', // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo') '100th', // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z') '12:00 am CET', // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a') '12:00 AM, 12:00 am', // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a') '1:30 AM, 1:30 am', // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a') '2:00 AM, 2:00 am', // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a') '6:00 AM, 6:00 am', // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a') '10:00 AM, 10:00 am', // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a') '12:00 PM, 12:00 pm', // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a') '5:00 PM, 5:00 pm', // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a') '9:30 PM, 9:30 pm', // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a') '11:00 PM, 11:00 pm', // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour') '0th', // Carbon::now()->subSeconds(1)->diffForHumans() 'imizuzwana engu-1 ago', // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true) 'imizuzwana engu-1 ago', // Carbon::now()->subSeconds(2)->diffForHumans() 'imizuzwana engu-2 ago', // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true) 'imizuzwana engu-2 ago', // Carbon::now()->subMinutes(1)->diffForHumans() 'ngemizuzu engu-1 ago', // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true) 'ngemizuzu engu-1 ago', // Carbon::now()->subMinutes(2)->diffForHumans() 'ngemizuzu engu-2 ago', // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true) 'ngemizuzu engu-2 ago', // Carbon::now()->subHours(1)->diffForHumans() 'amahora angu-1 ago', // Carbon::now()->subHours(1)->diffForHumans(null, false, true) 'amahora angu-1 ago', // Carbon::now()->subHours(2)->diffForHumans() 'amahora angu-2 ago', // Carbon::now()->subHours(2)->diffForHumans(null, false, true) 'amahora angu-2 ago', // Carbon::now()->subDays(1)->diffForHumans() 'ezingaba ngu-1 ago', // Carbon::now()->subDays(1)->diffForHumans(null, false, true) 'ezingaba ngu-1 ago', // Carbon::now()->subDays(2)->diffForHumans() 'ezingaba ngu-2 ago', // Carbon::now()->subDays(2)->diffForHumans(null, false, true) 'ezingaba ngu-2 ago', // Carbon::now()->subWeeks(1)->diffForHumans() 'lwamasonto angu-1 ago', // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true) 'lwamasonto angu-1 ago', // Carbon::now()->subWeeks(2)->diffForHumans() 'lwamasonto angu-2 ago', // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true) 'lwamasonto angu-2 ago', // Carbon::now()->subMonths(1)->diffForHumans() 'izinyanga ezingu-1 ago', // Carbon::now()->subMonths(1)->diffForHumans(null, false, true) 'izinyanga ezingu-1 ago', // Carbon::now()->subMonths(2)->diffForHumans() 'izinyanga ezingu-2 ago', // Carbon::now()->subMonths(2)->diffForHumans(null, false, true) 'izinyanga ezingu-2 ago', // Carbon::now()->subYears(1)->diffForHumans() 'kweminyaka engu-1 ago', // Carbon::now()->subYears(1)->diffForHumans(null, false, true) 'kweminyaka engu-1 ago', // Carbon::now()->subYears(2)->diffForHumans() 'kweminyaka engu-2 ago', // Carbon::now()->subYears(2)->diffForHumans(null, false, true) 'kweminyaka engu-2 ago', // Carbon::now()->addSecond()->diffForHumans() 'imizuzwana engu-1 from now', // Carbon::now()->addSecond()->diffForHumans(null, false, true) 'imizuzwana engu-1 from now', // Carbon::now()->addSecond()->diffForHumans(Carbon::now()) 'imizuzwana engu-1 after', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true) 'imizuzwana engu-1 after', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()) 'imizuzwana engu-1 before', // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true) 'imizuzwana engu-1 before', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true) 'imizuzwana engu-1', // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true) 'imizuzwana engu-1', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true) 'imizuzwana engu-2', // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true) 'imizuzwana engu-2', // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1) 'imizuzwana engu-1 from now', // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2) 'ngemizuzu engu-1 imizuzwana engu-1', // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4) 'kweminyaka engu-2 izinyanga ezingu-3 ezingaba ngu-1 imizuzwana engu-1', // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4) 'kweminyaka engu-3 from now', // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4) 'izinyanga ezingu-5 ago', // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4) 'kweminyaka engu-2 izinyanga ezingu-3 ezingaba ngu-1 imizuzwana engu-1 ago', // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2) 'lwamasonto angu-1 amahora angu-10', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'lwamasonto angu-1 ezingaba ngu-6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2) 'lwamasonto angu-1 ezingaba ngu-6', // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2]) 'lwamasonto angu-1 and ezingaba ngu-6 from now', // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2) 'lwamasonto angu-2 amahora angu-1', // Carbon::now()->addHour()->diffForHumans(["aUnit" => true]) 'amahora angu-1 from now', // CarbonInterval::days(2)->forHumans() 'ezingaba ngu-2', // CarbonInterval::create('P1DT3H')->forHumans(true) 'ezingaba ngu-1 amahora angu-3', ]; } ================================================ FILE: tests/PHPStan/FeaturesTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPStan; use PHPUnit\Framework\Attributes\Large; use RuntimeException; use Tests\AbstractTestCase; #[Large] class FeaturesTest extends AbstractTestCase { /** * @SuppressWarnings(LongVariable) */ protected string $phpStanPreviousDirectory = '.'; protected function setUp(): void { parent::setUp(); $this->phpStanPreviousDirectory = getcwd(); chdir(__DIR__.'/../..'); } protected function tearDown(): void { chdir($this->phpStanPreviousDirectory); parent::tearDown(); } public function testAnalysesWithoutErrors(): void { $this->assertStringContainsString( '[OK] No errors', $this->analyze(__DIR__.'/project.neon'), ); } public function testAnalysesWithAnError(): void { $this->assertStringContainsString( '22 Static call to instance method Carbon\Carbon::foo().', $this->analyze(__DIR__.'/bad-project.neon'), ); } private function analyze(string $file): string { $output = shell_exec(implode(' ', [ implode(DIRECTORY_SEPARATOR, ['.', 'vendor', 'bin', 'phpstan']), 'analyse', '--configuration='.escapeshellarg(realpath($file)), '--no-progress', '--no-interaction', '--level=0', escapeshellarg(realpath(__DIR__.'/Fixture.php')), ])); if (!\is_string($output)) { throw new RuntimeException('Executing phpstan returned '.var_export($output, true)); } return $output; } } ================================================ FILE: tests/PHPStan/Fixture.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPStan; use Carbon\Carbon; class Fixture { public function testCarbonMacroCalledStatically(): string { return Carbon::foo(15); } public function testCarbonMacroCalledDynamically(): string { return Carbon::now()->foo(42); } } ================================================ FILE: tests/PHPStan/MacroExtensionTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPStan; use Carbon\Carbon; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\PHPStan\MacroExtension; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Testing\PHPStanTestCase; use PHPStan\Type\ClosureTypeFactory; use PHPStan\Type\VerbosityLevel; use PHPUnit\Framework\Attributes\RequiresPhp; /** * PHPStan is calling deprecated ->setAccessible() method, they already fixed it, * but did not release a new version with the fix. * * Disabling this test for PHP 8.5 until the patch is out. */ #[RequiresPhp('< 8.5')] class MacroExtensionTest extends PHPStanTestCase { private ReflectionProvider $reflectionProvider; private MacroExtension $extension; protected function setUp(): void { parent::setUp(); $this->reflectionProvider = $this->createReflectionProvider(); $this->extension = new MacroExtension( $this->reflectionProvider, self::getContainer()->getByType(ClosureTypeFactory::class) ); } public function testHasMacro() { $carbon = $this->reflectionProvider->getClass(Carbon::class); $this->assertFalse($this->extension->hasMethod($carbon, 'foo')); Carbon::macro('foo', function ($someArg) { }); $carbonInterval = $this->reflectionProvider->getClass(CarbonInterval::class); $this->assertTrue($this->extension->hasMethod($carbon, 'foo')); $this->assertFalse($this->extension->hasMethod($carbonInterval, 'foo')); $this->assertFalse($this->extension->hasMethod($carbonInterval, 'foo')); } public function testGetMacro() { Carbon::macro('foo', function (): CarbonInterval { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'foo'); $variant = $method->getVariants()[0]; $this->assertSame( CarbonInterval::class, $variant->getReturnType()->describe(VerbosityLevel::typeOnly()), ); } public function testIsStatic() { Carbon::macro('calendarBerlin', static function (): string { return self::this()->tz('Europe/Berlin')->calendar(); }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'calendarBerlin'); $this->assertTrue($method->isStatic()); Carbon::macro('calendarBerlinNonStatic', function (): string { return $this->tz('Europe/Berlin')->calendar(); }); $method = $this->extension->getMethod($carbon, 'calendarBerlinNonStatic'); $this->assertFalse($method->isStatic()); } public function testGetDeclaringClass() { Carbon::macro('lower', 'strtolower'); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'lower'); $this->assertSame(Carbon::class, $method->getDeclaringClass()->getName()); CarbonImmutable::macro('lowerImmutable', 'strtolower'); $carbonImmutable = $this->reflectionProvider->getClass(CarbonImmutable::class); $method = $this->extension->getMethod($carbonImmutable, 'lowerImmutable'); $this->assertSame(CarbonImmutable::class, $method->getDeclaringClass()->getName()); } public function testIsPrivate() { Carbon::macro('lowerVisibility', 'strtolower'); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'lowerVisibility'); $this->assertFalse($method->isPrivate()); } public function testIsPublic() { Carbon::macro('lowerVisibility', 'strtolower'); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'lowerVisibility'); $this->assertTrue($method->isPublic()); } public function testIsFinal() { $mixinClass = new class() { // Declaring final won't apply for macro, sub-class will always be able to override macros. final public static function foo(): string { return 'foo'; } public static function bar(): string { return 'bar'; } }; $carbon = $this->reflectionProvider->getClass(Carbon::class); Carbon::macro('foo', [$mixinClass, 'foo']); $method = $this->extension->getMethod($carbon, 'foo'); $this->assertTrue($method->isFinal()->yes()); Carbon::macro('bar', [$mixinClass, 'bar']); $method = $this->extension->getMethod($carbon, 'bar'); $this->assertTrue($method->isFinal()->no()); } public function testIsInternal() { Carbon::macro('lowerVisibility', 'strtolower'); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'lowerVisibility'); $this->assertFalse($method->isInternal()->yes()); } public function testGetDocComment() { Carbon::macro( 'closureWithDocComment', /** * Foo. */ function () { return 'foo'; }, ); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'closureWithDocComment'); $this->assertSame( "/**\n* Foo.\n*/", preg_replace('/^[\t ]+/m', '', $method->getDocComment()), ); } public function testGetName() { Carbon::macro('lowerVisibility', 'strtolower'); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'lowerVisibility'); $this->assertSame('lowerVisibility', $method->getName()); } public function testGetParameters() { Carbon::macro('noParameters', function () { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'noParameters'); $variant = $method->getVariants()[0]; $this->assertSame([], $variant->getParameters()); Carbon::macro('twoParameters', function (string $a, $b = 9) { }); $method = $this->extension->getMethod($carbon, 'twoParameters'); $variant = $method->getVariants()[0]; $parameters = $variant->getParameters(); $this->assertCount(2, $parameters); $this->assertSame('a', $parameters[0]->getName()); $this->assertNull($parameters[0]->getDefaultValue()); $this->assertSame('string', $parameters[0]->getType()->describe(VerbosityLevel::typeOnly())); $this->assertSame('b', $parameters[1]->getName()); $this->assertNotNull($parameters[1]->getDefaultValue()); $this->assertSame('9', $parameters[1]->getDefaultValue()->describe(VerbosityLevel::value())); $this->assertSame('mixed', $parameters[1]->getType()->describe(VerbosityLevel::typeOnly())); } public function testGetReturnType() { Carbon::macro('noReturnType', function () { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'noReturnType'); $variant = $method->getVariants()[0]; $this->assertSame('mixed', $variant->getReturnType()->describe(VerbosityLevel::typeOnly())); Carbon::macro('carbonReturnType', function (): Carbon { }); $method = $this->extension->getMethod($carbon, 'carbonReturnType'); $variant = $method->getVariants()[0]; $this->assertSame(Carbon::class, $variant->getReturnType()->describe(VerbosityLevel::typeOnly())); } public function testIsDeprecated() { Carbon::macro( 'deprecated', /** * @deprecated since 3.0.0 */ function () { }, ); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'deprecated'); $this->assertTrue($method->isDeprecated()->yes()); $this->assertNull($method->getDeprecatedDescription()); Carbon::macro( 'discouraged', /** * @discouraged since 3.0.0 */ function () { }, ); $method = $this->extension->getMethod($carbon, 'discouraged'); $this->assertFalse($method->isDeprecated()->yes()); $this->assertNull($method->getDeprecatedDescription()); } public function testIsVariadic() { Carbon::macro('variadic', function (...$params) { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'variadic'); $variant = $method->getVariants()[0]; $this->assertTrue($variant->isVariadic()); Carbon::macro('notVariadic', function ($params) { }); $method = $this->extension->getMethod($carbon, 'notVariadic'); $variant = $method->getVariants()[0]; $this->assertFalse($variant->isVariadic()); } public function testGetPrototype() { Carbon::macro('prototype', function () { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'prototype'); $this->assertSame($method, $method->getPrototype()); } public function testGetThrowType() { Carbon::macro('throwType', function () { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'throwType'); $this->assertNull($method->getThrowType()); } public function testHasSideEffects() { Carbon::macro('hasSideEffects', function () { }); $carbon = $this->reflectionProvider->getClass(Carbon::class); $method = $this->extension->getMethod($carbon, 'hasSideEffects'); $this->assertTrue($method->hasSideEffects()->maybe()); } } ================================================ FILE: tests/PHPStan/MixinClass.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPStan; class MixinClass { // Declaring final won't apply for macro, sub-class will always be able to override macros. final public static function foo(): string { return 'foo'; } public static function bar(): string { return 'bar'; } } ================================================ FILE: tests/PHPStan/bad-project.neon ================================================ includes: - ../../extension.neon parameters: bootstrapFiles: - ./bootstrap-non-static.php ================================================ FILE: tests/PHPStan/bootstrap-non-static.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\Carbon; Carbon::macro('foo', function ($someArg): string { return 'foo'; }); ================================================ FILE: tests/PHPStan/bootstrap.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\Carbon; Carbon::macro('foo', static function ($someArg): string { return 'foo'; }); ================================================ FILE: tests/PHPStan/project.neon ================================================ includes: - ../../extension.neon parameters: bootstrapFiles: - ./bootstrap.php ================================================ FILE: tests/PHPUnit/AssertObjectHasPropertyNoopTrait.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPUnit; trait AssertObjectHasPropertyTrait { } ================================================ FILE: tests/PHPUnit/AssertObjectHasPropertyPolyfillTrait.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPUnit; trait AssertObjectHasPropertyTrait { protected static function assertObjectHasProperty(string $attributeName, $object, string $message = '') { self::assertObjectHasAttribute($attributeName, $object, $message); } } ================================================ FILE: tests/PHPUnit/AssertObjectHasPropertyTrait.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\PHPUnit; use PHPUnit\Framework\TestCase; require_once method_exists(TestCase::class, 'assertObjectHasProperty') ? __DIR__.'/AssertObjectHasPropertyNoopTrait.php' : __DIR__.'/AssertObjectHasPropertyPolyfillTrait.php'; ================================================ FILE: tests/Unit/MonthTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Unit; use Carbon\CarbonImmutable; use Carbon\Exceptions\InvalidFormatException; use Carbon\Month; use Tests\AbstractTestCase; class MonthTest extends AbstractTestCase { public function testFromName(): void { $this->assertSame(Month::January, Month::fromName('jan')); $this->assertSame(Month::February, Month::fromName('FEBRUARY')); $this->assertSame(Month::February, Month::fromName('févr', 'fr')); $this->assertSame(Month::March, Month::fromName('Mars', 'fr')); } public function testFromNumber(): void { $this->assertSame(Month::May, Month::fromNumber(5)); $this->assertSame(Month::October, Month::fromNumber(-2)); $this->assertSame(Month::September, Month::fromNumber(9)); $this->assertSame(Month::November, Month::fromNumber(-1)); $this->assertSame(Month::July, Month::fromNumber(7)); $this->assertSame(Month::December, Month::fromNumber(0)); $this->assertSame(Month::December, Month::fromNumber(12)); $this->assertSame(Month::January, Month::fromNumber(13)); } public function testOfTheYear(): void { $date = Month::October->ofTheYear(2020); $this->assertInstanceOf(CarbonImmutable::class, $date); $this->assertSame('2020-10-01 00:00:00.000000 America/Toronto', $date->format('Y-m-d H:i:s.u e')); } public function testLocale(): void { $this->assertSame('ottobre', Month::October->locale('it')->monthName); $this->assertSame('diciembre', Month::January->locale('es')->subMonth()->monthName); } public function testFromNameFailure(): void { $this->expectExceptionObject(new InvalidFormatException("Could not parse 'pr 1'")); Month::fromName('pr', 'fr'); } } ================================================ FILE: tests/Unit/UnitTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Unit; use Carbon\CarbonImmutable; use Carbon\CarbonInterval; use Carbon\CarbonPeriodImmutable; use Carbon\Unit; use Carbon\WeekDay; use PHPUnit\Framework\Attributes\TestWith; use Tests\AbstractTestCase; class UnitTest extends AbstractTestCase { public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); CarbonImmutable::setLocale('en'); } #[TestWith([Unit::Microsecond, 'microseconds'])] #[TestWith([Unit::Millisecond, 'millisecond'])] #[TestWith([Unit::Second, 'second'])] #[TestWith([Unit::Minute, 'minute'])] #[TestWith([Unit::Hour, 'hours'])] #[TestWith([Unit::Day, 'day'])] #[TestWith([Unit::Week, 'WEEK'])] #[TestWith([Unit::Month, 'Month'])] #[TestWith([Unit::Quarter, 'quarters'])] #[TestWith([Unit::Year, 'year'])] #[TestWith([Unit::Decade, 'decade'])] #[TestWith([Unit::Century, 'centuries'])] #[TestWith([Unit::Millennium, 'millennia'])] #[TestWith([Unit::Day, 'day'])] #[TestWith([Unit::Day, 'day'])] #[TestWith([Unit::Day, 'jour', 'fr_BE'])] #[TestWith([Unit::Day, 'JOUR', 'fr'])] #[TestWith([Unit::Month, 'Monaten', 'de'])] #[TestWith([Unit::Month, 'monaten', 'de'])] public function testFromName(Unit $unit, string $name, ?string $locale = null): void { $this->assertSame($unit, Unit::fromName($name, $locale)); } public function testSingular(): void { $this->assertSame('day', Unit::Day->singular()); $this->assertSame('century', Unit::Century->singular()); $this->assertSame('jour', Unit::Day->singular('fr')); $this->assertSame('Tag', Unit::Day->singular('de')); $this->assertSame('siècle', Unit::Century->singular('fr')); } public function testPlural(): void { $this->assertSame('days', Unit::Day->plural()); $this->assertSame('centuries', Unit::Century->plural()); $this->assertSame('jours', Unit::Day->plural('fr')); $this->assertSame('Tage', Unit::Day->plural('de')); $this->assertSame('siècles', Unit::Century->plural('fr')); } public function testInterval(): void { $interval = Unit::Day->interval(2); $this->assertInstanceOf(CarbonInterval::class, $interval); $this->assertSame(['days' => 2], array_filter($interval->toArray())); } public function testLocale(): void { $interval = Unit::Day->locale('fr'); $this->assertInstanceOf(CarbonInterval::class, $interval); $this->assertSame(['days' => 1], array_filter($interval->toArray())); $this->assertSame('1 jour', $interval->forHumans()); } public function testToPeriod(): void { CarbonImmutable::setTestNow('2023-12-09 11:47:53'); $days = Unit::Day->toPeriod(WeekDay::Monday, WeekDay::Friday); $this->assertInstanceOf(CarbonPeriodImmutable::class, $days); $this->assertSame('Every 1 day from 2023-12-11 to 2023-12-15', (string) $days); } public function testStepBy(): void { CarbonImmutable::setTestNow('2023-12-09 11:47:53'); $days = Unit::Week->stepBy(Unit::Day); $this->assertInstanceOf(CarbonPeriodImmutable::class, $days); $this->assertSame('Every 1 day from 2023-12-09 11:47:53 to 2023-12-16 11:47:53', (string) $days); } } ================================================ FILE: tests/Unit/WeekDayTest.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Tests\Unit; use Carbon\Exceptions\InvalidFormatException; use Carbon\WeekDay; use Tests\AbstractTestCase; class WeekDayTest extends AbstractTestCase { public function testFromName(): void { $this->assertSame(WeekDay::Friday, WeekDay::fromName('fri')); $this->assertSame(WeekDay::Tuesday, WeekDay::fromName('TUESDAY')); $this->assertSame(WeekDay::Saturday, WeekDay::fromName('sam', 'fr')); $this->assertSame(WeekDay::Sunday, WeekDay::fromName('Dimanche', 'fr')); } public function testFromNumber(): void { $this->assertSame(WeekDay::Friday, WeekDay::fromNumber(5)); $this->assertSame(WeekDay::Friday, WeekDay::fromNumber(-2)); $this->assertSame(WeekDay::Tuesday, WeekDay::fromNumber(9)); $this->assertSame(WeekDay::Saturday, WeekDay::fromNumber(-1)); $this->assertSame(WeekDay::Sunday, WeekDay::fromNumber(7)); $this->assertSame(WeekDay::Sunday, WeekDay::fromNumber(0)); } public function testLocale(): void { $this->assertSame('venerdì', WeekDay::Friday->locale('it')->dayName); $this->assertSame('sábado', WeekDay::Sunday->locale('es')->subDay()->dayName); } public function testFromNameFailure(): void { $this->expectExceptionObject(new InvalidFormatException("Could not parse 'pr'")); WeekDay::fromName('pr', 'fr'); } } ================================================ FILE: tests/bootstrap.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require_once __DIR__.'/../vendor/autoload.php'; require_once __DIR__.'/PHPUnit/AssertObjectHasPropertyTrait.php'; set_error_handler(static function ( int $errno, string $errstr, string $errfile = '', int $errline = 0, array $errcontext = [] ): bool { if (!(error_reporting() & $errno)) { return false; } throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); }); ================================================ FILE: tests/phpmd-test.xml ================================================ Mess detection rules for Carbon ================================================ FILE: tests/remove-comments-in-switch.php ================================================ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $files = [ __DIR__.'/../src/Carbon/Traits/Date.php', __DIR__.'/../src/Carbon/Traits/Units.php', __DIR__.'/../src/Carbon/Lang/fr.php', ]; $comments = [ '// @--property', '// @property', '// @call ', '// Words with feminine grammatical gender: semaine', ]; foreach ($files as $file) { $contents = str_replace("\r", '', file_get_contents($file)); $newContents = implode("\n", array_filter(explode("\n", $contents), static function ($line) use ($comments) { $code = trim($line); foreach ($comments as $comment) { if (str_starts_with($code, $comment)) { return false; } } return true; })); if ($newContents !== $contents) { file_put_contents($file, $newContents); } }